User`s manual

4.0 - Programming PMAC
Page - 39
If PMAC is not using an absolute feedback sensor that will keep a point of reference on the machine, the axis should be
homed before running a motion program or Jog commands. If a home search procedure in not performed after power-
up\reset, PMAC will consider the power-up\reset position as the zero point reference.
I-variable Description I-variable Description
Ix03 Motor x Position Address Ix26 Motor x Home Offset
Ix20 Motor x Jog/Home Acceleration Time I902, I907,.. Encoder 0 Capture Control (PMAC 1 Only)
Ix21 Motor x Jog/Home S-Curve Time I903, I908,.. Encoder 0 Flag Select (PMAC 1 Only)
Ix23 Motor x Homing Speed & Direction Ix25 Motor x Flag Address
The flag channel used by Ix25 must match the position feedback channel used by Ix03 (indirectly from the conversion table)
Description M-variable Description M-variable
ENC capture/compare position register Mx03 FAULT input status Mx23
ENC 3rd channel input status Mx19 Desired-velocity-zero bit Mx33
HMFL input status Mx20 In-position bit Mx40
-LIM input status Mx21 Home-complete bit Mx45
+LIM input status Mx22 Encoder home capture offset (counts) Mx73
Home commands could be issued on the terminal window, a Motion Program or a PLC Program:
- HOME1..8 ;Home axis 1 to 8 in a Motion Program. Program is halted until home is completed.
- #1HM ;Online command for homing motor #1 from the terminal window.
- CMD”#1HM” ;Online command for homing motor #1 from a PLC program.
while (…) ;If a command statement is used in a PLC, the lines after must have a while
endwhile ;loop waiting for the home procedure to complete (see main PMAC manual for details).
HOMEZ is very similar to these HOME commands but no motion will result in this kind of home search. PMAC will
determine the zero reference home position in the place where the axes are found when HOMEZ is issued.
4.8 - Command and Send statements
Using the COMMAND or CMD statement, online commands could be issued from a PLC or Motion program having the
same result as if they were issued from a host computer or a terminal window. Certain online commands might not be valid
when issued from a running program. For example, a Jog command to a motor part of a coordinate system running a motion
program will be invalid. 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 hangup from a full response queue,
or from disturbing the normal host communications protocol.
Messages to a host computer or terminal window could be issued using the SEND command.
If there is no host on the port to which the message is sent, or the host is not ready to read the message, the message is left in
the queue. If several messages back up in the queue this way, the program issuing the messages will halt execution until the
messages are read. This is a common mistake when the SEND command is used outside of an Edge-Triggered condition in
a PLC program. On the serial port, it is possible to send messages to a non-existent host by disabling the port handshaking
with I1=1.
If a program, particularly a PLC program, sends messages immediately on power-up/reset, it can confuse a host-computer
program (such as the PMAC Executive Program) that is trying to "find" PMAC by querying it and looking for a particular
response.
It is possible, particularly in PLC programs, to order the sending of messages or command statements faster than the port
can handle them. This will almost always happen if the same SEND or CMD command is executed every scan through the
PLC. For this reason, it is good practice to have at least one of the conditions that causes the SEND or CMD command to
execute to be set false immediately to prevent execution of this SEND or CMD command on subsequent scans of the PLC.