Optima DMC-1xxx and DMC-18x2 Command Reference
OC
i
143
OC
FUNCTION: Output Compare
DESCRIPTION:
The OC command allows the generation of output pulses based on one (or two for a 5-8 axis
controller) of the main encoder positions. For circular compare, the output is a low-going
pulse with a duration of approximately 600 nanoseconds and is available at the output
compare signal (labeled CMP on the ICM-1900 and ICM-2900). For one shot, the ouput
goes low until OC is called again.
Axes A-D pulses are output on the CMP pin and axes E-H pulses are output on the second
CMP pin. Both outputs can be used simultaneously. For both OC compare signals (1-4
axis output and 5-8 axis output) to execute successfully, the beginning pulse position for
both commands MUST be within 65535 counts of their current axis positions when the
commands are executed.
This function cannot be used with any axis configured for a step motor and the auxiliary
encoder of the corresponding axis can not be used while using this function. The OC
function requires that the main encoder and auxiliary encoders be configured exactly the
same (see the command, CE). For example: CE 0, CE 5, CE 10, CE 15.
ARGUMENTS: OCx = m, n
where
x = A,B,C,D,E,F,G H specifies which encoder input to be used.
m = Absolute position for first pulse. Integer between -2
10
9
and 2
10
9
n = Incremental distance between pulses. Integer between -65535 and 65535, 0 one shot (go
low,
stay low; -1 single pulse)
OCA = 0 will disable the Circular Compare function on axes A-D.
OCE = 0 will disable the Circular Compare function on axes E-H.
The sign of the parameter, n, will designate the expected direction of motion for the output
compare function. When moving in the opposite direction, output compare pulses will
occur at the incremental distance of 65536-|n| where |n| is the absolute value of n.
When changing to CEx=2, if the original command was OCx=m,n and the starting position
was _TPx, the new command is OCx=2*_TPx-m,-n. For pulses to occur under CEx=2,
the following conditions must be met: m > _TPx and n > 0 for negative moves (e.g.
JGx=-1000) and m < _TPx and n < 0 for positive moves (e.g. JGx=1000)
USAGE: DEFAULTS:
While Moving
Yes
Default Value
-
In a Program
Yes
Default Format
-
Command Line
Yes
Controller Usage
ALL CONTROLLERS
OPERAND USAGE:
_OC contains the state of the OC function
_OC = 0 : OC function has been enabled but not generated any pulses.
_OC = 1: OC function not enables or has generated the first output pulse.
(on a 5-8 axis controller, _OC is a logical AND of axes A-D and E-H)
EXAMPLES: