PACSystems Support for Reflective Memory
About this task
PACSystems PLC support reflective memory cards, as follows.
- Write data from reflective memory.
- Read data from reflective memory.
Write Data from Reflective Memory
On PACSystems, there are four functions that allow an application running on a PAC System CPU to communicate with a reflective memory card:
-
BUS_WRT_DWORD
orBUS_WRT_WORD
to write data to the network.
-
BUS_RD_DWORD
orBUS_WRT_WORD
to read data from the network.
The following examples are for use with a PAC PLC application interfacing to a RFM interface (named a CMX
interface).
Note: Examples for the 9070 are not currently available.
Typical write VME
functions take the following parameters, related to the location of the CMX
module (defined in the Hardware Configuration portion of the PLC application) and the memory that is to be written:
Parameter | Description | |
(enable) | ||
data | IN | PLC Memory space that is to be written to the Memory Xchange module, *note this must match in byte size the number of items written. |
Rack | R | Rack where the Memory Xchange module is located. |
Slot | S | Slot where the Memory Xchange module is located. |
Subslot | SS | Set to 0, unused with memory Xchange modules. |
Region | RGN | Which of the 4 memory regions in the memory Xchange module. |
Offset | OFF | 0-based number indicating what portion of the memory region is to be accessed. |
DWord | Number of DWORDs to be written. | |
Output | ST | Status of the operation. |
Reference | In | Reference for the Data to be written. |
For detailed instructions, see PACSystems Memory Xchange Modules Users' Manual, GFK-2300.
In the following PAC Ladder example, the application will:
- Write every scan as a single DWord of data to an RFM interface card that is located at
Procedure
- Rack is 0
- Slot is 1
-
Region is 1
- Take the data in the variable
DataToWrite
and writes it.
The instruction writes 1 double word and if the bus operation is successful, the function will pass power and the ST output will have a value of 0.
Read Data from Reflective Memory
In the following example, data from the Memory Xchange module is read from Rack is 0, Slot is 7, Region is 1, Offset is 1024 bytes into the memory, and the result of the read will be 1 Double word of data placed into the PLC variable ReadData. The Bus Read is immediate, and with the ReadOk contact being ON, and the ReadStatus being a value of 0, the contents of that memory location on the CMX card will be in the variable specified.
These functions all take the following parameters:
Parameter Description (enable) Rack R Rack where the Memory Xchange module is located. Slot S Slot where the Memory Xchange module is located. Subslot SS Set to 0. Region RGN Which of the 4 memory regions in the memory Xchange module. Offset OFF 0-based number indicating what portion of the memory region is to be accessed. DWord Number of DWORDs to be read. Output ST Status of the operation. Reference Q Reference where read data is to be placed. If the bus read operation is successful, the ST output will have a value of 0.
If the
Bus_RD
function passes power, the data requested is present and valid.If the
Bus_RD
function does not pass power, the data will hold last state, and will not be changed, or cleared. - Take the data in the variable