IEC-1131-3 - Industrial Automation Training

Download Report

Transcript IEC-1131-3 - Industrial Automation Training

IEC 61131-3
OVERVIEW
IEC 61131-3 Hands on Training
Evolution of Control Technology
1950s
1960s
1970s 1980s
1990s 2000 20011
Relays
PLC
PC Based Ctrls
7/7/2015
2
The Future of Automation
Current
Future
Servo
Controller
PLC
Serial
+/- 10v
PLC
Software
A
M
P
Remote I/O
PC & FALCON
Software
FALCON
Network
Servo
Software
Software
Smart Drives
Network
+/- 10v
PC & HMI
A
M
P
A
M
P
Drive
Software
Network
Commodity Drives
HMI Software
Servo
Controller
Remote I/O
Serial
7/7/2015
+/- 10v
A
M
P
•
•
•
•
•
Simpler, more cost effective
Single source supplier
Single software package (4 vs. 1)
Decreased maintenance costs
Lower installation costs
3
System Architecture
Production control
Ethernet
Remote I/O
PC & Falcon
Software
Network
Software
Network
+/- 10v
A
M
P
A
M
P
Commodity Drives
7/7/2015
4
Software Architecture
Program Editor
Graphical
Configuration
User Interface
Utility
Editor
Visual
BASIC
Graphical User
Interface
D
L
L
Logic
Engine
HMI
Symbo
l
Server
Toolkit
7/7/2015
Open XP Environment
D
L
L
I/O
Drivers
Communication
Drivers
I/O
Driver
Tool
Kit
5
Program Editors
• IEC 1131-3 Language Support
– Ladder Diagram, Sequential Function Chart,
Structured Text, Instruction List
• Windows based Editing Tools
– Familiar Tool Bars,
Displays & Key Commands
– On-line Help throughout
• On-line and Off-line Editing
– Simulate program without actual I/O
7/7/2015
Easy Program Editing
6
FALCON Workshop
IEC-1131 Overview
•
International Standard of the International Electrotechn
Commission (Global programming standard).
•
Specifies the syntax and semantics of a unified suite of
programming languages for programmable controllers
(IEC-61131-3).
• Graphical Languages
 Ladder Diagram (LD)
• Function Block Diagram (FBD)
 Sequential Function Chart (SFC)
•Textual Languages
 Instruction List (IL)
7/7/2015
 Structured Text (ST)
7
Diagnostic Tools
• On-line editing and debugging.
• “Watch Window” allows display and forcing of
variables and view of actual program status.
• On-line Help Menu with contents and search
capability.
• Application specific message boxes driven by
program.
• System event logging.
• 7/7/2015
I/O Status bits
Increases Productivity
8
I/O &Communication Drivers
• I/O
Ethernet
– Popular network
– Cost effective IO solution
– Supports up to six interfaces simultaneously
• Motion Control
• See brochure for complete list
Communication to 6 networks at the same time9
7/7/2015
I/O &Communication Drivers
•
•
•
•
•
•
•
•
•
•
•
•
• GE 90/30
Profibus DP
• GE Genius
DeviceNet
• Beckhoff TCP/IP
EtherNet I/P
• Yaskawa Remote I/O
Interbus-S
• Opto-22 Parallel
• OptoMux
CAN-Open
• COM 1-4 Serial Channels
SERCOS
• Wonderware
Modbus RTU
• GE Cimplicity
Modbus TCP/IP
• Intellution FixDMAX
SIRPLEX
• Visual Basic 6.0, .Net
• CMC PCI I/O Interface
AS-I
AB RIO
Partial List of Device Drivers 10
7/7/2015
AB DH, DH+
Real Time Motion Control
• The FALCON provides motion connectivity to
the popular motion experts
-Standard Motion Control Algorithms
-Flexible to meet the users needs
-Cost effective IO solution
-RTE providing Real Time Control
Communication to 6 networks at the same time
11
7/7/2015
Complete Development Sys.
Programming in SFC,
Ladder Diagram and
Structured Text
Graphical User Interface
Runtime Engine
unlimited number of I/O
7/7/2015
12
Logic Engine
• Runtime Logic Engine
– unlimited I/O points (digital or analog)
– with or without FALCON GUI.
• Executes LD, SFC+ and ST programs
• Monitoring and change of data values
(but not editing) Logic Engine
• Includes Drivers for:
– Modbus TCP/IP
7/7/2015
13
User Interfaces / Toolkits
• HMI (third party)
– High-End User Interface/Distributed Structure /Historical
capabilities
– Full Featured HMI offering
• FALCON Graphic User Interface
–
–
–
–
–
Embedded Graphical User Interface (GUI)
Easy to implement
Low cost HMI
Common database
High performance
• Toolkits
– Function Block Toolkit
– Visual Basic Toolkit: License free applications
7/7/2015
14
Product Family
• FALCON Software Only
• FALCON Loaded on 15’’ Color Touch (3 PCI)
• Pro Series (Enclosed Box with IO)
• Service
(PC Selection 10 or 15, Loading and Configuration,
Telephone Support)
7/7/2015
15
Key Points
• Real-time Control with Integrated HMI, I/O, OI, Motion
and Diagnostics
• One-Stop Shopping of Products and Services Open
software environment on PC Platforms on XP
• IEC 61131-3 Standard
• Scaleable PC Environment
• HMI Choices- Low-end HMI, HMI, Visual BASIC
• Programmable Machine Diagnostics
• Reduced hardware, engineering and total life cycle cos
7/7/2015
16
System Overview
Hardware Structure
FALCON is built upon a standard PC
hardware platform. The main CPU provides both
the application programming environment and
7/7/2015
application program execution (run time).
17
Hardware Architecture
• Mix different manufacturers process & motion
control
• FALCON runs under Windows XP as a
protected user application
• Drivers for each type of I/O are provided
• Use standard PLC I/O
PLC
• No PLC needed
7/7/2015
18
System Overview
Software Subsystem
Program Editor/
Debugger
Operator
Interface
Configuration
Utility
Program
Manager
Program
Execution
7/7/2015
I/O Scanner
19
Starting FALCON
Starting the Program Editor
Access Levels:
• Five Levels : 0-4
•“4567” default for level 4
7/7/2015
Level 0:
Activate operator screens and controls in the GUI.
Selecting and running SFC programs.
Level 1:
Running/Aborting RLL programs, viewing RLL/
SFC programs.
Level 2:
Editing SFC programs and executing project
management functions
Level 3:
Editing RLL, modifying GUI, and modifying system
configuration files.
Level 4:
20
Changing the passwords for access levels 1 - 4.
Working with Projects
About Projects:
Project Management allows the user to organize the
Work into logical divisions called projects:
Program files
Configuration files
Operator Interface files
7/7/2015
21
Controlling I/O with FALCON
Configuration Utility Overview
The configuration files tell
FALCON
what interface cards are in
the computer, and what I/O
are attached to those cards.
Syste
m
Slot
Board
Connector
Port
7/7/2015
I/O Point
22
Create New System Configuration
• Hands On Exercise
– Page 10- 12
7/7/2015
23
Multitasking – I/O Scan Rate
PLC
Overhead
I/O Scan
Outputs
Logic
Limited capacity
7/7/2015
24
Multitasking – I/O Scan Rate
PC
I/O Scan Rate
I/O Logic
FALCON Runtime
Other App’s
HMI, Network or ?
Allow enough time to solve logic and
service the other applications.
Expandable capacity
7/7/2015
25
Sequential Function Chart (SFC)
SFC Overview
Editor
7/7/2015











