Jump in ST language

sarathbabu
2012-04-12
2012-04-12
  • sarathbabu - 2012-04-12

    Hi friends,
    How to implement "Jump" in statement logic in codesys.I have not find any instruction.

    jmp test;

    test:

    is my syntax showing errors.Help me on this

    Thanks

     
  • singleton - 2012-04-12

    Hi,
    use the CASE instruction:

    CASE iMyState OF
       1:
          // Do something
          // ....
         IF xEverythingIsFine THEN
            iMyState := 2;
         ELSE
            iMyState := 999;
         END_IF
       2:
          // Do something else....
       999:
    END_CASE
    
     

Log in to post a comment.