Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Nikini

Types of Memory
When power is
removed,
Types of Memory Erasing Programming Memory
contents are:
RAM Random Access Memory Electrical Electrical Volatile
Using masks in
ROM Read Only Memory Manufacturing
Not possible process
PROP Programmable ROM

EPROM Erasable PROM Non volatile


With UV light
RPROM Reprogrammable PROM Electrical

EEPROM Electrically Erasable PROM


Electrical
EAPROM Electrically Alterable PROM
Nikini
Basic Memory Areas
The Basic memory areas of a PLC :

CPU
Work Memory (RAM)
contains the executable user program
(for example logic and data blocks)
Load Memory
(FEEPROM/EEPROM) System Memory (RAM)
Contains the entire
Block stack, Interrupt stack
User Program
Diagnostic buffer, Local data stack
process image input/output tables,
bit memory, timers, counters
Nikini
PLC Memory
MSB LSB
27 26 25 24 23 22 21 20

Bit 20 Byte MB100 0 1 0 1 1 0 0 1


0
MS Byte
Word MW100

LS Byte

MS Byte
Double Word MD100

LS Byte
Nikini
PLC Memory
• Bit is the abbreviation for binary digit.
– The BIT is the smallest binary (bivalent) information
unit.
– It can accept a signal status of “1” or “0”. 0

• BYTE.
– A byte has the size of 8 bits.

0 1 0 1 1 0 0 1
Nikini
PLC Memory
• WORD
– The word length corresponds to the number from 16
binary characters.
– A word also has the size of 2 bytes or 16
MSB LSB

1 0 1 0 0 0 0 1 1 0 1 0 0 1 0 0

• DOUBLE-WORD
– A double-word corresponds to the word length of 32
binary characters.
MSB LSB

1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 0 1 0 1 1 0 1 0 1 1 0 1 1 0 1 0 0
Nikini
Memory addressing

MSB LSB
7 6 5 4 3 2 1 0

0
Bit
1
I 0 . 3
2

Area Byte Bit of Byte


Identifier Address
Nikini
Direct addressing
• Word Address
MW0 MW2
MB0 MB1 MB2 MB3
MW1

• Double word Address


MD0
MW0 MW2
MB0 MB1 MB2 MB3
MW1
Nikini
Memory Types
•Input Image Register (I)
•Output Image Register (Q)
•Bit (M) memory
•Variable (V) memory
•Special Memory (SM) bits
•Timer (T) memory
•Counter (C) memory
•Analog Inputs (AI) and Outputs (AQ)
•Accumulators (AC)
•High Speed Counters (HC)
•Constant Values: Decimal, Hexadecimal, ASCII
Nikini
Input Image Register(I)
Input Image register :

The CPU samples the physical input points at the beginning of each
scan cycle and writes these values to the input image register.

The input image register can be accessed in bits, bytes , words or


double words.

Format: Bit I [byte address]. [bit address] I0.1


Byte, Word, Double Word I [size]. [Starting byte] IB4
Nikini
Output Image Register (Q)
Output Image register :

At the end of the scan cycle, the CPU copies the values stored in the
output image register to the physical output points.

The output image register can be accessed in bits, bytes , words or


double words.

Format: Bit Q [byte address]. [bit address] Q0.1


Byte, Word, Double Word Q [size]. [Starting byte] QB4
Nikini
Bit (M) memory

Bit (M) memory :

Used as control relays to store the intermediate status of an


operation or other control information.

The M memory area can be accessed in bits, bytes , words or


double words.

Format:
Bit M [byte address]. [bit address] M2.3
Byte, Word, Double Word M [size]. [Starting byte] MD5
Nikini
Variable (V) memory
Variable (V) memory :

Used to store intermediate results of operations being performed by


the control logic.

The V memory area can be accessed in bits, bytes , words or double


words.

Format:
Bit V [byte address]. [bit address] V3.1
Byte, Word, Double Word Q [size]. [Starting byte] VW4
Nikini
Special Memory (SM) bits
Special Memory (SM) bits :

