Conditional jumps

Conditional jumps are instructions in a PLC program that branch the execution of the program to another location depending on a specific condition. They are also referred to as "conditional branches" or "conditional jumps".

Copy

// --------------------------- Conditional jumps ---------------------------
     GVL_Sequence1.stSeqIf.xJump := FALSE;

   IF GVL_Sequence1.stSeqIf.xSeqAutomaticReleased AND GVL_Sequence1.iStepCounter = 7 AND (GVL_Sequence1_IOs.i_xDecision_1_Path2) THEN
      GVL_Sequence1.iStepCounter := 2;
      GVL_Sequence1.stSeqIf.xJump := TRUE; // Block step increment for one cycle
   END_IF

   IF GVL_Sequence1.stSeqIf.xSeqAutomaticReleased AND GVL_Sequence1.iStepCounter = 10 AND (GVL_Sequence1_IOs.i_xDecision_1_Path2) THEN
      GVL_Sequence1.iStepCounter := 2;
      GVL_Sequence1.stSeqIf.xJump := TRUE; // Block step increment for one cycle
   END_IF

Last updated

Was this helpful?