0% found this document useful (0 votes)
1K views10 pages

Chapter - PLC Memory

This document describes the memory types and organization used in programmable logic controllers (PLCs). It explains that PLCs have separate memory areas for storing program files, data files like inputs, outputs, timers, and counters. The data files are organized into racks, slots and locations. It also provides details on the structure of timers, counters and how their presets, accumulated values and status bits are addressed. Finally, it discusses the status and control memory used to monitor the PLC and program.

Uploaded by

Moddy Cavallindo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views10 pages

Chapter - PLC Memory

This document describes the memory types and organization used in programmable logic controllers (PLCs). It explains that PLCs have separate memory areas for storing program files, data files like inputs, outputs, timers, and counters. The data files are organized into racks, slots and locations. It also provides details on the structure of timers, counters and how their presets, accumulated values and status bits are addressed. Finally, it discusses the status and control memory used to monitor the PLC and program.

Uploaded by

Moddy Cavallindo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 10

Chapter - PLC Memory

Program Files

PLC-5
MicroLogix

2
3

999

Data Files
O0

Outputs

I1

Inputs

S2

Status

B3

Bits

T4

Timers

C5

Counters

R6

Control

N7

Integer

F8

Float

PLC-5 Data Memory Files


Interface to
outside world

Fixed types of
Data files

Rack
I/O slot number in rack
O:000
I:nnn
S2:nnn
B3:nnn
T4:nnn
C5:nnn
R6:nnn
N7:nnn
F8:nnn

outputs
inputs
processor status
bits in words
timers
counters
control words
integer numbers
floating point numbers

Other files 9-999 can be created and used.


The user defined data files can have different
data types.

Locations in Files

T4:0
T4:1
T4:999

Some Memory Types


Type

D e s c r ip t io n

B O O L
C O N TR O L
C O U N TER
D IN T
IN T
M ES SA G E
P ID
R EA L
S IN T
S T R IN G
T IM E R

H o l d s T R U E o r F A L S E v a lu e s
G e n e r a l p u r p o s e m e m o r y f o r c o m p le x in s t r u c t io n s
C o u n te r m e m o ry
3 2 b it 2 s c o m p lim e n t in t e g e r - 2 , 1 4 7 , 4 8 3 , 6 4 8 t o 2 , 1 4 7 , 4 8 3 , 6 4 7
1 6 b it 2 s c o m p lim e n t in t e g e r - 3 2 , 7 6 8 t o 3 2 , 7 6 7
U s e d f o r c o m m u n ic a t io n w it h r e m o t e d e v ic e s
U s e d f o r P I D c o n t r o l f u n c t io n s
3 2 b it f lo a t in g p o in t v a l u e + / - 1 . 1 7 5 4 9 4 4 e - 3 8 t o + / - 3 . 4 0 2 8 2 3 7 e 3 8
8 b it 2 s c o m p lim e n t in t e g e r - 1 2 8 t o 1 2 7
A n A S C I I s t r in g
T im e r m e m o r y

Addressing Bits, Integers and Structures


Separated with '.'
Literal Data Values
8 - an integer
8.5 - a floating point number
08FH - a hexadecimal value 8F
01101101B - a binary number 01101101

Addressing Files (Arrays)


t e s t [ 1 , 4 ] - r e t u r n s t h e v a lu e in t h e 2 n d r o w a n d 5 t h c o lu m n o f a r r a y t e s t

Expressions
sin(F8:3) + 1.3 - a simple calculation

Function Examples
A

M O V
so u rc e 1 3 0
d e s t in a t io n X
M O V
so u rc e X
d e s t in a t io n Y
A D D
so u rc e A X
so u rc e B Y
d e s t in a t io n Z

Timer Memory
EN - timer enabled bit
TT - timer timing bit
DN - timer done bit
FS - timer first scan
LS - timer last scan
OV - timer value overflowed
ER - timer error
PRE - preset word
ACC - accumulated time word

Counter Memory
CU - count up bit
CD - count down bit
DN - counter done bit
OV - overflow bit
UN - underflow bit
PRE - preset word
ACC - accumulated count word

W o rd s
t i m e r. P R E - t h e p r e s e t v a l u e f o r t i m e r T 4 : 0
t i m e r. A C C - t h e a c c u m u l a t e d v a l u e f o r t i m e r T 4 : 0
c o u n t e r. P R E - t h e p r e s e t v a l u e f o r c o u n t e r C 5 : 0
c o u n t e r. A C C - t h e a c c u m u l a t e d v a l u e f o r c o u n t e r C 5 : 0
B its
t i m e r. E N - i n d i c a t e s w h e n t h e i n p u t t o t i m e r T 4 : 0 i s t r u e
t i m e r. T T - i n d i c a t e s w h e n t h e t i m e r T 4 : 0 i s c o u n t i n g
t i m e r. D N - i n d i c a t e s w h e n t i m e r T 4 : 0 h a s r e a c h e d t h e m a x i m u m
c o u n t e r. C U - i n d i c a t e s w h e n t h e c o u n t u p i n s t r u c t i o n i s t r u e f o r C 5 : 0
c o u n t e r. C D - i n d i c a t e s w h e n t h e c o u n t d o w n i n s t r u c t i o n i s t r u e f o r C 5 : 0
c o u n t e r. D N - i n d i c a t e s w h e n t h e c o u n t e r C 5 : 0 h a s r e a c h e d t h e p r e s e t
c o u n t e r. O V - i n d i c a t e s w h e n t h e c o u n t e r C 5 : 0 p a s s e s t h e m a x i m u m v a l u e ( 2 ,1 4 7 ,4 8 3 ,6 4 7 )
c o u n t e r. U N - i n d i c a t e s w h e n t h e c o u n t e r C 5 : 0 p a s s e s t h e m i n i m u m v a l u e ( - 2 ,1 4 7 ,4 8 3 ,6 4 8 )

Status Bits

I m m e d ia t e ly a c c e s s ib le s t a t u s v a lu e s
S :F S - F ir s t S c a n F la g
S :N - T h e la s t c a lc u la t io n r e s u lt e d in a n e g a t iv e v a lu e
S :Z - T h e la s t c a lc u la t io n r e s u lt e d in a z e r o
S :V - T h e la s t c a lc u la t io n r e s u lt e d in a n o v e r f lo w
S :C - T h e la s t c a lc u la t io n r e s u lt e d in a c a r r y
S :M I N O R - A m in o r ( n o n - c r it ic a l/ r e c o v e r a b le ) e r r o r h a s o c c u r r e d

E x a m p le s o f S O M E v a lu e s a v a ila b le u s in g t h e G S V a n d S S V f u n c t io n s
C O N T R O L L E R D E V I C E - in f o r m a t io n a b o u t t h e P L C
P R O G R A M - in f o r m a t io n a b o u t t h e p r o g r a m r u n n in g
L a s t S c a n T im e
M a x S c a n T im e
TA S K
E n a b le T im e o u t
L a s t S c a n T im e
M a x S c a n T im e
P r io r it y
S t a r t T im e
W a tc h d o g
W A L L C L O C K T I M E - t h e c u r r e n t t im e
D a t e T im e
D IN T [0 ] - y e a r
D IN T [ 1 ] - m o n th 1 = ja n u a r y
D IN T [ 2 ] - d a y 1 to 3 1
D IN T [ 3 ] - h o u r 0 to 2 4
D I N T [ 4 ] - m in u t e 0 t o 5 9
D IN T [ 5 ] - s e c o n d 0 to 5 9
D I N T [ 6 ] - m ic r o s e c o n d s 0 t o 9 9 9 , 9 9 9

G SV
C la s s N a m e : W A L L C L O C K T I M E
In s ta n c e N a m e :
A t t r ib u t e N a m e : D a t e T i m e
D e s t : t im e [ 0 ]

SSV
C la s s N a m e : T A S K
I n s t a n c e N a m e : M a in P r o g r a m
A t t r ib u t e N a m e : W a t c h d o g
S o u rc e : 2 0 0

Control Memory

E N - en ab le b it
E U - en ab le u n lo ad
D N - d o n e b it
E M - em p ty b it
E R - e rro r b it
U L - u n lo ad b it
IN - in h ib it b it
F D - fo u n d b it
L E N - le n g th w o rd
P O S - p o s itio n w o rd

You might also like