Programming C Ontrol S Trategies With IEC 61131
Programming C Ontrol S Trategies With IEC 61131
Programming
Control Strategies with IEC 61131
D Compiler
Page 1
Page 2
A PLC-
PLC-system, as defined in IEC 61131-
61131-1, which claims to
comply, wholly or partially, with the requirements of this
part of the IEC 61131 standard shall only do so if it states:
Page 3
Page 4
Fill
Brew Water
Ready
Ground Full
Boil
Hot Coffee
Finished Grind
Page 5
water
Hot
water
Full
coffee
Ground
machine coffee
Ready Finished
Page 6
Fill
Water
Boil Grind
Water Coffee
Brew
Coffee
Page 7
Init
State Machine with SFC
Ready
Fill Water
Full
Brew Coffee
Finished
Init
Page 8
Page 9
Page 10
IEC 61131-
61131-3 Languages
Instruction List
Structured Text
Ladder Diagram
Page 11
Programming Languages
AND A B C
A C -| |--|/|----------------( )
B
Page 12
Knowledge
Complex Semantic ST
3
Functionality
2 SFC LD
Binary Expressions
Arithmetic Calculation 1 CFC
Sequential Processes
0
Parallel Processing
0 2 4 6
Non-Procedural
Functionality
Page 13
PROGRAM PROG name FUNCTION_BLOCK FB name FUNCTION FUN name Data type
Interface variables
Instructions
(POU body) Instruction part
Page 14
Data Types:
Types: Elementary and Complex
Enumeration enum The variable can assume a value out of a value list.
Range specification range The variable can assume values within the specified range.
Array limits array Several elements of the same data type are grouped in an
array. Accessing the array variable the maximally allowed
index value must not be exceeded.
Data structure structure Several data types are grouped to one data type. The
access to a certain variable of this structure is to be made
using a dot and the name of the component.
Page 15
Instructions LD VarIn
...
(POU body) LD VarLocal
ST VarOut1
...
ST VarOut2
Page 16
Page 17
Page 19
Page 20
Ladder Diagrams
US Look&Feel
Look&Feel
Comments in
Declaration Section and
Implementation Section
Control Relays A B C
-| |--|/|----------------( )
Non-
Non-Binary Logic
Macro Contacts to
Place Function Blocks
Within the Network
Online Powerflow
Page 21
comparison assignment
contact
arithmetic
conditional
Page 22
Dataflow-
Dataflow-Oriented
Modelling & Design 0001 S tartNetwork:
(* Network c omme nt *)
Page 23
Page 24
Steps
Contain the Actions to be Performed
Transitions
Conditions to Pass control
to the next step
Actions
Operations to be performed
Sequences
Simultaneous Sequences or
Sequence selection
Jumps
Iteration of Enclosed Section
Page 25
Sequencing Functionality 1)
FALS E
(Initial) Step
Transitions
Simultaneous steps
3)
Alternativ steps
Merging of Paths 5)
FALSE
Jumps
FALSE
Page 26
Prototypes
IEC 1131-3 standard
OEM specific
user global
application specific
Language
independend
Page 27
Page 28
PROGRAM EXAMPLE
VAR
byte1 : BYTE ;
byte2 AT %IB0.2 : BYTE ;
uint1 : uint
:=1 ;
END_VAR
ld byte1 Header byte2...
and byte2
...byte2 byte1 uint1
shl uint1
st byte1
END_PROGRAM
Page 29
CFE
Make Generator and Bibliothek Editors
Resource
IEC 61131-3
Interpreter Configuration
Library
Program Function
Funct.block
Resource - Builder
Loadable
UCODE + NCODE
Page 30