![Galil Motion Control RIO-47**0 Скачать руководство пользователя страница 61](http://html1.mh-extra.com/html/galil-motion-control/rio-47-0/rio-47-0_user-manual_558777061.webp)
Examples:
Interrupt
Note:
This multitasking program can be executed with the instruction XQ #A,0 designating A as the main
thread (i.e. Thread 0). #B is executed within A.
Instruction
Interpretation
#A Program
Label
XQ#B,1
Execute #B in thread 1
II1,0,-1&3
#ININT1 in thread 0 when input 1 low and input 3 high
II2,1,-5&10
#ININT2 in thread 1 when input 5 low and input 10 high
AI 13&14
Trippoint on inputs 13 and 14
#LOOP;JP#LOOP
Pseudo program – Loop indefinitely
EN End
program
#B Program
Label
AI 7&-8
Trippoint on inputs 7 and 8
#LOOP2
SB10
Set bit 10 high
WT500
Wait for half a second
CB10
Set bit 10 low
WT500 Wait
for
500msec
JP#LOOP2
Create a ‘light-blinker’ effect
EN End
program
#ININT1
Input interrupt program label
MG”Loop stops”
Print message, saying loop program in main thread halted
RI0
Return to main program without restoring trippoint, but keeping the
interrupt enabled
#ININT2
MG”Blinker stops”
Print message, saying blinker effect in thread 1 halted, since #ININT2
runs in thread 1
WT10000
Wait 10 seconds for user to reset inputs 5 and 10
RI1,1
Return to thread 1’s main program (blinker continues) while restoring
trippoint on inputs 5 and 10; interrupt disabled
Event Trigger
This example waits for input 1 to go low and input 3 to go high, and then execute the TZ interrogation
command.
Note:
The AI command actually halts execution of the program until the input occurs. If you do
not want to halt the program sequences, use the Input Interrupt function (II) or a conditional jump on an
input, such as:
JP #GO,(@IN[1] = 0) | (@IN[3] = 1).
Instruction
Interpretation
#INPUT Program
Label
AI-1&3
Wait for input 1 low and input 3 high
TZ
List the entire I/O status
EN End
program
RIO-47xxx
Chapter 5 Programming
●
55
Содержание RIO-47**0
Страница 2: ......
Страница 93: ...RIO Dimensions RIO 471xx Units in centimeters RIO 47xxx Appendix 87...
Страница 94: ...RIO 472xx Units in millimeters 88 Appendix RIO 47xxx...
Страница 107: ...Internal 56 64 Zero Stack 53 RIO 47xxx Index 101...