Reference Manual

Turbo PMAC/PMAC2 Software Reference
Turbo PMAC Program Command Specification 422
do not have motor or coordinate-system specifiers. At power-up/reset, all PLC programs are addressing
Motor 1 and C.S.1.
There is no modal ADDRESS command in motion programs. Any motor-specific or coordinate-system-
specific command issued from within a motion program without a specifier is automatically addressed to
Motor 1 or C.S.1, respectively.
Commands issued from within a program are placed in the command queue, to be parsed and acted upon
at the appropriate time by Turbo PMAC’s command interpreter, which operates in background, between
other background tasks. If issued from a motion program, the command will not be interpreted before the
next move or dwell command in the motion program is calculated. If issued from a PLC program, the
command will not be interpreted before the end of the current scan of the PLC. This delay can make the
action appear to execute out of sequence.
Because of the queuing of commands and the fact that command interpretation is a lower priority than
command issuing, it is possible to overflow the queue. If there is no room for a new command, program
execution is temporarily halted until the new command can be placed on the queue.
Also, commands that generate a response to the host (including errors if I6 is not equal to 2) potentially
can fill up the response queue if there is no host or the host is not prepared to read the responses. This
will temporarily halt program execution until the response queue is emptied. In standalone applications,
it is a good idea to set I1 to 1, disabling the serial handshake, so any responses can be sent out the serial
port (the default response port) at any time, even if there is no host to receive it.
In a PLC program, it is a good idea to have at least one of the conditions that caused the command
issuance to occur set false immediately. This will prevent the same command from being issued again on
succeeding scans of the PLC, overflowing the command and/or response queues. Typically in a motion
program, the time between moves prevents this overflow unless there are a lot of commands and the
moves take a very short time.
Turbo PMAC will not issue an acknowledging character (<ACK> or <LF>) to a valid command issued
from an internal program. It will issue a <BELL> character for an invalid command issued from a
program unless I6 is set to 2. It is a good idea to have I6 not set to 2 in early development so that it will
be known when Turbo PMAC has rejected such a command. Setting I6 to 2 in the actual application can
prevent program hang-up from a full response queue, or from disturbing the normal host communications
protocol.
Many otherwise valid commands will be rejected when issued from a motion program. For instance, any
motor cannot jogged in the coordinate system executing the program because all these motors are
considered to be running in the program, even if the program is not requesting a move of the motors at
that time.
When issuing commands from a program, be sure to include all the necessary syntax (motor and/or
coordinate system specifiers) in the command statement or use the ADDRESS command. For example,
use CMD"#4HM" and CMD"&1A" instead of CMD"HM" and CMD"A". Otherwise, motor and coordinate
system commands will be sent to the most recently addressed motor and coordinate system which may
not always be intended.
Examples:
COMMAND"#1J+"
CMD"#4HM"
CMD"&1B5R"
CMDP"P1"
47.5
ADDRESS#3
COMMAND"J-"
IF(M40=1 AND M41=1)
CMD"&4R"