beautypg.com

Js (jump to subroutine), Program flow, Destination is a line number or label – Yaskawa LEGEND-MC User Manual

Page 152: The logical operators are

background image

142

LEGEND-MC User’s Manual

JS (Jump to Subroutine)

[Program

Flow]

DESCRIPTION:

The JS command will change the sequential order of execution of commands in a program. If the jump is
executed, the program will continue at the label specified by the destination parameter. 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. The JS command can be nested 16
deep.

Multiple conditions can be used in a single jump subroutine 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 as a

boolean expression. Subroutines can be nested 16 deep in the standard controller.

ARGUMENTS: JS destination,condition

where

destination is a line number or label

condition is a conditional statement using a logical operator

The logical operators are:

USAGE:

RELATED COMMANDS:

EXAMPLES:

<

less than

>=

greater than or equal to

>

greater than

<>

not equal

=

equal to

|

logical OR (pipe symbol)

<= less than or equal to

&

logical AND

While Moving

Yes

Default Value

---

In a Program

Yes

Default Format

---

Command Line

No

Can be Interrogated

No

Used as an Operand

No

Distributed Control

No, Local

"EN" End

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)