Sei sulla pagina 1di 13

Chapter 3: Memory Organization and Addressing

Computer Aided Manufacturing TECH 4/53350

Memory Organization & Addressing


Learning objectives

Understand memory y organization g and addressing g for the following PLCs:

IEC 61131-3 Model Allen-Bradley ControlLogix Allen-Bradley PLC-5/SLC-500

Computer Aided Manufacturing TECH 4/53350

IEC 61131-3 Model


Technology Overview

IEC 61131-3 Protocol International Electrotechnical Commission (IEC) V d I Vendor Independent d d t Standardized St d di d Programming P i Language L f for Industrial Automation Specifies Syntax, Semantics and Display for:

Ladder Diagram Sequential Function Charts Function Block Diagram Structured Texts Instruction Lists Part 1 General Overview Part 2 Hardware Part 3 Programming Language Part 4 User Guidelines P t 5 - Communication Part C i ti
3

IEC 61131- 3 refers to Part 3 of IEC 61131 suite


Computer Aided Manufacturing TECH 4/53350

Memory Organization & Addressing

IEC 61131-3 Model


IEC 61131- 3 Protocol: A mutually agreed upon set of rules, conventions, and agreements for the efficient and orderly design of PLCs

Layered Software Architecture Each layer hides details of lower layers Common Elements of IEC 61131-3 Architecture: Configuration (Top layer)

It describes entire software (program + 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 Provides an interface between a program and a I/O ports of the PLC
4

Computer Aided Manufacturing TECH 4/53350

IEC 61131-3 Model


C Common El Elements t of f IEC 61131-3 61131 3 Architecture A hit t (continued) ( ti d)

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

IEC 61131-3 Memory Model


Configuration Resource Task Task Task Program FB FB Resource Task Program FB FB Task Program FB

Program Func- Function tion Block Block Function Bl k Block


Local Global Prog. Vars Prog. Vars

Lcl Glbl

Lcl Glbl

Lcl Glbl

Global and directly represented variables

Access Paths

Computer Aided Manufacturing TECH 4/53350

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 Defined for a configuration Accessible to all elements contained in the config configuration ration

Global Variables

Global Config variable can be accessed by all software elements Global Program Variable can be accessed by all function blocks in the program

Directly Represented Variables

Refers to memory and I/O locations


7

Computer Aided Manufacturing TECH 4/53350

A-B ControlLogix Memory


Project Task1 Program 32 Program Program 1 Main Routine Fault Routine Config. Task3 Program (local) ( ) Tags g Status Task2

Watchdog Other R ti Routines

Task32

Controller (global) Tags

I/O Data

System-shared S h d Data Power Up Handler

Controller Fault Handler

Computer Aided Manufacturing TECH 4/53350

Simple Ladder Logic


NOT Operation O i
Tasks

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 be interrupted by a higher-priority periodic task. Consists of Routines Max. of 32 per task Executed in order as listed in task
9

Programs

Computer Aided Manufacturing TECH 4/53350

Simple Ladder Logic


NOT Operation
NOT Truth Table

Possible Combinations of the 2 Switches: (22)


OFF OFF ON ON

A
OFF ON OFF ON

Light
OFF OFF ON OFF

Computer Aided Manufacturing TECH 4/53350

10

ControlLogix Program Organization

Tasks

Configured C fi dt to control t l execution ti of f one or more programs Maximum of 32 tasks No more than one continuous task Others are periodic, scheduled at fixed interval. May be interrupted by a higher-priority higher priority periodic task. Consists of Routines Max. of 32 per task Executed in order as listed in task
11

Programs

Computer Aided Manufacturing TECH 4/53350

ControlLogix Program Organization Routines


Encapsulate code in single programming language Main Routine is first one executed Must call other routines Fault Routine is executed if a program fault is encountered t d during d i execution ti Global Gl b l di directly tl represented t d varibles ibl Represents global controller memory I/O data
12

Controller Tags

Computer Aided Manufacturing TECH 4/53350

ControlLogix Scan

Control logic (program) continuously scanned. Data is transferred to/from I/O modules any time during g the logic g scan. If input data must remain constant, make a copy at beginning g g of scan and use the copy py throughout scan

Computer Aided Manufacturing TECH 4/53350

13

Potrebbero piacerti anche