Sunday, 26 October 2014

PLC Detailed memory map of PLC controller

 INTRODUCTION

 B.1 General explanation of memory areas
 B.2 IR memory area
 B.3 SR memory area
 B.4 AR memory area
 B.5 PC memory area

Introduction
Purpose of this appendix is to explain certain memory areas in detail. As the following tables cover whole memory, there are options left unused in this book. They should be skipped during the first reading, and used later according to needs.
B.1 General explanation of memory areas
Memory of PLC controller consists of several areas, some of these having predefined functions.

Data areaWord(s)Bit(s)Function
IR areainput areaIR 000 - IR 009 (10 words)IR 00000 - IR 00915 (160 bits)These bits may be assigned to an external I/O connection. Some of these have direct output on screw terminal (for example, IR000.00 - IR000.05 and IR010.00 - IR010.03 with CPM1A model)
output areaIR 010 - IR 019 (10 words)IR 01000 - IR 01915 (160 bits)
working areaIR 200 - IR 231 (32 words)IR 20000 - IR 23115 (512 bits)Working bits that can be used freely in the program. They are commonly used as swap bits
SR areaSR 232 - SR 255 (24 words)SR23200 - SR25515 (384 bits)Special functions, such as flags and control bits
TR area---TR 0 - TR 7 (8 bits)Temporary storage of ON/OFF states when jump takes place
HR areaHR 00 - HR 19 (20 words)HR0000 - HR1915 (320 bits)Data storage; these keep their states when power is off
AR areaAR 00 - AR 15 (16 words)AR0000 - AR1515 (256 bits)Special functions, such as flags and control bits
LR areaLR 00 - LR 15 (16 words)LR0000 - LR1515 (256 bits)1:1 connection with another PC
Timer/counter areaTC 000 - TC 127 (timer/counter numbers)Same numbers are used for both timers and counters
DM areaRead/writeDM 0000 - DM 0999 and DM 1022 - DM 1023 (1002 words)---Data of DM area may be accessed only in word form. Words keep their contents after the power is off
Error writingDM 1000 - DM 1021 (22 words)---Part of the memory for storing the time and code of error that occurred. When not used for this purpose, they can be used as regular DM words for reading and writing. They cannot be changed from within the program
Read onlyDM 6144 - DM 6599 (456 words)---
PC setupDM 6600 - DM 6655 (56 words)---
Storing various parameters for controlling the PC
Note:
1. IR and LR bits, when not used to their purpose, may be used as working bits.
2. Contents of HR area, LR area, counter and DM area for reading/writing is stored within backup condenser. On 25C, condenser keeps the memory contents for up to 20 days.
3. When accessing the current value of PV, TC numbers used for data have the form of word. When accessing the Completing flags, they are used as data bits. 4. Data from DM6144 to DM6655 must not be changed from within the program, but can be changed by peripheral device.
B.2. SR memory area
IR area doesn’t have predefined memory locations, but is meant for general use in the program. Of all the locations this memory area consists of, only those directly connected to PLC controller input/output lines are of interest for this appendix.

IR area can be divided into 3 parts:

1. Input area is located from word IR000 to IR009, totaling 160 bits. Most important of these are in the word IR000 because they are directly connected to screw terminal of PLC controller. Input IR000.01 is directly connected to screw terminal marked with 01 on the casing of the PLC controller.

2. Output area is located from word IR010 to IR019, totaling 160 bits. Most important of these are in the word IR010 because they are directly connected to screw terminal of PLC controller. Output IR000.00 is directly connected to screw terminal marked with 00 on the casing of the PLC controller.

3. Working area is located from word IR200 to IR231 totaling 512 bits for general use.

As IR memory area does not have predefined memory locations, more detailed explanations are not necessary.

B.3. IR memory area
Unlike IR area, SR area does have predefined memory locations. These bits are usually tied to the PLC controller work or contain current and set values of different functions. Purpose of specific memory locations of SR area is explained in the following table:

