: Clever usage of language properties CODESYS Users' Conference 2014, Manfred Werner CODESYS a trademark of 3S-Smart Software Solutions GmbH
Agenda 1 2 3 4 5 6 7 Task assignment and definitions A PLC classic: Function Block Diagram A CODESYS standard: Structured Text Rather unusual: CFC A specialist: Sequential Function Chart New in the family: UML State Chart Conclusion 2
Task assignment and definitions A process shall be automated. Different programming languages shall be used. The question arises which example to take? A car washing plant Photo: Alfred Kärcher GmbH & Co. KG 3
Task assignment and definitions A first approach 4
Task assignment and definitions In order to ensure an actual comparison, the same process will be automated using different programming languages. To keep the process as simple as possible, objects have already been created which "only" have to be commanded. These objects take care of themselves to decide whether and how the command can be carried out. The basic knowledge for all programming language will be acquired through the programming of a rolling gate. Close gate Wait for 3 seconds Open gate 5
Task assignment and definitions State OPEN Close! Action Transition condition Sensor open Sensor closed Transition X CLOSED Open! 6
Agenda 1 2 3 4 5 6 7 Task assignment and definitions A PLC classic: Function Block Diagram A CODESYS standard: Structured Text Rather unusual: CFC A specialist: Sequential Function Chart New in the family: UML State Chart Conclusion 7
A PLC classic: Function Block Diagram None of the classics Function Block Diagram (FBD), Ladder Logic (LD) or Instruction List (IL) knows states. However, states can be presented through variables. Typically, the IEC operators R or S instances of the function block RS or SR from the standard library a conditionally assigned state variable are used. State Transition condition Transition condition State 8
A PLC classic: Function Block Diagram Current state Future state 9
A PLC classic: Function Block Diagram Using a method creates an overview! Current state Future state 10
A PLC classic: Function Block Diagram Actions are handled separated from the process. Mostly, physical outputs are assigned cyclically. SafetyCondition What should always be complied with What should never occur 11
A PLC classic: Function Block Diagram Sequence programming in Function Block Diagram is possible. can be read if certain structures are respected. Alternative branches are possible for running the program. Programmers have much freedom. The value of the state variable can easily be saved. 12
Agenda 1 2 3 4 5 6 7 Task assignment and definitions A PLC classic: Function Block Diagram A CODESYS standard: Structured Text Rather unusual: CFC A specialist: Sequential Function Chart New in the family: UML State Chart Conclusion 13
A CODESYS standard: Structured Text In ST, a CASE structure is used practically always. State Action Transition condition Transition Current state Future state 14
A CODESYS standard: Structured Text Only the current state is executed. 15
A CODESYS standard: Structured Text Sequence programming in Structured Text Is possible. Alternative branches are possible for running the program. Programmers have much freedom. The value of the state variable can easily be saved. Only the code which is actually relevant is calculated. 16
1 2 3 4 5 6 7 Task assignment and definitions A PLC classic: Function Block Diagram A CODESYS standard: Structured Text Rather unusual: CFC A specialist: Sequential Function Chart New in the family: UML State Chart Conclusion 17
Rather unusual: CFC Option 1 Same procedure as in Function Block Diagram Option 2 The states are specialized FBs. Execute: Execute action. Done: Action finished 18
Rather unusual: CFC Programming by connecting 19
Rather unusual: CFC Online: a dream! 20
Sequence programming in Continuous Function Block Diagram is possible. Programming by simple wiring. Alternative branches are difficult to display. States are easy and clearly recognizable in the monitoring. Specialized FBs are necessary. Rather unusual: CFC 21
Agenda 1 2 3 4 5 6 7 Task assignment and definitions A PLC classic: Function Block Diagram A CODESYS standard: Structured Text Rather unusual: CFC A specialist: Sequential Function Chart New in the family: UML State Chart Conclusion 22
A specialist: Sequential Function Chart SFC is defined in the IEC61131-3. In addition to the action associations defined in the IEC, CODESYS offers an easier option to execute actions. Action association State Action Transition Transition condition 23
A specialist: Sequential Function Chart Unique online display Active action / step Fulfilled transition 24
A specialist: Sequential Function Chart A specialist has special features. 25
A specialist: Sequential Function Chart A specialist has special features. The state can be queried with: 26
A specialist: Sequential Function Chart Sequence programming in Sequential Function Chart Is possible. Graphical display of the sequence. Alternative or parallel branches are feasible without tricks. States are clearly recognizable in the monitoring. Flags for diagnostics and influencing are available. Only active actions are calculated. 27
Agenda 1 2 3 4 5 6 7 Task assignment and definitions A PLC classic: Function Block Diagram A CODESYS standard: Structured Text Rather unusual: CFC A specialist: Sequential Function Chart New in the family: UML State Chart Conclusion 28
New in the family: UML State Chart State Chart is an additional programming language included in the CODESYS UML Package. It is available in the CODESYS Store. It requires a dongle. 29
New in the family: UML State Chart Transition condition Transition State Action 30
New in the family: UML State Chart Unique online display Active state 31
New in the family: UML State Chart Special feature: Composite State 32
New in the family: UML State Chart Implicit flags to influence states 33
New in the family: UML State Chart A special asset of the State Chart: Multiple transitions between states 34
New in the family: UML State Chart Sequence programming in the State Chart is possible. Graphical display of the sequence. States are clearly recognizable in the monitoring. Implicit variables for diagnostics and influencing are available. Only active actions are calculated. 35
Agenda 1 2 3 4 5 6 7 Task assignment and definitions A PLC classic: Function Block Diagram A CODESYS standard: Structured Text Rather unusual: CFC A specialist: Sequential Function Chart New in the family: UML State Chart Conclusion 36
Conclusion Have it your own way! Decision criteria: How shall the program be used? Who shall program? Who shall put it into operation / carry out the diagnosis? Which language fits the task best? Which kind of presentation fits best for project documentation? 37
Inspiring Automation Solutions Thank you for your attention. 38