I don't know if there is a jump and if there is I don't think I would ever use it.
Within a single POU the way to conditionally run code is to put it into a IF/END_IF block.
If you want to call another POU as a subroutine then you put the name followed by parenthesis:
OTHERPOU( parameters);
PLCs work best when there is a clear line of code execution and Jumps disrupt that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All machine programing is based on states. The easiest way to create a state machine in ST is using a case statement. Please understand the example below is only an example to show how you can expand on the idea. The example does not jump states but that is easy to do by changing the step to a different number.
VAR
  Step:  INT;
  Delay:  TON;
  Enable:  BOOL;
  OUTPUT:  BOOL;END_VARCASEStepOF0:  (*Wait/Disable*)
  IFEnableTHEN
    Step:=10;
  END_IF10:   (*TURNONOUTPUTDELAY10s)
  OUTPUT:=TRUE;
  Delay(IN:=TRUE, PT:=T#10s);
  IFDelay.QTHEN
    Delay(IN:=FALSE, PT:=T#10s);
    Step:=20;
  END_IF20:   (*TURNOFFOUTPUTDELAY10s)
  OUTPUT:=FALSE;
  Delay(IN:=TRUE, PT:=T#10s);
  IFDelay.QTHEN
    Delay(IN:=FALSE, PT:=T#10s);
    Step:=0;
  END_IF Â
END_CASE
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
ricardorbinar hat geschrieben:
Hi, Im new in Structured Text Programming, and Im looking for a JUMP command. What is the code for jump in ST?
IF NOT(Jump Condition) THEN
END_IF
This is not how I typically program. I tend to implement SFC type code using a state variable and a CASE statement.
PJE
Sent from my SM-G900V using Tapatalk
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2016-05-01
Originally created by: scott_cunningham
JUMP is not directly supported in ST. You have RETURN available like in LD, but you have to use IF statements or other techniques. Note that the just released programming guidelines from the PLCopen group recommend not using JUMPs and RETURNS for debugging reasons. I agree and suggest to avoid JUMPS. There are times I like to use returns (at the beginning of a POU - IF NOT Enabled THEN RETURN).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, Im new in Structured Text Programming, and Im looking for a JUMP command. What is the code for jump in ST?
I don't know if there is a jump and if there is I don't think I would ever use it.
Within a single POU the way to conditionally run code is to put it into a IF/END_IF block.
If you want to call another POU as a subroutine then you put the name followed by parenthesis:
OTHERPOU( parameters);
PLCs work best when there is a clear line of code execution and Jumps disrupt that.
ricardorbinar,
All machine programing is based on states. The easiest way to create a state machine in ST is using a case statement. Please understand the example below is only an example to show how you can expand on the idea. The example does not jump states but that is easy to do by changing the step to a different number.
IF NOT(Jump Condition) THEN
END_IF
This is not how I typically program. I tend to implement SFC type code using a state variable and a CASE statement.
PJE
Sent from my SM-G900V using Tapatalk
Originally created by: scott_cunningham
JUMP is not directly supported in ST. You have RETURN available like in LD, but you have to use IF statements or other techniques. Note that the just released programming guidelines from the PLCopen group recommend not using JUMPs and RETURNS for debugging reasons. I agree and suggest to avoid JUMPS. There are times I like to use returns (at the beginning of a POU - IF NOT Enabled THEN RETURN).
Hi ricardorbinar.
Look for JMP in the CODESYS online help. Be careful not to build an endless loop!
BR
Martin
Dear Ricardo,
Since you are new to ST, you may find some of the videos below useful:
http://www.youtube.com/user/talizadeh?s ... irmation=1
Regards,
Tohid