@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-40x0 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-
40x0 executes operations from left to right. See
Mathematical and Functional Expressions
for more information.
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)
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.
Using the JP Command:
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.
Conditional
Meaning
JP #Loop,COUNT<10
Jump to #Loop if the variable, COUNT, is less than 10
JS #MOVE2,@IN[1]=1
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.
JP #BLUE,@ABS[V2]>2
Jump to #BLUE if the absolute value of variable, V2, is greater than 2
JP #C,V1*V7<=V8*V2
Jump to #C if the value of V1 times V7 is less than or equal to the
value of V8*V2
JP#A
Jump to #A
Example Using JP command:
Move the X motor to absolute position 1000 counts and back to zero ten times. Wait 100 msec between moves.
#BEGIN
Begin Program
COUNT=10
Initialize loop counter
#LOOP
Begin loop
PA 1000
Position absolute 1000
BGX
Begin move
AMX
Wait for motion complete
WT 100
Wait 100 msec
PA 0
Position absolute 0
DMC-40x0 User Manual
Chapter 7 Application Programming
•
140
Содержание DMC-4040
Страница 17: ...DMC 4080 Layout Figure 2 2 Outline of the of the DMC 4080 DMC 40x0 User Manual Chapter 2 Getting Started 8...
Страница 19: ...DMC 4040 Dimensions Figure 2 5 Dimensions of DMC 4040 DMC 40x0 User Manual Chapter 2 Getting Started 10...
Страница 20: ...DMC 4080 Dimensions Figure 2 6 Dimensions of DMC 4080 Chapter 2 Getting Started 11 DMC 40x0 User Manual...
Страница 54: ...Chapter 3 Connecting Hardware 45 DMC 40x0 User Manual...
Страница 55: ...DMC 40x0 User Manual Chapter 3 Connecting Hardware 46...
Страница 56: ...Chapter 3 Connecting Hardware 47 DMC 40x0 User Manual...
Страница 73: ...Figure 4 1 GalilTools DMC 40x0 User Manual Chapter 4 Software Tools and Communication 64...
Страница 185: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 7 Application Programming 176...
Страница 205: ...THIS PAGE LEFT BLANK INTENTIONALLY DMC 40x0 User Manual Chapter 10 Theory of Operation 196...
Страница 220: ...Step 2 Remove ICM For DMC 4040 Proceed to Step 3 Configure Circuit Appendices 211 DMC 40x0 User Manual...
Страница 222: ...Step 2 Remove ICM s Appendices 213 DMC 40x0 User Manual...
Страница 232: ...DMC 4080 Steps 4 and 5 Step 4 Replace ICM s Appendices 223 DMC 40x0 User Manual...