Words, Xkey program structure – 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 304

282
Language Reference • Reference
Publication 1398-PM601A-EN-P — October 2000
WORDS
Xn:
Xkey
Program Structure
Purpose
Marks the beginning of an Xkey routine.
Syntax
Xn:
Remarks
The keys marked X1 through X4 on the Operator Terminal are special function keys
that, when pressed, execute a routine in parallel with a main program. To enable an
Xkey, a routine must be written for the Xkey and the program must contain an Xn ON
or Xn CONT statement.
The program statements in an Xkey routine can be any legal program statement except
motion statements or subroutine calls. Motion statements include MOVD, MOVP, DV,
DIF, DELAY, and DWELL. Any jump commands in an Xkey routine must be to a
label within that same Xkey routine; jumps outside of the Xkey routine are not
allowed. PRINT and READ commands for the Operator Terminal are allowed.
If more than one Xkey is enabled, if a second Xkey is pressed while the first Xkey rou-
tine is still executing, the first Xkey routine will be aborted and execution of the sec-
ond will begin. Xn ON, Xn OFF, and Xn CONT statements can be used within an
Xkey routine to avoid this situation.
The Xn statement is used to mark the beginning of a routine for an Operator Terminal
Xkey, where n is 1 through 4. Xkey routines must be placed before the main body of a
program after any TITLE, ASSIGN, or Sn: statements.
The XNPGM = number statement can be used to simulate pressing an Xkey from
within a program.
See Also
Xn ON/OFF/CONT, XEND, Operator Terminal
Example
X1:
;Beginning of the X1 key routine
X1 OFF
;Disable Xkey routine while in it
; (needed if X1 CONT used)
X2 OFF
;Disable X2 while in X1 routine
... statements
X2 ON
;Re-enable X2 key
X1 ON
;Re-enable X1 key
XEND
;Mark the end of the X1 routine