PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

19
PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham

Transcript of PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

Page 1: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

PLC ARCHITECTURE – Memory1by

Dr. Amin Danial Asham

Page 2: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

References

Programmable Controllers-Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan

Page 3: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

The memory system is the area in the PLC’s CPU where all of the sequences of instructions, or programs, are stored and executed by the processor to provide the desired control of field devices. The memory sections that contain the control programs can be changed, or reprogrammed, to adapt to manufacturing line procedure changes or new system start-up requirements.

The memory of the a PLC is divided into two sections: o The system memory (inaccessible)

• Executive Memory• Scratch Pad

o The application memory (accessible)• Data Table• User Program

System memory and application memory,

are not necessarily adjacent, either

physically or by address.

Memory Map

Page 4: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

• Executive Area (System memory)• This part of memory maintains all the permanent programs which is

considered part of the PLC system.• Executive programs are the supervisory programs which direct all activities

such as communication with peripheral devices executions of the control programs, diagnostics of the system, etc..

• The executive section is the part of the PLC’s memory where the system’s available instruction software is stored (i.e., relay instructions, block transfer functions, math instructions, etc.).

• This part of memory is not accessible by the user.

•Scratch Pad Area (System memory)• This is a temporary storage area used by the CPU to store a relatively small

amount of data for interim calculations and control. The CPU stores data that is needed quickly in this memory area to avoid the longer access time involved with retrieving data from the main memory.

• This part of memory is not accessible by the user.

Page 5: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

• Data Table Area (Application Memory)• This area stores all data associated with the control program, such

as timer/counter preset values and other stored constants and variables used by the control program or CPU.

• The data table also retains the status information of both the system inputs (once they have been read) and the system outputs (once they have been set by the control program).

• This part of memory is accessible by the user.

• User Program Area (Application Memory)• This area provides storage for programmed instructions entered by

the user. The user program area also stores the control program.• This part of memory is accessible by the user.

Page 6: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

MEMORY TYPES We have two main categories of memories according to the retention of

the contents: Volatile memory: need to be powered to retain stored contents. In case of

power loss all stored contents are lost. o This type of memory is used with backup battery to be powered to

retaining the stored contents. Nonvolatile memory: keeps the stored contents even in the complete

absence of power.

There are two important [points must be considered about the characteristics of memory types: Volatility How easy the stored program can be altered.

The memory types will be discussed regarding volatility and the ease of altering the stored contents.

Page 7: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

MEMORY TYPES (continue)1) Read Only Memory (ROM)

• This type is nonvolatile and hence immune to alteration due to electrical noise or loss of power.

• Executive programs are often stored in ROM.

• The contents are stored in ROM’s once at the factory.

• Executive programs are built and debugged completely and then stored in ROM’s where it will never be changed any more in future.

Page 8: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

MEMORY TYPES (continue)

2) Random Access Memory (RAM)

• This is Read/Write (R/W) memory, hence data can be read from or written into the memory.

• RAM is excellent for easily creating and modifying programs and data entry.

• It is volatile memory, that is the contents are lost in case of power loss. For this backup batteries are used to keep stored data. CPU continuously monitor the battery conditions to avoid data loss.

• Battery-supported RAM has proven to be sufficient for most programmable controller applications.

• Comparing to other types of memory RAM is relatively fast. • Most of PLC’s use RAM with backup batteries for application

memory.

Page 9: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

MEMORY TYPES (continue)3) Programmable Read Only Memory (PROM)

• This is a special type of ROM since it can be programmed once and hence it is non-volatile.

• Once it is programmed, the contents can not be altered any more.

• It is rarely used as an application memory. • It may be used as a permanent backup for bug free

programs. • it has the disadvantage of requiring special

programming equipment.

Page 10: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

MEMORY TYPES (continue)4) Erasable Programmable Read Only Memory (EPROM)

• It is a special type of PROM with the ability of reprogramming after erasing the content using Ultra Violet (UV) light source through the window on the upper surface if the chip.