WordsBitsFunction
SR 232 - SR 23500 - 15Input area for macro functions. Contains input operands for MCRO(99) (may be used for working bits, when MCRO(99) is not used)
SR 236 - SR 23900 - 15Output area for macro functions. Contains output operands for MCRO(99) (may be used for working bits, when MCRO(99) is not used)
SR 24000 - 15Contains set value SV, when input interrupt 0 is used in counter mode (4 hexadecimal digits) (may be used for working bits, when input interrupt 0 is not used in counter mode)
SR 24100 - 15Contains set value SV, when input interrupt 1 is used in counter mode (4 hexadecimal digits) (may be used for working bits, when input interrupt 1 is not used in counter mode)
SR 24200 - 15Contains set value SV, when input interrupt 2 is used in counter mode (4 hexadecimal digits) (may be used for working bits, when input interrupt 2 is not used in counter mode)
SR 24300 - 15Contains set value SV, when input interrupt 3 is used in counter mode (4 hexadecimal digits) (may be used for working bits, when input interrupt 3 is not used in counter mode)
SR 24400 - 15Contains current value (PV-1), when input interrupt 0 is used in counter mode (4 hexadecimal digits)
SR 24500 - 15Contains current value (PV-1), when input interrupt 1 is used in counter mode (4 hexadecimal digits)
SR 24600 - 15Contains current value (PV-1), when input interrupt 2 is used in counter mode (4 hexadecimal digits)
SR 24700 - 15Contains current value (PV-1), when input interrupt 3 is used in counter mode (4 hexadecimal digits)
SR 248, SR 24900 - 15Contains current value PV of the high-speed counter (may be used for working bits, when high-speed counter is not used)
SR 25000 - 15Analog setting of value 0. Keeps 4 digit BCD value (0000 - 0200) set via analog potentiometer on the PLC controller casing.
SR 25100 - 15Analog setting of value 1. Keeps 4 digit BCD value (0000 - 0200) set via analog potentiometer on the PLC controller casing.
SR 25200Reset of the high-speed counter
 01 - 07Not used
 08Peripheral port. Switches on for the reset of the peripheral port (this doesn't apply to a case when peripheral device is connected). Bit automatically changes state to OFF after the reset
 09Not used
 10PLC Setup Reset Bit. When on, it initializes PC setup (DM6600-DM6655). It automatically goes to OFF after the reset. This applies only if the PC is in PROGRAM mode
 11Forced Status Hold Bit. OFF: bits used in the operation of forced set/reset are cleared when changing from PROGRAM to MONITOR mode. ON: bits used in the operation of forced set/reset keep their states when changing from PROGRAM to MONITOR mode.
 12 I/O Hold bit. OFF: IR and LR bits are reset when starting or ending an operation. ON: IR and LR bits keep their states when starting or ending an operation.
 13Not used
 14Error Log Reset Bit. Bit state OFF clears the record of error taking place. Bit automatically goes off after the operation
 15Not used
SR 25300 - 07FAL error code. Location contains error code (2 digit number). FAL number is stored at this location upon executing FAL(06) or FAL(07) instructions. Location contents are reset upon executing FAL 00 instruction or by clearing an error from peripheral device
 08Not used
 09Cycle Time Overrun Flag. Bit goes to ON when program length doesn't allow cycle of input/output scanning to be executed in a specified time period
 10 - 12Not used
 13Flag always on
 14Flag always off
 15First Cycle Flag. Goes ON during the first cycle at the beginning of the operation
SR 254001 min clock impulse (30s on, 30s off)
 010.02s clock impulse (0.01s on, 0.01s off)
 02Negative (N) flag
 03 - 05Not used
 06Differential Monitor Flag
 07STEP(8) execution flag
 08 - 15Not used
SR 255000.1s clock impulse (0.05s on, 0.05s off)
 010.2s clock impulse (0.1s on, 0.1s off)
 021.0s clock impulse (0.5s on, 0.5s off)
 03Instruction Execution Error (ER) Flag. Changes state to ON if error occurs during instruction execution
 04Carry (CY) flag
 05"Greater than" (GR) flag
 06"Equals" (EQ) flag
 07"Less than" (LE) flag
 08 - 15Not used

B.4. AR memory area
Purpose of this memory area is to provide information on PLC controller state, malfunctions and some system data. Memory locations of this area keep their states after the power has been shut down.

Word(s)Bit(s)Function
AR00 and AR0100 - 15Not used
AR0200Status flag of the first I/O unit for expanding I/O lines (I/O units status flag)
 01Status flag of the second I/O unit for expanding I/O lines (I/O units status flag)
 02Status flag of the third I/O unit for expanding I/O lines (I/O units status flag)
 03 - 07Not used
 12 - 15Number of connected I/O units
AR03 - AR0700 - 15Not used
AR0800 - 07Not used
 08 - 11Peripheral device error code
 12Flag of peripheral device error
 13Peripheral Device Transmission Enabled Flag
 14 - 15Not used
AR0900 - 15Not used
AR1000 - 15Power-off counter. Contains 4-digit BCD value
AR1100 - 07High-speed Counter Range Comparison Flags
 08 - 14Not used
 15Pulse Output Status. ON: stopped; OFF: Impulse at output
AR1200 - 15Not used
AR1300Power-up PC Setup Error Flag. Goes ON when error occurs in area DM 6600 - DM 6614
 01Start-up PC Setup Error Flag. Goes ON when error occurs in area DM 6615 - DM 6644
 02RUN PC Setup Error Flag. Goes ON when error occurs in area DM 6645 - DM 6655
 03 - 04Not used
 05Long Cycle Time Flag. Goes ON if real cycle length exceeds length set in DM 6619
 06 - 07Not used
 08Memory Area Specification Error Flag. Goes ON when non-existing address is specified in the program
 09Flash Memory Error Flag
 10Read-only DM Error Flag. Goes ON when checksum error occurs in DM 6144 - DM 6599 range
 11PC Setup Error Flag. Goes ON when checksum error occurs in PC Setup area
 12Program Error Flag. Goes ON when checksum error occurs in program memory (UM) or inappropriate instruction is executed
 13Expansion Instruction Error Flag
 14 - 15Not used
AR1400 - 15Maximum Cycle Time. 4 BCD digits. Cleared at the beginning of the operation
AR1500 - 15Current Cycle Time. 4 BCD digits. Not cleared when the operation ends
 Note:
1. IR and LR bits when not used for their function may be used as working bits.
2. Contents of HR area, LR area, counter, and DM area for reading/writing are kept by battery of central processing unit. In case that the battery is removed or malfunction occurs, this data will be lost.
3. When accessing the current value of PV, TC numbers used for data have form of word. When accessing Completing flags, they are used as data bits.
4. Data stored from DM6144 to DM6655 cannot be changed from within the program, but can be changed by peripheral device.
5. Program and data from DM 6144 to DM 6655 are stored in the flash memory.
 
B.5. PC memory area
PLC setup area can be roughly divided into 4 categories:

1. Settings related to basic operations of PLC controller and I/O processes
2. Settings related to cycle duration
3. Settings related to interrupts
4. Settings related to communication.

Word(s)Bit(s)Function
Settings are active only upon resetting the PLC and sending data from PC to PLC
DM 660000 - 07Startup Mode. Active only if bits 08 - 15 are set to 02. 00: PROGRAM; 01: MONITOR; 02: RUN
 08 - 15Startup mode designation. 00: programming console switch; 01: proceeds in the mode last used before turning off the power; 02: settings in 00 - 07
DM 660100 - 07Not used (set to 0)
 08 - 11IOM Hold Bit (SR 25212). 0: Reset; 1: Keeps the state
 12 - 15Forced Status Hold Bit (SR 25211). 0: Reset; 1: Keeps the state
DM 660200 - 03Writing to program memory protection. 00: OFF; 01: ON (except for DM 6602)
 04 - 07Programming console display language. 00: English; 01: Japanese
 08 - 11Not used
DM 660300 - 15Not used
DM 660400 - 0700: in case of battery malfunction, error will not be generated; 01: in case of battery malfunction, error will be generated
 08 - 15Not used
DM 6605 - DM 661400 - 15Not used
Cycle Time Settings (DM 6615 - DM 6619) take effect after the transfer to PC area, next time you start working
DM 6615 - DM 661600 - 15Not used
DM 661700 - 07Servicing time for peripheral port. Active when bits 08 - 15 are set to 01. It is expressed in percentage of cycle time duration (00 to 99 (BCD))
 08 - 15Peripheral port servicing setting enable. 00: 5% of cycle duration; 01: time defined in first half of the word
DM 661800 - 07Cycle monitor time. Settings are identical to those of the second half of the previous word
 08 - 15Cycle monitor enable (Setting in 00 to 07 x unit; 99 5 max). 00:120ms (settings in bits 00-07 are disabled) ; 01: setting unit 10ms; 02: setting unit 100ms; 03: setting unit 1s
DM 661900 - 15Cycle time. 0000: variable (no minimum); 0001: up to 9999 (BCD). Minimal time is expressed in ms
Interrupt Processing (DM 6620 - DM 6639) take effect after the transfer to PC area, next time you start working
DM 662000 - 03Input constant for IR  00000 - IR 00002. 0: 0.8ms; 1: 1ms; 2: 2ms; 3: 4ms; 4: 8ms; 5: 16ms; 6: 32ms; 7: 64ms; 8: 128ms 
 04 - 07Input constant for IR  00003 and IR 00004. Settings are same as with bits 00-03
 08 - 11Input constant for IR  00005 and IR 00006. Settings are same as with bits 00-03
 12 - 15Input constant for IR  00007 and IR 00011. Settings are same as with bits 00-03
DM 662100 - 07Input constant for IR  001. 0: 0.8ms; 1: 1ms; 2: 2ms; 3: 4ms; 4: 8ms; 5: 16ms; 6: 32ms; 7: 64ms; 8: 128ms
 08 - 15Input constant for IR  002. Settings are same as with IR 001
DM 662200 - 07Input constant for IR  003. Settings are same as with IR 001
 08 - 15Input constant for IR  004. Settings are same as with IR 001
DM 662300 - 07Input constant for IR  005. Settings are same as with IR 001
 08 - 15Input constant for IR  006. Settings are same as with IR 001
DM 662400 - 07Input constant for IR  007. Settings are same as with IR 001
DM 662500 - 07Input constant for IR  008. Settings are same as with IR 001
 08 - 15Input constant for IR  009. Settings are same as with IR 001
DM 6626 - DM 662700 - 15Not used
DM 662800 - 03Interrupt enabled on IR 00000. (0: regular input; 1: interrupt input; 2: fast-reaction input)
 04 - 07Interrupt enabled on IR 00001. (0: regular input; 1: interrupt input; 2: fast-reaction input)
 08 - 11Interrupt enabled on IR 00002. (0: regular input; 1: interrupt input; 2: fast-reaction input)
 12 - 15Interrupt enabled on IR 00003. (0: regular input; 1: interrupt input; 2: fast-reaction input)
High-speed counter settings (DM 6640-DM 6644) take effect after the transfer to PC area, next time you start working
DM 6640 - DM 664100 - 15Not used
DM 664200 - 03High-speed counter mode. 0: counting up/down; 4: incremental mode
 04 - 07High-speed counter reset mode. 0: Z phase and software reset; 1: software reset only 
 08 - 15High-speed counter enable. 0: high-speed counter not used; 1: high-speed counter used with settings 00-07
DM 6643 - DM 664400 - 15Not used
 Peripheral port settings take effect after the transfer to PC area
DM 6645 - DM 664900 - 15Not used
DM 665000 - 07Port settings. 00: standard (1 start bit, even parity, 2 stop bits, 9600bps); 01: Settings in DM 6651 (settings other than this cause error and turn on AR 1302)
 08 - 11Area for 1:1 connection with a PC via peripheral port. 0: LR00-LR15
 12 - 15Modes of communication. 0: Host link; 2: one-to-one PC link (slave); 3: one-to-one PC link (master); 4: NT link (settings other than this cause error and turn on AR 1302)
DM 665100 - 07Baud rate. 00: 1200 bps; 01: 2400 bps; 02: 4800 bps; 03: 9600 bps; 04: 19200 bps
 08 - 15Frame format (Start bits/Data bits/Stop bits/Parity).      00:1/7/1/even; 01:1/7/1/odd; 02:1/7/1/none; 03:1/7/2/even; 04:1/7/2/odd; 05:1/7/2/none; 06:1/7/1/even; 07:1/7/1/odd; 08:1/7/1/none; 09:1/7/2/even; 10:1/7/2/odd; 11:1/7/2/none          (settings other than this cause error and turn on AR 1302)   
DM 665200 - 15Host Link Transmission Delay (0000 - 9999ms)                      (settings other than this cause error and turn on AR 1302)
DM 665300 - 07Host Link (00 - 31 BCD)                                                        (settings other than this cause error and turn on AR 1302)
 08 - 15Not used
DM 665400 - 15Not used
Error log settings (DM 6655) take effect after the transfer to PLC controller
DM 665500 - 03Style. 0: move after 7 records; 1: keep only first 7 (no moving);   2-F: no records
 04 - 07Not used
 08 - 11Cycle Time monitor Enable. 0: detect long cycles as non-fatal errors; 1: do not detect long cycles
 12 - 15Not used

No comments:

Post a Comment