![Galil Motion Control DMC-14 5 Series Скачать руководство пользователя страница 112](http://html1.mh-extra.com/html/galil-motion-control/dmc-14-5-series/dmc-14-5-series_manual_3258007112.webp)
JP destination, logical condition
Jump to location if logical condition is satisfied
The destination is a program line number or label where the program sequencer will jump if the
specified condition is satisfied. Note that the line number of the first line of program memory is 0.
The comma designates "IF". The logical condition tests two operands with logical operators.
Logical operators:
Operator
Description
< less
than
> greater
than
= equal
to
<=
less than or equal to
>=
greater than or equal to
<> not
equal
Conditional Statements
The conditional statement is satisfied if it evaluates to any value other than zero. The conditional
statement can be any valid DMC-14XX numeric operand, including variables, array elements, numeric
values, functions, keywords, and arithmetic expressions. If no conditional statement is given, the jump
will always occur.
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
Multiple Conditional Statements
The DMC-14XX will accept multiple conditions 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 parentheses for proper evaluation by the
controller. In addition, the DMC-14XX executes operations from left to right. For further
information on Mathematical Expressions and the bit-wise operators ‘&’ and ‘|’, see pg. 110.
For example, using variables named V1, V2, V3 and V4:
JP #TEST, (V1<V2) & (V3<V4)
In this example, this statement will cause the program to jump to the label #TEST if V1 is less than V2
and V3 is less than V4. To illustrate this further, consider this same example with an additional
condition:
JP #TEST, ((V1<V2) & (V3<V4)) | (V5<V6)
DMC-14x5/6
Chapter 7 Application Programming
i
103
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com