• EPROMS are considered semi-perminant storages. • EPROM is used for application

programs where nonvolatile memory is needed, but that do not require program changes or on-line data entry.

• EPROM are offered as a backup for battery supported RAM in many controllers.

Page 11: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

MEMORY TYPES (continue)5) ELECTRICALLY ALTERABLE READ-ONLY MEMORY

(EAROM)

• EAROM is similar to EPROM except that it is erased by applying an erasing voltage.

• Writing is a very slow process and needs higher voltage (usually around 12 V) than is used for read access.

• It is very rare to be used as an application memory, but can be used as a backup to RAM.

Page 12: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

MEMORY TYPES (continue)6) Electrically Erasable Programmable Read Only Memory

(EEPROM)• This is a non-volatile memory with a flexibility of reading and

writing like RAM. • EEPROM is used as application memory. • Disadvantages of EEPROM:

o There is a delay during the writing process since the modified byte must be erased first.

o There is a limitation on the erase/write number of a single byte which is approximately 10000 times.

• These disadvantages are negligible, however, when compared to the remarkable advantages that EEPROM offers

Page 13: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

Memory Structure. Memory is a two dimensional array of bits. A bit is a binary digit. Each bit stores 1 or 0 represented by a voltage value. That is, if

there is a certain voltage value (such as 5 V) 1 is stored and zero voltage means 0.

A bit is considered ON if the stored value is 1 and OFF if the stored value is 0.

The bit status refers to the stored value in a bit 1/0 (ON/OFF)

A processor handles the data exchange with memory in group of bits called words.

Page 14: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

Memory Structure (continue)

A word size defines the number of bits in a single word, which varies depending on the type of the processor.

A smallest word size is a byte which is a group of 8 bits. Therefore, a word is a group of one or more bytes.

Page 15: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

Memory Capacity and UtilizationMemory size is usually measured in K which is equal to 1024 = 210. Kbytes or KB is 1024 bytes which is 210 bytes. The term memory utilization refers to:o the amount of data that can be stored in one

location.oOr, more specifically, to the number of memory

locations required to store each type of instruction.

Page 16: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

Memory Capacity and Utilization (continue)•Example1: Determine the memory requirements for an application with the following specifications:

70 outputs, with each output driven by logic composed of 10 contact elements.

11 timers and 3 counters, each having 8 and 5 elements, respectively20 instructions that include addition, subtraction, and comparison, each

driven by 5 contact elements.

Memory utilization requirements

Page 17: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

Memory Capacity and Utilization (continue)

Solution:a) There are 70 outputs each has one output coil and 10 contacts,

the required storage is: 70*1(o/p coil)+70*10*1(contact)=770 words.

b) 11 timers each has 8 contacts, therefore the required memory is : 11 *3(words needed for each timer)+11*8*1 (contacts used in the timer circuit)=33+88=121 words

c) 3 counter each has 5 contacts in the control circuit, therefore the expected needed memory is: 3*3(3(words needed for each timer)+3*5*1((contacts used in the counter circuit)=9+15=24 words

d) 20 math instruction each has 5 control contacts then the needed memory is: 20*1(words for each instruction)+5*20*1(words needed for each contact=120 words.

Page 18: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

Memory Capacity and Utilization (continue)

Solution: (continue) Therefore, total memory is :770+121+24+120= 1035 words. Since the program may be modified or expanded in future a safety

factor between 25% to 50% must be added, therefore, for 25% safety factor the needed memory is 1.25 x 1035= 1294 words

Memory size must be an integer value without fractions. Hence, the total memory needed is approximated to the closest higher integer.

•Notes:There are other factors that may affect memory requirements:o Control program sophisticationo Data storage and manipulation may need more memory.o Enhanced instructions for mathematical operations and data

manipulations need more memory requirements.

Page 19: PLC ARCHITECTURE – Memory 1 by Dr. Amin Danial Asham.

Thanks