PLC-Chap03
Transcript of PLC-Chap03
-
8/13/2019 PLC-Chap03
1/13
Chapter 3: Memory Organization and
Computer Aided Manufacturing TECH 4/53350 1
-
8/13/2019 PLC-Chap03
2/13
Memory Organization & Addressing
Understand memory organization and addressing for
the following PLCs:
IEC 61131-3 Model
Allen-Bradley ControlLogix
Allen-Bradley PLC-5/SLC-500
Computer Aided Manufacturing TECH 4/53350 2
-
8/13/2019 PLC-Chap03
3/13
IEC 61131-3 Model
IEC 61131-3 Protocol
International Electrotechnical Commission (IEC)
en or n epen en an ar ze rogramm ng anguage or
Industrial Automation
Specif ies Syntax, Semantics and Display for:
Sequential Function Charts
Function Block Diagram Structured Texts
Instruction Lists
IEC 61131- 3 refers to Part 3 of IEC 61131 suite
Part 1 General Overview
Part 2 Hardware
Part 3 Programming Language
Part 4 User Guidelines
Computer Aided Manufacturing TECH 4/53350 3
ar - ommun ca on
-
8/13/2019 PLC-Chap03
4/13
Memory Organization & Addressing
IEC 61131-3 ModelIEC 61131- 3 Protocol:A mutually agreed upon set of rules, conventions, and
Layered Software Architecture
Each layer hides details of lower layers
Common Elements of IEC 61131-3 Architecture:
Configuration (Top layer) It describes entire software ro ram + data for one PLC
Each PLC, within an organization, has a separate configuration
Includes resources, memory addresses for I/O channels, system
capabilities
Resource (within Configuration layer)
Provides support function for the execution of IEC programs
Configuration may consist of one or more resources
Computer Aided Manufacturing TECH 4/53350 4
rov es an n er ace e ween a program an a por s o e
-
8/13/2019 PLC-Chap03
5/13
IEC 61131-3 Modelommon emen s o - rc ec ure con nue
Tasks (within Resource layer)
Control the execution of a set of programs and/or function blocks
Programs/function blocks can be executed periodically or can be
event driven
Programs must be assigned to a task in order to be executed
The task must be configured to either execute periodically or upon a
trigger
Resource layer may consist of one or more Tasks
http://www.personal.kent.edu/~asamba/tech43550/iec61131.pdf
Computer Aided Manufacturing TECH 4/53350 5
-
8/13/2019 PLC-Chap03
6/13
IEC 61131-3 Memory Model
Configuration
Program Program
Task Task Task
Resource
Program Program
Task Task
Resource
Func-tion
Block
Func-tion
Block
Func-tion
FB
FB
FBFB
FB
oc
GlobalProg. Vars
LocalProg. Vars Lcl GlblLcl Glbl Lcl Glbl
Global and directly represented variables
Access Paths
Computer Aided Manufacturing TECH 4/53350 6
-
8/13/2019 PLC-Chap03
7/13
IEC 61131-3 Memory Model
Variables
Local Variable
Defined within the software element
Accessible only by the software element
Software Element: Function Block, Resource or Configuration
Global Variables
Defined for a configuration ccess e o a e emen s con a ne n e con gura on
Global Config variable can be accessed by all software elements
Global Program Variable can be accessed by all function blocks in the
Directly Represented Variables
Refers to memory and I/O locations
Computer Aided Manufacturing TECH 4/53350 7
-
8/13/2019 PLC-Chap03
8/13
A-B ControlLogix Memory
Task1 Task2
Project
Program 1Program
local Ta s
Program
Config.
Status
Task3
Routine
Fault Other Watchdog Task32
ou nes
Controller Fault Handler Power Up Handler
(global) Tags I/O Data ystem-s areData
Computer Aided Manufacturing TECH 4/53350 8
-
8/13/2019 PLC-Chap03
9/13
Simple Ladder LogicN T peration
Configured to control execution of one or more programs
Maximum of 32 tasks
No more than one continuous task
Others are periodic, scheduled at fixed interval. May beinterrupted by a higher-priority periodic task.
Programs
Consists of Routines
Max. of 32 per task
Computer Aided Manufacturing TECH 4/53350 9
Executed in order as listed in task
-
8/13/2019 PLC-Chap03
10/13
Simple Ladder LogicNOT Operation
Possible Combinations of
the 2 Switches: (22)A B Light
OFF ON OFF
ON OFF ON
ON ON OFF
Computer Aided Manufacturing TECH 4/53350 10
-
8/13/2019 PLC-Chap03
11/13
ControlLogix Program Organization
Tasks
on gure o con ro execu on o one or more programs
Maximum of 32 tasks
Others are periodic, scheduled at fixed interval. May be
interru ted b a hi her- riorit eriodic task.
Programs
Max. of 32 per task
Computer Aided Manufacturing TECH 4/53350 11
-
8/13/2019 PLC-Chap03
12/13
ControlLogix Program Organization
Encapsulate code in single programming language Main Routine is first one executed
Must call other routines
Fault Routine is executed if a program fault isencoun ere ur ng execu on
Controller Tags
o a rec y represen e var es Represents global controller memory
Computer Aided Manufacturing TECH 4/53350 12
-
8/13/2019 PLC-Chap03
13/13
ControlLogix Scan
.
Data is transferred to/from I/O modules any timedurin the lo ic scan.
If input data must remain constant, make a copy
at be innin of scan and use the cothroughout scan
Computer Aided Manufacturing TECH 4/53350 13