Idxn on/off, Idx n on/off – Rockwell Automation 1398-PDM-xxx IQ Master Version 3.2.4 for IA-2000 and IQ-5000 Positioning Drive Modules, IQ-55 User Manual
Page 242

220
Language Reference • Reference
Publication 1398-PM601A-EN-P — October 2000
WORDS
IDXn ON/OFF
Index Interrupt Enable/Disable
Interrupts
Purpose
Enable or disable encoder n index interrupt.
Syntax
IDXn ON/OFF
n
The number of the encoder: n = 1 or 2.
ON
Enable the index interrupt.
OFF
Disable the index interrupt.
Remarks
After an IDXn ON is executed, one interrupt will be detected and the position of
encoder 1 and encoder 2 will be saved into IXnP1 and IXnP2. The FIDXn flag is then
set, and the interrupt is disabled.
The flag remains set until it is cleared with an FIDXn OFF statement. If the state of an
interrupt flag is not known when enabling the interrupt, clear the flag with an FIDXn
OFF statement before enabling the interrupt. When a program stops, the interrupt flags
are cleared.
See Also
FIDXn, IXnPm
Example
IDX1 ON
IDX2 OFF
IF
If/Then/Else
Program Structure
Purpose
The IF statement tests for a condition and then executes the specified action if the con-
dition is satisfied. If the condition is false, no action is taken and the following instruc-
tion is executed. Optionally, a second action may be specified to be executed if the
condition is false.
Syntax
IF condition action1 [ELSE action2]
condition
The condition to be tested. The condition may be a comparison,
an input being ON or OFF, or a program flag being ON or OFF
Comparisons compare the values of two operands and determine
if the condition is TRUE or FALSE. A comparison may be
greater than (>), less than (<), equal to ( = ), not equal to (<>),
less than or equal to (< = ), or greater than or equal to (> = ). The
operands of a comparison may be user variables, system vari-
ables, analog input values (ADC), or constants.
I1 ON
;an input
F1 ON
;a user flag
INPOSN ON
;system flag
G1 > G2
;comparison user variable
G1 > POS1
;comparison system variable
POS2 <= 7.00
;comparison constant
action1
The action to be taken if the condition is TRUE. The action may
be any programming statement or block of statements. For exam-
ple, turning an output or program flag ON or OFF, writing a value
to the DAC1, jumping to a program label, or an addition or sub-
traction. A block of statements is any group of statements
enclosed in curly braces {}.