Steps
Macro Steps
• Structured text in Steps
Actions
• Step variables
Transitions
• Boolean or LD Transitions
Jump Labels
• Scaleable display
Jumps
• On-line changes
Loops
Select Diverge
Simultaneous Diverge
Application Icon
Add Comments
26
SFC- Example
7/7/2015
27
SFC- Example
Common Sequences
Transition 1
Step 2
Transition 3
Step 3
Transition 3
Step 3
Transition 2
Transition 2
Step 4
Transition 4
Transition 5
Step 4
Selective Divergence
Selective Convergence
Transition 1
Step 2
Transition 3
Transition 3
Step 3
7/7/2015
Step 4
Simultaneous Divergence
Step 3
Transition 2
Step 4
Transition 4
Simultaneous Convergence
28
Step System Variables
Step_is_active(X) – STEP1.X
- X = TRUE when active
Step time(T) - STEP1.T
- T = Elapsed time of step milliseconds
T set to Zero at step start
7/7/2015
29
Creating an SFC
• Hands On Exercise
– Page 17
7/7/2015
30
Symbols/Data Types
Symbol Mgr Overview
7/7/2015
The Symbol Manager allows
the user to create and manage
symbols for use in RLL or SFC
programs.
31
Symbols and Data Types
Symbol Data
Types
• TIME
• Timer (TMR)
• User-Defined Data Type
• PID Data Type
•
•
•
•
•
•
•
•
•
REAL
Integer (INT)
Double WORD (DWORD)
WORD
BYTE
Boolean (BOOL)
DATE
Time of Day (TOD)
STRING
7/7/2015
• PID Inputs and Outputs
• PRGCB Data Type
• Pre-Defined System Symbols
32
Symbol Manager
?
Symbol Types:
•Local – Used in program where defined only.
•Global – Available to all programs in project.
•Operator Interface and DDE
•External – I/O Points
7/7/2015
33
Symbol Data Types
• BOOL - Boolean (TRUE=1, FALSE=0)
• BYTE – Unsigned integer 8 bit
• Range 0 to 255
LSB
7
MSB
0
• DATE – D#YYYY-MM-DD
• YYYY = 1970 to 9999
• MM = 1 to 12
• DD = 1 to 31
• TODAY = Current date
7/7/2015
34
Symbol Data Types
• DWORD - Unsigned integer 32 bit
• Range 0 to 4294967296
LSB
31
MSB
0C
• INT – Integer
• 32 bit word
• Range –2146483648 to +2147483647
• REAL – Decimal
7/7/2015
• 64 bit word
• Range +1.401298 E-48 to +3.402823 E38
35
Symbol Data Types
• String – ASCII characters
• ASCII characters within “This is a valid string”
• Hex - $41 $42 $43 = A B C
• TIME – T#
• D or d – Days
• H or h – Hours
• M or m – Minutes
T#1D2h: 1 day and 2 hours
t#26H: 26 hours
t#5m45s: 5 minutes and 45
seconds
• S or s – Seconds
t#26s200MS: 26 Seconds and 200
milliseconds
7/7/2015
36
• MS or ms – Milliseconds
Symbol Data Types
• TMR – Timer
• Timer_name.PT = Real data value in seconds or T#
format
• Timer_name.EN = Boolean, will stop/start TMR
• Timer_name.ET = elapsed time in seconds of TMR
– Timer operations
• Timer_name.EN = sets .ET to zero when TMR starts
• Timer_name.ET = when equal to preset then
Timer_name.EN is reset
• Timer_name.EN = set to false then
Timer_name.ET is frozen at the last
value
7/7/2015
37
• Timer_name.ET = may be read any time
Symbol Data Types
• TOD – Time of Day
– TOD#HH:MM:SS
• HH = 0 to 23
• MM = 0 to 59
• SS = 0 to 59
– NOW – Current system time
• MOVE to define NOW
• ADD to add a duration to NOW
7/7/2015
38
Symbol Data Types
• UINT/WORD
• 16 bit unsigned integer
• Range – 0 to 65535
LSB
15
MSB
0
• User-Defined Data Types
• Groups of data types
• Integers, Boolean, Strings…
7/7/2015
39
Symbol Data Types
• System Created Symbols
• TODAY, NOW, NULL, TMR
• Counters - RLL counters status – CTU, CTD, CTUD
(Local)
• Timers – RLL timer status – TOF, TON, TP (Local)
• “stepname”.X - SFC STEP Active/inactive status (Local)
• “stepname”.T – SFC STEP elapsed execution time
(Local)
• Motion Control – Status of axis, axis variable group,
Program control and spindle
• File Control – Status of file operations
• Program Control – Status of PRGCB data types
7/7/2015
40
Symbol Data Types
• Run-Time Symbols
– RT_ERROR – (INT) Math error
• 0 = No error
• 1 = divide by zero
• 2 = negative square root
• RT_ERROR must be cleared by the user
– RT_FIRST_SCAN – (BOOL)
• Set to true on first scan of first program to run
– RT_SCAN_OVERRUN – (BOOL)
• I/O scan + logic scan exceeds scan rate
– RT_MAX_SCAN – (REAL)
7/7/2015
41
Symbol Data Types
• Run-Time Symbols
– RT_LAST_SCAN – (REAL)
• Duration in ms of last scan duration
– RT_AVG_SCAN – (REAL)
• Duration in ms of average scan duration
– RT_LOGIC_MAX – (REAL)
• Duration in ms of maximum logic scan duration
– RT_LOGIC_LAST – (REAL)
• Duration in ms of last logic scan duration
– RT_LOGIC_AVG – (REAL)
• Duration in ms of average logic scan duration
7/7/2015
42
Symbol Data Types
• Run-Time Symbols
– RT_IO_MAX – (REAL)
• Duration in ms of maximum I/O scan duration
– RT_IO_LAST – (REAL)
• Duration in ms of last I/O scan duration
– RT_IO_AVG – (REAL)
• Duration in ms of average I/O scan duration
– RT_MEM_PCT – (REAL)
• Remaining system RAM allocated to
the PC control software
7/7/2015
43
Symbol Data Types
• Run-Time Symbols
– RT_LOW_BATTERY – (BOOL)
• Low battery signal from UPS
– RT_POWER_FAIL – (BOOL)
• Power fail signal from UPS
– RT_SCAN_RATE – (REAL)
• Active configuration scan rate setting in ms
7/7/2015
44
Create Symbols
Hands On Exercise
Page 32 & 33
7/7/2015
46
Adding Logic to Transitions
Transitions
Overview
A Transition represents the condition
that allows program flow to pass from
one or more Steps preceding the
transition to one or more Steps
following the Transition
* A Boolean Transition is a Boolean
expression composed of
Structured
Text
Boolean
Transition
RLL
Transition
* An RLL Transition consists of a
single RLL rung with an output
coil having the same name as the
Transition itself
7/7/2015
47
Adding Logic to Transitions
• Transitions
– Boolean Transitions
• Structured Text
– RLL Transition
• Single rung of RLL
• Output coil with same name as the transition
7/7/2015
48
Transition Evaluation
• RLL rung power reaches coil and turns it on,
Transition is true then the program flows to
next step.
• Boolean expression resolves to TRUE,
Transition is true then the program flows to
next step.
More…
7/7/2015
49
Transition Evaluation
• Step function must complete before the
transition is evaluated
• Transition holds FALSE the system will
remain in the transition until it becomes
TRUE.
7/7/2015
50
Transition Evaluation
• Two I/O scans minimum per SFC step to
complete
1) Execute the Step logic
• If the Logic is completed move to step 2
2) Evaluate the transition
• If the transition is True the step is deactivated and
released to the next step
7/7/2015
51
Adding Transition Logic
Hands On Exercise
Page 37 & 38
7/7/2015
52
Using Structured Text
Structured Text
Overview
When you create the application code for an SFC step, you can choose to use Structured
Text code, as illustrated below. When the SFC is executed, the Structured Text code that
you incorporate within each step is processed as the step becomes active.
Step9
T-5
Step10
Step11
7/7/2015
(* Process incomming Character *)
IF COM2_INPUT_BUFF[1] = 11 THEN
lSelection := lSelection + 1;
ELSEIF COM2_INPUT_BUFF[1]=10 THEN
lSelection:= lSelection -1;
END_IF;
IF lSelection >= 3 THEN
lSelection := 0;
ELSEIF lSelection < 0 THEN
lSelection := 2;
END_IF;
(* Select a new string to display *)
CASE lSelection OF
0:
OutputString := 'Dave';
1:
OutputString:='Tim';
2:
OutputString:='Steve';
END_CASE;
53
Using Structured Text (cont.)
Structured Text Overview
(cont)
IF COM2_INPUT_BUFF[1] = 11 THEN
LSELECTION := LSELECTION + 1;
ELSEIF COM2_INPUT_BUFF[1]=10 THEN
LSELECTION:= LSELECTION -1;
ELSE
LSELECTION:= 0;
END_IF;
FOR
File Functions
REPEAT
:= 7/7/2015
WHILE
CASE
CALL
INCLUDE
SCAN
Mathematics Functions
IF
EXIT
Example
String Functions
Comment
Shift/Rotate Functions
54
Structured Text Commands
• Hands On Exercise
– Page 52
7/7/2015
55
Mixing RLL and SFC
Action Block
Overview
An Action Block consists of a segment of RLL program code that is
associated with a Step or Macro Step. The Action is executed when
the Step becomes active, based upon the following mechanisms.
In the example below, the Action called PaintColor consists of several
runs of RLL that are executed when Step2 becomes active. In this
particular example, the RLL execution does not begin until code
execution in the Step encounters the Label called label_a. The “P” code
is the Action qualifier and means that the RLL is executed one time, I.e.
it is pulsed. You can associatte zero or more Actions with a Step and
you can associatte one Action with more than one Step by referencing
the Action’s name.
7/7/2015
56
Mixing RLL and SFC (cont.)
Action Qualifiers:
 Non Stored (N)
 Time Limited (L) *
 Stored (S)
 Delayed and Stored (DS) *
 Reset (R)
 Stored and Time Delayed (SD) *
 Pulsed (P)
 Stored and Time Limited (SL) *
 Time Delayed (D) *  Pulse Width *
