User's Manual

PMAC User Manual
Writing a Host Communications Program 263
Note:
Almost all PMAC VME users purchase the Option 2 DPRAM and use the ASCII
communications feature of the DPRAM rather than the ASCII mailbox
communications described in this section. The ASCII DPRAM communications is
easier and faster. Refer to PMAC Option 2, Dual-Ported RAM User manual for
details.
Sending Commands to PMAC VME through Mailbox Registers
When sending commands to PMAC, write to these mailbox registers. This is relatively straightforward,
although two rules must be followed:
1. Never write to mailbox register #1 (this would be location $7FA003 in the example above) when
sending commands to PMAC. This mailbox register has a special purpose which will be covered
later. Knowing this, the second character of the command will have to be written to mailbox register
#2 (the third mailbox register at location $7FA005), and so on.
2. Write the first character of the message (or group of 15 characters in a long message) last; i.e. write
all the other characters in the command first (beginning with mailbox register #2) and then write the
first character into mailbox register #0 (at location $7FA001). The reason for this is when writing to
mailbox #0, PMAC immediately reads in all the mailbox registers and begins to act upon the received
command line.
Note:
Do not forget to end all the ASCII messages (commands) with a carriage return
<CR>. Control character commands, which do not require a <CR>, should be
written directly into mailbox register #0.
Example:
To send the commands to select motor #1 and jog to it combine two commands to do this on one line:
#1J+<CR>. There are five ASCII characters, and thus write to five mailbox registers. To send this
command, issue five VME write commands. Keep the same base address of PMAC from the previous
example. The following tables show the contents of the mailbox registers:
Address
$7FA001 $7FA003 $7FA005 $7FA007 $7FA009 $7FA00B
Mailbox #
0 1 2 3 4 5
Character
—- 1
Address
$7FA001 $7FA003 $7FA005 $7FA007 $7FA009 $7FA00B
Mailbox #
0 1 2 3 4 5
Character
—- 1 J
Address
$7FA001 $7FA003 $7FA005 $7FA007 $7FA009 $7FA00B
Mailbox #
0 1 2 3 4 5
Character
—- 1 J +
Address
$7FA001 $7FA003 $7FA005 $7FA007 $7FA009 $7FA00B
Mailbox #
0 1 2 3 4 5
Character
—- 1 J +
<CR>
Address
$7FA001 $7FA003 $7FA005 $7FA007 $7FA009 $7FA00B
Mailbox #
0 1 2 3 4 5
Character
# —- 1 J +
<CR>