User's Manual

PMAC User Manual
Writing a Host Communications Program 267
Now we read again the mailbox registers, looking for <CR>, <ACK>, or <BELL>. The fifth character we
read in mailbox #4 ($7FA009) happens to contain a <CR>, so we stop reading and write $00 into mailbox
register #1. Because PMAC still has to send the final <ACK> character, it interrupts us again with vector
$A1 and we see in the mailbox registers:
Address
$7FA001 $7FA003 $7FA005 $7FA007 $7FA01D $7FA01F
Mailbox #
0 ... 4 5 14 15
Character
<ACK>
...
<CR>
2 3 4
Now stop at the first character, <ACK>, which serves as the end-of-transmission character, and again
write $00 into mailbox register 1. Since PMAC does not having any more data to be read for now, there
will not be another interrupt (until another command is sent or one of our executing PLC or motion
programs puts out data via the CMD or SEND command).
The diagram on the following page summarizes communications over the VME bus using the mailbox
registers.
When PMAC is asked to list out a motion program or PLC with a command like: LIST PROG 10 or
LIST PLC 0, PMAC will have multiple lines of data to be read. Simply wait for the interrupt to occur,
read the mailbox registers, write $00 to mailbox register #1, and wait to be interrupted again, repeating
this procedure until all data from PMAC has been sent and read.
Dual-Ported RAM Communications
The PMAC Option 2 provides an 8K x 16 bit dual-ported RAM that allows PMAC and its host to share
an area of fast memory. For the PMAC PC and the PMAC Lite, Option 2 is a separate board that sits on
the PC bus and cables to PMAC. For the PMAC VME, Option 2(V) consists of ICs added to the main
board itself. Option 2 is not available for the PMAC STD. The dual-ported RAM can be used for
extremely fast communication of data and commands to and from PMAC.
Uses of DPRAM
The typical use in writing to PMAC is for a very fast repetitive downloading of position data and/or
rotary program information in real time. The typical use in reading from PMAC is getting very fast status
information repetitively.
Data such as motor status, position, velocity, following error, etc., can be continuously updated and
written to DPRAM by PLC programs or automatically by PMAC. Without using DPRAM, this data must
be accessed by sending PMAC on-line commands, such as ?, P, V, and F, through the VME mailbox
registers or over the PCbus. This same data may be obtained much faster via the DPRAM without the
time required to send the command through the communications port and wait for the response.
PMAC provides many facilities for using the dual-ported RAM (DPRAM) to pass information back and
forth between the host computer and PMAC. These facilities are comprised of the following functions:
DPRAM Control Panel Function (Host to PMAC)
DPRAM Servo Data Reporting Function (PMAC to Host)
DPRAM Background Fixed Data Reporting Function (PMAC to Host)
DPRAM Background Variable Data Reporting Function (PMAC to Host)
DPRAM ASCII Communications Buffer (Bidirectional)
DPRAM Binary Rotary Program Buffer (Host to PMAC)
DPRAM Data Gathering Buffer (PMAC to Host — already existing)
DPRAM <CONTROL-W> ASCII Command Function (Host to PMAC — already existing)
In addition to these automatic functions, otherwise unused registers can be accessed in the DPRAM using
M-variables on the PMAC side, and through pointer variables on the host side, for sending data either
way between the host and PMAC. The M-variable formats likely to be used are X:, Y: (for 1 to 16 bits),