WinCupl State Machine error code

Discussion in 'Programmer's Corner' started by simo_x, Feb 28, 2011.

  1. simo_x

    Thread Starter Member

    Dec 23, 2010
    200
    6
    Hi all, I am developing a little program for a state machine in WinCupl.
    The program should be a counter, which if the E input is low, in output I have binary peer numbers from 0000 to 1110, and if E is high odd numbers from 0001 to 1111 are in output.
    I started write this code
    Code ( (Unknown Language)):
    1. Name EX3;
    2. Designer Simo;
    3. Device g22v10;
    4.  
    5. /** Inputs **/
    6. PIN 1 = clock;
    7. PIN 2 = E;
    8. /** Outputs **/
    9. PIN 23 = Q0;
    10. PIN 22 = Q1;
    11. PIN 21 = Q2;
    12. PIN 20 = Q3;
    13.  
    14. FIELD state = [Q3..0];
    15.  
    16. $define S0     'b'0000
    17. $define S1     'b'0001
    18. $define S2     'b'0010
    19. $define S3     'b'0011
    20. $define S4     'b'0100
    21. $define S5     'b'0101
    22. $define S6     'b'0110
    23. $define S7     'b'0111
    24. $define S8     'b'1000
    25. $define S9     'b'1001
    26. $define S10    'b'1010
    27. $define S11    'b'1011
    28. $define S12    'b'1100
    29. $define S13    'b'1101
    30. $define S14    'b'1110
    31. $define S15    'b'1111
    32.  
    33. SEQUENCE state {
    34.    
    35.     PRESENT S0
    36.         IF !E NEXT S2;
    37.        
    38. }
    But WinCupl report this error:
    [0032ca] invalid next state: 'h'2

    I know that off course it is a stupid error, but how can I fix it? Where I am wrong there?
    Thank you for your help.
     
    Last edited: Feb 28, 2011
Loading...