OP

Syntax:Implicit Only
Operands:_OP0,_OP1,_OP2,_OP3,_OP4
Burn:burnable with BN

Output Port

Hardware: All

Full Description

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.

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 (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.

OP output bank mapping
ArgumentExamplesBanksBitsDescription
mSet all: OP255;OP$FF01-8General Outputs (1-4 axes controllers)
mSet all: OP65535;OP$FFFF0,11-16General Outputs (5-8 axes controllers)
aClear all: OP0;OP$00002,317-32Extended I/O
bAlternating on/off:OP43690;OP$AAAA4,533-48Extended I/O
cSet High Byte:OP65280;OP$FF006,749-64Extended I/O
dSet Low Byte: OP255;OP$00FF8,965-80Extended I/O

The DMC-40x0 comes equipped with 32 bits of extended I/O standard (banks 2-5).

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

Usage

Usage and Default Details
UsageValue
While Moving (No RIO)Yes
In a ProgramYes
Command LineYes
Controller UsageAll
Default Value0

Related Commands

SB - 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"