Commands, Buffered commands, Stored programs in q drives – Applied Motion RS-232 User Manual

Page 9: Multi-tasking in q drives, Immediate commands, Using commands, Yxxab<cr

Advertising
background image

9

920-0002 Rev. I

2/2013

Host Command Reference

Commands

There are two types of host commands available: buffered and immediate. Buffered commands are loaded

into and executed out of the drive’s volatile command buffer, also known as the queue. Immediate commands are
not buffered: when received by the drive they are executed immediately.

Buffered Commands

After being loaded into the command buffer of a drive, buffered commands are executed one at a time. (See

“Multi-tasking in Q Drives” below for an exception to this rule). If you send two buffered commands to the drive in
succession, like an FL (Feed to Length) command followed by an SS (Send String) command, the SS command
sits in the command buffer and waits to execute until the FL command is completed. The command buffer can
be filled up with commands for sequential execution without the host controller needing to wait for a specific
command to execute before sending the next command. Special buffer commands, like PS (Pause) and CT
(Continue), enable the buffer to be loaded and to pause execution until the desired time.

Stored Programs in Q Drives

Stored Q Programs, created with the Q Programmer application software, are created by using only buffered

commands.

Multi-tasking in Q Drives

Multi-tasking allows for an exception to the “one at a time” rule of buffered commands. The multi-tasking

feature of a Q drive allows you to initiate a move command (FL, FP, CJ, FS, etc.) and proceed to execute other
commands without waiting for the move command to finish.

Immediate Commands

Immediate commands are executed right away, running in parallel with a buffered command if necessary.

For example, this allows you to check the remaining space in the buffer using the BS (Buffer Status) command,
or the immediate status of digital inputs using the IS (Input Status) command, while the drive is processing other
commands. Immediate commands are designed to access the drive at any time.

Applied Motion recommends waiting for an appropriate Ack/Nack response from the drive before sending

subsequent commands. This adds limited overhead but ensures that the drive has received and executed the
current command, preventing many common communication errors. If the Ack/Nack functionality cannot be
used in the application for any reason, the user should allow a 10ms delay between commands to allow the drive
sufficient time to receive and act on the last command sent.

This approach allows a host controller to get information from the drive at a high rate, most often for

checking drive status or motor position.

Using Commands

The basic structure of a command packet from the host to the drive is always a text string followed by a

carriage return (no line feed required). The text string is always composed of the command itself, followed by any
parameters used by the command. The carriage return denotes the end of transmission to the drive. Here is the
basic syntax.

YXXAB<cr>

In the syntax above, “Y” symbolizes the drive’s RS-485 address, and is only required when using RS-485

networking. “XX” symbolizes the command itself, which is always composed of two capital letters. “A” symbolizes
the first of two possible parameters, and “B” symbolizes the second. Parameters 1 and 2 vary in length, can
be letters or numbers, and are often optional. The “<cr>” symbolizes the carriage return which terminates the
command string. How the carriage return is generated in your application will depend on your host software.

Once a drive receives the <cr> it will determine whether or not it understood the preceding characters as a

valid command. If it did understand the command the drive will either execute or buffer the command. If Ack/Nack

Advertising
This manual is related to the following products: