27
Design and Programming Advanced PLC By Dr. Palitha Dassanayake

Automationcontrol7

Embed Size (px)

Citation preview

Page 1: Automationcontrol7

Design and Programming Advanced

PLCBy

Dr. Palitha Dassanayake

Page 2: Automationcontrol7

Content Designing Advanced PLC Programming Advanced PLC

Page 3: Automationcontrol7

Industrial Applications on Automation

When a plant is to be replaced by Automationwe have to consider

Why?Accuracy

Productivity

Cost

Other

How?User requirements

System requirements

What to use?Select Sensors, actuators andcontrol methods

Many automation plant uses PLC

Page 4: Automationcontrol7

Planning your automation

Approach

Model Driven Approach

Component Based Approach

Page 5: Automationcontrol7

Model Driven Approach

Coupled with IT approach and UML

Page 6: Automationcontrol7

Component Based automation

Component based automation (CBA), the decentralized approach to automation with distributed intelligence in technological modules, is picking up speed. Component based automation clearly simplifies planning, engineering and commissioning of complex plans and reduces the time needed for the start of production by between 10% and 15%.

Page 7: Automationcontrol7

Planning your automation

Main system requirementsUnder this, the main requirement and functions expected from the system has to be identified.

Outputs: Reports, UML based diagrams etc.

Component SelectionDesign the system to match the main requirement and fail safe design in terms of programming testing as well as maintenance. Industrial Survey could be very helpful

Outputs: Layout diagrams, component diagrams

Page 8: Automationcontrol7

Planning your automation

Inclusion of monitoring and Control from higher levelsIt should be identified the requirements of monitoring and controlling from higher levels to decide whether SCADA systems to be included or notOutputs: Report or UML format

Maintenance and Scheduling supportPreventive maintenance reminders, auto scheduling requirements, historical records etc.Outputs: Reports

Page 9: Automationcontrol7

PLC programming

Micro level Macro level

Macro-level Programming

Organizational Blocks

Programmable Blocks

Data blocks and Data words

Page 10: Automationcontrol7

Basics of designing a program structure

The CPU run two programs

1. The operating system

2. User program

Page 11: Automationcontrol7

Operating Systems Handling start Update the process images Calling user programs Acquisition interrupt programs and calling

relevant OBs Error handling Memory Management Communicating with other devices

Page 12: Automationcontrol7

User program Specifying conditions to restart Processing process data Reactions to interrupt Handling disturbances in the normal

program cycle

Page 13: Automationcontrol7

Block Types S7-300 Organization blocks Functions (FC) Function blocks (FB) Data Blocks System Function Blocks (SFB and

SFC)

Page 14: Automationcontrol7

Organization Blocks

Main organization Block (OB1) Time of Day interrupts (OB10 to OB 17) Time Delay interrupts (OB 20 to OB 23) Cycle interrupts (OB 30 to OB 38) Hardware interrupts (OB 40 to OB 47) Start up (OB 100, OB 101 and OB 102)

Page 15: Automationcontrol7

Functions A logic block without memory. Temp.

variables are stacked on a local area and lost after leaving the block.

You can use data blocks to write permanently.

Page 16: Automationcontrol7

Function Blocks

Program with memory. An instance data block is created with the function block.

By calling more than one IDB with one FB you can get similar functions working simultaneously.

Page 17: Automationcontrol7

Ex. Function Block (FB)Formal parameter

Start INT INSpeed INT INHistory DT IN_OUTRun_time TIME IN_OUT

FB 20:Motor

Integer 16 Bits: StartInteger 16 Bits: SpeedData and Time : 48 bitsTime 32 bits: run time

Actual parameter

DB 202:Motor_2

Page 18: Automationcontrol7

FB Ex. Contd.FB 21: Motor Processing

Variable declarationStart Motor_1, FB 22Start Motor_2, FB 22Start Motor_3, FB 22

DB 100

Data for Motor_1

Data for Motor_2

Data for Motor_3

FB 22: Motors Call FB 21 from logic blockCALL FB 21,DB 100

Transfer dataCALL Motor_1CALL Motor_2CALL Motor_3

Page 19: Automationcontrol7

Data Blocks

FC 10

FC 11

FB 12

Shared DBDB 20

(Access by all blocksor any block)

Instance DBDB 112

(access only by FB 12)

Page 20: Automationcontrol7

SFC and SFBThey are in built functions and functions

Blocks that can be used.

Page 21: Automationcontrol7

Use of Word logicL MW 30L MW 28OWT MW 32

L MW 60L MW 64AWT MW 10

L MW 16L MW 12XORWT MW 40

Page 22: Automationcontrol7

LoadWhen an input, output or memory of a byte, word or double word is loaded it is stored in the accumulator

L MB 10

ACC2

ACC1 MB10

L MB 20ACC1ACC2 MB10

MB20

Page 23: Automationcontrol7

Load

L MW 20ACC1ACC2

MB21

MB11MB10

MB20

MB11MB10

When an input, output or memory of a byte, word or double word is loaded it is stored in the accumulator

L MW 10

ACC2

ACC1

Page 24: Automationcontrol7

Load

L MD 20ACC1ACC2

MB23MB22MB21MB20

MB13MB12MB11MB10

MB13MB12MB11MB10

When an input, output or memory of a byte, word or double word is loaded it is stored in the accumulator

L MD 10

ACC2

ACC1

Page 25: Automationcontrol7

TransferLLLHHLHHAcc1

T MB 10 // MB10=LLT MW 10// MB10=LH, M11=LL

T MD 10// MB10=HH,MB11=HL, MB12=LH,MB13=LL

Page 26: Automationcontrol7

L Iw 12 L w#16#18FF

AW T Qw 12 L Iw 18

L w#16#F4FF AW T Qw 18 L Qw 18 L w#16#0020 Ow T Qw 18 L QW 18 L QW 12 XORW T MW 20

Page 27: Automationcontrol7

END