Delta Tau GEO BRICK LV User Manual

Page of 440
 
Turbo PMAC User Manual 
412 
Writing a Host Communications Program 
Using the Buffer: First, Turbo PMAC’s internal binary rotary program buffer must be established with 
the &n DEFINE ROT command.   
Next, the header information for the DPRAM transfer buffer must be set up.  The starting address and size 
of the transfer buffer must be declared.  The buffer should not overlap any other use of DPRAM.  The 
size parameter must be an even number, with an absolute minimum of six PMAC addresses.  The size 
should be declared large enough to not limit throughput.  Each basic PMAC command component (e.g. 
X10) occupies two PMAC addresses in the transfer buffer.  The transfer occurs each background cycle, 
typically a few milliseconds. 
Both indices should be set to zero to indicate that both sides are pointing to the start of the buffer.  Next, 
the &n OPEN BIN ROT command should be given, so that Turbo PMAC checks for new data in the 
transfer buffer. 
Now, binary format commands can be loaded into the transfer buffer, and the host index updated.  As 
Turbo PMAC reads the commands from the buffer, it updates the PMAC index. 
Binary Command Structure: Typically, PCOMM32 routines generate the binary command format 
automatically.  Contact the factory if you require knowledge of this format. 
DPRAM Data Gathering Buffer 
Turbo PMAC’s data gathering function can create a rotary buffer in DPRAM, so that the host computer 
can pick up the data as it is being gathered.  This way, the size of the data gathering buffer is not limited 
by Turbo PMAC’s own memory capacity.  The data gathering buffer in DPRAM is selected if I5000 is set 
to 2 or 3; if I5000 is set to 3, it is used in a rotary fashion, which is typically how the buffer is used. 
The DPRAM data gathering buffer always starts at address 0x1140 (Y:$060450).  Its size is determined 
by the DEFINE GATHER {size} command, where {size} sets the number of PMAC addresses 
from the start.  This size value is stored at 0x113C (Y:$06044F). 
Variables I5001 through I5048 determine the potential registers to be gathered.  I5050 and I5051 are 24-
bit mask variables that determine which of the 48 possible sources will be gathered.  I5049 determines the 
gathering period, in servo cycles. 
The actual gathering is started by the on-line GATHER command, and stopped by the on-line 
ENDGATHER command.  As Turbo PMAC gathers data into the DPRAM, it advances the pointer that 
shows the address offset where the next item to be gathered will be placed.  This pointer is stored at 
0x113E (X:$06044F).  The host computer must watch for changes to this pointer to indicate that more 
data has been copied into DPRAM. 
Turbo PMAC Ethernet Protocol 
Communications through an Ethernet port are fully supported for Microsoft Windows 98, 2000, ME, and 
XP operating systems through the PCOMM32PRO driver library.  Users writing communications 
programs under one of those operating systems should consult the manual for PCOMM32PRO.  This 
section explains how comparable Ethernet communications drivers can be written for other operating 
systems. 
This section is intended for application programmers who have a fundamental understanding of Berkeley 
sockets used in the TCP/IP protocol suite.  Before any attempt to read or understand the contents of this 
manual review basic sockets and understand them before proceeding.  The fundamental socket functions 
that must be understood are recv, send, and socket. 
The examples in this manual are for demonstration purposes only and are to there to convey the concepts 
of how to communicate with the Turbo PMAC. Therefore, the examples do not include error checking 
and timeouts.  Delta Tau’s actual production code does, however, and application programmers are 
strongly encouraged to include error checking and timeouts in their code to prevent hang-ups and 
unresponsive behavior.