Delta Tau GEO BRICK LV User Manual

Page of 440
 
Turbo PMAC User Manual 
392 
Writing a Host Communications Program 
Setting up VME Communications 
Communications through the mailbox registers and the DPRAM must be set up through the use of 10 I-
variables: I90 – I99.  If use is desired at other than the default settings of these variables, another 
communications port (typically a serial port) must be used to make these settings before VME bus 
communications will be possible. 
The PMAC Executive program has a menu that automatically sets these variables in response to the 
desired addresses and a few other settings, so it is not necessary to know the details of these variables.  
The Software Reference manual has detailed instructions for setting these variables. 
VME Mailbox Register Communications 
Note:  
Usually, Turbo 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 the Option 2 DPRAM manual for details. 
Communicating with Turbo PMAC over the VME bus is different from talking over the RS232/422 port.  
When reading and writing to PMAC-VME over the VME bus, you must make use of the 16 mailbox 
registers.  Mailbox registers are simply a set of 16 8-bit registers that are addressable from the VME bus 
beginning at the base address of the PMAC-VME card plus 1.  That is, if we selected a PMAC base 
address of $7FA000, the first mailbox register (mailbox register #0) can be accessed at location $7FA001.  
The second mailbox register (mailbox register #1) is located $7FA003, the third at $7FA005, and so on 
up to $7FA01F for the 16th mailbox register (mailbox register #15).  As you can see, the mailbox 
registers are located at odd addresses beginning with the base address plus 1 of Turbo PMAC.  We will 
first discuss, by examples, how to send commands to PMAC through theses mailbox registers.   
Sending Commands to Turbo PMAC-VME through the Mailbox Registers 
When commands are sent to Turbo PMAC, these mailbox registers are written to.  This is relatively 
straightforward, although these two rules must be followed: 
1.  Never write to mailbox register #1 (this would be location $7FA003 in our example above) when 
sending a commands to PMAC.  This mailbox register has a special purpose.  Knowing this, the 
second character of the command should 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 to jog it, the two commands to do this can be combined on 
one line and would be: #1J+<CR>.  There are five ASCII characters here, and thus we will write into 
five mailbox registers.  To send this command, we will have to issue five VME write commands.