User's Manual
PMAC Dual-Ported RAM User Manual
8 Dual-Ported RAM Communications
PMAC Address Host Address
Y:$D000 $1FC000
X:$D000 $1FC002
Y:$D001 $1FC004
X:$D001 $1FC006
Y:$D200 $1FC800
X:$D200 $1FC802
.....
.....
.....
.....
Y:$DFFF $1FFFFC
X:$DFFF $1FFFFE
The following two equations can be helpful to help calculate both PMAC and host addresses for DPRAM:
Host address = Host start address + 4 x (PMAC address - $D000) + offset
where: offset = 0 for accessing Y memory, and offset = 2 for accessing X memory. In our example, Host
start address = $1FC000. In converting the other way, we have:
PMAC address = 0.25 x (Host address - Host start address) + $D000
Host DPRAM address bits A2 through A13 select which PMAC word is to be accessed. The value of
these bits equals the PMAC equivalent address minus $D000.
Read/write Example:
Suppose the DPRAM was configured to begin at host location $EC000 and you write to PMAC
WY$D000, $1234
WX$D000, $5678
H
ost
Writing to the DPRAM on the host side and reading it through PMAC is just as easy. The alignment of the
numbers work the same way as illustrated above.
The host application program and the PMAC motion control and/or PLC programs may be written to allow
a wide variety of control and data transfer capabilities. While certain DPRAM addresses are reserved as
mentioned above, the host may set certain addresses to trigger an operation in the PMAC, the PMAC may
set certain addresses to trigger an operation in the host, etc.
Programming Examples:
Example #1: Suppose a host program is written in C to read motor #1’s actual position. Use the DPRAM
automatic features to place this data in DPRAM or use a PMAC PLC program. To use a PLC program,
define two M-variables and a one line PLC program which constantly updates a location in DPRAM. The
C-program can then read this value, which is a 32-bit integer. In PMAC, enter the following M-variable
definitions and PLC program.