DMC-18x6 Command Reference
116
JS
FUNCTION: Jump to Subroutine
DESCRIPTION:
The JS command will change the sequential order of execution of commands in a program. If the
jump is taken, program execution will continue at the line specified by the destination
parameter, which can be either a line number or label. The line number of the JS command is
saved and after the next EN command is encountered (End of subroutine), program execution
will continue with the instruction following the JS command. There can be a JS command
within a subroutine.
Multiple conditions can be used in a single jump statement. The conditional statements are
combined in pairs using the operands "&" and "|". The "&" operand between any two
conditions, requires that both statements must be true for the combined statement to be true.
The "|" operand between any two conditions, requires that only one statement be true for the
combined statement to be true. Note: Each condition must be placed in parenthesis for
proper evaluation by the controller.
Note: Subroutines may be nested 16 deep in the controller.
A jump is taken if the specified condition is true. Conditions are tested with logical operators.
The logical operators are:
< less than or equal to
<= less than or equal to
> greater than
>= greater than or equal to
= equal to
<> not equal
ARGUMENTS: JS destination, condition where
destination is a line number or label
condition is a conditional statement using a logical operator
USAGE: DEFAULTS:
While Moving
Yes
Default Value
In a Program
Yes
Default Format
Command Line
No
Controller Usage
ALL CONTROLLERS
RELATED COMMANDS:
End
EXAMPLES:
JS #SQUARE,V1<5
Jump to subroutine #SQUARE if V1 is less than 5
JS #LOOP,V1<>0
Jump to #LOOP if V1 is not equal to 0
JS #A
Jump to subroutine #A (no condition)