User's Manual
PMAC Dual-Ported RAM User Manual
22 Dual-Ported RAM Automatic Functions
General Description
The buffer has three parts. The first part is the header: four 16-bit words (eight host addresses) containing
handshake information and defining the location and size of the rest of the table. This is at a fixed location
in DPRAM (see table at end of section). The second part contains the address specifications of the PMAC
registers to be copied into DPRAM. It occupies two 16-bit words (four host addresses) for each PMAC
location to be copied, starting at the location specified in the header. The third part, starting immediately
after the end of the second part, contains the copied information from the PMAC registers. It contains two
16-bit words (four host addresses) for each short (X or Y) PMAC location copied, and four 16-bit words
(eight host addresses) for each long PMAC location copied. The data format is the same as for data
gathering to dual-ported RAM.
Enabling
To start operation of this buffer:
1. Write the starting location of the second part of the buffer into register 0x07EE (X:$D1FB). This
location is expressed as a PMAC address, and it must be between $D200 and $DFFF.
2. Starting at the DPRAM location specified in the above step, write the PMAC addresses of the
registers to be copied, and the register types. The first 16-bit word is the PMAC address of the first
register to be copied; the second 16-bit word takes a value of 0, 1, 2, or 4 to specify Y, Long, X, or
Special respectively, for the first register. The third and fourth word specifies the address and type of
the second register to be copied, and so on.
3. Write a number representing the size of the buffer into register 0x07EC. (Y:$D1FB). This value must
be between 1 and 128. When PMAC sees that this value is greater than zero and the individual data
ready bit is zero, it is ready to start copying the registers you have specified into DPRAM.
4. To enable the single user mode write a zero into the control word at 0x07E8 (Y:$D1FA). To enable
the multi-user mode write a 256 (set bit 8 and clear bit 0) into the control word at 0x07E8 (Y:$D1FA)
and set bit 15 = 0 of each variable's data type register (X memory register). This will tell PMAC that
the host is ready to receive data and what the mode is for the data.
5. Set I55 to 1. This enables both the background variable data reporting function and the background
variable data writing function.
Single User Mode Procedure
In operation, PMAC will try to copy data into the buffer each background cycle – between each scan of
each PLC program. If bit 0 of the control word 0x07E8 is set to 1, it will assume that the host has not
finished reading the data from the last cycle, so it will skip this cycle. If bit 0 is 0, it will copy all of the
specified registers.
When PMAC is done copying the specified registers, it copies 16 bits of the servo timer register (X:$0000)
into the DPRAM at 0x07EA (X:$D1FA). Then it sets Bit 0 of the control word 0x07E8 (Y:$D1FA) to let
the host know that it has completed a cycle.
When the host wants to read this data, it should check to see that Bit 0 of the control word 0x07E8 (the
Data Ready bit) has been set. If it has, the host can begin reading and processing the data in the DPRAM.
When it is done, it should clear the Data Ready bit to let PMAC know that it can perform another cycle.
Multi-User Mode Procedure
The operation of this mode is very similar to the Single User Mode described above. The main difference
is that the control word is no longer used as a global handshaking bit for updating the buffer. It enables or
disables the multi-user mode only. In multi-user mode the control word is never modified by PMAC.
Handshaking is now on an individual variable basis and is controlled by bit 15 of the variable's data type
specifier.