Optima DMC-1xxx and DMC-18x2 Command Reference
OP
i
147
OP
FUNCTION: Output Port
DESCRIPTION:
The OP command sends data to the output ports of the controller. You can use the output port
to control external switches and relays.
ARGUMENTS: OP m,a,b,c,d
where
m is an integer in the range 0 to 65535 decimal, or $0000 to $FFFF hexadecimal. (0 to 255
for 4 axes or less). m is the decimal representation of the general output bits. Output
1 through output 8 for controllers with 4 axes or less. Outputs 1 through output 16 for
controller with 5 or more axes.
a,b,c,d represent the extended I/O in consecutive groups of 16 bits, (values from 0 to 65535).
Arguments which are given for I/O points which are configured as inputs will be ignored.
The following table describes the arguments used to set the state of outputs.
Arguments
Blocks
Bits
Description
M
0
1-8
General Outputs (1-4 axes controllers)
0,1
1-16
General
Outputs
(5-8 axes controllers)
A
2,3
17-32
Extended I/O
B 4,5
33-48
Extended
I/O
C 6,7
49-64
Extended
I/O
D 8,9
65-80
Extended
I/O
n = ? returns the value of the argument, where n is any of the above arguments.
USAGE:
DEFAULTS:
While Moving
Yes
Default Value
0
In a Program
Yes
Default Format
3.0
Command Line
Yes
Controller Usage
ALL CONTROLLERS
OPERAND USAGE:
_OP0 contains the value of the first argument, m
_OP1 contains the value of the first argument, a
_OP2 contains the value of the first argument, b
_OP3 contains the value of the first argument, c
_OP4 contains the value of the first argument, d
RELATED COMMANDS:
"SB (Binary EA)"
Set output bit
"
CB
"
Clear output bit
"OB "
Output Byte
EXAMPLES:
OP 0
Clear Output Port -- all bits
OP $85
Set outputs 1,3,8; clear the others
MG _OP0
Returns the first parameter "m"
MG _OP1
Returns the second parameter "a"