Reference Manual
PMAC 2 Software Reference
306 PMAC Program Command Specification
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.
PMAC will not issue an acknowledging character (<ACK> or <LF>) to a valid command
issued from a 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 you will know when 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.
If PMAC variable I64 is set to 1, any response sent to the host as a result of an internal
COMMAND statement is preceded by a <CTRL-B> character, making it easier for the host
computer to tell that this is an unsolicited response.
Many otherwise valid commands will be rejected when issued from a motion program.
For instance, you cannot jog any motor 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.
Example
COMMAND"#1J+"
CMD"#4HM"
CMD"&1B5R"
CMD"P1"
47.5
ADDRESS#3
COMMAND"J-"
IF(M40=1 AND M41=1)
CMD"&4R"
M41=0
ENDIF
See Also
Addressing Modes, On-Line Commands (Talking To PMAC)
I-variables I1, I3, I6.
Program commands ADDRESS, COMMAND^{letter}
Writing A PLC Program