Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 480 of 909
EXAMPLE:
The following line of code could be written in motor number 1 — it sets variable "a" in motor 2
equal to an I/O of motor 3:
a:2=IN(0):3 'Set variable in motor 2 to I/O of motor 3
EXAMPLE: (Subroutine checks inputs and calls corresponding subroutines based on state;
shows C#, ENDIF, GOSUB, GOTO, IF and IN)
C10 'Place label
IF IN(0)==0 'Check Input 0
GOSUB20 'If Input 0 low, call Subroutine 20
ENDIF 'End check Input 0
IF IN(1)==0 'Check Input 1
a=30 'as example for below
GOSUB(a) 'If Input 1 low, call Subroutine 30
ENDIF 'End check Input 1
GOTO(10) 'Will loop back to C10
C20 'Subroutine 20 code here
RETURN
C30 'Subroutine 30 code here
RETURN
RELATED COMMANDS:
EIGN(...) Enable as Input for General-Use (see page 405)
EILN Enable Input as Limit Negative (see page 408)
EILP Enable Input as Limit Positive (see page 410)
EIRE Enable Index Register, External-Input Capture (see page 412)
EIRI Enable Index Register, Internal-Input Capture (see page 414)
EISM(6) E-Configure Input as Sync Master (see page 416)
EOBK(IO) Enable Output, Brake Control (see page 437)
R
INA(...) Specified Input, Analog (see page 481)
OR(value) Output, Reset (see page 607)
OS(...) Output, Set (see page 609)
OUT(...)=formula Output, Activate/Deactivate (see page 613)
UO(...)=formula User Status Bits (see page 756)
UR(...) User Bits, Reset (see page 762)
US(...) User Bits, Set (see page 764)
Part 2: Commands: IN(...)