Lecture 27 PLC Languages

16
Programmable Logic Programmable Logic Controllers Controllers Lecture 27 Lecture 27 PLC Languages PLC Languages

description

a

Transcript of Lecture 27 PLC Languages

Page 1: Lecture 27 PLC Languages

Programmable Logic Programmable Logic ControllersControllers

Lecture 27Lecture 27

PLC LanguagesPLC Languages

Page 2: Lecture 27 PLC Languages

Jesus is a friend who knows all your faults and still loves you anyway.

But God demonstrates his own love for us in this: While we were still sinners, Christ died for us. Romans 5:8

Page 3: Lecture 27 PLC Languages

AgendaAgenda

IEC 61131 StandardProgramming ModelsInstruction ListStructured TextLadder DiagramFunction Block DiagramSequential Function Charts

Page 4: Lecture 27 PLC Languages

IEC 61131 StandardIEC 61131 Standard

•Common and open framework •Loosely defined•Approved in 1992•Six Main Components

- IEC 61131-1 Overview- IEC 61131-2 Requirements and Test Procedures- IEC 61131-3 Data Types and Programming- IEC 61131-4 User Guidelines- IEC 61131-5 Communications- IEC 61131-7 Fuzzy Control

Page 5: Lecture 27 PLC Languages

Programming ModelsProgramming Models

IL (Instruction List)ST (Structured Text)LD (Ladder Diagram)FBD (Function Block Diagram)SFC (Sequential Function Charts)

Page 6: Lecture 27 PLC Languages

Instruction ListInstruction List

•Textual PLC Programming Language•Effectively Like Assembly Programming •Best Suited for Small Uncomplicated Programs•Instructions Consist of:

- Operator- Modifier- Operand

Example: AND NOT 00200

Page 7: Lecture 27 PLC Languages

Instruction List ExampleInstruction List Example

Page 8: Lecture 27 PLC Languages

Instruction List Example 2Instruction List Example 2

Page 9: Lecture 27 PLC Languages

Structured TextStructured Text

• Textual PLC programming language• Effectively like BASIC programming • Easiest to troubleshoot and understand• Useful for implementing calculation-intensive functions and other difficult functions• Instructions consist of constructs

•Example: Analog_Out := Error * Gain;

Page 10: Lecture 27 PLC Languages

Structured TextStructured Text

* Sample Structured Text Code * (comments)VAR (variables)

temp: INT;error: BOOL;

END_VARtemp := %IW4; (addresses)IF temp > 3200 THEN

error := TRUE;%QW := 200;

ELSE%QW := temp / 16;

END_IF;

Page 11: Lecture 27 PLC Languages

Ladder DiagramLadder Diagram

• Primary programming language• Resembles original relay logic documentation• Addressing and memory is different for every manufacturer• Ladder logic scanning (rung order vs. network column)• Not purely parallel processor like relay logic

Page 12: Lecture 27 PLC Languages

Ladder DiagramLadder Diagram

Page 13: Lecture 27 PLC Languages

Function Block DiagramFunction Block Diagram

• Graphical data-flow programming method• Interconnected blocks• Similar to Ladder Logic

Page 14: Lecture 27 PLC Languages

Function Block Diagram ExampleFunction Block Diagram Example

Page 15: Lecture 27 PLC Languages

Sequential Function ChartsSequential Function Charts

• Graphical method for structuring programs• Design tool for sequential problems•Consists of:

- Interconnected steps- Actions- Transitions

Page 16: Lecture 27 PLC Languages

Sequential Function Chart Sequential Function Chart ExampleExample