OP |
Syntax: | Implicit Only |
| Operands: | _OP0,_OP1,_OP2,_OP3,_OP4 | |
| Burn: | burnable with BN | |
Output Port | Hardware: | All |
The OP command sends data to the output ports of the controller. Arguments to the OP command are bit patterns (decimal or hex) to set entire banks (bytes) of digital outputs. Use SB, CB or OB to set bits individually.
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 (where available) in consecutive groups of 16 bits, (values from 0 to 65535). Bit patterns for I/O banks which are configured as inputs have no affect on the bank.
m,a,b,c or d = ? returns the current value of the applicable argument.
The following table describes the arguments used to set the state of outputs.
| Argument | Examples | Banks | Bits | Description |
|---|---|---|---|---|
| m | Set all: OP255;OP$FF | 0 | 1-8 | General Outputs (1-4 axes controllers) |
| m | Set all: OP65535;OP$FFFF | 0,1 | 1-16 | General Outputs (5-8 axes controllers) |
| a | Clear all: OP0;OP$0000 | 2,3 | 17-32 | Extended I/O |
| b | Alternating on/off:OP43690;OP$AAAA | 4,5 | 33-48 | Extended I/O |
| c | Set High Byte:OP65280;OP$FF00 | 6,7 | 49-64 | Extended I/O |
| d | Set Low Byte: OP255;OP$00FF | 8,9 | 65-80 | Extended I/O |
The DMC-40x0 comes equipped with 32 bits of extended I/O standard (banks 2-5).
_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
| Usage | Value |
|---|---|
| While Moving (No RIO) | Yes |
| In a Program | Yes |
| Command Line | Yes |
| Controller Usage | All |
| Default Value | 0 |
SB - Set output bit
CB - Clear output bit
OB - Output Byte
OP 0 Clear Output Port -- all bits OP $85 Set outputs 1,3,8; clear the others MG _OP0 Returns the first parameter "m"