Galil Motion Control CDS-3310 User Manual page 88

Table of Contents

Advertisement

values, functions, keywords, and arithmetic expressions. If no conditional statement is given, the jump
will always occur.
Multiple Conditional Statements
The CDS-3310 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 parenthesis for proper evaluation by the controller. In
addition, the CDS-3310 executes operations from left to right. For further information on
Mathematical Expressions and the bit-wise operators '&' and '|', see pg 35.
For example, using variables named V1, V2, V3 and 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:
This statement will cause the program to jump to the label #TEST under two conditions; 1. If V1 is
less than V2 and V3 is less than V4. OR 2. If V5 is less than V6.
Examples
If the condition for the JP command is satisfied, the controller branches to the specified label or line
number and continues executing commands from this point. If the condition is not satisfied, the
controller continues to execute the next commands in sequence.
CDS-3310
Number
Numeric Expression
Array Element
Variable
Internal Variable
I/O
JP #TEST, (V1<V2) & (V3<V4)
JP #TEST, ((V1<V2) & (V3<V4)) | (V5<V6)
Instruction
JP #LOOP,count<10
JS #MOVE2,@IN[1]=1
JP #BLUE,@ABS[v2]>2
JP #C,v1*v7<=v8*v2
JP#A
V1=6
V1=V7*6
@ABS[V1]>10
V1<Count[2]
V1<V2
_TPA=0
_TVA>500
V1>_TTX
@IN[1]=0
Interpretation
Jump to #Loop if the variable, COUNT, is less than 10
Jump to subroutine #MOVE2 if input 1 is logic level high. After
the subroutine MOVE2 is executed, the program sequencer
returns to the main program location where the subroutine was
called.
Jump to #BLUE if the absolute value of variable, v2, is greater
than 2
Jump to #C if the value of v1 times v7 is less than or equal to the
value of V8*v2
Jump to #A
Chapter 7 Application Programming
i
27

Advertisement

Table of Contents
loading

Related Products for Galil Motion Control CDS-3310

Table of Contents