Logical operators, Operands – Yaskawa LEGEND-MC User Manual

Page 300

Advertising
background image

290

LEGEND-MC User’s Manual

defined by a label and EN command. After all the commands in the subroutine are executed, a return is
made to the main program). If the condition is not satisfied, the program sequence continues to the next
program line.

The JP and JS instructions have the following format:

The destination is a program line number or label. The destination is where the program sequencer jumps
to if the specified condition is satisfied. The comma designates "IF". The logical condition tests two
operands with logical operators. The operands can be any valid LEGEND-MC numeric operand, including
variables, array elements, numeric values, functions, keywords, and arithmetic expressions.

Logical operators:

Operands:

The jump statement may also be used without a condition.

Format:

Meaning

JS destination, logical condition

Jump to subroutine if logical condition is satisfied

JP destination, logical condition

Jump to location if logical condition is satisfied

<

less than

>

greater than

=

equal to

<=

less than or equal to

>=

greater than or equal to

<>

not equal

Type

Examples

Number

V1=6

Numeric Expression

V1=V7*6

@ABS[V1]>10

Array Element

V1<Count[2]

Variable

V1<V2

Internal Variable

_TPX=0

_TVX>500

I/O

V1>@AN[2]

@IN[1]=0

Advertising