User`s manual

7-30 Motion Mate DSM314 for Series 90-30 PLCs User's Manual
January 2001 GFK-1742A
7
A Conditional Jump cannot be used as the last line of a Subroutine (or on the line before an
Unconditional Jump to the end of a subroutine) because jump testing terminates when the End
Subroutine command is processed.
In summary, a Conditional Jump transfers control to a new program block on the basis of one of
the external CTL input bits turning ON. Tests for CTL bit status can be carried out once or
continuously during the following Type 3 command if it is in the same program block. Multiple
Conditional Jumps are not supported within the same program block (the following example
illustrates this incorrect usage of the Conditional Jump command).
Conditional Jump Example 1:
PROGRAM 1 MULTI-AXIS
VELOC AXIS1 10000
ACCEL AXIS1 10000
1: JUMP CTL01, 2 //This JUMP command will be ignored
JUMP CTL02, 3 //This JUMP command will be recognized
CMOVE AXIS1 +40000, INCR, LINEAR
2: CMOVE AXIS2 +20000, INCR, LINEAR
3: PMOVE AXIS2 +100000, ABS, LINEAR
4: DWELL AXIS2 100
ENDPROG
The first JUMP is not programmed correctly because (1) it is not followed by an intervening Type
3 command, and (2) it is in the same block as another JUMP command. When a new Block
Number becomes active AFTER a Conditional JUMP command, Jump testing will occur one final
time.
Conditional Jump Example 2:
PROGRAM 2 AXIS1
VELOC 10000
ACCEL 10000
1: CMOVE 20000, ABS, LINEAR
JUMP CTL01, 3
2: PMOVE 40000, ABS, LINEAR //CTL01 tested only once
3: DWELL 100
ENDPROG
In the example above, The
CTL01
bit test occurs just once because the PMOVE following the
JUMP contains a new Block Number (2). However, changing the location of Block Number 2
causes CTL bit testing throughout the PMOVE following the JUMP, as seen in the following
example:
Conditional Jump Example 3:
PROGRAM 3 AXIS1
VELOC 10000
ACCEL 10000
1: CMOVE 20000, ABS, LINEAR
2: JUMP CTL01, 3
PMOVE 40000, ABS, LINEAR //CTL01 tested throughout PMOVE