SM bits provide a means for communicating information between


the CPU and the user program. These bits are used to select and
control some of the special functions of the CPU:

e.g A bit that turns on for the first scan, bits that toggle at fixed
rates.

The SM memory area can be accessed in bits, bytes , words or


double words.
Format:
Bit SM [byte address]. [bit address] SM8.6
Byte, Word, Double Word SM [size]. [Starting byte] SMB42
Nikini
Timer (T) memory
Timer (T) memory :

Timers are devices that count increments of time.


Typically timers have resolutions of 1mS, 10mS, 100mS

The two variables associated with a timer are:

• Current Value : 16 bit signed integer – Stores the amount of time


counted by the timer.

• Timer bit : This bit is set when the current value is greater
than or equal to the preset value.

Format : T [ Timer number ] T24


Nikini
Counter (C) memory
Counter (C) memory :
Counters are devices that count each low to high transition event on
the counter inputs (s).
Types of counter : Up counter, Up/down counter
The two variables associated with a counter are:

• Current Value : 16 bit signed integer – Stores the accumulated


count
• Counter bit : This bit is set when the current value is greater
than or equal to the preset value.
Format : C [ Counter number ] C24
Nikini
Timer (T) memory &
Counter (C) memory
Counter memory area

Current value of Counter Cx Cx bit


MSB LSB

15 0

Timer memory area

Current value of Timer Tx Tx bit


MSB LSB

15 0
Nikini
Analog Inputs (AI) and
Outputs (AQ)
Analog Inputs (AI)

Converts a real world analog value e.g Temperature or Voltage


Into a 16 bit digital value.

Format: AIW [ Starting byte address ] AIW0, AIW2, AIW4…..

Analog Outputs (AQ)

Converts a 16 bit digital value into a current or voltage signal


proportional to the digital value.

Format: AQW [ Starting byte address ] AQW0, AQW2, AQW4


Nikini
Accumulators (AC), Constants
Accumulators (AC)

Used to pass parameters to and from subroutines and to store


intermediate values used in a calculation. Accumulators can be
accessed as bytes, words or double words and is dependent on the
instruction used.

Format : AC [ Accumulator number ]

Constant Values: Decimal, Hexadecimal, ASCII

Constants can be bytes, words or double words


The CPU stores all constants as binary numbers which can then be
represented in decimal, hexadecimal or ASCII formats.

Formats: decimal : 2453, Hexadecimal: 16#4E , ASCII : ‘ text ‘


Nikini
Addressing modes
Information is stored in different memory locations that have
unique addresses
• Direct Addressing:

Where the memory address to be accessed is


explicitly specified

Format: [Operand] [Address of location]


e.g LD 16#A Vw100

• Indirect Addressing:

Where a pointer is used to access the data in


memory
Nikini
Addressing modes: Indirect
addressing
• Indirect Addressing: MOVW &VB200, AC1
AC1 (Moves the address of VB200 to AC1)
Pointer to VB200

MOVW *AC1, AC0


(Moves the value pointed to by AC1 to AC0)
VB19
9
VB200 1 2 AC0
VB20 3 4
1 1234
VB20 5 6
2
VB20
3
Nikini
Representation of numbers
INTEGERS

• Both Signed and Unsigned Integers can be represented.


• The Integer range depends on the size of the data:
Byte : 8 bit values
Word: 16 bit values
Double word: 32 bit values

REAL OR FLOATING POINT NUMBERS

• Represented as a 32 bit single precision number


• Format as described in the ANSI/IEEE 754 standard
Nikini
Instruction types
• Contact
• Output
• Timer & Counter
• Program Control
• Logic Operations
• Logic Stack
• Table & Find
• Conversion
• High Speed Counter
• High Speed Output
• Interrupt
• Real Time Clock
• Math, Increment and Decrement
• PID
• Move, Shift, Rotate and Fill
• Communication and Networking

You might also like