Jp (jump to program location), Program flow, Location is a program label – Yaskawa LEGEND-MC User Manual

Page 151

Advertising
background image

141

LEGEND-MC User’s Manual

JP (Jump to Program Location)

[Program Flow]

DESCRIPTION:

The JP command causes a jump to a program location on a specified condition (optional). The program
location may be any label. The condition is a conditional statement which uses a logical operator such as
equal to or less than. A jump is executed if the specified condition is true.

Multiple conditions can be used in a single jump statement. Conditional statements are combined in pairs
using operands “&” and “|”. The “&” operand between two conditions requires both statements to be true
for the combined statement to be true. The ”|” operand between two conditions requires that one statement
be true for the combined statement to be true.

NOTE: Each condition must be in parenthesis for controller evaluation as a boolean expression.

ARGUMENTS: JP location, condition

where

location is a program label

condition is a conditional statement using a logical operator

The logical operators are:

USAGE:

EXAMPLES:

NOTE: JP is similar to an IF, THEN command. Text to the right of the comma is the condition that must be met for a jump
to occur. The destination is the specified label before the comma.

<

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

n/a

In a Program

Yes

Default Format

n/a

Command Line

No

Can be Interrogated

No

Used as an Operand

No

Distributed Control

No, Local

JP #POS1, (V1<5)

Jump to label #POS1 if variable V1 is less than 5

JP #A, (V7*V8=0)

Jump to #A if V7 times V8 equals 0

JP #B

Jump to #B (no condition)

Advertising