DMC-1500
Chapter 7 Application Programming
•
93
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.
Examples Using JP and JS
Instruction Interpretation
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.
Instruction Interpretation
#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
BGX Begin
move
AMX
Wait for motion complete
WT 100
Wait 100 msec
COUNT=COUNT-1
Decrement loop counter
JP #LOOP,COUNT>0
Test for 10 times through loop
EN End
Program
Command Format - JP and JS
FORMAT: DESCRIPTION
JS destination, logical condition
Jump to subroutine if logical condition is satisfied
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.
Содержание DMC-1510
Страница 6: ......
Страница 18: ...6 Chapter 1 Overview DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 88: ...76 Chapter 6 Programming Motion DMC 1500 Figure 6 7 Motion intervals in the Home sequence...
Страница 90: ...78 Chapter 6 Programming Motion DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 137: ...DMC 1500 Chapter 7 Application Programming 125 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 157: ...DMC 1500 Chapter 10 Theory of Operation 145 THIS PAGE LEFT BLANK INTENTIONALLY...
Страница 160: ...148 Appendices DMC 1500 Card Level Layout...
Страница 178: ...166 Appendices DMC 1500 ICM 1100 Drawing 1 3 4 0 0 4 4 0 2 4 0 7 0 0 4 5 3 7 0 5 7 0 2 8 5 1 0 0 1 0 1 0 7 0 1 0 0...
Страница 180: ...168 Appendices DMC 1500...
Страница 198: ...186 Appendices DMC 1500 THIS PAGE LEFT BLANK INTENTIONALLY...