Manual

3-76 Detailed Descriptions of ACL Commands
XD [<id> [, <rept> ]] Execute Download Sequence
This command invokes, or starts the execution of, a Download Sequence previously defined
via the BD and ED commands. The saved ACL commands are executed as though they had
been received from the host computer through the RS-232C port.
The XD command itself can be made part of a Download Sequence. In this way complex
motion sequences containing repetitive patterns can be built up using only a small amount of
download memory. The maximum nesting depth is twelve; in other words, if sequence 1
invokes sequence 2 and sequence 2 invokes sequence 3, etc., then if sequence 12 attempts to
invoke sequence 13 an error is logged and Download execution halts. However, sequence 1
can invoke sequence 2 a hundred times in a row if it is desired.
If a Download Sequence directly or indirectly invokes itself the maximum nesting depth will
probably soon be exceeded. Exception: if there is an XI ("Execute If") in the sequence it
may terminate the nesting before it becomes too deep. See the BD command.
<id> is the identifying number of the Download Sequence to be invoked; it must be an
integer in the range 0 through 255. <id> is optional; if omitted it defaults to zero (i.e.
Download Sequence 0 is invoked). If the specified Download Sequence is empty (i.e. has
not been defined via BD and ED) then the XD command has no effect.
<rept> is the repetition count; it is optional but cannot be specified unless <id> is also
specified. If <rept> is specified it must be an integer in the range 0 through 65535; this
value overrides the repetition count given in the BD command. If <rept> is omitted the BD
command's repetition count, if any, is used.
If <rept> is 1 the invoked sequence is executed once; if greater than one the sequence
executes the specified number of times. If <rept> is zero the sequence repeats forever, or
until it is halted; see below.
The execution of a Download Sequence can be prematurely halted four ways: by resetting
the machine or turning off the power; by executing an AD command contained in any
Download Sequence; by sending the
ESC.!5: command (see Chapter 6); or by exceeding
the maximum nesting depth (see above). In addition, a Download Sequence can be
interrupted by another Download Sequence invoked via the front panel or the Digital Inputs;
see Chapter 8.
For more information about storing, invoking, and executing Download Sequences, see the
BD, ED, XI, XU, and XW commands. Also see personality parameters 36 - 38 in Chapter 7.
Example: the sequence BD 2; AA 0, 0, -10; CD 1; WA 0.1; CD 0; ED; defines
Download Sequence 2, which performs a 10-degree clockwise arc centered about the Origin
location (0,0), then changes the Digital Outputs to 1, then waits 0.1 second, then changes the
Digital Outputs back to zero. After setting up this sequence, send FH; SO 2000,2000;
MA0,1000; XD2,36; . This sets the Origin at (2000,2000), moves the carriage to a point
1000 Calibrated Units above the Origin, and steps to 36 points around a circle, pausing at
each one to change the Digital Outputs.