4.6 CPM1A PLC controller memory map
By memory map we mean memory structure for a PLC controller. Simply said, certain parts of memory have specific roles. If you look at the picture below, you can see that memory for CPM1A is structured into 16-bit words. A cluster of several such words makes up a region. All the regions make up the memory for a PLC controller.
Unlike microcontroller systems where only some memory locations have had their purpose clearly defined (ex. register that contains counter value), a memory of PLC controller is completely defined, and more importantly almost entire memory is addressable in bits. Addressability in bits means that it is enough to write the address of the memory location and a number of bits after it in order to manipulate with it. In short, that would mean that something like this could be written: "201.7=1" which would clearly indicate a word 201 and its bit 7 which is set to one.
IR region
Memory locations intended for PLC input and output. Some bits are directly connected to PLC controller inputs and outputs (screw terminal). In our case, we have 6 input lines at address IR000. One bit corresponds to each line, so the first line has the address IR000.0, and the sixth IR000.5. When you obtain a signal at the input, this immediately affects the status of a corresponding bit. There are also words with work bits in this region, and these work bits are used in a program as flags or certain conditional bits.
SR region
Special memory region for control bits and flags. It is intended first and foremost for counters and interrupts. For example, SR250 is memory location which contains an adjustable value, adjusted by potentiometer no.0 (in other words, value of this location can be adjusted manually by turning a potentiometer no.0.
TR region
When you move to a subprogram during program execution, all relevant data is stored in this region up to the return from a subprogram.
HR region
It is of great importance to keep certain information even when supply stops. This part of the memory is battery supported, so even when supply has stopped it will keep all data found therein before supply stopped.
AR region
This is one more region with control bits and flags. This region contains information on PLC status, errors, system time, and the like. Like HR region, this one is also battery supported.
LR region
In case of connection with another PLC, this region is used for exchange of data.
Timer and counter region
This region contains timer and counter values. There are 128 values. Since we will consider examples with timers and counters, we will discus this region more later on.
DM region
Contains data related to setting up communication with a PC computer, and data on errors.
Each region can be broken down to single words and meanings of its bits. In order to keep the clarity of the book, this part is dealt with in Attachments and we will deal with those regions here whose bits are mostly used for writing.
Note:
1. IR and LR bits that are not used for their allocated functions can be used as work bits.
2. The contents of the HR area, LR area, Counter area, and read/write DM area are backed up by a capacitor. At 25 oC, the capacitor will back up memory for 20 days.
3. When accessing a PV, TC numbers are used as word data; when accessing Completing Flags, they are used as bit data.
4. Data in DM6144 to DM6655 cannot be overwritten from the program, but they can be changed from a Peripheral Device