Installation guide

Keyword Reference Guide
MN1270 02.2002 53
See Also:
AXISCHANNEL, CONFIG
COMPARELATCH/CML
Purpose:
Reads the state of the position compare latch.
Controllers Supported:
NextMove PCI NextMove PC NextMove BX MintDrive ServoNode 51
Format:
COMPARELATCH[axes] = <expression> {,<expression>}
v = COMPARELATCH[axis]
Dot Parameters:
Axis – Axis No.
Attributes:
Controller Read Write Command Multi-
Axis
Scaled Default Range
NextMove
0 x 2
Description:
Reads the state of the position compare latch and returns a bit pattern:
Bit Meaning
0 State of position compare pin: 1 – active 0 – inactive.
1 The position of the axis has matched the position in compare
register 0.
2 The position of the axis has matched the position in compare
register 1.
Bits 1 and 2 are latched values and can be cleared by writing to compare latch. Bit 0 is the state of the
compare pin and will not be affected by writing the value written to
COMPARELATCH.
Example:
LOOP
CLS
a = COMPARELATCH : REM store copy of the latch
COMPARELATCH = 0 : REM reset all latched bits
IF (a & 0x01) DO
PRINT “Compare Output is ON”
ELSE
PRINF “Compare Output if OFF”
ENDIF
IF (a & 0x02) THEN PRINT “Axis position matched value in register 0”
IF (a & 0x04) THEN PRINT “Axis position matched value in register 1”
WAIT = 250
ENDL
The above code will monitor the state of the compare output and print up a text message if the compare
output changes state.
See Also:
COMPAREMODE, COMPAREPOS