7/7/2015
* Requires a Specified Time Delay
57
Mixing RLL and SFC
• RLL Overview
– RLL Contacts
• Normally Open
• Normally Closed
• Positive Transition Sensing Contact
• Negative Transition Sensing Contact
7/7/2015
58
Mixing RLL and SFC
• RLL Overview
– RLL Coil Types
• Output Coil
/
• Negative Output Coil
• Set (Latch) Coil
R
• Reset (Unlatch) Coil
• Positive Transition Sensing Coil
• Negative Transition Sensing Coil
• Jump Coil/Label
• SFC Transition Coil
7/7/2015
P
N
59
Adding & Editing Action Blocks
• Hands On Exercise
– Page 62 to 66
7/7/2015
60
Program Parsing/Execution
Runtime Subsystem
Overview
•Runtime Subsystem:
 Program Manager: prepares application programs for execution
and manages the actions of the Program
Execution and I/O Scanner subsystems
 Program Execution: executes RLL and SFC programs, runs at he highest p
 I/O Scanner:
scanning physical I/O and sending information to
the Program Execution system, runs at the highest
priority along with the Program Execution
 Event Log:
stores time stamped system events, messages, and
errors, the Event Log must be running for messages
to the Output Window to function
•Program Parse: Program validation with out execution
7/7/2015
61
Parsing & Executing
Application Programs
• On Line Editing
– Making changes to running programs
– Seamless
• Changes are made during execution
• On Line edit controls appear
7/7/2015
62
Parsing & Executing
Application Programs
• On Line Editing
– Restart - Resets I/O & runs new program
– Activate Changes
• Replaces the old program
• I/O Scan continues
• Saves & Parses program
• Clears on line edit mode if no errors
– Parse Changes - Parses program without running it
– Cancel Changes - Restores source program to last
save
7/7/2015
63
Parsing & Executing
Application Programs
– Watching and Forcing Variables
7/7/2015
64
Parsing & Executing
Application Programs
• Program Operation Overview
– Activate Configuration
• Initialize global memory
• Enables/Disables outputs & starts scanning
– First Scan & Active Configuration – First scan
• Local and function block variables are initialized
• RT_FIRST_SCAN set high
• Logic is solved
• I/O is updated
– Power-Down Sequence – Last scan
• I/O set to disabled state
7/7/2015
• Program actions are terminated
65
Parsing & Executing
Application Programs
Program Operation Overview
– Normal Operation
• Step actions are solved once each scan the Step is
active
• Action are solved before the structured text
• If a transition becomes true
– I/O is updated
– All coils are turned off except latched coils
– Function Blocks are not solved
• Structured text in a Step is solved prior to the
transition logic
• FOR loop structured text is solved:
7/7/2015
– One iteration per scan
– NOWAIT executes all iterations in the loop
66
Parsing & Executing
Application Programs
• Program Operation Overview
– Normal Operation
• All structured text in a Step is executed
–Once the first scan the Step is active
–Not repeated during subsequent scans
• WHILE loop executes until WHILE condition is
FALSE
• Normal execution sequence is
–Update I/O
–Solve logic
7/7/2015
67
–Repeat
Parsing & Executing
Application Programs
• Initialization of Variables
– Inputs cannot be initialized
• Value comes from the Hardware
– Global memory symbols initialize
• When configuration is active or re-activated
– Local memory symbols initialize
• Each time the program executes
– Function blocks
• Initialize as assigned
– Local or Global
• Outputs cannot be written to by the user
• Internal variables are Local symbols
7/7/2015
68
Parsing & Executing
Application Programs
• Program Execution Order
– User defined – No guarantees
• SFC branches:
– User controls simultaneous diverge
• SFC actions:
– User controls simultaneous execution
7/7/2015
69
Parsing & Executing
Application Programs
• File Names
– File type in the project folder
• SFR – Redo information
• SFU – Undo information
• SFX – Cancel online edit information
• SST – Structured text from SFC program
• SWC – Name of symbols in the watch window
• R - RLL programs
• _gprog.st – Structured text of global configuration
• _gprog.bbn – Binary global configuration file
• OPI – Operator interface file
7/7/2015
70
Executing the Sample
Program
Hands On Exercise
Page 72
7/7/2015
71
Integrated Operator Interface
Operator Interface
Overview
All Global Symbols (G) in the active configuration are
available in the Operator Interface.
One screen active at a time







Graphical User Interface
Push buttons
Indicators
Dials
Gauges
Numeric Displays
Text Elements
Third Party OLE controls
7/7/2015
72
Integrated Operator Interface
• Overview
– Program editor global symbols are available
– Many internal objects
– 3rd party OLE objects may be used
– Launch other applications
7/7/2015
73
Creating an Operator
Interface Screen
• Hands On Exercise
– Page 82 to 86
7/7/2015
74
FALCON Workshop
This concludes the lecture
portion of the FALCON
Workshop. You will now
have the opportunity
to learn FALCON
through the self paced
Hands-on Exercise.
7/7/2015
75