User's Manual

PMAC User Manual
264 Writing a Host Communications Program
First write an ASCII 1 to location $7FA005, then a J to $7FA007, then a + to $7FA009, then a carriage
return (ASCII code 13) to $7FA010, and finally a # to $7FA001.
Example:
The above example works for a command line of 15 characters or less (including the <CR> that was
added to terminate the line). However, if the command line contains more than 15 characters (Remember
there are only 15 mailbox registers that can be written to, send the first 15 characters (do not send a <CR>
yet.), followed by the remaining characters in succession until all characters have been written. And after
the last character, send the <CR> which tells PMAC to act upon the command.
To download a motion program and if one the statements in the program happens to be the following line:
IF(P1=1)DISPLAY"DELTA TAU"<CR>. 27 characters are here to send, and thus 27 VMEwrite
commands must be performed. The following tables again show the contents of the mailbox registers.
After writing the first group of 14 characters (the characters F through Y in the above command line), the
mailbox registers look something like this:
Address
$7FA001 $7FA003 $7FA005 $7FA007 $7FA01D $7FA01F
Mailbox #
0 1 2 3 14 15
Character
—- F ( A Y
Now, write the first character I:
Address
$7FA001 $7FA003 $7FA005 $7FA007 $7FA01D $7FA01F
Mailbox #
0 1 2 3 14 15
Character
I —- F ( A Y
At this point, PMAC has taken these characters into its command queue, but has not done anything with
them yet since no <CR> has been encountered yet. It asserts the selected interrupt level (default is 2) and
provides the command a receipt interrupt vector (default is $A0), which must be acknowledged. Now we
send the next 11 characters (D through " followed by a<CR>):
Address
$7FA001 $7FA003 $7FA005 $7FA007 $7FA01D $7FA01F
Mailbox #
0 1 2 3 11 12
Character
—- D E "
<CR>
Finally, send the first character of this second (and last) group of characters, which is a ":
Address
$7FA001 $7FA003 $7FA005 $7FA007 $7FA01D $7FA01F
Mailbox #
0 1 2 3 11 12
Character
" —- D E "
<CR>
PMAC again asserts interrupt level 2 and provides the command receipt interrupt vector. Since a <CR>
has been included, PMAC knows that the command line has been sent. PMAC now inserts this line into
the program buffer previously opened (remember, in this example a motion program was being
downloaded to PMAC).
Reading Data from PMAC VME through Mailbox Registers
Now that data has been sent to PMAC VME using the mailbox registers, determine how to read data from
PMAC. Reading data will involve using the interrupts and interrupt vectors generated by PMAC VME
over the VME bus. In the following examples, the PMAC base address is at $7FA000 and the I-variable
I3 is set to 2 (the best setting of I3 for writing host communications routines).