EasyManua.ls Logo

Moog SmartMotor

Moog SmartMotor
909 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Part 2: Commands
Moog Animatics SmartMotor Developer's Guide,Rev. L
Page 604 of 909
l
=OF(D,word)
Returns an error code from the controller associated with this I/O word.
o
D-style: word is 1
o
M-style: word is 0
EXAMPLE: (Subroutine reports the status of the 24V expansion IO)
'This code reports the status of the 24V expansion IO
a=0 'Set loop start point for first IO
WHILE a<10 'While less than number of IO
b=a+16 'Set b to IO number for 24V expansion
c=OC(b) 'Set c to IO condition status
d=OF(b) 'Set d to IO fault status
PRINT("Output ",b," on pin ",a)
IF d==1 'If d represents overcurrent
PRINT(" is FAULTED overcurrent.",#13)
ELSEIF d==2 'If d represents a possible short
PRINT(" is FAULTED short.",#13)
ELSEIF c 'If c is true
PRINT(" is HIGH.",#13)
ELSE 'If c is not true
PRINT(" is LOW.",#13)
ENDIF
a=a+1 'Increment loop counter
LOOP
Program output is:
Output 16 on pin 0 is HIGH.
Output 17 on pin 1 is HIGH.
Output 18 on pin 2 is LOW.
Output 19 on pin 3 is LOW.
Output 20 on pin 4 is LOW.
Output 21 on pin 5 is LOW.
Output 22 on pin 6 is LOW.
Output 23 on pin 7 is LOW.
Output 24 on pin 8 is LOW.
Output 25 on pin 9 is LOW.
RELATED COMMANDS:
R
OC(...) Output Condition (see page 599)
OR(value) Output, Reset (see page 607)
OS(...) Output, Set (see page 609)
Part 2: Commands: OF(...)

Table of Contents

Related product manuals