210
Gemini GV6K/GT6K Command Reference
ONIN
On an Input Condition Gosub
Type
On Condition (Program Interrupt)
Syntax
<a_!><%><@><B>ONIN<b><b><b>...<b><b>
Units
n/a
Range
b = 0 (disable), 1 (enable) or X (don't care)
Default
X
Response
ONIN: *ONINXXXX_X
1ONIN: *1ONINXXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX_XXXX
See Also
INFNC, ONCOND, ONP, TIN
Product Rev
GT6K 6.0
GV6K 6.0
The
ONIN
command specifies the input bit pattern which will cause a branch to the ON program (
ONP
). If
the input pattern occurs, a GOSUB is performed. The subroutine or program that the GOSUB branches to is
selected with the ON program (
ONP
) command.
The number of external inputs available varies by the configuration of I/O bricks used. Refer to page
8
for
details.
The
ONIN
command must be enabled using the
ONCOND
command before any branching will occur. Once a
branch to the
ONP
program occurs, the
ONIN
command will not call the
ONP
program while the
ONP
program is executing, eliminating the possibility of recursive calls. After returning from the
ONP
program,
the input pattern specified by the
ONIN
command must evaluate false before another branch to the
ONP
program, resulting from the
ONIN
inputs, will be allowed.
Multi-Tasking
: Each task has it own
ONP
Program and its own set of On conditions. Only 1
ONIN
condition is allowed per task. Therefore, only one I/O brick can be referenced in an
ONIN
condition for a
specific task.
Example:
DEF bigmov
; Define program bigmov
D20
; Set move distance to 20 units
GO1
; Initiate motion
END
; End program definition
ONP bigmov
; Set ON program to bigmov
2ONINxxx11xx1
; When inputs 4, 5, and 8 on I/O brick 2 are activated,
; GOSUB to the ONP program
ONCOND1000
; Enable ONIN condition
;
; Now that the ONP program named bigmov is defined, if inputs 4, 5, and 8 on
; I/O brick 2 become active during normal program operation, the program will
; GOSUB to the ONP program (bigmov).
ONP
On Condition Program Assignment
Type
On Condition (Program Interrupt)
Syntax
<a_><!><%>ONP<t>
Units
t = text (name of On Condition program)
Range
text name of 6 characters or less
Default
n/a
Response
ONP: *ONP
bigmov
See Also
DEF, END, ONCOND, ONIN, ONUS, ONVARA, ONVARB
Product Rev
GT6K 6.0
GV6K 6.0
The
ONP
command assigns the program to which programming will GOSUB when an ON condition is met.
The program must be defined (
DEF
) previous to the execution of the
ONP
command. The
ONP
command
must be specified before enabling the ON conditions (
ONCOND
). If
ONP
is not defined first, the error
message
*UNDEFINED
LABEL
will appear.
To unassign the program as the ON condition program, issue the
ONP
CLR
command. Deleting the program
with the
DEL
command will accomplish the same thing.
Within the
ONP
program, the programmer is responsible for checking which ON condition caused the
branch, if multiple ON conditions (
ONCOND
) have been enabled. Once a branch to the
ONP
program occurs,
www.comoso.com
Содержание Gemini GV6K
Страница 24: ...www comoso com...
Страница 40: ...www comoso com...
Страница 344: ...www comoso com...
Страница 350: ...www comoso com...