Schneider Electric Concept 2.6 User Manual
advertisement
Assistant Bot
Need help? Our chatbot has already read the manual and is ready to assist you. Feel free to ask any questions about the device, but providing details will make the conversation more productive.
33002204 12/2010
Concept 2.6
User Manual
12/2010 www.schneider-electric.com
© 2010 Schneider Electric. All rights reserved.
2
33002204 12/2010
Table of Contents
Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 1 General description of Concept . . . . . . . . . . . . . . . . . . .
1.1
General description of Concept. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PLC hardware configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PLC Hardware Package Contents in Concept S, M and XL . . . . . . . . . . .
1.2
Programming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Online functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Secure Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Utility program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 2 New Performance Attributes of Concept 2.6 in
Comparison with Concept 2.5 . . . . . . . . . . . . . . . . . . . . .
New Performance Attributes of Concept 2.6 Compared with Concept 2.5
New performance attributes of Concept 2.6 SR2 in comparison with
Concept 2.6 SR1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
New performance attributes of Concept 2.6 SR3 in comparison with
Concept 2.6 SR2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 3 Project structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Project Structure and Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Programs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Sections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuration data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 4 Creating a Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 1: Launching Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 2: Configuring the PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 2.1: Required Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 2.2: Optional Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33002204 12/2010
45
57
75
19
21
23
3
4
Step 3: Creating the User Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 4: Save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 5: Perform Memory Prediction. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 6: Loading and Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 7: Optimize and Separate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step 8: Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 5 PLC configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1
General information about hardware configuration . . . . . . . . . . . . . . . . .
General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Proceed in the following way with the configuration . . . . . . . . . . . . . . . .
5.2
Configuration in OFFLINE and ONLINE mode . . . . . . . . . . . . . . . . . . . .
General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Available Functions in OFFLINE and ONLINE Modes. . . . . . . . . . . . . . .
5.3
Unconditional Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Precondition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PLC selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CPU Selection for the PLC Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PLC memory mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Loadables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Segment manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I/O Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.4
Optional configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Settings for ASCII Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Making Additional Functions Available in the Configurator . . . . . . . . . . .
Data Exchange between Nodes on the Modbus Plus Network . . . . . . . .
How many words are really used when data is received (Peer Cop) . . .
Protecting Data in the State RAM before Access . . . . . . . . . . . . . . . . . .
Parameterize interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Special Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5
Backplane Expander Config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Generals to Backplane Expander . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Edit I/O Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6
Configuration of various network systems . . . . . . . . . . . . . . . . . . . . . . . .
Configure INTERBUS system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configure Profibus DP System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configure Ethernet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
RTU extension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ethernet I/O Scanner . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How to use the Ethernet / I/O Scanner . . . . . . . . . . . . . . . . . . . . . . . . . .
5.7
Quantum Security Settings in the Configurator . . . . . . . . . . . . . . . . . . . .
Quantum Security Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
99
33002204 12/2010
Chapter 6 Main structure of PLC Memory and optimization of memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1
Main structure of the PLC Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General structure of the PLC Memory. . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2
General Information on Memory Optimization. . . . . . . . . . . . . . . . . . . . . .
Possibilities for Memory Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PLC-Independent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3
Memory Optimization for Quantum CPU X13 0X and 424 02 . . . . . . . . . .
General Information on Memory Optimization for Quantum CPU X13 0X and 424 02 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Selecting Optimal EXEC File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using the Extended Memory (State RAM for 6x references) . . . . . . . . . .
Harmonizing the IEC Zone and LL984 Zone. . . . . . . . . . . . . . . . . . . . . . .
Harmonizing the Zones for Global Data and IEC Program Memory . . . . .
6.4
Memory Optimization for Quantum CPU 434 12(A) and 534 14(A/B). . . .
General Information on Memory Optimization for Quantum CPU 434
12(A) and 534 14(A/B) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Harmonizing IEC Zone and LL984 Zone. . . . . . . . . . . . . . . . . . . . . . . . . .
Harmonizing the Zones for Global Data and IEC Program Memory (CPU
434 12(A) / 534 14 (A/B)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5
Memory optimization for Compact CPUs . . . . . . . . . . . . . . . . . . . . . . . . .
General Information on Memory Optimization for Compact CPUs . . . . . .
Harmonizing IEC Zone and LL984 Zone. . . . . . . . . . . . . . . . . . . . . . . . . .
Harmonizing the Zones for Global Data and IEC Program Memory
(Compact) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6
Memory optimization for Momentum CPUs. . . . . . . . . . . . . . . . . . . . . . . .
General Information on Memory Optimization for Momentum CPUs . . . .
Selecting Optimal EXEC file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Harmonizing the Zones for Global Data and IEC Program Memory
(Momentum) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.7
Memory optimization for Atrium CPUs . . . . . . . . . . . . . . . . . . . . . . . . . . .
General Information on Memory Optimization for Atrium CPUs . . . . . . . .
Use of IEC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Harmonizing the Zones for Global Data and IEC Program Memory
(Atrium) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 7 Function Block language FBD. . . . . . . . . . . . . . . . . . . . .
7.1
General information about FBD Function Block . . . . . . . . . . . . . . . . . . . .
General information on Function Block language FBD . . . . . . . . . . . . . . .
7.2
FBD Function Block objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions and Function Blocks (FFBs) . . . . . . . . . . . . . . . . . . . . . . . . . . .
Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Actual parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Text Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
155
213
33002204 12/2010
5
6
7.3
Working with the FBD Function Block langauge . . . . . . . . . . . . . . . . . . .
Positioning Functions and Function Blocks . . . . . . . . . . . . . . . . . . . . . . .
FFB Execution Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.4
Code generation with the FBD Function Block language . . . . . . . . . . . .
Code Generation Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.5
Online functions of the FBD Function Block language. . . . . . . . . . . . . . .
Online Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.6
Creating a program with the FBD Function Block language . . . . . . . . . .
Creating a Program in the FBD Function Block Language . . . . . . . . . . .
Chapter 8 Ladder Diagram LD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.1
General information about Ladder Diagram LD . . . . . . . . . . . . . . . . . . . .
General Information about the LD Ladder Diagram Language . . . . . . . .
8.2
Objects in Ladder Diagram LD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contacts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Functions and Function Blocks (FFBs) . . . . . . . . . . . . . . . . . . . . . . . . . .
Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Actual Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Text object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.3
Working with the LD Ladder Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . .
Positioning Coils, Contacts, Functions and Function Blocks . . . . . . . . . .
Execution sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuring Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.4
Code generation with LD Ladder Diagram. . . . . . . . . . . . . . . . . . . . . . . .
Code Generation Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.5
Online functions with the LD Ladder Diagram . . . . . . . . . . . . . . . . . . . . .
Online Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8.6
Creating a program withLD Ladder Diagram . . . . . . . . . . . . . . . . . . . . . .
Creating a Program in LD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 9 Sequence language SFC . . . . . . . . . . . . . . . . . . . . . . . . . .
9.1
General information about SFC sequence language. . . . . . . . . . . . . . . .
General information about SFC language . . . . . . . . . . . . . . . . . . . . . . . .
9.2
SFC sequence language elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Transition section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Alternative Branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Alternative connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Parallel branch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Parallel connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Text object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33002204 12/2010
271
239
9.3
Working with the SFC Sequence Language . . . . . . . . . . . . . . . . . . . . . . .
General information on editing objects . . . . . . . . . . . . . . . . . . . . . . . . . . .
Declaring step properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Declaring actions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Identifier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Declaring a Transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Alias Designations for Steps and Transitions . . . . . . . . . . . . . . . . . . . . . .
9.4
Online functions of the SFC sequence language . . . . . . . . . . . . . . . . . . .
Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Controlling a Step String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Learn monitoring times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Transition diagnosis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 10 Instruction list IL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.1
General information about the IL instruction list . . . . . . . . . . . . . . . . . . . .
General Information about the IL Instruction List . . . . . . . . . . . . . . . . . . .
10.2
Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General information about instructions . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Declaration (VAR...END_VAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.3
IL instruction list operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Load (LD and LDN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Store (ST and STN). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Set (S) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reset (R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Boolean AND (AND, AND (), ANDN, ANDN ()). . . . . . . . . . . . . . . . . . . . .
Boolean OR (OR, OR (), ORN, ORN ()) . . . . . . . . . . . . . . . . . . . . . . . . . .
Boolean exclusive OR (XOR, XOR (), XORN, XORN ()) . . . . . . . . . . . . .
Invert (NOT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Addition (ADD and ADD ()) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Subtraction (SUB and SUB ()). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Multiplication (MUL and MUL()). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Division (DIV and DIV ()) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compare on "Greater Than" (GT and GT ()). . . . . . . . . . . . . . . . . . . . . . .
Compare to "Greater than/Equal to" (GE and GE ()) . . . . . . . . . . . . . . . .
Compare to "EQual to"(EQ and EQ ()) . . . . . . . . . . . . . . . . . . . . . . . . . . .
Compare to "Not Equal to" (NE and NE ()) . . . . . . . . . . . . . . . . . . . . . . . .
Compare to "Less than/Equal to" (LE and LE ()). . . . . . . . . . . . . . . . . . . .
Compare to "Less Than"(LT and LT ()) . . . . . . . . . . . . . . . . . . . . . . . . . . .
321
33002204 12/2010
7
8
Jump to label (JMP, JMPC and JMPCN). . . . . . . . . . . . . . . . . . . . . . . . .
Call Function Block/DFB (CAL, CALC and CALCN) . . . . . . . . . . . . . . . .
FUNCNAME. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Right parenthesis ")" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.4
Call up of functions, Function Blocks (EFBs) and Derived Function Blocks
(DFBs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Use of Function Blocks and DFBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Invoking a Function Block/DFB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function call. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.5
Syntax check and Code generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Syntax Check. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Code generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.6
Online functions of the IL instruction list . . . . . . . . . . . . . . . . . . . . . . . . .
Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Monitoring field. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
10.7
Creating a program with the IL instruction list . . . . . . . . . . . . . . . . . . . . .
Creating a program in the IL instruction list. . . . . . . . . . . . . . . . . . . . . . .
Chapter 11 Structured text ST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.1
General information about structured Text ST. . . . . . . . . . . . . . . . . . . . .
General Information about the ST Structured Text . . . . . . . . . . . . . . . . .
11.2
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.3
Operators of the programming language of structured ST text . . . . . . . .
Use of parentheses "()" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FUNCNAME. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exponentiation (**) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Negation (-) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Complement formation (NOT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Multiplication (*) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Division (/) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modulo (MOD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Addition (+) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Subtraction (-) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comparison on "Greater Than" (>) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comparison on "Greater than/Equal to" (>=) . . . . . . . . . . . . . . . . . . . . . .
Comparison with "EQual to" (=) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comparison with "Not Equal to" (<>) . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comparison with "Less Than"(<) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comparison with "Less than or Equal to" (<=) . . . . . . . . . . . . . . . . . . . . .
Boolean AND (AND or &). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Boolean OR (OR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Boolean Exclusive OR (XOR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
393
33002204 12/2010
11.4
Assign instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Declaration (VAR...END_VAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IF...THEN...END_IF. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ELSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ELSIF...THEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CASE...OF...END_CASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
FOR...TO...BY...DO...END_FOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
WHILE...DO...END_WHILE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
REPEAT...UNTIL...END_REPEAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
EXIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Empty instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.5
Call up of functions, Function Blocks (EFBs) and Derived Function Blocks
(DFBs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function Block/DFB Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Function Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.6
Syntax check and code generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Syntax Check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Code generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.7
Online functions of the ST programming language . . . . . . . . . . . . . . . . . .
Online functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11.8
Creating a program with the structured ST text. . . . . . . . . . . . . . . . . . . . .
Creating a program in structured ST text . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 12 Ladder Logic 984 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.1
General about Ladder Logic 984. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General about Ladder Logic 984. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.2
Working with Ladder Logic 984 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Entering and Editing Logic Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Entering and Editing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Ladder and Network Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reference Zoom and DX Zoom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Search and Replace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.3
Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.4
Equation Network Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Equation Editing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Syntax and Semantics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.5
LL984 Programming Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LL984 Programming Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
455
33002204 12/2010
9
10
Chapter 13 DFBs (Derived Function Blocks) . . . . . . . . . . . . . . . . . . .
13.1
DFBs (Derived Function Blocks) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General information about DFBs (Derived Function Blocks) . . . . . . . . . .
Global / Local DFBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Use of variables in DFBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Combined Input/Output Variables (VARINOUT Variables) . . . . . . . . . . .
Global Variables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Context Sensitive Help (Online Help) for DFBs. . . . . . . . . . . . .
13.2
Programming and calling up a DFB . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
At a Glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating the DFB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating the Logic in FBD Function Block Language . . . . . . . . . . . . . . .
Creating the Logic in LD Ladder Diagram . . . . . . . . . . . . . . . . . . . . . . . .
Creating the Logic in IL Instruction List . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating the Logic in ST Structured Text. . . . . . . . . . . . . . . . . . . . . . . . .
Calling up a DFB in the FBD Function Block dialog. . . . . . . . . . . . . . . . .
Calling up a DFB in Ladder Diagram LD . . . . . . . . . . . . . . . . . . . . . . . . .
Calling up a DFB in the IL instruction list . . . . . . . . . . . . . . . . . . . . . . . . .
Calling up a DFB in structured text ST. . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 14 Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
14.1
Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Macros: general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Global / Local Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exchange marking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating Context Sensitive Help (Online Help) for Macros . . . . . . . . . . .
14.2
Programming and calling up a macro . . . . . . . . . . . . . . . . . . . . . . . . . . .
At a Glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Occupying the macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating the logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calling up a macro from an SFC section . . . . . . . . . . . . . . . . . . . . . . . . .
Calling a macro from an FBD/LD section. . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 15 Variables editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Declare variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Searching and replacing variable names and addresses . . . . . . . . . . . .
Searching and Pasting Variable Names and Addresses . . . . . . . . . . . . .
Exporting located variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 16 Project Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General information about the Project Browser . . . . . . . . . . . . . . . . . . . .
Detailed view in the project browser . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operating the Project Browser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
481
521
543
557
33002204 12/2010
Chapter 17 Derived data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17.1
General information on Derived Data Types . . . . . . . . . . . . . . . . . . . . . . .
Derived Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Global / Local Derived Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Extended Data Type Definition (larger than 64 Kbytes) . . . . . . . . . . . . . .
17.2
Syntax of the data type editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Elements of the Derived Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Key Words. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Names of the derived datatypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Separators. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
17.3
Derived data types using memory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Use of Memory by Derived Data Types . . . . . . . . . . . . . . . . . . . . . . . . . .
17.4
Calling derived data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Calling Derived Data Types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 18 Reference data editor . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General Information about the Reference Data Editor . . . . . . . . . . . . . . .
Converting RDE templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changing signal states of a Located variable . . . . . . . . . . . . . . . . . . . . . .
Cyclical Setting of Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Unconditional locking of a section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Replacing variable names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Load reference data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 19 ASCII Message Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . .
19.1
ASCII Editor Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Generals to ASCII editor dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Control code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Carriage Return. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Flush (buffer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Repeat. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19.2
User Interface of ASCII Message Editor . . . . . . . . . . . . . . . . . . . . . . . . . .
How to Use the ASCII Message Editor . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message Number . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Message Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simulation Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
19.3
How to Continue after Getting a Warning . . . . . . . . . . . . . . . . . . . . . . . . .
How to Continue after Getting a Warning . . . . . . . . . . . . . . . . . . . . . . . . .
19.4
ASCII Editor in Offline/Combination/Direct Modes . . . . . . . . . . . . . . . . . .
ASCII Message Editor in Offline/Combination/Direct Modes . . . . . . . . . .
595
611
565
33002204 12/2010
11
12
Chapter 20 Online functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20.1
General information about online functions . . . . . . . . . . . . . . . . . . . . . . .
General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20.2
Connect to PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Presettings for ONLINE operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modbus Network Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modbus Plus Network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Modbus Plus Bridge. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
TCP/IP-Network Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Connecting IEC Simulator (32 bit) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
State of the PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20.3
Setting up and controlling the PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting the Time for Constant Scans . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Single Sweeps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Deleting memory zones from the PLC . . . . . . . . . . . . . . . . . . . . . . . . . . .
Speed optimized LL984-Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Save To Flash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Reactivate flash save. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Set PLC Password. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20.4
Selecting Process information (status and memory) . . . . . . . . . . . . . . . .
General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PLC state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Memory Statistics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20.5
Loading a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Download Changes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Uploading the PLC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Upload Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20.6
Section animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IEC-Sections animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LL984 Programming Modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20.7
Online Diagnosis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Diagnostics Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
20.8
Logging Write Access to the PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Logging and Encrypted Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 21 Import/Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21.1
General Information about Import/Export. . . . . . . . . . . . . . . . . . . . . . . . .
General Information about Import/Export. . . . . . . . . . . . . . . . . . . . . . . . .
21.2
Exporting sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exporting Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21.3
Exporting variables and derived data types . . . . . . . . . . . . . . . . . . . . . . .
Exporting variables and Derived Data Types. . . . . . . . . . . . . . . . . . . . . .
33002204 12/2010
631
691
21.4
Section import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing Sections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Procedure for importing sections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing IL and ST Programs to FBD, SFC, IL or ST Sections (with
Conversion) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing (insert file) IL and ST programs into IL or ST sections . . . . . . .
Procedure for "Copying" an IL section from an existing project into a new project.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Procedure for converting FBD sections from an existing project into IL sections of a new project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21.5
Variables import . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing Variables in "Text Delimited" Format. . . . . . . . . . . . . . . . . . . . .
Importing structured variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing variables in Factory Link format . . . . . . . . . . . . . . . . . . . . . . . .
Multiple Address Assignment after Variable Import . . . . . . . . . . . . . . . . .
21.6
Import/Export of PLC Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Import/Export of PLC Configuration using Concept . . . . . . . . . . . . . . . . .
Import/Export of PLC Configuration using Concept Converter . . . . . . . . .
Chapter 22 Documentation and Archiving. . . . . . . . . . . . . . . . . . . . .
22.1
Documentation of projects, DFBs and macros . . . . . . . . . . . . . . . . . . . . .
Documentation contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Documentation Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining Page Breaks for Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Use of keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
22.2
Managing projects, DFBs and macros . . . . . . . . . . . . . . . . . . . . . . . . . . .
Archiving projects, used DFBs, EFBs and data type files . . . . . . . . . . . . .
Deleting projects, DFBs and macros. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Chapter 23 Simulating a PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23.1
Simulating a PLC (16-bit simulator). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simulating a Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23.2
Simulating a PLC (32-bit simulator). . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Concept-PLCSIM32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simulating a PLC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Simulating a TCP/IP interface card in Windows 98. . . . . . . . . . . . . . . . . .
Simulating a TCP/IP interface card in Windows NT . . . . . . . . . . . . . . . . .
Chapter 24 Concept Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General Description of Concept Security . . . . . . . . . . . . . . . . . . . . . . . . .
Access Rights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Changing Passwords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Activating Access Rights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Protecting Projects/DFBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
745
729
757
33002204 12/2010
13
14
Appendix A Tables of PLC-dependent Performance Attributes. . . . .
775
Performance of Quantum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Performance Attributes of Compact. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Performance Attributes of Momentum . . . . . . . . . . . . . . . . . . . . . . . . . . .
Performance Attributes of Atrium. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix B Windows interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
799
B.1
Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Window Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Elements of a window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.2
Menu commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Menu commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.3
Dialog boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Dialog boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.4
Generating a project symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Creating a Project Symbol in a Program Group. . . . . . . . . . . . . . . . . . . .
B.5
Online help. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
At a Glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How the Online Help is set out. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix C List of symbols and short cut keys . . . . . . . . . . . . . . . . .
C.1
Icon bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
819
General icon bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Icon bar in the FBD editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Icon bar in the SFC-Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Icon bar in the LD editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
List of Symbols in the IL and ST Editor . . . . . . . . . . . . . . . . . . . . . . . . . .
List of Symbols in the LL984-Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Icons in PLC Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Toolbar in the RDE Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Toolbar in the Project Browser. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C.2
Short cut keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General Short Cut Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Short Cut Keys in the IL, ST and Data Type Editor . . . . . . . . . . . . . . . . .
Short Cut Keys in the FBD and SFC Editor . . . . . . . . . . . . . . . . . . . . . . .
Shortcut keys in the LD-Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Short Cut Keys in the LL984-Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix D IEC conformity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.1
What is the IEC 1131-3 standard?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General information about IEC conformity. . . . . . . . . . . . . . . . . . . . . . . .
IEC Conformity Test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.2
IEC standards tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Common elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IL (AWL) language elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ST language elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
849
33002204 12/2010
Common graphic elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
LD (KOP) language elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Implementation-dependent parameters . . . . . . . . . . . . . . . . . . . . . . . . . .
Error causes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.3
Expansions of IEC 1131-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Expansions of IEC 1131-3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.4
Text language syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Text Language Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix E Configuration examples. . . . . . . . . . . . . . . . . . . . . . . . . .
E.1
Quantum Example - Remote Control with RIO . . . . . . . . . . . . . . . . . . . . .
Editing local drop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Remote Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.2
Quantum Example - Remote control with RIO (series 800) . . . . . . . . . . .
Editing Local Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Remote Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Remote Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.3
Quantum Example - Remote Control with DIO . . . . . . . . . . . . . . . . . . . . .
Editing Local Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Local Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.4
Quantum Example – INTERBUS Control . . . . . . . . . . . . . . . . . . . . . . . . .
General Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Local Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.5
Quantum Example - SY/MAX Controller . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Local Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Remote Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6
Quantum Example - Profibus DP Controller . . . . . . . . . . . . . . . . . . . . . . .
General Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Profibus DP Export Settings in SyCon . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Local Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Importing Profibus DP Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.7
Quantum-Example - Peer Cop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Generals to Peer Cop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Configuration of Peer Cop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Global data transfer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Specific data transfer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.8
Compact Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing Local Drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.9
Atrium Example – INTERBUS Controller . . . . . . . . . . . . . . . . . . . . . . . . .
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
INTERBUS export settings in CMD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Edit local I/O drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Edit remote I/O drop (import INTERBUS configuration) . . . . . . . . . . . . . .
877
33002204 12/2010
15
16
E.10
Momentum Example - Remote I/O Bus . . . . . . . . . . . . . . . . . . . . . . . . . .
General Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Editing local drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Example 10 – Editing Remote Drops (I/O Bus) . . . . . . . . . . . . . . . . . . . .
E.11
Momentum Example - Ethernet Bus System . . . . . . . . . . . . . . . . . . . . . .
Configure Ethernet. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Network Configuration in Different Operating Systems . . . . . . . . . . . . . .
Editing local drop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Create online connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix F Convert Projects/DFBs/Macros . . . . . . . . . . . . . . . . . . . .
991
Converting projects/DFBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix G Concept ModConnect . . . . . . . . . . . . . . . . . . . . . . . . . . . .
995
G.1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.2
Integration of Third Party Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Integrating new Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Removing Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.3
Use of third party module in Concept. . . . . . . . . . . . . . . . . . . . . . . . . . . .
Use of Third Party Modules in Concept . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix H Convertion of Modsoft Programs . . . . . . . . . . . . . . . . . . .
1001
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
How to Convert a Modsoft Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix I Modsoft and 984 References . . . . . . . . . . . . . . . . . . . . . .
1007
Modsoft Keys with Concept Equivalents . . . . . . . . . . . . . . . . . . . . . . . . .
Modsoft Function Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix J Presettings when using Modbus Plus for startup . . . . .
1011
Installing the SA85/PCI85 with Windows 98/2000/XP . . . . . . . . . . . . . . .
Installing the SA85/PC185 in Windows NT . . . . . . . . . . . . . . . . . . . . . . .
Installing the Modbus Plus Driver in Windows 98/2000/NT . . . . . . . . . . .
Virtual MBX Driver for 16 bit application capability with Windows
98/2000/NT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
MBX Driver for connection between ModConnect Host interface adapters and 32 bit applications with Windows 98/2000/NT . . . . . . . . . . . . . . . . .
Remote MBX - Driver for Remote Operation . . . . . . . . . . . . . . . . . . . . . .
Ethernet MBX - Driver for Modbus Plus Function via TCP/IP . . . . . . . . .
Establishing the hardware connection. . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix K Presettings when using Modbus for startup . . . . . . . . . .
1025
Interface Settings in Windows 98/2000/XP . . . . . . . . . . . . . . . . . . . . . . .
Interface Settings in Windows NT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Setting up the hardware connection . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Transfer problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33002204 12/2010
Appendix L Startup when using Modbus with the EXECLoader . . .
1031
Quantum first startup with EXECLoader . . . . . . . . . . . . . . . . . . . . . . . . . .
Compact first startup with EXECLoader . . . . . . . . . . . . . . . . . . . . . . . . . .
Momentum first startup for IEC with EXECLoader . . . . . . . . . . . . . . . . . .
Momentum first startup for LL984 with EXECLoader . . . . . . . . . . . . . . . .
Appendix M Startup when using Modbus with DOS Loader . . . . . . .
1049
Quantum first startup with DOS Loader . . . . . . . . . . . . . . . . . . . . . . . . . .
Compact first startup with DOS Loader. . . . . . . . . . . . . . . . . . . . . . . . . . .
Momentum first startup for IEC with DOS Loader . . . . . . . . . . . . . . . . . . .
Momentum first startup for LL984 with DOS Loader . . . . . . . . . . . . . . . . .
Appendix N Startup when using Modbus Plus with the EXECLoader
1063
Quantum first startup with EXECLoader . . . . . . . . . . . . . . . . . . . . . . . . . .
Compact first startup with EXECLoader . . . . . . . . . . . . . . . . . . . . . . . . . .
Atrium first startup with EXECLoader . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Momentum first startup for IEC with EXECLoader . . . . . . . . . . . . . . . . . .
Momentum first startup for LL984 with EXECLoader . . . . . . . . . . . . . . . .
Appendix O Startup when using Modbus Plus with DOS Loader . . .
1085
Quantum first startup with DOS Loader . . . . . . . . . . . . . . . . . . . . . . . . . .
Compact first startup with DOS Loader. . . . . . . . . . . . . . . . . . . . . . . . . . .
Atrium first startup with DOS Loader. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Momentum first startup for IEC with DOS Loader . . . . . . . . . . . . . . . . . . .
Momentum first startup for LL984 with DOS Loader . . . . . . . . . . . . . . . . .
Appendix P EXEC files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1101
Loading Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix Q INI Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1105
Q.1
Settings in the CONCEPT.INI File. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General information on the Concept INI file . . . . . . . . . . . . . . . . . . . . . . .
INI Print Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
INI Settings for Register Address Format, Variable Storage and Project
Name Definition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
INI-settings for path information and global DFBs [Path] [Upload] . . . . . .
Representation of Internal Data in the INI File . . . . . . . . . . . . . . . . . . . . .
INI Settings for the LD Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
INI Settings for Online Processing [Colors] . . . . . . . . . . . . . . . . . . . . . . . .
INI Settings for Warning Messages and the Address Format . . . . . . . . . .
INI Security Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
INI-Settings for the RDE behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
INI settings for the Options> Toolsmenu. . . . . . . . . . . . . . . . . . . . . . . . . .
Q.2
Settings in the Projectname.INI File . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
General Information for Projectname.INI File . . . . . . . . . . . . . . . . . . . . . .
INI Settings for the Event Viewer [Online Events] . . . . . . . . . . . . . . . . . . .
INI-Settings for the Online-Backup [Backup]. . . . . . . . . . . . . . . . . . . . . . .
33002204 12/2010
17
18
Appendix R Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1125
R.1
General information about interrupt sections . . . . . . . . . . . . . . . . . . . . . .
General Information about Interrupt Processing . . . . . . . . . . . . . . . . . . .
R.2
Interrupt section: Timer event section . . . . . . . . . . . . . . . . . . . . . . . . . . .
Timer Event Sections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining the Scan Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Defining the Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Execution Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Examples for Parameterization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R.3
Interrupt section: I/O event section . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I/O Event Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Priority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Runtime Error. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
R.4
Modules for interrupt sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
EFBs for Interrupt Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Appendix S Automatic Connection to the PLC . . . . . . . . . . . . . . . . . .
1147
Automatic Connection with Command Line Parameters (Modbus,
Modbus +, TCP/IP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Automatic Connection with the CCLaunch Tool (Modbus Plus) . . . . . . .
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
33002204 12/2010
Safety Information
§
Important Information
NOTICE
Read these instructions carefully, and look at the equipment to become familiar with the device before trying to install, operate, or maintain it. The following special messages may appear throughout this documentation or on the equipment to warn of potential hazards or to call attention to information that clarifies or simplifies a procedure.
19
33002204 12/2010
PLEASE NOTE
Electrical equipment should be installed, operated, serviced, and maintained only by qualified personnel. No responsibility is assumed by Schneider Electric for any consequences arising out of the use of this material.
A qualified person is one who has skills and knowledge related to the construction and operation of electrical equipment and the installation, and has received safety training to recognize and avoid the hazards involved.
20
33002204 12/2010
About the Book
At a Glance
Document Scope
This user manual is intended to help you create a user program with Concept. It provides authoritative information on the individual program languages and on hardware configuration.
Validity Note
Related Documents
Title of Documentation
Concept Installation Instructions
Concept IEC Block Library
Concept EFB User Manual
Concept LL984 Block Library
Reference Number
840 USE 502 00
840 USE 504 00
840 USE 505 00
840 USE 506 00
You can download these technical publications and other technical information from our website at www.schneider-electric.com.
User Comments
The documentation applies to Concept 2.6 for Microsoft Windows 98, Microsoft
Windows 2000, Microsoft Windows XP and Microsoft Windows NT 4.x.
NOTE: Additional up-to-date tips can be found in the Concept README file.
We welcome your comments about this document. You can reach us by e-mail at [email protected].
33002204 12/2010
21
22
33002204 12/2010
General description of Concept
33002204 12/2010
General description of Concept
1
Overview
This chapter contains a general description of Concept. It should provide an initial overview of Concept and its helper programs.
What's in this Chapter?
This chapter contains the following sections:
1.1
Section
1.2
Topic
General description of Concept
Programming
Page
23
33002204 12/2010
General description of Concept
1.1
General description of Concept
Overview
This section describes the performance features of Concept and provides an overview of the hardware that may be programmed using Concept.
What's in this Section?
This section contains the following topics:
Topic
Introduction
PLC hardware configuration
PLC Hardware Package Contents in Concept S, M and XL
Page
24
33002204 12/2010
General description of Concept
Introduction
Operating System
Nowadays, a graphical user interface is a requirement for tasks of this kind. For this reason, Concept has been established as an MS Windows application. Concept can be operated in Windows 98, Windows 2000, Windows XP and Windows NT. These operating systems have the advantage that they are used all over the world.
Therefore PC users have a basic knowledge of Windows technology and mouse operation. In addition to this all common monitors, graphic cards and printers can be used with MS Windows. As a user, you are not therefore tied to specific hardware configurations.
International Standard IEC 1131-3
For effective system configuration Concept offers a unified configuration environment in accordance with international standard regulations IEC 1131-3.
PLC Independence when Programming
The guiding principle behind the development of Concept was that all the system configuration procedures and all the editors should have the same look and feel.
Most of the configuration steps, especially program creation, are designed independently of the PLC to be programmed.
Graphical Interface
The entire program is divided up into sections corresponding to the logic structure.
The Concept configuration tool enables objects (such as function blocks, steps, and transitions) to be selected, placed and moved easily in graphical form. Plausibility tests already take place in the SFC editor (Sequential Function Chart/ sequence language) during object placing, as most of the links between objects are generated automatically during placing. In the FBD editor (Function Block Diagram/Function
Block language) and LD editor (Ladder Diagram), plausibility tests take place when blocks are linked. Unauthorized links, such as those between different data types have already been rejected during configuration. A plausibility test also takes place in the LL984 editor (Ladder Logic 984) during placing. In the IL editor (Instruction
List) and ST editor (Structured Text) unauthorized instructions are identified via a colored outline. After the first successful program run, the program may be optimized in graphic terms by moving links, blocks or texts to improve the display.
33002204 12/2010
25
General description of Concept
If desired the sections may be displayed with print preview information, in order to individually control pages of documentation. Signals receive an expansive designation with symbol names and comments. Unique notes on signal tracking are provided at the signal breaks. The individual block processing sequences from one section may be displayed and documented in the FBD editor.
Import/Export Functions
Sections from various projects can be combined as desired in another project using import/export functions.
It is also possible to convert the sections of one IEC programmer language into sections of another IEC programmer language.
Variables may be imported into and exported from the text using text delimited or
FactoryLink format.
Runtime System
Open Software Architecture
Concept possesses open software architecture to enable connection to external systems (e.g. for visualization) via standard interfaces.
Online Help
The runtime system on the PLC offers quick reactions to signal state process changes (short cycle time), Simulating signal transmitters
, Online display
, online parameter changes and online program changes.
Special care was taken when developing the help function. The context sensitive
Online help function
provides support for every configuration situation just by clicking on the subject using the mouse or pressing the F1 key.
Menu commands and dialogs are also context sensitive, as are, function blocks and hardware components of the individual PLC families.
26
33002204 12/2010
General description of Concept
PLC hardware configuration
Description
Concept is the unified projection tool for Quantum, Compact, Momentum and Atrium products.
Hardware components (for example CPU, program memory, input/output units etc.) can be specified before, during or after program creation.
This projection task can be performed both online (linked to the PLC) and locally (PC alone). Projection is supported by Concept, and only suggests valid combinations.
Misprojection is therefore prevented. In online mode the projected hardware is tested for plausibility immediately and input errors are rejected.
After linking the programmer device (PC) to the PLC, a plausibility test is performed on the projected values (e.g. from the Variable Editor) using the actual hardware resources and if necessary an error message will appear.
33002204 12/2010
27
General description of Concept
PLC Hardware Package Contents in Concept S, M and XL
Description
PLC Hardware Package Contents in Concept S, M and XL:
Concept version
Concept Vx.x S
Concept Vx.x M
Concept Vx.x XL contain Hardware
Momentum
Compact, Momentum
Atrium, Compact, Momentum, Quantum
28
33002204 12/2010
General description of Concept
1.2
Programming
Overview
This section provides an overview of the editors which are available in Concept.
What's in this Section?
This section contains the following topics:
Topic
General information
Libraries
Editors
Online functions
Communication
Secure Application
Utility program
Page
33002204 12/2010
29
General description of Concept
General information
At a Glance
As a solution for automatic control engineering tasks, Concept provides the following z z z z
IEC 1131-3 compatible programming languages:
Function Block language FBD (Function Block Diagram)
,
LD (Ladder Diagram)
,
Sequential language SFC (Sequential Function Chart)
, z
Instruction List IL
and
Structured Text ST
.
The Modsoft orientated language is also available z Ladder Diagram LL984 (Ladder Logic)
.
The IEC programming language (FBD, LD, SFC, ST and IL) basic elements are
Functions and Function Blocks, which make up assembled logic units. Concept contains various Block libraries
with predefined elementary functions/Function Blocks (EFBs). In order to locate the individual EFBs without difficulty, they are split into different groups according to their area of use.
For the Modsoft orientated programming language LL984, there is a Block library
with Instructions available.
Sections
The control program is constructed from sections according to the logic structure.
Only one programming language is used within a section.
Merging these sections makes up the entire control program and the automation device uses this to control the process. Any IEC sections (FBD, LD, SFC, IL, ST) may be mixed within the program. The LL984 sections are always edited as a block before the IEC sections.
Data types
A subset of Data types from the international standard IEC1131-3 is available.
In the Data type editor
intrinsic data types can be derived from IEC data types.
Using variables
30
Variables for linking basic elements (objects) within a section are not usually necessary with the graphic programming languages FBD, LD, SFC and LL984, as these links are usually made graphically. (An additional link using variables is only necessary for incredibly complex sections.) Graphic links are managed by the system and therefore no projection requirement is created. The Variable Editor
is used to project all other variables such as those for data transfer between various sections.
33002204 12/2010
General description of Concept
Libraries
At a Glance
IEC library
For program creation Concept provides various block libraries with predefined
Functions and Function Blocks.
There are 2 different types of block libraries: z IEC library
Block libraries for sections in the IEC programming languages (FBD, LD, SFC, IL z and ST)
LL984 Library
Block library for sections in the Modsoft orientated programming language LL984
The following IEC libraries are available for applications: z AKFEFB
This library contains the AKF/ALD EFBs, which are not covered by the IEC library.
z z
ANA_IO
This library is for analog value processing.
COMM
This library is used for exchanging data between a PLC and another Modbus, z z
Modbus Plus or Ethernet node.
CONT_CTL
This library is for projecting process-engineering servoloops. It contains controller, differential, integral, and polygon graph EFBs.
DIAGNOSTICS
This library is used to investigate the control program for misbehaviors. It contains action diagnostics, Reaction diagnostics, locking diagnostics, process prerequisite diagnostics, dynamic diagnostics and signal group monitoring EFBs.
z z z z
EXPERTS
This library contains EFBs, which are necessary for using expert modules.
EXTENDED
This library contains useful supplements for different libraries. It has EFBs for creating average values, selecting maximum values, negating, triggering, converting, creating a polygon with 1st degree interpolation, edge recognizing, and for specifying an insensitive zone for control variables.
FUZZY
This library contains EFBs for fuzzy logic.
IEC
This library contains the EFBs defined in IEC 1131-3. It has for example EFBs for mathematical calculations, counters, timers etc.
33002204 12/2010
31
General description of Concept z z
LIB984
This library contains IEC 1131 compatible EFBs from the LL984 library, for example, EFBs for register transfer.
SYSTEM
This library contains EFBs for using system functions. It has EFBs for cycle time recognition, for various system cycle use, for SFC section control and for system status display.
LL984 Library
The LL984 library contains the LL984 editor instructions (blocks). It contains instructions for mathematical calculations, counters, timers, instructions for displaying system status, controller, differential and integral instructions and instructions for exchanging data between a PLC and another Modbus or Modbus
Plus node.
32
33002204 12/2010
General description of Concept
Editors
At a Glance
FBD editor
When generating a section specify which programming language you are going to use.
The following editors are available for creating sections in the various programming z z z z z z languages:
FBD editor (Function Block Language)
LD editor (Ladder Diagram)
SFC editor (Sequence language)
IL editor (Instruction List)
ST editor (Structured Text)
LL984 editor (Modsoft orientated Ladder Logic)
The following editors are available for declaring variables, creating data types and z z displaying variables. the Variable Editor (for declaring variables),
the reference data editor (for displaying and online changing of values)
and z the data type editor (for creating user specific data types)
.
The following editors are available for creating user specific functions and Function z z
Blocks:
Concept DFB (for creating Derived Function Blocks and macros)
Concept EFB (for creating user specific elementary functions and Function
Blocks)
The FBD editor
is used for graphic function plan programming according to IEC 1131-3.
Elementary functions, Elementary Function Blocks (EFBs) and Derived Function
Blocks (DFBs) are connected with signals (variables) onto FBD sections for the function plan. The size of a FBD section is 23 lines and 30 columns.
EFBs are equipped with a fixed or variable number of input variables and may be placed anywhere on the section. Variables and EFBs may have comments separately added to them, column layouts on a section may be commented on anywhere using text boxes. All EFBs may be performed conditionally or unconditionally.
All the EFBs are divided into function- and use-orientated libraries in various groups, to make them easier to locate.
33002204 12/2010
33
General description of Concept
LD editor
The LD editor
is used for graphic ladder programming according to
IEC 1131-3.
Contacts and coils are connected to the Ladder Diagram in LD sections using signals (variables).
The size of a FBD section is 23 lines and 30 columns.
Furthermore, the elementary functions and Function Blocks (EFBs), which are named in the FBD editor, the Derived Function Blocks (DFBs) and User Defined
Function Blocks (UDFBs) may also be bound in the ladder diagram (see
The structure of a LD section corresponds to a rung for relay switching. The left power rail is located on its left-hand side. This left power rail corresponds to the phase (L ladder) of a rung. With LD programming, in the same way as in a rung, only the LD objects (contacts, coils) which are linked to a power supply, that is to say connected with the left power rail, are "processed". The right power rail, which corresponds to the neutral ladder, is not shown optically. However, all coils and EFB outputs are linked with it internally and this creates a power flow.
SFC editor
The SFC editor
is used to graphically program an IEC 1131-3 compatible sequential control.
The SFC elements are connected in a SFC section to one of the sequential controls corresponding to the task setting. The size of a SFC section is 32 lines and 200 lines. z z z z z z
The following sequential control programming objects are available in Concept.
Step (including actions and action sections)
Transition (including transition section)
Alternative branch and merge
Parallel branch and merge
Jump
Connection
Simple diagnostics monitoring functions are already integrated in the steps.
IL editor
The IL editor
is used for programming IEC 1131-3 compatible instruction lists.
Existing IL instructions, elementary functions and Elementary Function Blocks
(EFBs), and Derived Function Blocks (DFBs) are written in series in text form in IL sections from operators (commands) and operands (signals, variables).
34
33002204 12/2010
General description of Concept
When the program is entered, all the standard Windows services and some additional commands for text-processing are available. The size of an IL section is
64 Kbyte maximum.
z z z z z
The following instruction list programming operators are available in Concept:
Logic (AND, OR etc.)
Arithmetic (ADD, SUB, MUL, DIV, …)
Comparative (EQ, GT, LT, …)
Jumps (JMP, … conditional/unconditional)
EFB call (CAL , … conditional/unconditional)
IL programming is done in text form. When text is entered, all the standard Windows services for text-processing are available. The IL editor also contains some further commands for text-processing.
A spell check is performed immediately after text has been entered (instructions, key words, separators), highlighting errors with a colored outline.
ST editor
LL984 editor
The ST editor
is used for programming IEC 1131-3 structured text.
Existing ST statements, elementary functions and Elementary Function Blocks
(EFBs), and Derived Function Blocks (DFBs) are written in text form in IL sections by printing (operator lists) and operands (signals, variables).
When the program is entered, all the standard Windows services and some additional commands for text-processing are available. The size of a ST section is
64 Kbyte maximum.
z z z z
The following structured text programming statements and operators are available in Concept: conditional/unconditional statement execution (IF, ELSIF, ELSE, …) conditional/unconditional loop execution (WHILE, REPEAT)
Mathematical, comparative, and logic operators conditional/unconditional EFB call
ST programming is done in text form. When text is entered, all the standard
Windows services for text-processing are available. The ST editor also contains some further commands for text-processing.
A spell check is performed immediately after text has been entered (instructions, key words, separators), highlighting errors with a colored outline.
Using the Modsoft orientated LL984-Editor
(Ladder Diagram 984), instructions, contacts, coils and signals (variables) are connected to a ladder diagram. Instructions, contacts, coils and variables may be commented on.
33002204 12/2010
35
General description of Concept
The structure of a LL984 section corresponds to a rung for relay switching. The left power rail is located on its left-hand side, but it is not visually displayed. This left power rail corresponds to the phase (L ladder) of a rung. With LL984 programming, in the same way as in a rung, only the LL984 objects (instructions, contacts, coils) connected to a power supply, i.e. connected to the left power rail, are "processed".
The right power rail, which corresponds to the neutral ladder is not visually displayed either. However, all coils and instruction outputs are linked with it internally and this creates a power flow.
Concept has various predefined instructions for ladder programming using LL984.
These may be found in the block library LL984. Additional instructions for special applications are available as loadables and may be loaded at a later time.
Variable Editor
The Variable Editor
is used to declare and comment on all necessary symbolic signal names (variables). Only declared variables may be used in Concept programs.
A data type must be assigned to each symbolic signal name! If this variable is assigned a reference address, a Located variable (without reference address =
Unlocated variable) is received. An initial value may also be provided for each variable, which will be transferred into the PLC during the first load.
Data type editor (DDT editor)
The Data type editor
may be used to define specific Derived Data
Types (Derived Data Type = DDT).
Derived Data Types combine several Elementary data types (BOOL, WORD, …) in one data record. It is not only the same data types which may be combined as
ARRAY, but also various data types may be combined as STRUCT. In Concept, a number of Derived Data Types are already available, which for instance may be used for DFBs.
DDTs appear in DFBs or EFBs only as a connection, i.e. for instance in FBD a variable input is only necessary in the block. It is thus recommended that frequently recurring groups of elementary data types (and also DDTs) be defined as DDTs, in order to improve accessibility of an application.
The definition appears in text form, and all the standard Windows services and some additional commands for text-processing are available. The size of a data type file is 64 Kbyte maximum.
Reference data editor
The Reference data editor
may be used in online mode to display the variable value, to force variables and to set variables. There is also the possibility of separating variables from the process. Inputs may be saved in a data file and be reused.
36
33002204 12/2010
General description of Concept
Online functions
Available online functions
After the programming device has been linked to the PLC, a range of online Startup z z z z and maintenance functions become available.
z the program on the programming device is compared with the program on the
PLC the PLC can be started and stopped
Object information is displayed
Programs can be loaded, sections can be changed online and loaded z
Variable values can be entered online
Animation mode shows the program with its current signal states
Operating and monitoring
Declaration of special operating and monitoring variables is not necessary in
Concept. The variables to be visualized can be identified as such in the Variable
Editor and then be exported into a ModLink or FactoryLink configuration data file.
This data file can be used for visualizing.
33002204 12/2010
37
General description of Concept
Communication
Description
Communication between the PLC and another Modbus-, Modbus Plus-, SY/MAX-
Ethernet or TCIP/IP Ethernet node is projected using IEC languages (FBD, LD,
SFC, ST, IL) with the EFBs from the block library COMM. The instruction MSTR may be used with the programming language LL984 to construct these communications.
A peer to peer transfer of register contents is possible using the peer cop, independent of these blocks/instructions.
Communication is projected between the PLC and the decentralized I/O via the
INTERBUS by simply entering the NOA module in the component list and loading a loadable (ULEX).
Communication is projected between the programming device and a PLC via
Ethernet by simply entering and parametering the appropriate couple module in the component list.
38
33002204 12/2010
General description of Concept
Secure Application
At a Glance
In several areas of industry, the need for security demands regulated access to
PLCs, recording program changes and archiving those recordings. Following a standardized procedure ensure that records may not be falsified. To enable these requirements, new features have been implemented in Concept that ensure secure application. To guarantee that all of these parameters are defined, the user can activate the Secure Application check box in the Project → Project Properties dialog. Concept will then ensure that all of these parameters are set and that their contents remain valid. The project is then indicated as being a secure application, and this information is included in the information that is downloaded to the PLC.
Secure Application
The secure application is defined in the Project → dialog by activating the Secure Application check box. These settings are then exported, imported, read and loaded to the PLC.
NOTE: When the secure application is activated, a NOT EQUAL status is generated and required reloading to the PLC. Unchecking the check box also creates a NOT
EQUAL status so that loading is again required as well. If Concept is connected to a PLC that is already defined with the "Secure Application" setting, the setting is automatically accepted in Concept in case of upload the controller.
The log file is stored in the Concept directory and has the name of the current date
(YEARMONTHDAY.ENC, e.g. 20020723.ENC). The path of the log file can be defined in dialog Common Preferences . If no path is defined then Concept uses the default log path (Concept directory, e.g. C:\CONCEPT).
z z z z z z z z
Among other things, logging write-access to the PLC can record the following data:
Section name
EFB/DFB Instance name, FB Type name
Pin Name
[Variable name] [Literal] [Address]
Old value
New value
User name (if the Concept (Login) password is activated in Concept Security)
Data and Time (see also Address format in LOG file [Logging], page 1116
)
Requirements
33002204 12/2010 z z z z
The secure application can only be activated if the following prerequisites are met: can only be used with 140 CPU 434 12A or 140 CPU 534 14A/B at least one IEC section (if no IEC section exists then the download is aborted.)
Offline mode ( Online → )
Supervisor Rights (see Concept under Help → About... → )
39
General description of Concept
Activation Combination for Secure Application
Various Activation Combinations for Secure Application:
"Secure
Application" activated in
Concept
Not activated
Not activated
"Secure
Application" loaded to PLC
Not activated
Activated
Reaction to connection with the PLC
Activated
Activated
Not activated
Activated
Normal operation without secure application
When uploading, the Secure Application check box is activated in Concept and encrypted logging is activated.
Download required because the status is NOT
EQUAL.
Normal operation with secure application (e.g. encrypted logging).
Reading the Encrypted Log File
To read the encrypted log file, the View tool is opened automatically in the View
Logfile dialog.
NOTE: If an encrypted log file has been improperly modified in any way, the log is decoded as much as is possible, and the lines that have been modified will remain unreadable. The first line will contain the message: "This log file has been modified".
40
33002204 12/2010
General description of Concept
Utility program
At a Glance z z z z z z z z
In addition to Concept the following range of utility programs are available:
Concept DFB
Concept EFB
Concept SIM (16 bit)
Concept PLCSIM32 (32 bit)
Concept Security
Concept WinLoader
Concept Converter
Concept ModConnect
Concept DFB
33002204 12/2010
Concept DFB is used to create DFBs (Derived Function Blocks)
and
Macros
.
DFBs (Derived Function Blocks)
DFBs can be used for setting both the structure and the hierarchy of a program. In programming terms, a DFB represents a subroutine.
DFBs can be created in the programming languages FBD, LD, IL, and ST. In
Concept, DFBs can be called up in any programming language, regardless of the programming language they were created in. One or several existing DFBs can be called up within one DFB, with the called-up DFBs themselves able to call up one or several DFBs.
Macros
Macros are used to duplicate frequently used sections and networks (including their logic, variables and variable declaration).
z z z z z z z z z z
Macros have the following properties:
Macros can only be created in the programming language FBD.
Macros only contain one section.
Macros can contain a section of any complexity.
In programming terms, there is no difference between an instanced macro, i.e. a macro inserted into a section and a conventionally created section.
z
It is possible to call up DFBs in a macro.
It is possible to declare macro-specific variables for the macro.
It is possible to use data structures specific to the macro
Automatic transfer of the variables declared in the macro.
Initial values are possible for the macro variables.
It is possible to instance a macro many times in the entire program with different variables.
Section names, variable names and data structure names can contain the character ~ as an exchange marking.
41
General description of Concept
Concept EFB
The optional tool Concept EFB can be used to generate, in C++ programming language, your own application specific Functions and Function Blocks (EFBs) and to integrate them in the form of libraries with groups in your version of Concept.
The operating rules for these user-defined blocks (UDFBs) are identical to those for standard EFBs.
It is, for instance, recommended that complex program parts with a high number of calls and program parts, whose solution is to remain hidden from the user, e.g. special technology objects etc. be generated using Concept EFB.
NOTE: Concept EFB is not included as part of the Concept package and may be ordered in addition.
Concept SIM (16 bit)
The 16 bit simulator Concept SIM
is available for simulating a PLC, i.e. to test your user program online without hardware. Concept SIM simulates a coupled PLC via Modbus Plus.
NOTE: The simulator is only available for the IEC languages (FBD, SFC, LD, IL and
ST).
Concept PLCSIM (32 bit)
The 32 bit simulator Concept PLCSIM32
is available for simulating a PLC, i.e. to test your user program online without hardware. Concept PLCSIM32 simulates a PLC coupled via TCP/IP, where the signal states of the I/O modules can also be simulated. Up to 5 programming devices can be coupled to the simulated
PLC at the same time.
NOTE: The simulator is only available for the IEC languages (FBD, SFC, LD, IL and
ST).
Concept Security
Concept Security
can be used to assign access. Access signifies that the function of Concept and its utility programs is limited depending on the user.
The access defined for one user is applicable to all Concept installation projects. A maximum of 128 users may be defined.
Concept Converter
Projects, DFBs, macros, and data structures (Derived Data Types), created for an earlier version of Concept, can be converted without hassle to work in the current version of concept in the Concept Converter
.
42
33002204 12/2010
General description of Concept
Concept EXECLoader
The Concept EXECLoader can be used to load Exec data files onto the PLC.
Concept ModConnect
Concept-ModConnect
can be used to extend the configurator for new (specific) I/O modules.
33002204 12/2010
43
General description of Concept
44
33002204 12/2010
New Performance Attributes
33002204 12/2010
New Performance Attributes of
Concept 2.6 in Comparison with
Concept 2.5
2
Overview
This Chapter describes the new performance attributes of Concept 2.6 in comparison with Concept 2.5.
What's in this Chapter?
This chapter contains the following topics:
Topic
New Performance Attributes of Concept 2.6 Compared with Concept 2.5
New performance attributes of Concept 2.6 SR2 in comparison with Concept
2.6 SR1
New performance attributes of Concept 2.6 SR3 in comparison with Concept
2.6 SR2
Page
33002204 12/2010
45
New Performance Attributes
New Performance Attributes of Concept 2.6 Compared with Concept 2.5
Highlights z z z
New general performance attributes:
Interrupt sections
Global variables
Security features
New EFBs
New EFBs in the SYSTEM library:
New EFBs
I_LOCK
I_UNLOCK
I_MOVE
ISECT_OFF
ISECT_ON
ISECT_STAT
PRJ_VERS
GET_IEC_INF
RES_IEC_INF
Description
Disable all interrupt sections
Enable all interrupt sections
Interrupt protected assignment
Disable specific interrupt sections
Unlock a specific interrupt section
Interrupt section status
States project name and version
Read IEC status flags
Reset IEC status flags
New EFBs in the COMM library:
New EFBs
PORTSTAT
Description
States Modbus Port status
Start Concept
New features when starting Concept:
New performance attributes
Automatic connection to every desired PLC
When starting Concept using the
CCLaunch tool, a connection is made to every desired PLC
Description
Startup using the Concept Project Symbol creates automatic connection to any desired PLC. This connection is defined by the Command line parameter
.
In large networks, a topology file is created and is then used in the CCLaunch tool. You can use this to create a complete MB+ Routing path
, which then creates a connection to the PLC automatically.
46
33002204 12/2010
New Performance Attributes
New performance attributes
Displays list of previously opened
Projects/DFBs
Archive content display
Description
When starting Concept a list of previously opened
Projects/DFBs (max. 4) is displayed in the File main menu.
When unpacking an archived project, all archived files are shown first.
Animation
12 different color schemes for animation in the FBD, IL, ST, SFC and LD editors:
New performance attributes
CONCEPT.INI:
[Colors]
AnimationColors= (0-12)
Description
Defines the color scheme for online animation in all editors.
Reference data editor
New feature in the reference data editor:
New performance attributes Description
Address format IEC (QW0000X) The IEC (QW0000X) address format can be displayed.
Online functions
New online features:
New performance attributes
Quantum password protection
Event sections
Event viewer
Description
Quantum PLC is write protected by entering a password.
Online diagnostics are displayed for Interrupt sections.
Error descriptions can be defined in a project specific INI file
that should appear in the event viewer ( Online
→
).
Message window
New performance attributes in the Windows menu:
New performance attributes
Save messages
Description
After messages are displayed they can be saved to file using the Save Messages...
(main menu Window ) menu command.
33002204 12/2010
47
New Performance Attributes
New CPU
New CPU:
PLC family
Atrium
New Module
New Quantum module:
Module
140-NOE-771-01
140-NOE-771-11
140-CPS-114-20
140-CPS-124-20
140-NOG-111-00
140-NWM-100 00
New Momentum module:
Module
170-ANR-120-91
Project Browser
Description
CPU 180-CCO-241-11
Description
Ethernet module without Hot Standby features.
Ethernet module (Factory Cast) without Hot Standby features.
Power supply module
Power supply module
1/SFB Master module
Ethernet module (Factory Cast HMI)
Description
Analog/Digital Input/Output module
New features in the Project browser:
New performance attributes
Display interrupt sections
Show detailed view
Description
When I/O event sections and Timer event sections are used, they are displayed in the Project browser structure.
The Project browser window is split vertically, and a second window displays the substructure (e.g. DFBs,
Transitions sections, etc.) of the selected elements in a structure tree.
48
33002204 12/2010
New Performance Attributes
Analyze section
New features when analyzing sections:
New performance attributes
Analyze interrupt sections
Description
There is now an additional analysis for Interrupt sections.
Analyzing global variables in DFBs There is an analysis for global variables in DFBs.
DFB
New features for DFB programming:
New performance attributes
Located variables
Description
Located variables are permitted in DFBs when the option in the IEC Extensions dialog box is enabled.
Global variables can be created throughout the program with located variables in DFBs.
Data types
New features for DFB programming:
New performance attributes Description
View comments for data structure elements
(larger than 64 Kbytes), page 572
Comments for data type components defined in data type files (*.ddt, *.dty) are displayed in: z z z
Editors status line
Variables editor for the definition of initial values
Inspect Animation field
The 64 kb restriction is not imposed for local data type definition with the introduction of unlocated Include files.
33002204 12/2010
49
New Performance Attributes
Configuration
New features in the Configurator:
New performance attributes
1/SFB Coupler configuration
Description
Required to provide support for the A500/A350 I/O module. Extended I/O range up to 160 input/output words.
Quantum security parameter The following parameters can be defined in the new dialog box (submenu of the Config. Extensions ): z z z
Secure data area
Network write restrictions
Enable the Auto-Logout option
Interbus configuration with Atrium The Interbus configuration is done with Atrium CPUs
180 CCO 241 01 (= 1 INTERBUS) and 180 CCO 241 11
(= 2 INTERBUS).
Logging (*.LOG, *.ENC)
New features for DFB logging:
New performance attributes
Additional contents
New Date/Time format
Encrypting the log
Description
When logging PLC write access, modifications made to variable and literal values are displayed in addition.
By activating the check box Universal Date Format in dialog Common Preferences (setting also affects the
CONCEPT.INI file) the format can be changed. The month is then stated within Concept with 3 characters and in English. Example: 24-Dec-2002 14:46:24
By activating the check box Encrypt Logfile in dialog
Common Preferences (or indirectly using the check box Secure Application in dialog Project Properties ) login the write access to the PLC will be encrypted. The encrypted file contains the file extension *.ENC.
Secure Application
New features for a secured application:
New performance attributes
Application backup
Description
If you activate the check box in the Project →
Properties dialog box, program modifications are automatically logged and encrypted in a *.ENC file.
These settings can be loaded using Export/Import and transferred to the PLC.
50
33002204 12/2010
New Tools
New Performance Attributes
New Tools for Concept:
New Tool
CCLaunch
View Tool
Description
This tool is used for making an automatic connection
with a PLC in a large network.
This tool allows you to view encoded LOG files (*.ENC).
It is started automatically with menu instruction View
Logfile if log encrypting has been activated.
33002204 12/2010
51
New Performance Attributes
New performance attributes of Concept 2.6 SR2 in comparison with Concept 2.6
SR1
New EFBs
New EFBs in the IEC library:
New EFBs
CMPR
MBIT with pointer
SEARCH
SENS with pointer
XXOR
Description
Compares the Bit pattern of Matrix A to that of Matrix B.
Changes the bit position in a data matrix.
Searches the register in a source table for a specific bit pattern.
Checks the query value of a specific bit position in a data matrix.
Performs a Boolean Exclusive-OR-Operation with the bit patterns of the source and target matrix.
Search/Replacement of FFBs
New features when searching for/replacing FFBs:
New feature Description
FFB type is replaced in all sections (only for DFBs)
In the dialog box Replace FFB Type by activating the new check box Replace in all sections the selected FFB type can be replaced in all sections (only for DFBs).
Create a new project
New features when generating a new project:
New feature
Specify project path when generating a new project
Description
When generating a new project ( File
→
) you can define a new path or accept the standard path again.
52
33002204 12/2010
New Performance Attributes
New options in the upload and loading dialog box
New options in the upload and loading dialog box:
New features
New check boxes in the dialog box Load into the
PLC : z State RAM + Initial
Values z Only state RAM
New check boxes in the dialog box PLC Upload : z z
Upload State RAM +
Initial Values
Only upload State
RAM
Description
By activating the check box State RAM + Initial Values at first all initial values of the Located 4x-Variables are copied from the
Variable Editor into the state RAM mirror. Then, the initial values and all blocked 0x and 1x-I/O-bits are loaded from the state
RAM mirror into the PLC.
By activating the check box State RAM Only the initial values of the Located 4x-Variables and all blocked 0x and 1x I/O bits are loaded from the state RAM mirror into the PLC.
By activating the check box Upload State RAM + Initial Values at first all Located 0x-, 1x, and 4x-values are read from the PLC and saved in the state RAM mirror. Then, the initial values of the
4x-variables are overwritten with the value from the state RAM mirror.
With the activation of the check box Only read state RAM all
Located 0x-, 1x- and 4x-values are read from the SPS, and saved in the state RAM mirror.
INI files
New settings in the CONCEPT.INI:
New Settings Description
Define overwriting of the uploaded state RAM values
Define start of the RDE-
Animation
Exclusion of all or global
DFBs from Online-Backup
In the line [RDE] of the CONCEPT.INI you can define that uploaded state RAM values are not overwritten by online operations in the RDE.
In the line [RDE] of the CONCEPT.INI you can define that the
RDE animation is automatically started when opening a table.
In the line [Backup] of the CONCEPT.INI you can define that after the Online-Backup the directories "DFB" and/or
"DFB.GLB" are not present in the backup directory.
New settings in the Projectname.INI:
New Setting
Define path and backup files
Description
In the line [Backup] of Projectname.INI, you can output a Batchfile (EXE-file) for the Online-Backup-Operation, by which you perform additional backups e.g. for another PC.
33002204 12/2010
53
New Performance Attributes
Multiple Address Assignment
New feature for multiple address assignment:
New feature
Cleaning up multiple assignment of a single address by different variable names
Description
In the dialog box Multiple Address Assignments variable names that are all assigned to the same address are replaced or renamed. In the end, only one variable name is assigned to this address.
54
33002204 12/2010
New Performance Attributes
New performance attributes of Concept 2.6 SR3 in comparison with Concept 2.6
SR2
New menu command
New menu command:
New menu command
Options →
Description
Use this menu command to open a menu to execute additional applications or help programs.
33002204 12/2010
55
New Performance Attributes
56
33002204 12/2010
Project structure
33002204 12/2010
Project structure
3
Overview
This chapter describes the structure of projects in Concept.
What's in this Chapter?
This chapter contains the following topics:
Topic
Project Structure and Processing
Programs
Sections
Configuration data
Page
33002204 12/2010
57
Project structure
Project Structure and Processing
Structure of a project
The creation of a PLC program with Concept is carried out hierarchically in a project using PLC configuration
and Program
. The program is divided into section groups and Sections
.
The PLC configuration and required program parts can be created in any order within a project (top down or bottom up).
Structure of a project:
Processing an IEC/LL984 project
This table describes the processing of a LL984/IEC project (Quantum):
Step
1
2
Logic processor
Overhead, e.g. communication with
NOM, NOE etc.
Executing LL984 segment 1
I/O processor
-
3 Executing LL984 segment 2
Writing outputs calculated in segment n
Reading inputs required in segment 2
Writing outputs calculated in segment 1
Reading inputs required in segment 3
58
33002204 12/2010
33002204 12/2010
Project structure
Step
4
...
n n+1 n+2 n+3 m
Logic processor
Executing LL984 segment 3
I/O processor
Writing outputs calculated in segment 2
Reading inputs required in segment 4
...
...
Executing LL984 segment n (n =< 32) Writing outputs calculated in segment n-1
Executing IEC section 1
Executing IEC section 2
Executing IEC section 3
..
Executing IEC section n (n =< 1600) and back to stage 1
-
-
-
-
Reading inputs required in segment 1
-
1 The overhead is executed in this stage (e.g. communication with the coupling modules NOM, NOE).
2 - 4 In these stages, the logic for the LL984 sections is executed by the logic processor in segments 1-3 (corresponding to the settings in the Segment scheduler
).
At the same time the I/O processor transfers the output values calculated in the respective previous segment to the hardware and the hardware reads the input values required for the next respective segment.
n In this step, the logic processor in segment n runs the LL984 sections logic.
At the same time the I/O processor transfers the output values calculated in the previous segment to the hardware and the hardware reads the input values required for segment 1.
Note: The output values calculated in this segment are only executed on next execution of stage 2, i.e. after the IEC logic and the overhead have been processed. Therefore no time critical logic should be executed in this segment.
n+1 - m The logic processor runs the IEC sections logic in these steps.
It then "jumps back" to stage 1.
Note: No hardware signals are read or written. The values calculated/read in stages 2 to n are used exclusively. The outputs calculated in these stages are transferred in stages 2 to n (corresponding to the settings in the segment scheduler).
59
Project structure
Processing a LL984 project
This table describes the processing of a LL984 project (Quantum):
Step
1
2
3
4
...
n
Logic processor
Overhead, e.g. communication with
NOM, NOE etc.
Executing LL984 segment 1
I/O processor
-
Executing LL984 segment 2
Executing LL984 segment 3
...
Executing LL984 segment n (n =< 32) and back to stage 1
Writing outputs calculated in segment n
Reading inputs required in segment 2
Writing outputs calculated in segment 1
Reading inputs required in segment 3
Writing outputs calculated in segment 2
Reading inputs required in segment 4
...
Writing outputs calculated in segment n-1
Reading inputs required in segment 1
1 The overhead is executed in this stage (e.g. communication with the coupling modules NOM, NOE).
2 - 4 In these stages, the logic for the LL984 sections is executed by the logic processor in segments 1-3 (corresponding to the settings in the Segment scheduler
).
At the same time the I/O processor transfers the output values calculated in the respective previous segment to the hardware and the hardware reads the input values required for the next respective segment.
n In this step, the logic processor in segment n runs the LL984 sections logic.
At the same time the I/O processor transfers the output values calculated in the previous segment to the hardware and the hardware reads the input values required for segment 1.
It then "jumps back" to stage 1.
Note: The output values calculated in this segment are only processed the next time stage 2 is completed, i.e. after the overhead has been processed. Therefore no time critical logic should be executed in this segment.
Processing an IEC project
This table describes the processing of an IEC project (Quantum):
Step
1
Logic processor
Overhead, e.g. communication with
NOM, NOE etc.
I/O processor
-
60
33002204 12/2010
Project structure
Step
2
3
4
...
n n+1 n+2 n+3 m
Logic processor
-
-
-
...
-
Executing IEC section 1
Executing IEC section 2
Executing IEC section 3
..
Executing IEC section n (n =< 1600) and back to stage 1
I/O processor
Writing outputs allocated to segment 1
Reading inputs allocated to segment 1
Writing outputs allocated to segment 2
Reading inputs allocated to segment 2
Writing outputs allocated to segment 3
Reading inputs allocated to segment 3
...
Writing outputs allocated to segment n
(n =< 32)
-
-
-
-
-
Reading inputs allocated to segment n
(n =< 32)
1 The overhead is executed in this stage (e.g. communication with the coupling modules NOM, NOE).
2 - n The hardware signals from the allocated modules respective segments are written and read by the I/O processor in these stages (corresponding to the settings in the Segment scheduler
).
n+1 - m The logic processor runs the IEC sections logic in these steps.
It then "Returns" to stage 1.
Note: No hardware signals are read or written. The values read in stage 2 to n are used exclusively. The outputs calculated in these stages are transferred in stages 2 to n (corresponding to the settings in the Segment manager).
Processing an IEC project
This table describes the processing of an IEC project (Quantum):
Step
1
2
Logic processor
Overhead, e.g. communication with
NOM, NOE etc.
-
I/O processor
-
3 -
Writing outputs allocated to segment 1
Reading inputs allocated to segment 1
Writing outputs allocated to segment 2
Reading inputs allocated to segment 2
33002204 12/2010
61
Project structure
62
Step
4
HE1
HE2
...
HE64
TE1
TE2
...
TE16
...
n n+1 n+2 n+3 m
Logic processor
-
I/O processor
Writing outputs allocated to segment 3
Reading inputs allocated to segment 3
1. I/O event section, spontaneous execution, when Hardware Interrupt occurs
2. I/O event section, spontaneous execution, when Hardware Interrupt occurs
...
64. (last) I/O event section, spontaneous execution, when
Hardware Interrupt occurs
-
...
-
1. Timer event section, only executed when time interrupt occurs
2. Timer event section, only executed when time interrupt occurs
...
-
-
...
16. Timer event section, only executed when time interrupt occurs
-
...
-
...
Writing outputs allocated to segment n
(n =< 32)
Executing IEC section 1 (cyclically)
Executing IEC section 2 (cyclically)
Executing IEC section 3 (cyclically)
..
Executing IEC section n (n =< 1600) and return to stage 1
-
-
-
-
-
Reading inputs allocated to segment n
(n =< 32)
1 The overhead is executed in this stage (e.g. communication with the coupling modules NOM, NOE).
2 - n The hardware signals from the allocated modules respective segments are written and read by the I/O processor in these stages (corresponding to the settings in the Segment scheduler
).
n+1 - m The logic processor processes the IEC sections logic in these steps.
It then "Returns" to stage 1.
33002204 12/2010
Project structure
Note: No hardware signals are read or written. The values read in stage 2 to n are used exclusively. The outputs calculated in these stages are transferred in stages 2 to n (corresponding to the settings in the Segment scheduler).
HE1 - HE64 If a hardware interrupt signal specially assigned to a section changes its value according to its parameter configuration, the cyclical processing and if necessary the processing of a Timer event section is immediately stopped and returned to the I/O event section. Once all event sections (and Timer event sections) are processed, the cyclical processing is continued at the point where
the interrupt occurred. (See also chapter " I/O Event Sections, page 1142 ")
TE1 - TE16 When a specially configured Timer interrupt signal for a section occurs, cyclical processing is immediately stopped and jumps to the Timer event section.
Once Timer event sections are processed, the cyclical processing is continued at the point where the interrupt occurred as long as there are no further instructions for Timer event sections. (See also chapter "
Timer Event Sections, page 1129
")
33002204 12/2010
63
Project structure
Programs
Structure of a program
A program consists of one or more Sections
or section groups.
Section groups can contain sections and other section groups. Section groups can be created exclusively and filled using Project → Project browser . Sections describe the entire systems mode of operating.
Moreover the variables, constants, literals and direct addresses are managed within the program.
Variables
Variables are used to exchange data within a section, between several sections and between the program and the PLC.
Variables are declared using the menu command Project → .
If the variable with this function is assigned an address, it is called a Located variable. If the variable has no address assigned to it, it is called an Unlocated variable. If the variable is assigned with a derived data type, it is called a Multielement variable.
There are also constants and literals.
The following table provides an overview of the various types of variables:
Variable type
Located variables
Unlocated variables
Description
Located variables are allocated a State RAM address (reference address 0x, 1x, 3x,4x). The value of this variable is saved in the
State RAM and can be changed online using the Reference data editor. These variables can be addressed using their symbolic names or using their reference address.
All PLC inputs and outputs are connected to the State RAM. The program can only access peripheral signals attached to the PLC via located variables. Access from external pages via Modbus or
Modbus Plus interfaces of the PLC, e.g. from visualization systems can be made using located variables.
Unlocated variables are not assigned a State RAM addresses.
They therefore do not occupy any State RAM addresses. The value of this variable is saved internally in the system and can be changed using the Reference data editor. These variables are only addressed using their symbolic names.
Signals requiring no peripheral access, e.g. intermediate results, system tags etc, should primarily be declared as unlocated variables.
64
33002204 12/2010
Project structure
Variable type Description
Multi element variables A variable which is assigned a Derived data type.
Structured variables
A distinction is made here between Structured variables and Array variables.
Variables to which a Derived data type defined using a STRUCT
(structure) is assigned.
Array variables
A structure is a collection of data elements with generally different data types (Elementary data types and/or Derived data types).
A variable which is assigned a defined data type with the key word
ARRAY.
An array is a collection of data elements with the same data type.
Variable start behavior
In start behavior of PLCs there is a distinction between cold restarts and warm restarts: z Cold restart
Following a cold restart (loading the program with Online → ) all variables (irrespective of type) are set to "0" or their initial value if available.
z Warm restart
In a warm restart (stopping and starting the program or Online → changes ) different start behaviors are valid for located variables/direct addresses and unlocated variables: z z
Located variables/direct addresses
In a warm restart all 0x, 1x and 3x registers are set to "0" or their initial value if available.
The buffered coils are an exception to this. Buffered coils retain their current value (storage behavior).
4x registers retain their current value (storage behavior).
Unlocated variables
In a warm restart all unlocated variables retain their current value (storing behavior).
This varying behavior in a warm restart leads to peculiarities in the warm restart behavior of set and reset functions.
z Set and Reset in LD and IL
Warm restart behavior is dependent on the variable type used (storage behavior in use of unlocated variables; non storage behavior in use of located z variables/direct addresses)
SR and RS Function Blocks in FBD, LD, IL and ST
These function blocks work with internal unlocated variables and therefore always have a storage behavior.
33002204 12/2010
65
Project structure
Constant variables
Constants are unlocated variables assigned a value, which cannot be modified by the logic program (read only).
Literals (values)
Literals are used to describe FFB inputs, and transition conditions etc using direct values. These values cannot be overwritten by the program logic (read only).
The values of literals can be changed online.
There are two different types of literal; generic and standardized.
The following table provides an overview of the various types of literals:
Literal
Generic literals
Standardized literals
Description
If the literal’s data type is not relevant, simply specify the value for the literal. In this case,
Concept automatically assigns a suitable data type to the literal.
If you would like to manually determine a literal’s data type, this may be done using the following construction: "Data type name"#"Literal value"
For example
INT#15 (Data type: Integer, value: 15),
BYTE#00001111 (Data type: Byte, value:
00001111)
REAL#23.0 (Data type: Real, value: 23.0)
To assign the data type REAL the value may also be specified in the following manner:
23.0.
Entering a comma will automatically assign the data type REAL.
66
33002204 12/2010
Project structure
Direct addresses
Direct addresses are memory ranges in the PLC. They are located in the State RAM and can be assigned Input/Output modules.
Direct addresses can be entered or displayed in various formats. The display format is specified in the dialog box Options Preferences Common . Setting the display format has no impact on the entry format, i.e. direct addresses can be entered in any format.
The following address formats are possible: z Standard format (400001) z
The five character address comes directly after the first digit (the Reference).
Separator format (4:00001)
The first digit (the Reference) is separated from the following five-character address by a colon (:).
z z
Compact format (4:1)
The first digit (the Reference) is separated from the following address by a colon
(:), and the leading zeros of the address are not given.
IEC format (QW1) z z z z
In first place, there is an IEC identifier, followed by the five-character address.
%0x12345 = %Q12345
%1x12345 = %I12345
%3x12345 = %IW12345
%4x12345 = %QW12345
The values of direct address can be modified online using the Reference data editor
.
Start behavior of digital outputs
Outputs that are assigned 0x registers are deleted during PLC startup. Digital outputs that assigned 4x registers keep their current value when the PLC is stopped or started.
33002204 12/2010
67
Project structure
Sections
Introduction
A program consists of one or more sections. A section describes the mode of functioning of a systems technological unit (for example a motor).
Each section has its own document window in Concept. For overview purposes it is useful to divide a very large section into several small ones. The scroll bar is used to move within a section.
The page break can be made visible for each section, so that the page format can be monitored when programming. In this way, a readable printout of the section is assured.
Section types
There are three different types of sections in Concept provided for Quantum processing.
z Cyclical section are executed in every program cycle. The reaction time depends on the cycle time and is a minimum of one cycle and maximum of two z cycles.
I/O event sections are not executed cyclically, but are started and processed spontaneously when a specially assigned Interrupt signal value changes state
(corresponding to the setting in the Configurator and Section properties). z
The 140-HLI-340-00 module provides 16 Interrupt inputs. The local backplane has space for a maximum of 4 HLI modules.
The reaction time to an I/O event generally depends on the process duration of the EFBs to be processed in the section as well as the transition times.
Timer event sections are started and processed in precise user defined intervals.
The time intervals are defined in multiples of 1ms and a Phase in the Section properties for Timer Event Sections dialog box.
The reaction time is independent of the cycle time. Reactions to outputs are also carried out in defined time intervals.
Maximum number of sections
There can be up to a maximum of 1,600 sections per program.
Programming languages
Sections can be programmed using the IEC programming languages FBD (Function
Block Diagram), LD (Ladder Diagram), SFC (Sequential Control), IL (Instruction
List), or ST (Structured Text), or in the LL984 programming language (Ladder
Logic), which resembles Modsoft. Only one of the stated programming languages is permitted to be used within a section.
68
33002204 12/2010
Project structure
Exchanging values
Values are exchanged within sections via links, variables, or direct addresses.
Values are exchanged between different sections via variables or direct addresses.
Section execution order
The LL984 sections are the first to be executed. The LL984 section vertical sequence can be defined via the Project → Configurator → Configure → scheduler...
dialog box. Once the entire LL984 section has been processed, the
IEC sections are then processed (FBD, SFC, LD, IL, ST). The execution order can be determined using either the Project → or the Project browser
dialog box.
Printing sections
Sections are divided into pages when printing out. The amount of information on these pages is dependent on the settings in the menu File → . Page division can be displayed using the menu option View → .
Section variable
A Multi-element variable is automatically generated for each IEC section (FBD, SFC,
LD, IL, and ST) and has the same name as the section. z z
This variable is SECT_CTRL data and has two elements:
The "disable" BOOL data type element for disabling sections.
The "hsbyState" BYTE data type element for displaying the Hot Standby status of sections.
If the smallest bit of this element is set, the data from this section is transferred/received, see the Hot Standby User's manual . (This bit corresponds to the exclamation mark in the project browser.)
Disabling sections
The component "disable" can be used to enable/disable the section variable If the multi element address is not used or if the value 0 has been assigned to "disable", the corresponding section is executed. If "disable" is assigned the value "1", the corresponding section will not be executed. By using this variable, the execution of sections can be controlled according to events.
NOTE: If a disabled section is animated, the DISABLED status is displayed in the status bar.
33002204 12/2010
69
Project structure
CAUTION
Risk of unwanted process states.
Disabling a section does not mean that programmed outputs will be deactivated within the section if an output has already been set in a prior cycle, this status remains even after the section is disabled. The status of these outputs cannot be modified.
Failure to follow these instructions can result in injury or equipment damage.
Disabling Interrupt Sections
A specific Interrupt section can be disabled using the ISECT_OFF block. It can be enabled again using the ISECT_ON block. The section names are provided by the
SECT_CTRL control variable.
The I_LOCK block can disable all interrupt sections. They can be enabled again using the I_UNLOCK block.
NOTE: A possible interrupt on an interrupt section has no effect.
Lock section UNCONDITIONALLY (possibility 1)
The procedure for locking a section unconditionally is as follows:
Step
1
6
7
4
5
2
3
Action
Using Online
→
open the Reference data editor
.
By double clicking on a line number, open the Lookup variables dialog box.
From the area Data type first choose the option Structured and then from this list SECT_CTRL .
Result: The names of all sections are displayed.
Now select the names of the section to be locked.
Use the command button Components...
to select the ANY type components dialog box.
Select the line disable: BOOL and confirm with OK .
If the following has not been performed yet:
Create a connection between the PLC and the programming device and load your program onto the PLC.
70
33002204 12/2010
Step
8
9
Project structure
Action
Change the entry in the column Value to 1 (TRUE) to lock the section or 0
(FALSE) to enable the section.
Using Online
→
activate the animation if it is inactive.
Result: The section is disabled or enabled according to the value.
Note: Locking a section does not mean that programmed outputs will be deactivated within the section if an output has already been set in a prior cycle, this status remains even after the section has been disabled. The status of these outputs cannot be modified.
CAUTION
Risk of unwanted process states.
The entry in the column Value remains even after the reference data editor has been closed (even if the entries are not saved), or in other words, the section remains disabled and must be explicitly re-enabled via the reference data editor
(value = 0).
Failure to follow these instructions can result in injury or equipment damage.
Lock section UNCONDITIONALLY (possibility 2)
The procedure for locking a section unconditionally is as follows:
Step
1
2
3
4
5
6
Action
Using Project
→
open the Project browser
.
From Online
→
create a connection between the programming device and the PLC.
From Online
→
(if the program is in NOT EQUAL mode) or Online
→
(if in MODIFIED mode) restore the consistency between the programming device and the PLC.
Select the section to be locked from the project browser.
Activate the context menu for sections using the right mouse button, and activate
Animate enable state .
Change the enable status using the menu command Switch enable state from the context menu (right mouse button) of the selected section.
Note: Sections may only be disabled or enabled via the Project browser, if they have not already been disabled/enabled via another Section
or via the Reference data editor
.
Result: The section is locked.
Note: Locking a section does not mean that programmed outputs will be deactivated within the section if an output has already been set in a prior cycle, this status remains even after the section has been disabled. The status of these outputs cannot be modified.
33002204 12/2010
71
Project structure
Locking a section CONDITIONALLY
The procedure for locking a section conditionally (program dependent) is as follows:
Step
1
2
3
4
5
6
7
8
9
10
Action
Create the logic according to the section to be locked, for example in an FBD section.
When doing this, please note that the logic must carry a BOOL data "output" and that the section to be disabled will be disabled at logic "1".
Note: The section containing a logic for disabling/enabling other sections should not be disabled.
By double clicking on your logic’s "output", open the Connect FFB dialog box.
Use the command button Lookup...
to open the Lookup Variable dialog box.
From the area Data type first choose the option Structured and then from this list SECT_CTRL .
Reaction: The names of all sections are displayed.
By double clicking, now select the names of the section to be locked.
Select the line disable: BOOL and confirm with OK .
Result: The multi-element variable from the section to be locked (Section name.disable) now creates the "output" of the logic.
From Project → open the Section Execution Order dialog box.
Using the command buttons, ensure that the section containing the logic for locking is executed before the section to be locking is executed.
If the following has not been performed yet:
Create a connection between the PLC and the programming device.
Download your program to the PLC.
Result: When logic "1" is at the "Output" the section to be locked is not edited.
Note: Locking a section does not mean that programmed outputs will be deactivated within the section if an output has already been set in a prior cycle, this status remains even after the section has been disabled. The status of these outputs cannot be modified.
72
33002204 12/2010
Project structure
Configuration data
Description
The PLC configuration is the interface between the program and the hardware.
The configuration data consists essentially of the component list and the entry in the address field of the program.
Loadables facilitate communication with the IEC programming language and the loading of further LL984-Instructions.
33002204 12/2010
73
Project structure
74
33002204 12/2010
Creating a Project
33002204 12/2010
Creating a Project
4
Overview
This chapter describes the general procedure for the initial creation of a project. The most linear sequence possible is used here, in order to show a Concept-newcomer an easily manageable way of creating a project. Crosslinks between the Menu
Commands are of course possible. As they gain experience, users will learn shortcuts and alternatives. For more detailed information, please see the relevant chapters in the user manual.
What's in this Chapter?
This chapter contains the following topics:
Overview
Step 1: Launching Concept
Step 2: Configuring the PLC
Step 2.1: Required Configuration
Step 2.2: Optional Configuration
Step 3: Creating the User Program
Step 4: Save
Step 5: Perform Memory Prediction
Step 6: Loading and Testing
Step 7: Optimize and Separate
Step 8: Documentation
Topic
Page
75
33002204 12/2010
Creating a Project
Overview
Project Creation
The creation of a project has 8 main steps:
Step
1
2
3
4
5
6
7
8
Action
Launching Concept
Launch Concept and start a new project.
Configuring the PLC
Set the hardware configuration.
Creating the user program
Create new sections and create your program.
Save
Save your project
Perform Memory Prediction
Check the PLC memory workload.
Loading and testing the project
Create a link between the PC and the PLC. Load the project in the PLC and start it. Test the program with the Online Test Function. Now eliminate any mistakes in the program! Load the altered sections into the PLC.
Optimize and Separate
It is now advisable to optimize the program storage capacity and to reload the optimized program into the PLC. After successfully loading, testing and (if necessary) optimizing, you may disconnect the PC from the PLC. The program will now run offline.
Documenting
Create a complete set of documentation of your project.
Notes
NOTE: The steps "Configuring the PLC" and "Creating the User Program" can be performed in either order. This means that the PLC configuration can also be changed after the creation of the program.
NOTE: In order to prevent loss of data, you should save your program regularly.
76
33002204 12/2010
Creating a Project
Step 1: Launching Concept
Launching Concept
The procedure for launching Concept is as follows:
Step
1
2
3
Action
Double click on the Concept icon to launch Concept.
Select File
→
.
You can specify a new project path or accept the standard project path with the project name namenlos.prj
.
Result: The new project is opened.
Note: If you select the standard project path with the project name namenlos.prj
, you can save this project with a name at a later time Step 4:
Save, page 88 . A saved project can be invoked with the
Open Project...
, or by using its project icon.
Note
NOTE: For additional steps please note the settings in the submenu Options →
Preferences !
Resume
Now proceed with Step 2: Configuring the PLC
.
33002204 12/2010
77
Creating a Project
Step 2: Configuring the PLC
What should be configured?
Using Project → PLC configuration configure the entire hardware configuration for your project.
Required Configuration
NOTE: The PLC type must first be set! All further configurations can then be executed independently of the processing sequence.
z z z z
The following configurations are necessary for the configuration:
Specifying the type of PLC (minimum configuration), page 79
Set memory partitions, page 79
Optional Configuration z z z z z z
The following configurations are to be used according to the project:
Set Modbus communication, page 81
Set Peer Cop communication, page 82
ASCII messages (only for 984 LL), page 83
78
33002204 12/2010
Creating a Project
Step 2.1: Required Configuration
Precondition
The PLC type must first be set! All further configurations can then be executed independently of the processing sequence.
Specifying the type of PLC (minimum configuration)
The procedure for specifying the type of PLC (minimum configuration) is as follows:
Step
1
2
3
4
5
6
Action
Select Project → .
Response: The PLC configuration window is opened, this contains further menu commands for hardware configuration.
Select the PLC Selection menu command from the list.
Response: The PLC selection dialog is opened.
From the PLC family list select your PLC type.
Select your CPU from the CPU/Executive list.
From the Runtime list select the Enable status.
Response: It is possible to program sections in IEC languages (FBD, LD, IL and
ST).
Note: In the Runtime list, the status Not available , Disabled or Only 984 is displayed, then the selected CPU does not support any IEC programming languages. If in the list the status Only IEC is displayed, then the selected CPU exclusively supports IEC languages and these do not have to be explicitly enabled.
With simple tests and programs the configuration can now be exited and the procedure continued from
Step 3: Creating the User Program, page 85
.
Set memory partitions
The procedure for setting the memory partition is as follows:
Step
1
2
3
Action
Select Project
→
.
Response: The PLC configuration window is opened, this contains further menu commands for hardware configuration.
Select the PLC memory partition menu command from the list.
Response: The PLC memory partition dialog is opened.
In the Discretes and Words ranges select the probable number of I/O flag bits and I/O words, to be required by the user program
Note: The maximum address range, that must not be exceeded, can be read on the right-hand side of the dialog.
33002204 12/2010
79
Creating a Project
Install loadables
The procedure for installing the loadables is as follows:
Step
1
2
3
4
5
Action
Select Project → .
Response: The PLC configuration window is opened, this contains further menu commands for hardware configuration.
Select the Loadables menu command from the list box.
Response: The Loadables dialog is opened.
Select the loadable in the Available: list.
Note: Loadables are assigned in the
Select the Install => command button.
Response: The selected loadable is moved to the Installed: field.
Repeat the steps 3 and 4 until all the loadables required have been installed.
Set I/O map
The procedure for setting the I/O map is as follows:
Step
1
2
3
4
5
6
7
8
Action
Select Project → .
Response: The PLC configuration window is opened, this contains further menu commands for hardware configuration.
Select the I/O map menu command from the list.
Response: The I/O map dialog is opened.
Select the Supervision time column and enter a time, within which a communication exchange must take place. If this time is exceeded, an error message appears.
Select the Edit... command button.
Response: The dialog for entering modules is opened.
In the Module column, select the ...
command button.
Response: The I/O Module Selection dialog is opened.
In the Modules column, select the module.
Response: The module is displayed in the current slot.
Select the Input start and/or Output start columns and enter the first address of the occupied input and/or output reference range for the module.
Select the module and choose the Params command button.
Response: If the module has a parameter dialog, you can define the parameter
(e.g. disconnect behavior, data format, measuring range) here.
Resume
Now proceed with Step 3: Creating the user program
.
80
33002204 12/2010
Creating a Project
Step 2.2: Optional Configuration
General Information
The following configurations do not need to be executed urgently, but they offer extended functions.
Set head setup
The procedure for specifying the remote I/O is as follows (this procedure is optional for minimum configuration):
Step
1
2
3
4
8
9
5
6
7
Action
Select Project
→
.
Response: The PLC configuration window is opened, this contains further menu commands for hardware configuration.
Select the I/O map menu command from the list.
Response: The I/O map dialog is opened.
Select the Head setup...
command button.
Response: The Head Setup dialog is opened.
Enter the slots for the RIO or NOM modules.
Response: Return to the I/O map dialog.
Select the head setup in the Go To list.
Select an empty line (last line) in the table, and select the Insert command button.
Response: In the Type column another I/O station is entered.
Select the Drop column and enter the station number.
Note: Only as many remote I/O stations can be configured as there are segments registered in the segment scheduler.
Select the head setup in the Go To list for the 2nd drop.
Next, carry out steps 3 to 6 of the
Set I/O map, page 80 procedure.
Set Modbus communication
To set the Modbus communication (Quantum slave, terminal, printer, etc.) proceed as follows:
Step
1
2
3
Action
Select Project → .
Response: The PLC configuration window is opened, this contains further menu commands for hardware configuration.
Select the Modbus Port settings menu command from the list.
Response: The Modbus port settings dialog is opened.
Make the corresponding settings.
33002204 12/2010
81
Creating a Project
Set Peer Cop communication
If a Modbus Plus link exists, the Peer Cop functionality is able to transfer state RAM data globally or directly between several nodes on a local network. The procedure for setting the Peer Cop communication is as follows:
Step
1
2
3
4
5
6
7
Action
Select Project → .
Response: The PLC configuration window is opened, this contains further menu commands for hardware configuration.
Select the Config. Extensions → list.
Response: The Select extensions dialog is opened.
Check the Peer Cop box.
Response: Return to the PLC configuration window and the Peer Cop menu command is now available.
Select Config. Extensions → .
Response: The Peer Cop dialog is opened.
In the Go To range select the local bus devices, and enter the slot.
Select in the Global range the Receive...
and Send...
command buttons to define the destination and source addresses of the transmission data and/or the address of the other bus devices.
Select in the Specific range the Receive...
and Send...
command buttons to define the destination and source addresses of the transmission data and/or the address of the other bus devices.
Set data protection
Address ranges of coils and holding registers can be protected from being overwritten by external signals. The procedure for setting the data protection is as follows:
Step
1
2
3
4
5
Action
Select Project
→
.
Response: The PLC configuration window is opened, this contains further menu commands for hardware configuration.
Select the Config. Extensions → .
Response: The Configuration extensions dialog is opened.
Check the Data protection box.
Response: Return to the PLC configuration window and the Data protection menu command is now available.
Select Config. Extensions → .
Response: The Data protection dialog is opened.
Select the range for the coils and holding registers. This range should contain write-protection.
82
33002204 12/2010
Creating a Project
Various PLC settings
Diverse internal PLC data can be evaluated, a watchdog timeout for the user program can be specified, the time windows for the communication (I/O time disk) parameterized and the multiple assignment of outputs authorized. The procedure for setting the PLC settings is as follows:
Step
1
2
3
4
5
6
Action
Select Project
→
.
Response: The PLC configuration window is opened, this contains further menu commands for hardware configuration.
Select the Specials menu command from the list.
Response: The Specials dialog is opened.
Check the Battery coil , Timer register and Time of Day check boxes and enter an address in the corresponding text boxes.
Check the Allow Duplicate Coils check box and enter the address from which this should be allowed in the text box..
In the Watchdog timeout (ms*10): text box enter a numeric value between 2 and 255 (ms). This enables you to set an impulse watchdog for the user program.
Response: As soon as the count pulses exceed the specified time, an error message appears.
In the Online Editing Timeslice (ms): text box enter a numeric value between
3 and 100 (ms). This enables you to define a time for executing the multi-cycle edit functions (paste, delete, find etc.)
ASCII messages (only for 984 LL)
To set the ASCII messages (only for 984LL), execute the following steps:
Step
1
2
3
4
5
Action
Select Project
→
.
Response: The PLC configuration window is opened, this contains further menu commands for hardware configuration.
Select from the list ASCII
→
.
Response: The ASCII Setup dialog is opened.
Enter the total messages, the size of the message width and the number of
ASCII ports (from the I/O periphery) in the text boxes.
Response: In the PLC configuration
→
window the ASCII Port Settings menu command is available.
Select from the list ASCII
→
.
Response: The ASCII port settings dialog is opened.
.
Make the corresponding settings.
Note: ASCII messages can now be created under Project
→
33002204 12/2010
83
Creating a Project
Resume
Now proceed with Step 3: Creating the user program
.
84
33002204 12/2010
Creating a Project
Step 3: Creating the User Program
General
A user program is created in sections. Each section is programmable in one of the available languages and has a unique name in the project. Sections can be generated at any time during the programming.
Overview
The creation of a user program consists of 9 steps:
Step
1
2
3
4
5
Action
Generating a New Section
Declaring the Variables
Programming a Section
Analyzing Program/Section
Specifying the section execution sequence
Generating a New Section
The procedure for generating a new section is as follows:
Step
1
2
3
4
Action
In the main menu File call up the menu command New section...
.
Result: The dialog box New program section is opened.
Click on the programming language desired for this section.
In the text box Section name enter the unique name for this section.
Generate all the required sections in this way.
33002204 12/2010
85
Creating a Project
Declaring the Variables
A program consists of functions and Function Blocks (FFBs) or of instructions with the statement of variables (e.g. signals), addresses or literals. While direct addresses and literals can be used immediately, variables must be declared before they can be used in programming. The procedure for declaring variables is as follows:
Step
1
2
3
Action
In the main menu Project call the menu command Variable declaration...
.
Result: The dialog box Variable declaration is opened.
Enter the variable name, the associated data type, and if necessary the reference address, the initial value and a comment.
Confirm the entries with OK .
Note: Further editing is also possible from a FFB connection or contact etc. by double-clicking -> Var. Declaration...
. This starts the Variables editor.
Programming a Section
The procedure for programming a section is as follows:
Step
1
2
Action
Using File → open the section to be programmed.
Create programs according to the rules of the individual programming languages: z z z z z z
Function Block Diagram FBD
Ladder Diagram LD (IEC)
SFC (Sequential Control)
Instruction list (IL)
Structured text (ST)
LL984 (Ladder Diagram (Modsoft))
Analyzing Program/Section
Check a section or the entire program for syntax violations! The procedure for analyzing a program/section is as follows:
Step
1
2
Action
In the main menu Project call up the menu command Analyze section or
Analyze program .
Remove the cause of the displayed or reported error.
Note: Loading a section or program into the PLC is only possible after an errorfree check. (The removal of the cause of warnings is not absolutely necessary.
Checking the warnings is, however, sensible.)
86
33002204 12/2010
Creating a Project
Set execution order of sections
The sections are initially stored in the order of their creation and are executed after the program has started. In general this sequence must be adjusted projectspecifically to suit the task setting. The procedure for specifying the section execution sequence is as follows:
Step
1
Action
To specify the section execution sequence there are two alternatives: z In the main menu Project call the menu command Execution order...
and using the command buttons First , Last , Next , Previous sequence the sections as required.
z In the main menu Project call up the menu command Project browser and sequence them as required by moving them around in the
Resume
Now proceed with Step 4: Saving
.
33002204 12/2010
87
Creating a Project
Step 4: Save
General Information
General information about saving: z If you exit a project without saving, you will be automatically asked if you want to save the project or not. If you answer yes to this question, this begins the same z procedure described below.
In order to prevent loss of data, projects should be saved regularly during long periods of configuration or programming sessions.
Saving a Project for the First Time
The procedure for saving a project for the first time is as follows:
Step
1
2
3
4
Action
In the File main menu invoke the Save Project As...
menu command.
In the File name text box, enter the project name name.prj.
Select the desired drive and directory from the Directory list.
Alternatively, it is possible to enter the whole path specification in the File name text box, e.g. c:\product1\reactor3.prj
(max. 28 characters +
.prj).
If these directories do not yet exist, they will be automatically created.
Note: According to IEC 1131, a project includes all programs, data etc which belong to a PLC. If several projects (i.e. PLCs) belong to one system, then all projects should be stored in a common directory named after the system.
Click the OK command button.
Response: The project has now been stored in the specified directory under the given name.
Supplementary Saving
The procedure for supplementary saving is as follows:
Step
1
Action
From the File main menu simply select the Save menu command.
Resume
Now proceed with Step 5: Executing memory prediction
.
88
33002204 12/2010
Creating a Project
Step 5: Perform Memory Prediction
Check the PLC memory workload.
Perform an offline memory prediction of the configured PLC before downloading the program to the PLC. The table displayed in the Project → dialog shows the use of individual memory ranges. An expected memory workload is then recognized.
NOTE: In some cases the memory prediction is not very accurate. A discrepancy between required memory in the PLC and the memory prediction under Concept may occur. The memory prediction always indicates more available memory than is actually available in the PLC.
This is due to the dynamic memory in the DFBs and Sections, which is difficult to calculate. Especially ST sections cause a great difference between the prediction and PLC. To be sure that there is sufficient memory available in the PLC, load a project into a PLC for examination. The simulator cannot be used because many projects have sufficient memory in the simulator but not in the PLC.
Resume
Now proceed with Step 6: Loading and testing the project
.
33002204 12/2010
89
Creating a Project
Step 6: Loading and Testing
General Information z z
Loading and testing programs is only possible if either the 16-bit simulator Concept SIM is switched on or the Concept SIM 16-bit simulator is switched off and a PLC is attached with a z
Modbus Plus, Modbus, TCP/IP cable, or the Concept PLCSIM32 simulator is switched on.
NOTE: Testing using Concept SIM
and Concept PLCSIM32
simulators is only possible with IEC user programs.
Overview
Loading and testing macros is divided into 9 main steps:
Step
1
2
3
6
7
4
5
8
9
Action
Loading the EXEC file into the PLC (see Concept Installation Instructions )
Connecting the PC and PLC
Loading and Starting the Program
Activating the Animation
Changing the Values of Literals
Changing the Values of Variables
Locating Errors
Downloading Changes
Starting and Stopping the PLC
Connecting the PC and PLC
The procedure for linking the PC and the PLC is as follows:
Step
1
2
3
4
Action
From the Online main menu invoke the Connect...
menu command.
Response: The Link to PLC dialog box opens.
Set the protocol type (Modbus, Modbus Plus, TCP/IP or Simulator) and the PLC node (when working in a network) with which you wish to communicate.
Under Access right select the Change Configuration option
Confirm the details with OK .
90
33002204 12/2010
Creating a Project
Loading and Starting the Program
The procedure for loading and launching the program is as follows:
Step
1
2
3
4
5
Action
From the Online main menu invoke the Connect...
menu command.
Response: The Download Controller dialog box will be opened in the PLC.
When loading the program for the first time, use the All command button.
Click the Load command button.
Response: Various dialog boxes will be displayed.
Answer the question Stop the program in PLC? Yes/No with Yes .
Note: This question only appears when a program is already running in the PLC.
Answer the question Start a program in PLC? Yes/No with Yes , if there are no errors.
If warnings or errors are reported, these will be listed in the Messages window.
Correct the warnings or errors at the specified point.
Activating the Animation
With the animation (online status report) it is possible to monitor the status of variables, steps, transitions etc within individual sections of the editor window. The procedure for activating the animation is as follows:
If… Then…
To display binary values exclusively.
To display binary values exclusively, invoke the
Online main menu and click on the Animate booleans menu command.
Response: The valences of all booleans (variables, direct addresses, literals) are displayed in colour (0-
Signal = red, 1-Signal = green).
33002204 12/2010
91
Creating a Project
If…
If you want to display the values of all variables.
If you want to enter monitoring fields in the text languages (IL and ST).
Then…
To display the values of all variables invoke the
Editing main menu option and select the Select All menu command (selects all items in the current section).
Thereafter invoke from the Online main menu option the Animate selection menu command.
Response: The valences of all values (variables, direct addresses, literals) are displayed in colour (red
= 0-Signal, green = 1-Signal, yellow = either, for variables, immediate display of the value or, for multielement-variables, displays the value by doubleclicking on the variable).
Use the Selected Inspect menu command to paste the text languages IL and ST into section monitoring fields.
Response: The current value of the allocated variables is shown in these monitoring fields. With multi element variables, only the value of the first element is shown.
This can be changed by double-clicking on the monitoring field of the Numeric Inspect Settings dialog box, which invokes the options available.
Changing the Values of Literals
The procedure for changing literals is as follows:
Step
1
2
3
Action
Activate the animation, as described in
Activating the Animation, page 91 .
Double-click on the literal to be changed.
Enter a new value and confirm with OK .
Response: The new value will be sent to the PLC during the next logic scan.
92
33002204 12/2010
Creating a Project
Changing the Values of Variables
With the Reference data editor
it is possible to show and set the values of variables (state, control, force). The procedure for changing variables is as follows:
Step
1
2
3
4
Action
From the main menu, select Online and then the Reference data editor menu command.
Enter the variables to be displayed in the dialog box marked RDE Templates .
To set the value highlight the Disable check box, and enter the desired value.
The RDE template can be saved under a unique name.
To do this, invoke the RDE main menu option and select the Save template as… menu command.
Note: Several RDE templates can be invoked at once. To do this, invoke the
RDE main menu option and select the Open template... menu command.
Locating Errors
If errors occur during the processing of the program by the PLC, these will generally be reported on screen Messages and entered in an events list in log book form. The procedure for locating errors is as follows:
Step
1
2
3
4
Action
From the Online main menu invoke the Event Viewer menu command.
Response: A window is opened, in which all errors are listed and described.
Select an error line and use the command button Go to Error .
Response: This will go directly to the section in which the error occurred. The faulty object is highlighted.
Correct the program.
If your program now has the UNEQUAL status carry out the steps in
Downloading and Starting the Program
once again.
If the program now has the MODIFIED status perform the steps in Downloading
Changes
once again.
33002204 12/2010
93
Creating a Project
Downloading Changes
If the project has the MODIFIED status after it has been altered, these changes can be loaded online into the PLC without stopping the program currently running. The procedure for downloading changes is as follows:
Step
1
2
Action
From the Online main menu access the Download Changes...
menu command.
Click on OK .
Response: The changes will be downloaded to the controller.
Starting and Stopping the PLC
The procedure for starting and stopping the PLC is as follows:
Step
1
Action
If the same project is running on the PC and PLC ( EQUAL ), then the PLC can be started or stopped with Online → .
Resume
Now proceed with Step 7: Optimize and Separate
.
94
33002204 12/2010
Creating a Project
Step 7: Optimize and Separate
Optimizing Projects
At the end of the installation and/or after several runs of Download Changes...
it is useful to perform an optimization, so that any gaps in the program data memory management are filled. After optimization the project is UNEQUAL on the PC and
PLC and the program must be loaded into the PLC with Download...
( Warning:
Program must be stopped and restarted!). The procedure for optimizing projects is as follows:
Step
1
2
3
4
5
6
7
8
Action
Save the project with File → .
In the File main menu invoke the Close project menu command and take note of the dialog boxes which then appear.
In the File main menu invoke the Optimize Project...
menu command and select the project to be optimized. Take note of the dialog boxes which subsequently appear.
Check the size of the program data memory in the Online main menu with the
Memory Statistics...
menu command.
The sizes can then be altered with PLC configuration .
Save the project with File → .
Reload the optimized program into the PLC using Online → . To do this the program currently running must be stopped.
Start the newly loaded program using Online
→
.
Separating the PC and Controller
After successfully testing the program in the PLC (with a connected process) the PC can be separated from the controller. The procedure for separating the PC and the controller is as follows:
Step
1
2
3
Action
Please take note of the program status in the footnote!
To maintain consistency EQUAL must be there.
z if it reads MODIFIED , modifications must be loaded first
z If it reads UNEQUAL the program must be reloaded into the PLC
.
From the Online main menu access the Disconnect...
menu command. Take note of the information in the displayed dialog box.
The project can be closed after separation.
In the File main menu invoke the Close project...
menu command. Take note of the information in the dialog box, if displayed.
33002204 12/2010
95
Creating a Project
Resume
Now proceed with Step 8: Documenting
.
96
33002204 12/2010
Creating a Project
Step 8: Documentation
General information
Each project should be fully documented. Changes and additions should also be documented (partial documentation). z z
Among other things documentation includes: z z
Comments on the project ( Project → Properties ),
Comments on each separate section ( File Section properties ), z z
Comments on variables,
Comments on the functions applied, function modules and DFBs (command z button Comment in the property dialog of each module),
Comments on steps and transitions (command button Comment in the property z dialog of each element),
Comments in the form of freely placed text elements in the graphic programming languages ( Object → ),
Comments on each line of commands in the textual programming languages z
Comments on user-specific data types,
Comments on derived function modules (DFBs).
33002204 12/2010
97
Creating a Project
Printing the documentation
The procedure for printing documentation is as follows:
Step
1
2
3
4
5
6
7
8
9
Action
In the main menu call up File menu command Print...
.
In dialog box Documentation contents select Page layout whether each page should have a uniform header and footer as well as printing a front page. The appearance of header, footer and front page is stored in the available ASCII files.
In the area Contents and in dialog box Documentation contents , select what is to be printed.
If Variable list has been selected, call up Options in order to select the variables which are to be printed.
When Sections has been selected, z z call up Select and specify the sections that are to be printed and also call up Options . In area Graphics enlargement factor also specify the appropriate size of the logic which is to be printed.
Activate command button OK .
Reaction: All entries are saved.
Make sure that the page set-up of the sections is as desired.
In the main menu call up View follow this with the successive menu commands
Overview and Pabe Break .
Change the order of for example the FFBs in such a way, that there are as few transitions between adjoining pages as possible.
In the main menu call up File the menu command Print...
again and activate command button Print .
The printout is made with defined settings and the dialog box is closed.
98
33002204 12/2010
PLC configuration
33002204 12/2010
PLC configuration
5
Overview
This section describes the single process for the hardware configuration.
What's in this Chapter?
This chapter contains the following sections:
5.4
5.5
5.6
5.7
5.1
Section
5.2
5.3
Topic
General information about hardware configuration
Configuration in OFFLINE and ONLINE mode
Unconditional Configuration
Optional configuration
Backplane Expander Config
Configuration of various network systems
Quantum Security Settings in the Configurator
Page
33002204 12/2010
99
PLC configuration
5.1
General information about hardware configuration
Overview
This section contains general information about hardware configuration.
What's in this Section?
This section contains the following topics:
Topic
General information
Proceed in the following way with the configuration
Page
100
33002204 12/2010
PLC configuration
General information
At a Glance
The system configuration has far-reaching consequences as it influences the entire control work mode. It has to define all control-specific information as well as general information, allocate the necessary memory space and determine the input/output area. For the first configuration the user must enter several basic details for the PLC area, such as PLC type and memory. Only valid configurations are authorized.
A configuration always refers to a Project, i.e. the menu command PLC configuration is only available when a project has been opened.
The configuration is available offline or online.
33002204 12/2010
101
PLC configuration
Proceed in the following way with the configuration
Introduction
In this section you are given a general overview on how to proceed with the configuration.
Use Configuration Menu
There are menu commands that absolutely must be carried out and are available in the PLC Configuration window. Grayed out menu commands are currently unavailable and can be enabled for extending the hardware-configuration in the
Config. Extensions directory with the menu command Select Extensions .
Read in Module Set-up
The PLC module set-up is entered manually and can be compared with the connected hardware in ONLINE mode. After it has been read in, the modules missing in Concept are shown in the I/O map, and can be re-edited.
The I/O addressing must then be done for each module.
When doing this, please ensure the permitted references are used:
Modules
Analog input modules
Analog output modules
Digital input modules
Digital output modules
Expert modules - input
Expert modules - output
References
3x references
4x references
3x or 1x references
4x or 0x references
3x or 1x references
4x or 0x references
Downloading the Hardware Configuration
The hardware configuration of a project is saved and can be downloaded to the simulation program Concept-SIM, Concept-SIM32 or an automation installation. By doing this, the EQUAL status is established between the host computer and the
PLC.
NOTE: The Concept-SIM must be deactivated for transfer of the configuration to a real PLC.
102
33002204 12/2010
5.2
PLC configuration
Configuration in OFFLINE and ONLINE mode
Overview
This section contains information for configuration in OFFLINE and ONLINE mode.
What's in this Section?
This section contains the following topics:
Topic
General information
Available Functions in OFFLINE and ONLINE Modes
Page
33002204 12/2010
103
PLC configuration
General information
At a Glance
In OFFLINE mode no link is created between programming device and PLC, and the configuration can be performed. In ONLINE mode there is a link between programming device and PLC, so that only one conditional configuration can take place.
104
33002204 12/2010
PLC configuration
Available Functions in OFFLINE and ONLINE Modes
Introduction
This section contains an overview of the available functions in OFFLINE and/or
ONLINE mode. The possibilities in the ONLINE mode are different in their use of the simulator and the real PLC.
Configuration in OFFLINE Mode
In OFFLINE mode all menu commands are available for the hardware configuration in the PLC Configuration window. The submenus in the Config. Extensions directory can be enabled in the Select Extensions dialog to extend the configuration.
If the PLC is in ONLINE mode, you can switch to OFFLINE mode using the menu command Online → . In the footer of the editor window, the status-bar indicator NOT CONNECTED appears.
Configuration in ONLINE Mode and in the Active Simulator
A configuration is not possible in ONLINE mode with an active simulator or a
Modbus Plus connection, i.e. no entries can occur. The available dialogs can only be invoked and read.
You can switch to ONLINE mode using the menu command Online → and establishing a connection between the host computer and the PLC.
Configuration in ONLINE Mode and in the Real PLC
Using the connection to a real PLC a configuration in ONLINE mode is possible, as long as the Change Configuration access level is activated.
It is not possible to configure or reconfigure a PLC while the PLC is in RUN mode.
If a program is already running in the PLC, it must be stopped before reconfiguration can be implemented. Stop the PLC with Online → Online Control Panel → Stop
PLC . After editing, the changes are automatically transferred to the hardware when the PLC is started up.
NOTE: When you delete an Expert module in ONLINE mode in the I/O map, the allocated loadable is also automatically deleted. If you wish to place this module back in the I/O map at a later time, it will be necessary to download again.
You can switch to ONLINE mode using the menu command Online → and establishing a connection between the host computer and PLC.
33002204 12/2010
105
PLC configuration
Effects of ONLINE Changes
If the following conditions are satisfied, all animated windows are automatically closed if a change is made in the I/O map (e.g. deleting or adding to a module) z z z z
Conditions:
ONLINE mode animated section(s)
Status between PLC and host computer is EQUAL z
Controller stopped
Access level Change Configuration is activated.
106
33002204 12/2010
PLC configuration
5.3
Unconditional Configuration
Overview
This section contains a description of the configuration to be performed unconditionally and an overview of the presettings in the configuration menu.
What's in this Section?
This section contains the following topics:
Topic
Precondition
PLC selection
CPU Selection for the PLC Type
PLC memory mapping
Loadables
Segment manager
I/O Map
Page
33002204 12/2010
107
PLC configuration
Precondition
Introduction
Only when the CPU has been selected in the PLC Selection dialog will all the other menu commands become available in the PLC Configuration window.
The following dialogs are a minimum selection and MUST be edited as part of the hardware configuration.
z PLC Selection z PLC Memory Partition z Loadables z Segment Scheduler z I/O Map
The preferences can be adopted as long as they are compatible with the hardware being used.
108
33002204 12/2010
PLC configuration
PLC selection
Introduction
Select the PLC family (Quantum, Compact, Momentum or Atrium) and the CPU, as well as the memory size, according to use. All the available CPUs are listed in the list box.
Determine logic zone
The logic zone for the desired programming language (IEC or LL984) can be expanded to the corresponding PLC type with the PLC family selection.
The assignment and installation of the loadables is determined according to the following settings:
Selection
Enable
Disable
984 only/IEC only
Meaning
Installation of the IEC loadables. A desired memory area for the IEC zone can be set up. The assignment and installation of the loadable pairing to the selected CPU is performed automatically in the
Loadables dialog.
No installation of the IEC loadables. This will completely switch off the IEC zone and the entire logic zone will be made available for the
LL984.
Some Momentum CPUs can only be programmed in the IEC zone or only in the LL984 zone.
Determine total IEC memory
By defining the total IEC memory size and the global data, you also automatically determine the IEC-program memory size. On the basis of this size, the available memory space for the LL984 user program can also be determined.
NOTE: With global data it is the memory space of the unlocated variables.
NOTE: Total IEC memory = IEC program memory + global data
33002204 12/2010
109
PLC configuration
CPU Selection for the PLC Type
Introduction
When installing hardware (Concept EXECLoader), you are required to load various
EXEC data files (*.BIN). This determines the firmware for various PLC types. The available PLC types, which can be operated by loading the EXEC data files with the corresponding CPUs, are shown in the following tables.
Loading Firmware for Quantum PLC Types
The following table shows the current EXEC versions, which are located on the
Service Release CD and supplied with Concept.
Quantum PLC type:
140 CPU
113 02
113 02S
113 02X
113 03
113 03S
113 03X
213 04
213 04S
213 04X
424 0x
424 0xX
434 12
534 14
434 12A
(Redesigned
CPU)
534 14A/B
(Redesigned
CPU
-
-
-
-
-
Q186Vxxx
(IEC+LL984)
X
(LL984 only)
-
-
X
X
X
X
(LL984 only)
X
-
-
X
X
-
-
-
-
-
-
-
-
-
-
-
Q486Vxxx
(IEC+LL984)
-
Q58Vxxxx
(IEC+LL984)
-
-
-
-
-
-
-
-
-
-
X
X
-
-
-
-
-
-
-
-
-
-
-
-
-
-
X
-
-
Q5RVxxxx
(IEC+LL984)
-
X
-
-
X
-
-
-
-
X
-
-
-
X
-
QIECVxxx
(IEC only) *
-
IEC memory
(kbyte)
max. 150 max. 136 max. 379 max. 136 max. 305 max. 610 max. 305 max. 465 max. 465 max. 890 max. 2550 max. 890 max. 2550
NOTE: * After the QIECVxxx.BIN EXEC data file has been loaded, the EMUQ.EXE loadable must be loaded into Concept in the Loadables dialog.
110
33002204 12/2010
PLC configuration
Loading Firmware for Quantum LL984 Hot Standby Mode
The Quantum CPUs not ending in X or S can be used for the LL984 Hot Standby mode. A special EXEC file must be downloaded onto the CPU for this. The loadable for LL984 Hot Standby (CHS_208.DAT) is automatically installed by the system.
Loading Firmware for Quantum IEC Hot Standby Mode
The 140 CPU 434 12 and 140 CPU 534 14 CPUs can also be used for IEC Hot
Standby. A special EXEC file must be downloaded onto the CPU for this. The loadables for IEC Hot Standby (IHSB196.EXE and CHS_208.DAT) are automatically installed by the system.
Loading Firmware for Quantum Equation Editor
The Quantum CPUs not ending in X or S can be used for the LL984 equation editor.
A special EXEC file must be downloaded onto the CPU flash for this. This EXEC file is not part of the Concept delivery range but can be obtained over the Internet at www.schneiderautomation.com.
Loading Firmware for Momentum PLC Type
The following table shows the current EXEC versions, which are located on the
Service Release CD and supplied with Concept.
Momentum PLC type (CPU 171 CBB 970 30):
171 CBB
970 30-984
970 30-IEC
X
-
MPSV100.BIN
(LL984 only)
-
X
MPSV100e.BIN
(IEC only)
IEC memory
(kbyte)
236
Momentum PLC type (CPU 171 CCC 7x0 x0):
171 CCC
760 10-984
760 10-IEC
780 10-984
780 10-IEC
-
X
-
M1LLVxxx
(LL984 only)
X
X
-
X
M1IVxxxE
(IEC only)
-
IEC memory
(kbyte)
220
220
33002204 12/2010
111
PLC configuration
Momentum PLC type (CPU 171 CCC 9x0 x0):
171 CCC
960 20-984
960 30-984
960 30-IEC
980 20-984
980 30-984
980 30-IEC
X
-
-
X
X
X
M1EVxxx
(LL984 only)
-
X
X
-
-
-
M1EVxxxE
(IEC only)
IEC memory
(kbyte)
236
236
Momentum PLC type (CPU 171 CCS 7x0 x0):
171 CCS
700 10
700/780 00
760 00-984
760 00-IEC
X
-
X
X
M1LLVxxx
(LL984 only)
-
X
-
-
M1IVxxxE
(IEC only)
IEC memory
(kbyte)
160
The stripped EXEC of the M1 supports up to a maximum of 44 I/O modules.
Loading Firmware for Compact PLC Types
The CTSXxxxD.BIN
EXEC file must be downloaded onto the CPU flash for all
Compact CPUs.
Loading Firmware for Atrium PLC Types
A special EXEC file (see table below) must be downloaded onto the CPU flash for each Atrium CPU.
180 CCO
121 01
241 01
241 11
EXEC file
AI3Vxxxx.BIN
AI5Vxxxx.BIN
AI5Vxxxx.BIN
112
33002204 12/2010
PLC configuration
PLC memory mapping
At a Glance
For the creation of the program, sufficient address zones for the necessary number of input bits, output/flag bits, input words and output/flag words are to be entered.
An overview of the state RAM value is also given: z Max. state RAM z State RAM in use z State RAM use
An unassociated value is shown with an error message, and can be automatically suited to the given value.
IEC Hot Standby data
After configuration of an IEC Hot Standby system, enter sufficient address zones for the required number of input words. The higher the number of IEC Hot Standby input words, the larger the transmit buffers for the IEC component. This means all the bigger the IEC application in use can be.
CAUTION
System cycle time influence!
The size of the configured state RAM in an IEC Hot Standby project has a significant effect on the system cycle time. As soon as a configured cycle ends, the next starts after the transfer of all state RAM data to the CHS module.
Failure to follow these instructions can result in injury or equipment damage.
33002204 12/2010
113
PLC configuration
Loadables
Introduction
Loadables are loadable programs, which are only loaded into the PLC when required.
The various uses of loadables are described in the following sections.
NOTE: When you delete an Expert module in online mode in the I/O map the allocated loadable is also automatically deleted. If you wish to place this module back in the I/O map at a later time, it will be necessary to download again.
Downloading Loadables for the IEC Runtime System
The following loadables for the combined execution of IEC and LL984 programs
(CPU 113 0x, CPU 213 0x or CPU 424 02) are available:
If...
you want to use CPUs with the mathematics processor for IEC programming,
Then...
install the loadable pairing @1S7196 and @2I7196.
you want to use CPUs without the mathematics processor for IEC programming, install the loadable pairing @1SE196 and @2IE196.
Downloading Loadables for Expert Modules
The following loadables are available for Expert modules:
If...
you are configuring the 140 ESI
062 00 module with 32 bit runtime system and the 140-NOA-611-x0 module you are configuring the 140 ESI
062 10 module,
Then...
install the loadable ASUP196.
Note: The ULEX196 loadable is automatically installed.
The ASUP 196 loadable is only installed automatically on 32-bit CPUs. On 16-bit CPUs with Stripped EXEC
(QIECVxxx.BIN), the ASUP196 loadable must be installed afterwards.
install the loadable pairing NSUP + ESI.
Note: These two loadables do not come with the
Concept software package, but are supplied with the
140 ESI 062 10 module and must be unpacked at the time of installation ( Unpack...
).
Downloading Loadables for LL984
These are not included in the Concept delivery range. You can order these loadables via the "Automation Customer Service Bulletin Board (BBS)" (related topics README).
114
33002204 12/2010
PLC configuration
Downloading Loadables for Hot Standby
The following loadables for Hot Standby mode are available:
If...
you are using the LL984 Hot
Standby mode,
Then the loadable CHS_208 is automatically installed.
you are using the IEC Hot Standby mode, the loadables IHSB196 and CHS_208 will be loaded automatically.
Downloading User Loadables
Loadables that are created by the user are called user loadables (*.EXE, *.DAT).
They are located in the Concept directory DAT and using the Unpack...
command button they can be inserted into the Loadables dialog at installation.
Downloading Loadables for IEC Support Only
The following loadables for IEC support only (CPU 113 xxS without mathematics processor) are available:
If...
your application uses REAL arithmetic,
Then install the loadable EMUQ196.
Note: The loadable is installed together with the EXECfile QIECVxxx (installation in Concept EXECLoader).
Downloading Loadables for INTERBUS and IEC Support Only
The following loadables for IEC support are available:
If the CPU z z z z z
113 02S
113 03S
213 04S
534 14
434 12 is configured,
113 03 is configured
213 04 is configured,
Then install the loadable ASUP196.
Note: The ULEX196 loadable is automatically installed.
The ASUP 196 loadable is only installed automatically on 32-bit CPUs. On 16-bit CPUs with Stripped EXEC
(QIECVxxx.BIN), the ASUP196 loadable must be installed afterwards.
install the loadable pairing @1SE196 + @2IE196. The
ULEX196 loadable is automatically installed.
install the loadable pairing @1S7196 + @2I7196. The
ULEX196 loadable is automatically installed.
33002204 12/2010
115
PLC configuration
Downloading Loadables for INTERBUS and LL984 Support Only
The following loadables for LL984 support are available:
If the CPU z z z
113 02
113 03
213 04 is configured, z z
534 14
434 12 is configured,
Then you can install the following loadables: z z
ULEX196
@1S7196 + @2I7196 + ULEX196
Note: The ULEX196 loadable is automatically installed with this.
the loadables ASUP196 and ULEX196 will be loaded automatically.
116
33002204 12/2010
PLC configuration
Segment manager
At a Glance
If a remote I/O st. (Drop) is configured, the sequence and method of processing the
LL984 section can be defined in the dialog box Segment manager .
When deleting (in the dialog box I/O map ) a configured remote I/O st. (Drop), it is automatically deleted in the segment manager.
Mode of Functioning
Every I/O st. (Drop) is assigned a segment. It is therefore not permitted to enter fewer segments in the segment scheduler, than there are I/O st.s (Drops) configured in the I/O map. In the segment scheduler, the maximum segment numbers is by default set at 32.
The configurator checks the agreement between the two dialogs and classifies the
I/O st.s (Drops) in the segment scheduler. A window informs you which I/O stations
(Drops) have been inserted.
Altering the segment processing sequence
The sequence for segment processing can be altered manually, in that the segment number or I/O st. number can be edited in the corresponding line. For the local I/O st. (Drop), 1 is entered in the first line of the dialog box in the columns In stat.
and
Out stat.
automatically.
1
If no sequence was defined, the segments are processed in ascending order.
Sorting criteria for additional I/O st.s
Recently added I/O st.s (Drops) are classified in the segment manager according to the following criteria:
If…
A new I/O st. is added,
All determined segments are already in use,
Then… it is automatically classified behind the last available line.
the last segment is reused for the input of the new I/O st.
(Drop), i.e. a segment number can be repeated, as the stations are differentiated.
33002204 12/2010
117
PLC configuration
Available methods for segment processing
When setting the segment manager, the following methods of processing can be selected:
Processing type
Continuous
Controlled
WDT reset
End of logic
Meaning
Cyclic processing
Manually controlled processing
Reset watchdog timer
End of processing
NOTE: If subprograms are to be used in LL984, the last configured segment cannot be processed in the segment manager. The type of solution must unconditionally be
End of logic .
Advanced settings in the segment manager
With the "Controlled" type of processing, only the reference numbers 0x and 1x are authorized, which determines when the logic for the corresponding section is processed.
The field In. stat.
and Out stat.
allow the input of corresponding I/O st. numbers, which must be configured. If a 0 is entered, no input/output is served by this segment number.
118
33002204 12/2010
PLC configuration
I/O Map
Introduction
In the I/O map, configure the I/O stations (drops) with the modules in use. Afterwards perform the I/O addressing and the parameterization of the configured modules.
Allocating Drops
Drop numbers can be allocated optionally except for the first one (from 2 to ). The first drop number is automatically recognized as the local drop, and cannot be edited.
Configuring the Backplane Expander
The 140 XBE 100 00 module is necessary to expand the backplane. By doing this you can connect a second backplane, and gain 13 extra slots. The 140 XBE 100 00 module is mounted in both backplanes and, in addition, requires an independent power supply (power supply unit).
Expanded backplanes are configured in Concept in the first drop using slots 2-1 to
2-16.
A more detailed description about the configuration of expanded backplanes with
the 140 XBE 100 00 module is given in the chapter Backplane Expander Config, page 133
.
CAUTION
The slot assignment of the 140 XBE 100 00 is not shown in the configurator, so a double assignment is possible.
You should take note of the hardware slots of the module and the power supply, and should not occupy these slots with other modules in the I/O map.
Failure to follow these instructions can result in injury or equipment damage.
NOTE: The flow of data via an expanded backplane is quicker than via the remote system.
33002204 12/2010
119
PLC configuration
Allocating the I/O Ranges
When allocating the I/O ranges the following references are allowed: z 3x references for analog input modules z 4x references for analog output modules z 3x or 1x references for digital input modules z 4x or 0x references for digital output modules z 1x or 3x references for Expert modules (input) z 0x or 4x references for Expert modules (output)
NOTE: The unique addressing is checked so that no addresses are occupied twice within the configuration.
Parameterization
Configured modules can be individually parameterized to determine the variable process conditioned settings.
Connection to other Network Systems
In addition to local and remote drops, links to other network systems can be established with configured coupling modules: z Ethernet z INTERBUS z Profibus DP
See also the chapter entitled
Configuration of various network systems, page 137
and Configuration examples, page 877
.
120
33002204 12/2010
Read in Map
PLC configuration
In the ONLINE mode of the stopped PLC, the hardware modules are listed in the I/O map and can be transferred as follows:
Step
1
2
3
6
7
4
5
8
9
10
Action
Open a project.
Open the PLC Configuration window.
Using the PLC Type menu command, open the PLC Type dialog and select the
PLC type.
Connect the host computer to the PLC ( Online
→
).
Open the I/O Map dialog ( PLC Configuration
→
).
Use the Edit command button to open the Local Quantum I/O station dialog.
Check the Poll check box.
Response: The recognized modules are listed in the Read column in color.
Double click on the colored text boxes in the Read column.
Response: The listed modules are transferred to the Module column.
Enter the address zone in the corresponding columns ( In.Ref.
, In End , Out Ref.
,
Out End ).
After the hardware matching between the host computer and the PLC, the configuration can continue.
33002204 12/2010
121
PLC configuration
5.4
Optional configuration
Overview
This section contains the description of the optional configuration.
What's in this Section?
This section contains the following topics:
Topic
Settings for ASCII Messages
Making Additional Functions Available in the Configurator
Data Exchange between Nodes on the Modbus Plus Network
How many words are really used when data is received (Peer Cop)
Protecting Data in the State RAM before Access
Parameterize interfaces
Special Options
Page
122
33002204 12/2010
PLC configuration
Settings for ASCII Messages
Introduction
To create the ASCII messages, you are required first of all to set a mask, which contains the number of messages, the message area size and the ASCII ports.
Once you have done that you can create the ASCII messages, which are then processed with the Ladder Logic programming language.
Precondition
ASCII messages are only possible in the Quantum family, and can only be processed with the LL984 processing language.
Procedure
To create the ASCII messages, you must first set the mask:
Step
1
2
3
4
5
6
7
Action
In the PLC Configuration
→
window, open the ASCII Setup dialog.
In the Total Messages text box specify a value from 1 to 999.
In the Message Area Size text box specify a value from 1 to 9999 bytes.
In the ASCII Ports text box specify an interface from 2 to 32.
Confirm your entries with the OK command button.
Response: The settings are saved and the dialog is exited.
In the Project main menu open the ASCII Message Editor dialog (with the
ASCII Messages...
menu command).
Create the ASCII messages here, see also the description
33002204 12/2010
123
PLC configuration
Making Additional Functions Available in the Configurator
Introduction
Additional functions can be used for the configuration, if they have previously been enabled or set in the Select Extensions dialog.
Activating Advanced functions/Dialogs
By checking the check box or setting the Ethernet modules the corresponding menu commands are enabled and can be edited in the PLC Configuration → window.
z z z z
The following functions/dialogs can be activated:
Data protection
Peer Cop
Hot Standby
Ethernet I/O-Scanner
NOTE: The available functions are dependent upon the configured CPU. Also see the online help "Select Extensions".
Specify Coupling Modules
Coupling modules must be configured in order to connect to other network systems.
To do this, specify the number of modules in the corresponding list box, which are then available in the I/O map.
The following systems can be configured: z TCP/IP Ethernet z Symax-Ethernet z MMS-Ethernet z Profibus DP
NOTE: The maximum number of coupling modules depends upon the configured
CPU. Also see the online help "Select Extensions".
124
33002204 12/2010
PLC configuration
Data Exchange between Nodes on the Modbus Plus Network
Introduction
With a Modbus Plus (MB+) connection you can configure a PLC using the Peer Cop functionality, so that data exchange with another PLC is possible. In such a case, the Peer Cop takes data from a reference area within a "source" PLC and places this via the Modbus Plus (MB+) network into a determined reference range of a
"destination" PLC. This operation is performed in the same identical way for each token rotation.
Using the Peer Processor, input data from other nodes on the local network can be received by the user program. Likewise, output data from the user program can be transmitted to other nodes on the local network.
The Peer Cop has two variants for data exchange: z global data exchange z specific data exchange
Precondition
The Peer Cop menu command is only available if, in the Select extensions dialog the Peer Cop check box is checked.
Global Data Exchange
With global data exchange, the data sent from the current "source" PLC is received by all "destination" PLC devices in the Modbus Plus (MB+) network. Up to 64 destination devices can be reached in this way, which can each receive the data in
8 destination addresses of the State RAM.
See also section "
How many words are really used when data is received (Peer
".
Specific Data Exchange
With specific data exchange, data is sent from a selected "source" PLC to a selected
"destination" PLC in the Modbus Plus (MB+) network. To do this, enter the respective addresses for the data exchange in a table at the corresponding source and destination nodes (1-64).
The address must correspond to the MB+ node address on the back of the respective module. This address setting can be altered and must be specified before mapping. (See also hardware description)
Select the node to be read or written according to the hardware configuration.
33002204 12/2010
125
PLC configuration
How many words are really used when data is received (Peer Cop)
Introduction
The number of words used may not exceed 500. To avoid this a simple formula can be used, how many words are used on receipt.
Formula
The formula, to find the number of words used is as follows:
Length + (index – 1) = number of words
Example
The Peer Cop dialog Global Input has the following entry:
126
33002204 12/2010
33002204 12/2010
PLC configuration
The following process takes place:
Step
1.
2.
Action
Bus node 1 sends 1 word to the subfield start reference 400001, starting at index
3.
At index 3 (word 3) the receipt of the data begins. (The preceding words are also counted.)
Word 1 - 500
3.
4.
5.
In total 3 words are required by subfield 1.
Formula: 1 + (3 - 1) = 3
Bus node 1 sends 18 words to the subfield start reference 400002, starting at index 5.
At index 5 (word 5) the receipt of the data begins. (The preceding words are also counted.)
Word 1 - 500
6.
In total 22 words are required by subfield 2.
Formula: 18 + (5 - 1) = 22
NOTE: Only the largest number of words used per bus node by be taken into account. In the example 22 words from a maximum of 500 permitted words are used.
For more bus nodes the largest number of words used per bus node must be added.
For example:
127
PLC configuration
Protecting Data in the State RAM before Access
Introduction
Output address ranges (coils and registers) can be protected by specifying the address from which writing is possible in the Data Protection dialog. All addresses before this are write-protected.
Precondition
The Data Protection menu command is only available if, in the Select Extensions dialog, the Data Protection check box is checked.
Entering Access Protection
This access protection operates in connection with "normal" data access, which happens externally via a Modbus or Modbus Plus interface. Access from the host computer out is in any case permitted and bypasses this protection mechanism.
128
33002204 12/2010
PLC configuration
Parameterize interfaces
At a Glance
Depending on their use in Concept, the following interfaces must be parameterized: z ASCII interface z Modbus interface
Parameterize ASCII interface
For an ASCII message transmission, the serial communication parameters for the port interfaces can be specified in the ASCII port settings dialog box.
NOTE: The ASCII port settings dialog box is only available when the number of
ASCII ports has been specified beforehand in the dialog box ASCII set up .
Parameterize Modbus interface
For a Modbus coupling, in the dialog box Modbus port settings the serial communication parameters of the port interface can be entered on the programming device, on a CPU and the NOM assemblies (Network Option Module).
CAUTION
Do not make any online changes since this will cause all Editors to close!
The Modbus port settings should not be altered in Online mode, or else all Editors are automatically closed.
Failure to follow these instructions can result in injury or equipment damage.
NOTE: The settings for a Modbus coupling in Concept only have an effect if the switch on the front of the assembly is at the lowest position (mem).
Switch position on the NOM
33002204 12/2010
NOTE: If the left-hand switch is in the upper position and right-hand switch is set to mem then, as of firmware version 2.20, bridge mode is deactivated. This means that the network connection between Modbus and Modbus Plus is locked.
129
PLC configuration
Interface parameterization with network connections between Modbus and Modbus Plus
A network connection between Modbus and Modbus Plus nodes can be made in the dialog box Modbus port settings by checking the check box Bridge mode .
NOTE: The settings are only effective if the switch on the front of the assembly is in the middle position (RTU).
130
33002204 12/2010
PLC configuration
Special Options
Introduction
In the Specials dialog you can configure special options: z Battery coil z Timer register: z Time stamp for MMI applications (TOD) z Allow duplicate coils z Watchdog-Timeout (ms) z Time slice for online changes (ms)
Battery coil
You can specify an address of a coil, which shows the status of the battery. This assignment is used for battery monitoring. In this way, the weak battery can be replaced early to avoid a loss of data.
Timer Register:
The content of the time register is incremented every 10 ms and has a free value between 0000 and FFFF hex.
Time for MMI applications (Date/Time)
This time stamp is only intended for a MMI application. Eight registers are reserved for setting the clock.
The TOD input (Time of Day) is in the American format:
4xxxx
4xxxx+1
4xxxx+2
4xxxx+3
4xxxx+4
4xxxx+5
4xxxx+6
4xxxx+7
Control register
Discrete 1 (MSB)
Discrete 2
Discrete 3
Discrete 4
Day of week (1 - 7)
Month (1 - 12)
Day (1 - 31)
Year (00 - 99)
Hours (0 - 23)
Minutes (0 - 59)
Seconds (0 - 59)
1 = set clock values
1 = read clock values
1 = preset discrete
1 = error discrete
33002204 12/2010
131
PLC configuration
Allow Duplicate Coils
You can assign several outputs to a coil. To do this, check the check box, and specify the first address to which several outputs can be allocated in the First Coil
Address: text box.
NOTE: This function is unavailable with the Momentum PLC family.
Watchdog Timeout (ms*10)
You can set a pulse supervision for the user program by entering a numerical value of between 2 and 255 (ms). As soon as there are no count pulses within the specified time, an error message will appear.
Time Slice for Online Changes (ms)
You can set a time supervision for the communication between the nodes by entering a numerical value between 3 and 30 (ms). As soon as there is no communication within the specified time, an error message will appear.
132
33002204 12/2010
PLC configuration
5.5
Backplane Expander Config
Introduction
This chapter describes the function and configuration of the backplane expander.
What's in this Section?
This section contains the following topics:
Topic
Generals to Backplane Expander
Edit I/O Map
Error handling
Page
33002204 12/2010
133
PLC configuration
Generals to Backplane Expander
Introduction
The Quantum backplane expander provides a single backplane expansion to a local drop or a RIO drop through the 140 XBE 100 00 module.
Function description
The module connects two Quantum backplanes (primary and secondary) through a custom cable and support all data communication between the backplanes. Each backplane requires a 140XBE10000 module that occupy a single slot and requires its own power supply.
Procedure at an Error
The backplane expander is designed in the way that if it is not installed or improperly connected, it will not effect the functionality of the primary rack. Only the backplane expander installed and connected properly, the both racks are then able to communicate and controlled by prime CPU or RIO drop controller.
134
33002204 12/2010
PLC configuration
Edit I/O Map
Requirements
Currently only Quantum controllers support backplane expander. Primary rack contains the CPU or RIO drop controller and is allowed to config all type of additional modules up to the physical slot address limitation. All I/O modules can be also added to the secondary rack. However, option modules, such as NOMs, NOEs and CHSs must reside in the primary rack.
To place a module in proper rack, it is necessary to add an extra attribute in the I/O module database to specify that the module is available only for the primary or secondary or both.
Configuration in I/O Map
Exist Quantum local drop or RIO drop only support one rack up to sixteen slots. With backplane expander, it is extended as if the drop support two racks, and each has sixteen slots. By clicking at the button ...
on Module column, all modules available to the rack clicked (primary or secondary) will show in the module selection dialog that can be selected and assigned to the current slot.
Each rack requires a 140 XBE 100 00 module to make backplane expander work properly.
NOTE: The 140 XBE 100 00 module does not have a personality code and therefore can not be recognized by the Concept.
The module will just look like an unfilled slot in the Concept I/O map. If any module is configured in the secondary rack, it is user’s responsibility to ensure there is one slot in each rack that is reserved for 140 XBE 100 00 module and all hardware are connected properly.
33002204 12/2010
135
PLC configuration
Error handling
Introduction
The validate processes for the primary rack will be applied to the secondary rack too, such as duplicate reference, missing input or output reference, etc. Besides existing regular validation, traffic cop will do some special check for the backplane expander.
No reserved slot for 140 XBE 1000 00
If any module is found in the secondary rack and there is no empty slot left in either of racks when user trying to exit the rack editor dialog, an error message will be displayed: "There must be one empty slot reserved for 140 XBE 100 00 module in each rack to make backplane expander work." The rack editor dialog will then not be closed.
Special module in secondary rack
To prevent any special module (such as, NOE, CHS, etc) being added to the secondary rack, rack editor dialog do not allow to cut/copy these head modules. It will also check module personalities before user try to do any paste operation. If some unsupported module for the secondary rack is found, an error message will be displayed: "The buffer contains some module that can not reside in the secondary rack." The paste operation will be aborted.
136
33002204 12/2010
5.6
PLC configuration
Configuration of various network systems
Overview
This section contains the description of the configuration of various network systems.
What's in this Section?
This section contains the following topics:
Topic
Configure INTERBUS system
Configure Profibus DP System
Configure Ethernet
RTU extension
Ethernet I/O Scanner
How to use the Ethernet / I/O Scanner
Page
33002204 12/2010
137
PLC configuration
Configure INTERBUS system
At a Glance
The configuration of the INTERBUS system can take place within the PLC families of Quantum and Atrium.
INTERBUS configuration with Quantum
With the Quantum family the coupling of a remote bus takes place in a Quantum I/O station (Drop). To do this, the INTERBUS Master NOA 611 00 must be configured and parameterized in the CMD tool (Configuration Monitoring and Diagnostic Tool).
See also Configuration example 4
.
INTERBUS configuration with Atrium
With the Atrium family, the coupling of the remote bus takes place via the master assembly 180 CCO 121 01, 180 CCO 241 01 or 180 CCO 241 11 in this way, the
INTERBUS Master CRP 660 0x is automatically inserted into the local I/O station
(Drop). The INTERBUS I/O station (Drop) nodes are configured in the CMD tool
(Configuration Monitoring and Diagnostic tool), saved as a *.SVC data file and imported to Concept. After the import into the I/O map the configuration can be changed afterwards in Concept.
See also Configuration example 9
.
138
33002204 12/2010
PLC configuration
Configure Profibus DP System
Introduction
The configuration of the Profibus DP system can take place within the PLC families of Quantum and Atrium.
Profibus DP Configuration with Quantum
With the Quantum family the connection to the Profibus DP system takes place in a
Quantum drop. To do this, you must first of all set the number of bus controllers
(CRP 811 00) used in the Select Extensions dialog. The modules then appear in the list box of the I/O Module Selection dialog and can be inserted into the I/O map.
The configuration of the Profibus DP node is created in the SyCon configuration tool, saved as a *.CNF file and transferred directly to Concept. However, the configuration (*.CNF) can be imported to Concept at a later time.
CAUTION
PROFIBUS DP ADDRESSES MAY BE OVERWRITTEN
When working with Profibus DP configuration make sure that the addresses of two
8 bit E/A modules without gap to the following 16 bit limit is only permitted when both 8 bit modules belong to the same Profibus DP master. If you do not adhere to this guideline, the input bits of one module (e.g. Profibus DP Master A) may be overwritten by the other module (e.g. Profibus DP Master B).
Failure to follow these instructions can result in injury or equipment damage.
33002204 12/2010
139
PLC configuration
Importing the Profibus DP Configuration
To import the configuration (*.CNF) to Concept, proceed as follows:
Step
1
2
3
4
5
6
7
Action
In the PLC Configuration window, open the I/O Map dialog.
Select the drop and use the Edit dialog Local Quantum I/O Drop .
Double click on the in the Module column.
Reaction: The I/O Modules Selection dialog is opened.
In the I/O Adapter column, select the CRP-811-00 module, and press the OK command button.
Reaction: The CRP-811-00 will be inserted in the I/O map.
In the Local Quantum I/O Drop dialog, select the line of the mapped bus controller (CRP-811-00) and press the Params command button.
Reaction: The CRP-811-00 (Profibus DP) dialog will open.
Using the Import open the Select Import File window.
To import, specify the path of the CNF file, and press the OK command button.
Reaction: The Profibus DP configuration is entered in the Concept I/O map.
Note: After the Profibus DP nodes are entered into Concept, the reference ranges for all modules and diagnostic data must be edited later.
Configuration Example
An example of configuration is given in Example 11
.
140
33002204 12/2010
PLC configuration
Configure Ethernet
Introduction z z z
An Ethernet bus system can be configured within the following PLC families:
Quantum
Atrium
Momentum
Precondition
In order to connect to the Ethernet bus system, a PCI network card must be available in the host computer. Afterwards the Ethernet interface needs to be parameterized and the drivers that are provided on CD need to be installed
(
Configure Ethernet, page 975 ).
After the Ethernet module has been slotted into the central backplane, the internet address, subnet mask, gateway and frame type can be allocated by the network administrator.
Configuration with Quantum
The procedure for Ethernet configuration in Concept is as follows:
Step
1
2
3
4
5
6
7
Action
In the PLC Configuration window, open the Select Extensions dialog.
Enter the number of Ethernet modules (NOE) in the text boxes.
Response: The modules then appear in the list box in the I/O Module Selection dialog and can be inserted into the I/O map.
In the PLC Configuration window, open the Ethernet I/O Scanner dialog, in which you enter the information from the network administrator (Internet address, subnet mask, gateway, frame type).
In the Online main menu, open the Connect to PLC dialog (menu command
Connect...
).
In the Protocol Type list box, select the option TCP/IP , and in the IP address or DNS Hostname text box, enter the address of the TCP/IP card.
After programming, in the Online main menu, open the Load into PLC dialog
(menu command Load...
), and click on the Load command button.
Response: A message appears, asking whether you would like to start the PLC.
Before you confirm the message with the Yes command button, the display "link" must appear on the Ethernet module.
33002204 12/2010
141
PLC configuration
Error Action
After configuration, only start the PLC once the display "link" has appeared on the
Ethernet module. If this is not the case, withdraw the Ethernet module from the central backplane and then slot it in again. If the display "link" is still not shown, there must be a serious error.
Available Ethernet Modules
The maximum number of NOE modules is dependent upon the configured CPU
(select in the PLC Selection dialog):
CPUs
113 02/S/X
113 03/S/X
213 04/S/X
424 0x/X
434 12
534 14
Number of NOE modules
0 - 2
0 - 2
0 - 2
0 - 6
0 - 6
0 - 6
Configuration with Momentum
The configuration of the Ethernet bus system with Momentum is described in the
section Momentum Example - Ethernet Bus System, page 974
.
142
33002204 12/2010
PLC configuration
RTU extension
Requirements
To make the RTU menu command available you have to choose a Compact CPU with LL984 programming language in the PLC Selection dialog.
CTS-/RTS-Delay
In this dialog you can set time delay for CTS or RTS independently for Comm port
1 of your Compact PLC. This feature allows modem communications with radios that require longer time frames. The delay time range is 0 ... 500 ms using 10 ms units.
Enter the time delays your require.
Secured Data Area (SDA)
This feature allows you to configure an area in RAM that is secured from being overwritten. Secured Data Area (SDA) is a block of the Compact PLCs RAM that is set aside as 6x data space. The SDA can only be written to by specific functions that require secured data storage. General purpose Modbus commands, builtins, can not write to the SDA. Modbus Read (function 20) is able to read from the SDA,
Modbus Write (function 21) is not able to write to the SDA. The SDA size range is 0
... 128 K words using only 1 K word blocks. Enter the size your require.
Refer to the applicable user manual for the specific function for the required SDA size. For example, for Gas Flow, refer to the "Starling Associates Gas Flow
Loadable Function Block" User Guide (890 USE 137 00).
PLC Login Password Protection
For the description of password protection, refer to section
.
33002204 12/2010
143
PLC configuration
Ethernet I/O Scanner
Introduction z z z
This function is for the following Quantum modules available:
140-NOE-211-x0
140-NOE-251-x0
140-NOE-771-xx z z z z z
This function is for the following Momentum modules available:
171-CBB-970-30
171-CCC-960-20
171-CCC-980-20
171-CCC-980-30
171-CCC-960-30
Ethernet address and I/O scanning parameters can be modified using the Ethernet
/ I/O Scanner dialog box. From the PLC Configuration window, select Ethernet /
I/O Scanner . This menu option will only be available if you have selected an M1
Processor Adapter with an Ethernet port or have Quantum TCP/IP Ethternet modules (NOE) as specified above.
This section describes how to configure the Ethernet port, including IP address, other address parameters and I/O scanning.
Ethernet Configuration Options
The Ethernet / I/O Scanner screen offers three options for configuring the Ethernet port on an M1 Processor Adapter:
Configuration options Meaning
Specify IP Address
Use Bootp Server
Disable Ethernet
This is the default option. It allows you to type the IP address, gateway and subnet mask in the text boxes in the upper righthand corner of the screen.
Click this radio button if you want the address parameters to be assigned by a Bootp server. If you select this option, the address parameter text boxes in the upper righthand corner of the screen will be grayed out. They will not display the actual address parameters.
Click this radio button if you want to disable the Ethernet port.
Disabling the port will reduce the scan time for the Processor
Adapter.
144
33002204 12/2010
PLC configuration
Setting Ethernet Address Parameters
If you choose to specify the IP address, you should complete all four text boxes in the upper righthand corner of the dialog box:
Parameters
Internet Address
Meaning
Type a valid IP address in the Internet Address text box (for example: 1.0.0.1).
CAUTION
Potential for duplicate addresses
Obtain a valid IP address from your system administrator to avoid duplication.
Failure to follow these instructions can result in injury or equipment damage.
Gateway
Subnet Mask
Frame Type
Consult your system administrator to determine the appropriate gateway. Type it in the Gateway text box.
Consult your system administrator to obtain the appropriate subnet mask. Type it in the Subnet Mask text box (for example:
255.255.255.0).
For NOE there is an additional Frame Type field. Your two possible choices are ETHERNET II or IEEE 802.3
NOTE: Changing the subnet mask or the frame type and downloading the application via the NOE hinder the I/O scanner to run after a PLC start.
Disconnecting Concept then leads to run the I/O scanner.
Configuring I/O
Once the Ethernet port address parameters have been set, you may assign parameters for I/O scanning.
The text box Master Module (Slot) contains the Module type that you have configured for Ethernet communications. In the case of the Momentum Ethernet controller the slot will always be number 1, and the configured module type is displayed in the variable dialog field. If you are configuring a NOE in a standard rack the slot number assigned in the I/O Map will be displayed along with the module type. Until the I/O Map is conmpleted this test field will indicate "Unassigned". In instances where more than one NOE is configured the I/O Scan parameters reflect the unit currently in the dialog box from which you can select the additional unit by activating the Pulldown list.
33002204 12/2010
145
PLC configuration
The text field Health Block (1x/3x) is only available by using the 140-NOE-771-xx.
The health timeout is used for setting the health bit. If the response arrives before the end of the HealthTimeout period, the health bit is set; otherwise it is cleared. If the Health Timeout is zero, the health bit is set to true once communications are established, and it is never cleared.
NOTE: The configuration of the health block, refer to the user guide Quantum NOE
771 xx Ethernet Modules, model no. 840 USE 116 00.
The text box Diagnostic Block (64 words, 3x or 4x registers) is only available by using the Momentum Ethernet (M1E) and allows you to define the starting register of a number of bits which are used for diagnostic. The block can be specified in either 3x or 4x registers. For more information, refer to the user guide Quantum NOE
771 xx Ethernet Modules, model no. 840 USE 116 00.
The Device Control Block is only available when using NOE 771-01(11) with the
Firmware Rev. 3.5 and higher.
Enable this check box, to enable/disable the I/O scanner entry.
Each entry in the I/O scanner can be enabled or disabled by setting the related bit z z in the control block.
Bit=1, than I/O scanning stops, corresponding Health bit = 0 (socket is closed)
Bit=0, than I/O scanning starts, corresponding Health bit = 1.
For more information, please refer to Quantum NOE 771 xx, Ethernet Modules, User
Guide in Chapter I/O-Scanner Enable/Disable.
I/O Scanner Configuration table:
Column Description
Slave IP Address Type the IP address of the slave module in this column (for example:
128.7.32.54). This address will be stored in a pulldown menu, so that you may use it in another row by clicking on the down arrow and selecting it.
Unit ID If the slave module is an I/O device attached to the specified slave module, use the Unit ID column to indicate the device number. The Unit
ID is used with the Modbus Plus to Ethernet bridge to route to Modbus
Plus networks.
Health Timeout
Rep Rate
Use this column to specify the length of time in ms to try the transaction before timing out. Valid values are 0 ... 50 000 ms (1 min).
To avoid timing out, specify 0.
Use this column to specify how often in ms to repeat the transaction.
Valid values are 0 ... 50 000 ms (1 min).
NOTE: For legacy NOEs the repetition rate must be 0 or a multiple of 16 ms. Legacy NOEs are the NOE 771 00 versions and NOE 771 01/NOE
771 11 versions lower than rev. 4.3.
146
33002204 12/2010
33002204 12/2010
PLC configuration
WARNING
Unpredictable operation
The repetition rate values of NOEs with firmware rev. 4.3 and higher must be 0 ms or a multiple of a step size between 5 ms (minimum) and 200 ms (maximum). The minimum cyclic repetition rate that is allowed is 5 ms.
If you configure more than one slave and want to use different repetition rates, then you must ensure that the repetition rates have a common step size.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Examples : If one repetition rate in the I/O scanner is set to 6 ms, all other repetition rates values must be a multiple of 6 (i.e. 6 ms, 12 ms, 18 ms, 24 ms, etc.) z Repetition Rates 24 ms, 30 ms, 36 ms, 42 ms are also valid becaue the step size z z is 6 ms
Repetition Rates 0 ms, 35 ms, 42 ms, 70 ms, 14 ms are valid because the step size is 7 ms
Repetition Rates 24 ms, 35 ms, 19 ms are not valid because there is no common z z step size
Repetition Rates 20 ms, 100 ms, 300 ms are not valid because the max. limit has been exceeded
Repetition Rates 0 ms, 3 ms, 30 ms are not valid because the min. limit has been exceeded
I/O Scanner Configuration table continued:
Column Description
Read Ref Master Use the read function to read data from the slave to the master.
This column specifies the first address to be read (for example: 400001).
Read Ref Slave Use the read function to transfer data from the slave to the master.
This column specifies the first address of up to 125 to read to (for example: 400050).
Read Length
Write Ref Master Use the write function to write data from the master to the slave.
This column specifies the first address to write (for example: 400100).
Write Ref Slave
Use the read function to read data from the slave to the master.
This column specifies the number of registers to read (for example: 20).
Use the write function to write data from the master to the slave.
This column specifies the first address of up to 100 to write to (for example: 400040).
Write Length
Description
Use the write function to write data from the master to the slave.
This column specifies the number of registers to write (for example: 40).
You can type a brief description (up to 32 characters) of the transaction in this column.
147
PLC configuration
How to use
NOTE: You may include read and write commands on the same line.
For more information about how to use the Ethernet / I/O Scanner dialog see section
How to use the Ethernet / I/O Scanner, page 149
.
148
33002204 12/2010
PLC configuration
How to use the Ethernet / I/O Scanner
Introduction
This section describes how to complete your Ethernet I/O configuration using the
Copy , Cut , Paste , Delete and Fill Down buttons.
Copy and Paste
To save time when typing similar read and write commands, you may copy and paste entire rows within your configuration:
Step
1
2
3
4
Action
Select the row you want to copy by clicking on the row number at the far left.
Click the Copy button above the I/O configuration list.
Select the row where you would like to paste the data (by clicking on the row number at the far left).
Click the Paste button.
Cut and Paste
To move a row within the configuration list, follow the direction:
Step
1
2
3
4
Action
Select the row you want to move by clicking on the row number at the far left.
Click the Cut button above the I/O configuration list.
Select the row where you would like to paste the data (by clicking on the row number at the far left).
Click the Paste button.
Note: Multiple rows may be cut/copy and pasted. The number of rows actually pasted is limited by the number of rows selected. For example if you copy 10 rows to the clipboard, then select an area of 6 rows to past, only the first six rows of clipboard data is pasted.
Delete
To delete a row within the configuration list, follow the direction:
Step
1
2
Action
Select the row you want to delete by clicking on the row number at the far left.
Click the Delete button above the I/O configuration list.
Note: Multiple rows may be deleted.
33002204 12/2010
149
PLC configuration
Fill down
To copy part of any row to the next row or to a series of adjoining rows, use the Fill
Down button, following the steps in the table
Step
1
2
Action
Use your mouse to select the data you would like to copy and the cells you would like to copy it to.
Note: You must select one contiguous block of cells, with the data to be copied in the first row. You cannot select two separate blocks.
Click the Fill down Button.
Result: The data from the first row is copied to the selected cells in the defined block.
NOE Ethernet modules
In this dialog the NOE Ethernet modules 140 NOE 211 x0,140 NOE 251 x0 and 140
NOE 771 10 are parameterized (in the Ethernet Configuration area).
In this dialog the NOE Ethernet module 140 NOE 771 00 is parameterized and addressed (in the I/O Scanner Configuration area).
z z z
For the followings modules you receive an function description:
140 NOE 211 x0
140 NOE 251 x0
140 NOE 771 xx
Momentum Ethernet modules
In this dialog the Momentum Ethernet modules are addressed (in the I/O Scanner
Configuration area).
z z z z z z z z
For the followings modules you receive an function description:
171 CBB 970 30 IEC
171 CBB 970 30 984
171 CCC 980 30 IEC
171 CCC 980 30 984
171 CCC 980 20 984
171 CCC 960 30 IEC
171 CCC 960 30 984
171 CCC 960 20 984
150
33002204 12/2010
5.7
PLC configuration
Quantum Security Settings in the Configurator
Quantum Security Parameters
Introduction
Various security parameters can be defined in the configuration of the Quantum
CPUs 140 434 12A and 140 534 14A/B which are indicated in the log file *.LOG. This guarantees secure process documentation which includes the logging with the automatic logout, write access of NOEs/NOMs on the PLC as well as limited participants (max. 12) for network write access.
The definition of the security parameters can be found in dialog Configuration
→
Security Expansion .
Dialog Quantum Security Parameters :
Requirements
The security parameters are only available if the following conditions have been met: z z
Supervisor Rights (see Concept under Help → Info... → ) only with CPUs 140 CPU 434 12A and 140 CPU 534 14A/B
33002204 12/2010
151
PLC configuration
Automatic Logout
Auto. logout is only available for Quantum CPU 434 12A and 534 14 A/B.
The automatic logout procedure logs a user out as soon as a predefined time limit
(max. 90 minutes) is reached with no activity on the connection. This could be a lack of read or write activity from the programming device to the PLC for example.
The Never setting disables this function, i.e. automatic logout cannot occur.
NOTE: Automatic logout does not function if: z z the programming device (Concept) is connected to the PLC not via the local
ModbusPlus Port of the CPU, but via a NOE/NOM module and at the same time another device is connected to the same NOE/NOM module with read access to the PLC.
Disable All Writes from NOEs/NOMs
By disabling all write accesses of z z z z z z z z z z z z z z z z
140 NBE 210 00 (ID-Code 0x0406)
140 NBE 250 00 (ID-Code 0x0407)
140 NOE 211 00 (ID-Code 0x0404)
140 NOE 251 00 (ID-Code 0x0405)
140 NOE 311 00 (ID-Code 0x0408)
140 NOE 351 00 (ID-Code 0x0409)
140 NOE 511 00 (ID-Code 0x040A)
140 NOE 551 00 (ID-Code 0x040B)
140 NOE 771 00 (ID-Code 0x040D)
140 NOE 771 01 (ID-Code 0x0422)
140 NOE 771 10 (ID-Code 0x040E)
140 NOE 771 11 (ID-Code 0x0423)
140 NOM 211 00 (ID-Code 0x010C)
140 NOM 212 00 (ID-Code 0x010C)
140 NOM 252 00 (ID-Code 0x010C)
140 NWM 100 00 (ID-Code 0x0420) to the PLC, all write instructions are ignored by the CPU and responded to with an error message.
NOTE: MSTR read operations are not executed if the check box Disable All Writes from NOEs/NOMs is checked. (this also means the error state of the MSTR block shows no error!)
Disable all Writes from CPU Modbus Ports
To disable writes from the Quantum CPU Modbus connections, check the Disable all Writes from CPUs from Modbus Ports check box.
152
33002204 12/2010
PLC configuration
Limited Write Access on the Modbus Plus Network
A restricted number of participants that have access to the PLC can be configured for the Modbus Plus network. A maximum of 12 participants are allowed, the participant address of the programming device is automatically entered in the participant list and cannot be deleted.
Dialog Add Modbus Plus Address (press Add...
)
Examples of Modbus Plus paths
Modbus Plus network:
33002204 12/2010
The address must be entered from the point of view of the receiving PLC to the sender, and thus begins at the first gateway or the next PLC. This depends on whether the sender and the receiver are located in the same Modbus Plus segment
(no bridges/gateways) or whether the sender and the receiver are located in different segments (separated by one or more bridges/gateways).
153
PLC configuration
Example 1:
Concept (MB+ Address 1) writes to PLC 6. There are no bridges or gateways between the two participants. Thus, the address entered appears as follows: 1 or
1.0.0.0.0
Example 2:
PLC 2 (MB+ Address 2) writes to PLC 6. A gateway (MB+ Address 3) is located between the two participants. Thus, the address entered appears as follows:
3.2.0.0.0
NOTE: Only the first Modbus Plus address can be recognized by the PLC. Thus, as soon as this first address is a bridge or a gateway, all devices in the network behind the bridge or gateway have write access to the PLC. Thus, in our example PLC 7 could also write to PLC 6 (Address: 3.7.0.0.0).
154
33002204 12/2010
PLC Memory and optimization
33002204 12/2010
Main structure of PLC Memory and optimization of memory
6
Overview
This Chapter describes the main structure of the PLC Memory and the optimization of the memory with the different PLC families.
What's in this Chapter?
This chapter contains the following sections:
6.1
Section
6.2
6.3
6.4
6.5
6.6
6.7
Topic
Main structure of the PLC Memory
General Information on Memory Optimization
Memory Optimization for Quantum CPU X13 0X and 424 02
Memory Optimization for Quantum CPU 434 12(A) and 534
14(A/B)
Memory optimization for Compact CPUs
Memory optimization for Momentum CPUs
Memory optimization for Atrium CPUs
Page
155
33002204 12/2010
PLC Memory and optimization
6.1
Main structure of the PLC Memory
General structure of the PLC Memory
At a Glance
Memory for the EXEC file
The EXEC file contains the operating system and one or two runtime systems (IEC and/or LL984) for operating the user programs.
State RAM z z z
In principle, the memory of a PLC consists of three parts: the memory for the Exec file, the state RAM and the program memory.
z z z
The state RAM can be divided into different zones: the used 0x, 1x, 3x and 4x references, a reserve for further 0x, 1x, 3x and 4x references, possibly an extended memory zone for 6x references.
Program Memory z z z z z z z z
The program memory can be divided into different zones: z the I/O map etc., a reserve for extensions, the ASCII messages (if used), the Peer Cop configuration (if used), the Ethernet configuration (if used) etc., a reserve for extensions, the IEC loadables (if required), the Global Data, consisting of the Unlocated Variables, the IEC program memory with the program codes, EFB-Codes and program data
(section data and DFB instance data), possibly the ULEX loadable for INTERBUS or other loadables, the LL984 program memory.
156
33002204 12/2010
6.2
PLC Memory and optimization
General Information on Memory Optimization
Overview
This Section contains general information on memory optimization.
What's in this Section?
This section contains the following topics:
Topic
Possibilities for Memory Optimization
PLC-Independent
Page
33002204 12/2010
157
PLC Memory and optimization
Possibilities for Memory Optimization
Description
The possibilities for memory optimization are partly dependent on the PLC family z z z z z z and CPU used:
Memory Optimization for Quantum CPU X13 0X and 424 02, page 162
Memory Optimization for Quantum CPU 434 12(A) and 534 14(A/B), page 176
Memory optimization for Compact CPUs, page 187
Memory optimization for Momentum CPUs, page 197
Memory optimization for Atrium CPUs, page 204
158
33002204 12/2010
PLC Memory and optimization
PLC-Independent
Introduction z z z
There are 3 PLC-independent possibilities for memory optimization:
Optimize State RAM for 0x and 1x References, page 159
Only Download Required Loadables, page 160
Optimize Expansion Size, page 161
Optimize State RAM for 0x and 1x References
The state RAM contains the current values of the 0x, 1x, 3x and 4x references.
Even if the state RAM zone is outside the program memory zone, the size of the state RAM for 0x and 1x references influences the size of the program memory.
Therefore, do not select a state RAM zone that is too large. In theory, the procedure only needs as many 0x and 1x references as the hardware requires. However, you will require a somewhat larger number of references if the I/O map is to be extended.
It is advisable to be generous with the number of references during the creation phase of the user program when frequent changes are still being made. At the end of the programming phase, the number of these references can be reduced in order to create more space for the user program.
The settings for the 0x-, 1x-references can be found in Project →
Configurator → .
In this dialog box, there is an overview of the size of the occupied state RAM zone and the percentage of the maximum state RAM that this represents.
33002204 12/2010
159
PLC Memory and optimization
Optimize state RAM for 0x, 1x, 3x and 4x references:
Only Download Required Loadables
All the installed loadables are downloaded into the program memory zone and occupy space. Therefore, only install those loadables which you really need (related topics
The memory space occupied by the installed loadables is displayed in the
Loadables dialog box under Used Bytes ( Project → ). This information is calculated from the size of the loadable files and from the memory size assigned to the loadables.
160
33002204 12/2010
PLC Memory and optimization
Optimize Expansion Size
Each time, there is the possibility to reserve memory space for later expansion in the mapping zone (I/O map) and in the configuration expansion zone (Peer Cop). This memory space is necessary if e.g. the I/O map or the Peer Cop settings should be changed online. It is advisable to overestimate the reserves during the installation phase of the user program, that is, when modifications are often being made. At the end of the programming phase the reserves may be reduced again, to provide more space for the user program.
The settings for the mapping reserves are found in Project → PLC Configurator →
I/O Map → . The settings for the Peer Cop reserves can be found in
Project → PLC Configurator → Config. Extensions → Select Extensions →
Cop → .
Optimize Expansion Size
33002204 12/2010
161
PLC Memory and optimization
6.3
Memory Optimization for Quantum CPU X13 0X and 424 02
Overview
This Section describes the memory optimization for the Quantum CPUs CPU X13
0X and CPU 424 02.
What's in this Section?
This section contains the following topics:
Topic
General Information on Memory Optimization for Quantum CPU X13 0X and
424 02
Selecting Optimal EXEC File
Using the Extended Memory (State RAM for 6x references)
Harmonizing the IEC Zone and LL984 Zone
Harmonizing the Zones for Global Data and IEC Program Memory
Page
162
33002204 12/2010
PLC Memory and optimization
General Information on Memory Optimization for Quantum CPU X13 0X and
424 02
Logic Memory
The program memory zone, in which the user program is located, is called the logic zone. This zone therefore determines the maximum size of your user program.
The current size of the logic zone is displayed under Project → in the configurations overview in the PLC zone. The entry for the memory size is given in Nodes for LL984 (1 node equals 11 bytes) and in kilobytes for IEC.
Optimizing the Logic Memory z z z z
You have various possibilities for optimising the logic memory to suit your requirements:
Selecting Optimal EXEC File, page 165
Using the Extended Memory (State RAM for 6x references), page 169
Harmonizing the IEC Zone and LL984 Zone, page 171
Harmonizing the IEC Zone and LL984 Zone, page 171
NOTE: Also note the PLC-independent possibilities for memory optimization
.
33002204 12/2010
163
PLC Memory and optimization
Structure of the CPU X13 0X memory (simplified representation):
164
33002204 12/2010
PLC Memory and optimization
Selecting Optimal EXEC File
Introduction
The simplest and most basic option is to download the optimal EXEC file for your requirements onto the PLC (see also Installation Instructions ).
Depending on which EXEC file you select, zones will be reserved in the program memory of the PLC for IEC and/or LL984 programs. Therefore, if you install a
'combined EXEC file' and then only use one of the two language types in the user program, the program memory will not be used optimally.
z z z
Therefore, decide which languages you want to use:
Exclusive Use of IEC, page 165
Exclusive Use of LL984, page 166
Joint Use of IEC and LL984, page 167
Exclusive Use of IEC
If you want to use IEC exclusively, download the EXEC file "QIEC_xxx.bin" (not available for CPU 424 02). Since this EXEC file does not contain an operating system, you have to download the IEC runtime system onto the PLC in the form of
a loadable (EMUQ.exe) (related topics Loadables, page 114
). The loadable is downloaded into the program memory zone and takes up memory space.
33002204 12/2010
165
PLC Memory and optimization
Structure of the CPU X13 0X memory with exclusive use of IEC:
Exclusive Use of LL984
If you want to use LL984 exclusively, download the EXEC file "Q186Vxxx.bin" for a
CPU X13 0X and the EXEC file "Q486Vxxx.bin" for a CPU 424 02.
166
33002204 12/2010
PLC Memory and optimization
Structure of the CPU X13 0X memory with exclusive use of LL984:
Joint Use of IEC and LL984
If joint use of IEC and LL984 is required, download the EXEC file "Q186Vxxx.bin" for a CPU X13 0X and the EXEC file zone "Q486Vxxx.bin" for a CPU 424 02. Since these EXEC files only contain the LL984 operating system, you have to download the IEC operating system onto the PLC in the form of loadables (@2I7/@2IE or
@1S7/@1SE) (see also
). Both loadables will be downloaded into the program memory zone and occupy memory space.
NOTE: Joint use of IEC and LL984 is not possible with the CPU 113 02 because its memory is too small for this application.
33002204 12/2010
167
PLC Memory and optimization
Structure of the CPU X13 0X memory with joint use of IEC and LL984:
168
33002204 12/2010
Using the Extended Memory (State RAM for 6x references)
PLC Memory and optimization
Introduction
If a CPU 213 04 or CPU 424 02 is used, you can make a zone in the state RAM available for the 6x references.
NOTE: 6x references are registers and can only be used with LL984 user programs.
Even if the state RAM memory zone is outside the program memory zone, the size of the state RAM influences the size of the program memory.
Using the extended memory (state RAM for 6x references):
33002204 12/2010
169
PLC Memory and optimization
If you do NOT use 6x
If you do not want to use any 6x references, you can, with a CPU 213 04, select whether to reserve state RAM 6x references or not.
Under Project PLC Configuration PLC Selection select from the Memory
Partition the 48 K Logic / 32 K Memory entry.
NOTE: With a CPU 424 02 there is no option for deactivating the 6x zone.
If you use 6x
If you want to use 6x references, select under Project PLC Configuration PLC selection in the Memory Partition list box, the 32 K Logic / 64 K Memory entry.
170
33002204 12/2010
PLC Memory and optimization
Harmonizing the IEC Zone and LL984 Zone
Introduction
With joint use of IEC and LL984 sections, the sizes of both zones should be harmonized with each other.
Harmonizing the IEC zone and LL984 zone:
33002204 12/2010
171
PLC Memory and optimization
Size of IEC Zone
The size of the total IEC memory and also the available space for LL984 data (user program) is determined by the memory size of the loadable @2I7 or @2IE.
You can define the memory size of the loadables in Project →
→ Loadables → Install @2I7 or @2IE Edit... Memory Size .
The total size is given in paragraphs. A paragraph equals 16 bytes.
For the @1S7 or @1SE loadables, no memory size is needed. Ensure that "0" is specified here.
The fixed total IEC memory size is again made up of several zones. You will find the explanation of how to harmonize these zones vertically in the chapter
Harmonizing the Zones for Global Data and IEC Program Memory, page 173
.
Size of LL984 Zone
The size of the available memory for LL984 user programs is calculated using the following formula:
LL984 zone = available LL984 nodes – memory size of loadable @2I7/@2IE – size of loadables @2I7 or @2IE – size of loadables @1S7 or @1SE
When doing this calculation, it must be ensured that the size of the LL984 zone is node-oriented and the remaining instructions are byte-oriented.
Error Message during Download of Program
There are three possible causes for an error message, which says that the user program is too large for the PLC memory, appearing during download:
1.
The memory is currently too small.
2.
The loadable memory size is too small (see current chapter).
3.
The zone for global data and the IEC program memory zone are not optimally harmonized (see chapter
Harmonizing the Zones for Global Data and IEC
172
33002204 12/2010
PLC Memory and optimization
Harmonizing the Zones for Global Data and IEC Program Memory
Introduction
The total IEC memory space, determined by the loadable memory size, (see
Chapter
Harmonizing the IEC Zone and LL984 Zone, page 171
) is made up of two zones: z z z z z z z
IEC Program Memory comprising the EFB codes, the program codes, the section data, the DFB specimen data, the block links, z possibly data from online changes, possibly animation data etc.
z Global Data z comprising the Unlocated Variables
The zones for global data and IEC program memory can be harmonized with one another.
33002204 12/2010
173
PLC Memory and optimization
Harmonizing the Zones for IEC Program Memory and Global Data:
Size of the IEC Program Memory Zone
You change the settings for the IEC program memory in Project →
Configuration → in the IEC zone. Enter the size of the total IEC memory and the global data, so that the IEC program memory size will be calculated
(IEC program memory size = total IEC memory - global data). This setting is only possible when the PC and PLC are offline. If you do not use any or only a few unlocated variables and have no or only a few block links, you can select the IEC program memory as very large, because hardly any memory is needed for global data.
174
33002204 12/2010
PLC Memory and optimization
Size of the Zone for Global Data
The zone for global data (unlocated variables) is calculated using the following formula:
Zone for global data = memory size of the loadable - IEC program memory
The current content of the individual zones (EFBs, specimen data, user program etc.) is displayed under Online Memory statistics... Memory statistics . This display is only possible when the PC and PLC are online.
Error Message during Download of Program
There are three possible reasons for an error message, which says that the user program is too large for the PLC memory, appearing while downloading the program onto the PLC:
1.
The memory is currently too small.
2.
The loadable memory size is too small (see Chapter Harmonizing the IEC Zone and LL984 Zone, page 171
).
3.
The zone for global data and the IEC program memory zone are not optimally harmonized (see current chapter).
33002204 12/2010
175
PLC Memory and optimization
6.4
Memory Optimization for Quantum CPU 434 12(A) and 534 14(A/B)
Overview
This section describes the memory optimization for the Quantum CPUs 434 12(A) and 534 14(A/B).
What's in this Section?
This section contains the following topics:
Topic
General Information on Memory Optimization for Quantum CPU 434 12(A) and
534 14(A/B)
Harmonizing IEC Zone and LL984 Zone
Harmonizing the Zones for Global Data and IEC Program Memory (CPU 434
12(A) / 534 14 (A/B))
Page
176
33002204 12/2010
PLC Memory and optimization
General Information on Memory Optimization for Quantum CPU 434 12(A) and
534 14(A/B)
Logic Memory
The program memory zone, in which the user program is located, is called the logic zone. This zone therefore determines the maximum size of your user program.
The current size of the logic zone is displayed under Project → in the configurations overview in the PLC zone. The memory size is given in nodes for LL984 (1 node equals 11 bytes) and in kilobytes for IEC.
Optimizing the Logic Memory z z
You have various possibilities for optimising the logic memory to suit your requirements:
Harmonizing IEC Zone and LL984 Zone, page 179
Harmonizing the Zones for Global Data and IEC Program Memory (CPU 434
12(A) / 534 14 (A/B)), page 184
NOTE: Also note the PLC-independent possibilities for memory optimization
.
33002204 12/2010
177
PLC Memory and optimization
Structure of the CPU 434 12(A) / 534 14(A/B) memory (simplified representation):
178
33002204 12/2010
PLC Memory and optimization
Harmonizing IEC Zone and LL984 Zone
Introduction
The EXEC file "Q58Vxxxx.bin" is required for the CPU 434 12 and 534 14.
The EXEC file "Q5RVxxxx.bin" is required for the CPU 434 12A and 534 14A/B
(redesigned CPUs).
These EXEC files contain the runtime systems for IEC and LL984.
The sizes of the logic zones for IEC and LL984 should be harmonized with each other. The size of both zones can be defined in Project → PLC Configurator →
PLC selection .
Depending on the size you select for the IEC zone, zones will be reserved in the program memory of the PLC for IEC and/or LL984 programs. Therefore, if you define a combined IEC and LL984 zone and then only use one of the two language types in the user program, the program memory will not be used optimally.
z z
Therefore, decide which languages you want to use:
Exclusive Use of IEC, page 179
Exclusive Use of LL984, page 180
z
Joint Use of IEC and LL984, page 181
Exclusive Use of IEC
If you require exclusive use of the IEC, select in Project → PLC Configuration →
PLC Selection in the IEC Operating System list box, the entry Enable and drag the total IEC memory slider to the right hand margin (highest value). This will completely switch off the LL984 zone and the entire logic zone will be made available for the IEC user program.
33002204 12/2010
179
PLC Memory and optimization
Structure of the CPU 434 12 (A)/ 534 14(A/B) memory with exclusive use of IEC:
Exclusive Use of LL984
If you require exclusive use of LL984, select from Project → PLC Configuration →
PLC Selection in the IEC Operating System list box, the Disable entry. This will completely switch off the IEC zone and the entire logic zone will be made available for the LL984 user program.
180
33002204 12/2010
PLC Memory and optimization
Structure of the CPU 434 12(A)/ 534 14(A/B) memory with exclusive use of LL984:
Joint Use of IEC and LL984
When using IEC and LL984 jointly, you should harmonize the sizes of both zones with each other.
By setting the total IEC memory size and Global Data you can automatically determine the size of the IEC program memory, and also the available space for
LL984-data (user program).
The size of the available memory for LL984 user programs is calculated using the following formula:
LL984 zone = available LL984 nodes - total IEC memory
When performing this calculation, it must however be ensured that the size of the
LL984 zone is node-oriented and the remaining instructions are kilobyte-oriented.
33002204 12/2010
181
PLC Memory and optimization
To set the total IEC memory, select from Project PLC Configuration PLC selection in the IEC Operating System list box, the Enable entry. The IEC zone is now enabled and you can enter the required memory size in the Total IEC Memory text box. The memory size is given in kilobytes.
The fixed total IEC memory size is again made up of several zones. You will find the explanation of how to harmonize these zones vertically in the chapter
Harmonizing the Zones for Global Data and IEC Program Memory, page 173
.
Structure of the CPU 434 12(A)/ 534 14(A/B) memory with exclusive use of IEC and
LL984:
182
33002204 12/2010
PLC Memory and optimization
Error Message during Download of Program
There are three possible causes for an error message, which says that the user program is too large for the PLC memory, appearing during download:
1.
The memory is currently too small.
2.
The logic zone is too small (see current chapter).
3.
The zone for global data and the IEC program memory zone are not optimally harmonized (see chapter
Harmonizing the Zones for Global Data and IEC
Program Memory (CPU 434 12(A) / 534 14 (A/B)), page 184
).
33002204 12/2010
183
PLC Memory and optimization
Harmonizing the Zones for Global Data and IEC Program Memory (CPU 434 12(A)
/ 534 14 (A/B))
Introduction
The fixed total IEC memory (see chapter
Harmonizing IEC Zone and LL984 Zone, page 179
) is made up of two zones.
The total IEC memory space, determined by the loadable memory size, (see
Chapter
Harmonizing the IEC Zone and LL984 Zone, page 171 ) is made up of two
zones: z IEC Program Memory z z z z z z z comprising the EFB codes, the program codes, the section data, the DFB specimen data, the block links, possibly data from online changes, possibly animation data etc.
z Global Data z comprising the Unlocated Variables
The zones for global data and IEC program memory can be harmonized with one another.
184
33002204 12/2010
PLC Memory and optimization
Harmonizing the Zones for Global Data and IEC Program Memory (CPU 434 12(A)
/ 534 14 (A/B))
Size of the IEC Program Memory Zone
You change the settings for the IEC program memory in Project →
Configuration → in the IEC zone. Enter the size of the total IEC memory and the global data, so that the IEC program memory size will be calculated
(IEC program memory size = total IEC memory - global data). This setting is only possible when the PC and PLC are offline. If you do not use any or only a few unlocated variables and have no or only a few block links, you can select the IEC program memory as very large, because hardly any memory is needed for global data.
33002204 12/2010
185
PLC Memory and optimization
Size of the Zone for Global Data
The zone for global data (unlocated variables) is calculated using the following formula:
Zone for global data = memory size of the loadable - IEC program memory
The current content of the individual zones (EFBs, specimen data, user program etc.) is displayed under Online Memory statistics... Memory statistics . This display is only possible when the PC and PLC are online.
Error Message during Download of Program
There are three possible reasons for an error message, which says that the user program is too large for the PLC memory, appearing while downloading the program onto the PLC:
1.
The memory is currently too small.
2.
The total IEC memory size is too small (see Chapter Harmonizing IEC Zone and
3.
The zone for global data and the IEC program memory zone are not optimally harmonized (see current chapter).
186
33002204 12/2010
6.5
PLC Memory and optimization
Memory optimization for Compact CPUs
Overview
This Section describes the memory optimization for Compact CPUs.
What's in this Section?
This section contains the following topics:
Topic
General Information on Memory Optimization for Compact CPUs
Harmonizing IEC Zone and LL984 Zone
Harmonizing the Zones for Global Data and IEC Program Memory (Compact)
Page
33002204 12/2010
187
PLC Memory and optimization
General Information on Memory Optimization for Compact CPUs
Logic Memory
The program memory zone, in which the user program is located, is called the logic zone. This zone therefore determines the maximum size of your user program.
The current size of the logic zone is displayed under Project → in the configurations overview in the PLC zone. The entry for the memory size is given in Nodes for LL984 (1 node equals 11 bytes) and in kilobytes for IEC.
Optimizing the Logic Memory
You have various possibilities for optimising the logic memory to suit your z z requirements:
Harmonizing IEC Zone and LL984 Zone, page 190
Harmonizing the Zones for Global Data and IEC Program Memory (Compact), page 194
NOTE: Also note the PLC-independent possibilities for memory optimization
.
188
33002204 12/2010
PLC Memory and optimization
Structure of a Compact CPU memory (simplified representation)
33002204 12/2010
189
PLC Memory and optimization
Harmonizing IEC Zone and LL984 Zone
Introduction
The IEC zone "CTSXxxxx.bin", required for Compact CPUs, contains the runtime systems for IEC and LL984 (see also Installation instructions ).
The sizes of the logic zones for IEC and LL984 should be harmonized with each other. You can define the size of both zones in Project → PLC Configurator →
PLC Selection .
Depending on the size you select for the IEC zone, zones will be reserved in the program memory of the PLC for IEC and/or LL984 programs. Therefore, if you define a combined IEC and LL984 zone and then only use one of the two language types in the user program, the program memory will not be used optimally.
z z
Therefore, decide which languages you want to use:
Exclusive Use of IEC, page 190
Exclusive Use of LL984, page 191
z
Joint Use of IEC and LL984, page 192
Exclusive Use of IEC
If you require exclusive use of the IEC, select in Project → PLC Configuration →
PLC Selection in the IEC Operating System list box, the entry Enable and drag the total IEC memory slider to the right hand margin (highest value). This will completely switch off the LL984 zone and the entire logic zone will be made available for the IEC user program.
190
33002204 12/2010
PLC Memory and optimization
Structure of the Compact CPU memory with exclusive use of IEC
Exclusive Use of LL984
If you require exclusive use of LL984, select from Project → PLC Configuration →
PLC Selection in the IEC Operating System list box, the Disable entry. This will completely switch off the IEC zone and the entire logic zone will be made available for the LL984 user program.
33002204 12/2010
191
PLC Memory and optimization
Structure of the Compact CPU memory with exclusive use of LL984
Joint Use of IEC and LL984
When using IEC and LL984 jointly, you should harmonize the sizes of both zones with each other.
By setting the total IEC memory size and Global Data you can automatically determine the size of the IEC program memory, and also the available space for
LL984-data (user program).
The size of the available memory for LL984 user programs is calculated using the following formula:
LL984 zone = available LL984 nodes - total IEC memory
When performing this calculation, it must however be ensured that the size of the
LL984 zone is node-oriented and the remaining instructions are kilobyte-oriented.
To set the total IEC memory, select from Project PLC Configuration PLC selection in the IEC Operating System list box, the Enable entry. The IEC zone is now enabled and you can enter the required memory size in the Total IEC Memory text box. The memory size is given in kilobytes.
192
33002204 12/2010
PLC Memory and optimization
The fixed total IEC memory size is again made up of several zones. You will find the
.
Structure of the Compact Memory with joint use of IEC and LL984:
Error Message during Download of Program
There are three possible causes for an error message, which says that the user program is too large for the PLC memory, appearing during download:
1.
The memory is currently too small.
2.
The logic zone is too small (see current chapter).
3.
The zone for global data and the IEC program memory zone are not optimally harmonized (see chapter
Harmonizing the Zones for Global Data and IEC
Program Memory (Compact), page 194 ).
33002204 12/2010
193
PLC Memory and optimization
Harmonizing the Zones for Global Data and IEC Program Memory (Compact)
Introduction
The fixed total IEC memory (see chapter
Harmonizing IEC Zone and LL984 Zone, page 190
) is made up of two zones.
z IEC Program Memory z z z z z z z comprising the EFB codes, the program codes, the section data, the DFB specimen data, the block links, possibly data from online changes, possibly animation data etc.
z Global Data z comprising the Unlocated Variables
The zones for global data and IEC program memory can be harmonized with one another.
194
33002204 12/2010
PLC Memory and optimization
Harmonizing the Zones for Global Data and IEC Program Memory (Compact):
Size of the IEC Program Memory Zone
You change the settings for the IEC program memory in Project →
Configuration → in the IEC zone. Enter the size of the total IEC memory and the global data, so that the IEC program memory size will be calculated
(IEC program memory size = total IEC memory - global data). This setting is only possible when the PC and PLC are offline. If you do not use any or only a few unlocated variables and have no or only a few block links, you can select the IEC program memory as very large, because hardly any memory is needed for global data.
33002204 12/2010
195
PLC Memory and optimization
Size of the Zone for Global Data
The zone for global data (unlocated variables) is calculated using the following formula:
Zone for global data = memory size of the loadable - IEC program memory
The current content of the individual zones (EFBs, specimen data, user program etc.) is displayed under Online Memory statistics... Memory statistics . This display is only possible when the PC and PLC are online.
Error Message during Download of Program
There are three possible reasons for an error message, which says that the user program is too large for the PLC memory, appearing while downloading the program onto the PLC:
1.
The memory is currently too small.
2.
The total IEC memory size is too small (see Chapter Harmonizing IEC Zone and
3.
The zone for global data and the IEC program memory zone are not optimally harmonized (see current chapter).
196
33002204 12/2010
6.6
PLC Memory and optimization
Memory optimization for Momentum CPUs
Overview
This Section describes the memory optimization for Momentum CPUs.
What's in this Section?
This section contains the following topics:
Topic
General Information on Memory Optimization for Momentum CPUs
Selecting Optimal EXEC file
Harmonizing the Zones for Global Data and IEC Program Memory
(Momentum)
Page
33002204 12/2010
197
PLC Memory and optimization
General Information on Memory Optimization for Momentum CPUs
Logic Memory
The program memory zone, in which the user program is located, is called the logic zone. This zone therefore determines the maximum size of your user program.
The current size of the logic zone is displayed under Project → in the configurations overview in the PLC zone. The entry for the memory size is given in Nodes for LL984 (1 node equals 11 bytes) and in kilobytes for IEC.
Optimizing the Logic Memory
You have various possibilities for optimising the logic memory to suit your z z requirements:
Selecting Optimal EXEC file, page 200
Harmonizing the Zones for Global Data and IEC Program Memory (Momentum), page 201
NOTE: Also note the PLC-independent possibilities for memory optimization
.
198
33002204 12/2010
PLC Memory and optimization
Structure of a Momentum CPU memory (simplified representation):
33002204 12/2010
199
PLC Memory and optimization
Selecting Optimal EXEC file
Introduction
It is not possible to use IEC and LL984 jointly in Momentum.
Using IEC
EXEC file assignment during IEC use:
171 CBB M1IVxxxE
970 30 -
MPSV100e.BI
N x
171 CCS
760 00
760 10
780 10
960 30
980 30
-
x x
M1IVxxxE x x x
-
-
M1EVxxxE
-
Using LL984
EXEC file assignment during LL984 use:
171 CBB
970 30
M1LLVxxx x
M1MVxxxE
-
171 CCS
700 10
700/780 00
760 00
760 10
780 10
960 20
960 30
980 20
980 30 x
-
-
-
x x x
M1LLVxxx x
x x x x
-
-
-
M1EVxxx
-
200
33002204 12/2010
PLC Memory and optimization
Harmonizing the Zones for Global Data and IEC Program Memory (Momentum)
Introduction
The logic zone for the total IEC memory is made up of two zones.
z z z z z z z
IEC Program Memory comprising the EFB codes, the program codes, the section data, the DFB specimen data, the block links, z possibly data from online changes, possibly animation data etc.
z Global Data z comprising the Unlocated Variables
The zones for global data and IEC program memory can be harmonized with one another.
33002204 12/2010
201
PLC Memory and optimization
Harmonizing the Zones for Global data and IEC Program Memory (Momentum 171
CCS 760 00-IEC):
Size of the IEC Program Memory Zone
The settings for the IEC user program zone are available in Online → statistics... → Memory statistics in the Configured text box. This setting is only possible when the PC and PLC are offline. If you do not use any or only a few unlocated variables and have no or only a few block links, you can select the IEC program memory as very large, because hardly any memory is needed for global data.
202
33002204 12/2010
PLC Memory and optimization
Size of the Zone for Global Data
The zone for global data (unlocated variables and block links) is calculated using the following formula:
Zone for global data = memory size of the loadable - IEC program memory
The current content of the individual zones (EFBs, specimen data, user program etc.) is displayed under Online Memory statistics... Memory statistics . This display is only possible when the PC and PLC are online.
Error Message during Download of Program
There are two possible reasons for an error message, saying that the user program is too large for the PLC memory, appearing while downloading the program onto the
PLC:
1.
The memory is currently too small.
2.
The zone for global data and the IEC program memory zone are not optimally harmonized (see current chapter).
33002204 12/2010
203
PLC Memory and optimization
6.7
Memory optimization for Atrium CPUs
Overview
This Section describes the memory optimization for Atrium CPUs.
What's in this Section?
This section contains the following topics:
Topic
General Information on Memory Optimization for Atrium CPUs
Use of IEC
Harmonizing the Zones for Global Data and IEC Program Memory (Atrium)
Page
204
33002204 12/2010
PLC Memory and optimization
General Information on Memory Optimization for Atrium CPUs
Logic Memory
The program memory zone, in which the user program is located, is called the logic zone. This zone therefore determines the maximum size of your user program.
The current size of the logic zone is displayed under Project → in the configurations overview in the PLC zone. The memory size is given in kilobytes for IEC.
Optimizing the Logic Memory
You have various possibilities for optimising the logic memory to suit your z z requirements:
Harmonizing the Zones for Global Data and IEC Program Memory (Atrium), page 209
NOTE: Also note the PLC-independent possibilities for memory optimization
.
33002204 12/2010
205
PLC Memory and optimization
Structure of the Atrium CPU Memory (simplified representation):
206
33002204 12/2010
PLC Memory and optimization
Use of IEC
Introduction
The EXEC files required for the CPUs of the Atrium family contain the operating systems for IEC (see also Installation Instructions ).
When using the Atrium 180 CCO 121 01, load the EXEC file "AI3Vxxxx.bin".
When using the Atrium 180 CCO 241 01and 180 CCO 241 11 load the EXEC file
"AI5Vxxxx.bin".
Select in Project PLC Configuration PLC Selection in the IEC Operating
System list box, the entry Enable and drag the total IEC memory slider to the right hand margin (highest value). This will completely switch off the LL984 zone and the entire logic zone will be made available for the IEC user program.
Structure of the Atrium CPU memory with exclusive use of IEC:
33002204 12/2010
207
PLC Memory and optimization
Error Message during Download of Program
There are three possible causes for an error message, which says that the user program is too large for the PLC memory, appearing during download:
1.
The memory is currently too small.
2.
The logic zone is too small (see current chapter).
3.
The zone for global data and the IEC program memory zone are not optimally harmonized (see chapter
Harmonizing the Zones for Global Data and IEC
Program Memory (Atrium), page 209
).
208
33002204 12/2010
PLC Memory and optimization
Harmonizing the Zones for Global Data and IEC Program Memory (Atrium)
Introduction
The fixed total IEC memory (see chapter
Use of IEC, page 207 ) is made up of two
zones.
z IEC Program Memory z z z z z z z comprising the EFB codes, the program codes, the section data, the DFB specimen data, the block links, possibly data from online changes, possibly animation data etc.
z Global Data z comprising the Unlocated Variables
The zones for global data and IEC program memory can be harmonized with one another.
33002204 12/2010
209
PLC Memory and optimization
Harmonizing the Zones for Global Data and IEC Program Memory (Atrium):
Size of the IEC Program Memory Zone
You change the settings for the IEC program memory in Project →
Configuration → in the IEC zone. Enter the size of the total IEC memory and the global data, so that the IEC program memory size will be calculated
(IEC program memory size = total IEC memory - global data). This setting is only possible when the PC and PLC are offline. If you do not use any or only a few unlocated variables and have no or only a few block links, you can select the IEC program memory as very large, since hardly any memory is needed for global data.
210
33002204 12/2010
PLC Memory and optimization
Size of the Zone for Global Data
The zone for global data (unlocated variables) is calculated using the following formula:
Zone for global data = memory size of the loadable - IEC program memory
The current content of the individual zones (EFBs, specimen data, user program etc.) is displayed under Online Memory statistics... Memory statistics . This display is only possible when the PC and PLC are online.
Error Message during Download of Program
There are three possible reasons for an error message, which says that the user program is too large for the PLC memory, appearing while downloading the program onto the PLC:
1.
The memory is currently too small.
2.
The total IEC memory size is too small (see Chapter
).
3.
The zone for global data and the IEC program memory zone are not optimally harmonized (see current chapter).
33002204 12/2010
211
PLC Memory and optimization
212
33002204 12/2010
Function Block language FBD
33002204 12/2010
Function Block language FBD
7
Overview
This Chapter describes the Function Block language FBD which conforms to IEC
1131.
What's in this Chapter?
This chapter contains the following sections:
7.1
Section
7.2
7.3
7.4
7.5
7.6
Topic
General information about FBD Function Block
FBD Function Block objects
Working with the FBD Function Block langauge
Code generation with the FBD Function Block language
Online functions of the FBD Function Block language
Creating a program with the FBD Function Block language
Page
213
33002204 12/2010
Function Block language FBD
7.1
General information about FBD Function Block
General information on Function Block language FBD
At a Glance
Processing sequence
The processing sequence of the individual FFBs in an FBD section is determined by the data flow within the section (see also
).
Editing with the keyboard
Normally editing in Concept is performed with the mouse, however it is also possible with the keyboard (see also
Short Cut Keys in the FBD and SFC Editor, page 837 )
IEC conformity
The objects of the programming language FBD (Function Block Diagram) help to z z divide a section into a number of: z EFBs (Elementary Functions and Elementary Function Blocks)
,
DFBs (Derived Function Blocks)
and
UDEFBs (User-defined Functions and Function Blocks)
.
These objects, combined under the name FFBs, can be linked with each other by: z Links
or z Current parameters
.
Expansive logic can also be placed in the FBD section in the form of macros (see
).
Theoretically, each section can contain as many FFBs and also as many inputs and outputs as required. However, it is advisable to subdivide a whole program in logic units, that is to say in different sections.
Comments can be provided for the logic of the section with text objects (see Text
214
33002204 12/2010
7.2
FBD Function Block objects
Overview
This section describes the FBD Function Block objects.
What's in this Section?
This section contains the following topics:
Topic
Functions and Function Blocks (FFBs)
Link
Actual parameters
Text Object
Function Block language FBD
Page
33002204 12/2010
215
Function Block language FBD
Functions and Function Blocks (FFBs)
Introduction z z z
FFB is the generic term for:
EFB (Elementary Function and Elementary Function Block)
DFB (Derived Function Block)
UDEFB (Derived Elementary Function and Derived Elementary Function Block)
EFB z z
EFB is the generic term for:
Elementary Function
Elementary Function Block
EFBs are functions and function blocks that are available in Concept in the form of libraries. The logic of EFBs is built in C programming language and cannot be changed in the FBD editor.
Elementary Function
Functions have no internal conditions. If the input values are the same, the value at the output is the same for all executions of the function. E.g. the addition of two values gives the same result at every execution.
An Elementary Function is represented graphically as a frame with inputs and outputs. The inputs are always represented on the left and the outputs always on the right of the frame. The name of the function, that is the function type, is displayed in the center of the frame. The function counter is displayed above the frame.
The function counter cannot be changed and always has an .n.m. structure.
.n = current section number
.m = current function number
Functions are only executed in FBD if the input EN=1 or if the input EN is grayed out
(see also EN and ENO, page 219 ).
Elementary Function
216
33002204 12/2010
Function Block language FBD
Elementary Function Block
Function blocks have internal conditions. If the inputs have the same values, the value at the output at every execution is another value. E.g. with a counter, the value on the output is incremented.
A function block is represented graphically as a frame with inputs and outputs. The inputs are always represented on the left and the outputs always on the right of the frame. The name of the function block, that is the function block type, is displayed in the center of the frame. The instance name is displayed above the frame. The instance name serves as a unique identification for the function block in a project.
The instance name is produced automatically with the following structure: FBI_n_m
FBI = Function Block Instance n = Section number (current number) m = Number of the FFB object in the section (current number)
The instance name can be edited in the Object → dialog box of the function block. The instance name must be unique throughout the whole project and is not case sensitive. If the name entered already exists, you will be warned and you will have to choose another name. The instance name must correspond to the IEC name conventions, otherwise an error message occurs.
NOTE: In compliance with IEC1131-3 only letters are permitted as the first character of instance names. Should numbers be required as the first character however, the menu command Options → Preferences → IEC Extensions... →
Figures in Identifiers will enable this.
Function blocks are only executed in FBD if the input EN=1 or if the input EN is
grayed out (related topics EN and ENO, page 219 ).
Elementary Function Block
33002204 12/2010
217
Function Block language FBD
DFB
Derived Function Blocks (DFBs) are function blocks that have been defined in
Concept DFB.
With DFBs, there is no distinction between functions and function blocks. They are always treated as function blocks regardless of their internal structure.
A DFB is represented graphically as a frame with double vertical lines and with inputs and outputs. The inputs are always represented on the left and the outputs always on the right of the frame. The DFB name is displayed centrally within the frame. The instance name is displayed above the frame. The instance name serves as a unique identification for the function block in a project.
The instance name is produced automatically with the following structure: FBI_n_m
FBI = Function Block Instance n = Section number (current number) m = Number of the FFB object in the section (current number)
The instance name can be edited in the Object → dialog box of the DFB.
The instance name must be unique throughout the whole project and is not case sensitive. If the name entered already exists, you will be warned and you will have to choose another name. The instance name must correspond to the IEC name conventions, otherwise an error message occurs.
NOTE: In compliance with IEC1131-3 only letters are permitted as the first character of instance names. Should numbers be required as the first character however, the menu command Options → Preferences → IEC Extensions... →
Figures in Identifiers will enable this.
Derived function blocks are only executed in FBD if the input EN=1 or if the input EN
is grayed out (related topics EN and ENO, page 219 ).
Derived Function Block
218
33002204 12/2010
UDEFB
EN and ENO
Function Block language FBD z z
UDEFB is the generic term for:
User-defined Elementary Function
User-defined Elementary Function Block
UDEFBs are functions and function blocks that have been programmed with
Concept EFB in C++ programming language and are available in Concept in the form of libraries.
In Concept, there is no functional difference between UDEFBs and EFBs.
With all FFBs, an EN input and an ENO output can be configured.
The configuration of EN and ENO is switched on or off in the FFB Properties dialog box. The dialog box can be called up with the Objects → menu command or by double-clicking on the FFB.
If the value of EN is equal to "0" when the FFB is invoked, the algorithms that are defined by the FFB will not be executed and all outputs keep their previous values.
The value of ENO is automatically set to "0" in this case.
If the value of EN is equal to "1", when the FFB is called up, the algorithms which are defined by the FFD will be executed. After successful execution of these algorithms, the value of ENO is automatically set to "1". If an error occurs during execution of these algorithms, ENO will be set to "0".
The output behavior of the FFBs in FBD does not depend on whether the FFBs are called up without EN/ENO or with EN=1.
33002204 12/2010
219
Function Block language FBD
Link
Description
Links are connections between FFBs.
Several links can be connected with one FFB output. The link points are identified by a filled-in circle.
Data Types
The data types of the inputs/outputs to be linked must be the same.
Creating Links
Links can be created using Objects → .
Editing Links
Links can be edited in select mode. An overlap with other objects is permitted.
Configuring Loops
No loop can be configured with links because in this case, the execution order in the section cannot be determined uniquely. Loops must be resolved with actual parameters (see
Configuring Loops, page 230 ).
220
33002204 12/2010
Function Block language FBD
Actual parameters
At a Glance
Direct addresses
The information on/display of direct addresses can be given in various formats. The display format is set in the dialog box Options Presettings Joint . Setting the display format has no impact on the entry format, i.e. direct addresses can be entered in any format.
The following address formats are possible: z Standard format (400001)
The five-character address comes directly after the first digit (the Reference).
z z
Separator format (4:00001)
The first digit (the Reference) is separated from the following five-character address by a colon (:).
Compact format (4:1) z
The first digit (the Reference) is separated from the following address by a colon
(:), and the leading zeros of the address are not given.
IEC format (QW1)
In first place, there is an IEC identifier, followed by the five-character address.
z z z z
%0x12345 = %Q12345
%1x12345 = %I12345
%3x12345 = %IW12345
%4x12345 = %QW12345
Data types
In the program runtime, the values from the process or from other actual parameters are transferred to the FFB over the actual parameters and then re-emitted after processing. z z z z
These actual parameters can be: direct addresses
Located variables
Unlocated variable
z
Constants
Literals
The data type of the actual parameter must match the data type of the input/output.
The only exceptions are generic inputs/outputs, of which the data type is determined by the formal parameter. If all actual parameters consist of literals, a suitable data type is selected for the Function Block.
33002204 12/2010
221
Function Block language FBD
Initial values
FFBs, which use actual parameters on the inputs that have not yet received any value assignment, work with the initial values of these actual parameters.
Unconnected inputs
NOTE: Unconnected FFB inputs are specified as "0" by default.
222
33002204 12/2010
Function Block language FBD
Text Object
At a Glance
Text can be positioned in the form of text objects using FBD Function Block language. The size of these text objects depends on the length of the text. The size of the object, depending on the size of the text, can be extended vertically and horizontally to fill further grid units. Text objects may not overlap with FFBs; however they can overlap with links.
Memory space
Text objects occupy no memory space on the PLC because the text is not downloaded onto the PLC.
33002204 12/2010
223
Function Block language FBD
7.3
Working with the FBD Function Block langauge
Overview
This section describes working with the FBD Function Block object language..
What's in this Section?
This section contains the following topics:
Topic
Positioning Functions and Function Blocks
FFB Execution Order
Configuring Loops
Page
224
33002204 12/2010
Function Block language FBD
Positioning Functions and Function Blocks
Selecting FFBs
Using Objects → you can open a dialog for selecting FFBs. This dialog is modeless, that is, it is not automatically closed once an FFB is positioned, but remains open until you close it. If you have several FBD sections open, and invoke the dialog, only one dialog box is opened that is available for all sections. The dialog box is not available for any other sections (non-FBD editor). If the FBD sections are changed into icons (minimize window), the dialog box is closed. If one of the FBD section icons is called up again, the dialog box is automatically reopened.
The first time Concept is started the FFB is displayed oriented to the library. This means that, when selecting an FFB, the Library command button must first of all be used to select the corresponding library. Then you can select the corresponding
Group in the list box. Now, you can select the required FFB from the EFB type list.
If you do not know which library/group the FFB required is in, you can invoke an
FFB-oriented dialog with the Sorted by FFB command button. This contains all
FFBs of all libraries and groups in an alphabetical list.
After each subsequent project start, the view you selected appears.
Once the FFB has been selected, its position in the section must be selected. The cursor becomes a small FFB and the cross shows the position (upper left corner of the FFB) where the FFB is positioned. The FFB is positioned by clicking on the lefthand mouse button.
Positioning FFBs (Functions and Function Blocks)
In the FBD function block language editor, the window appears with a logic grid.
FFBs
are aligned in this grid as they are positioned. If FFBs are positioned outside of the section frame or if there is overlapping with another FFB, an error warning will appear and the FFB will not be positioned. Actual parameters may overlap another object when being positioned at an FFB input/output, but they must not go outside the limits of the section frame. If a link to another FFB is established, this link is checked. If this link is not permitted, a message is received, and the link is not established. When links are created, overlaps and crossing with other links and FFBs are permitted. If an FFB is selected, the comment relating to it is displayed in the first column of the status line. If an actual parameter is selected, its name and, if applicable, its direct address, its I/O map and its comment are displayed in the first column of the status line.
33002204 12/2010
225
Function Block language FBD
Change FFB Type
With the Objects → menu command the FFBs already positioned in the section can be replaced with FFBs of another type (e.g. an AND with an OR).
The variables given to the FFB remain if the data type and position of the inputs/outputs are the same as the "old" and the new FFB.
NOTE: FFBs with inputs / outputs of the ANY data type (generic FFBs) cannot be replaced.
226
33002204 12/2010
Function Block language FBD
FFB Execution Order
Introduction
The execution order is first determined by the order when positioning the FFB. If the
FFBs are then linked graphically, the execution order is determined by the data flow.
Display FFB Execution Order.
The execution order can also be displayed with the Objects →
Order menu command. This is represented by the execution number (number in brackets behind the instance name or function counter).
Show execution order of the FFBs
33002204 12/2010
227
Function Block language FBD
Change FFB Execution Order
The execution order can be specifically changed afterwards with the menu command Objects → , but only if the rules regarding data flow are not broken.
Changing the execution order of two networks which are in one loop
This change can only be made when the two FFBs are linked by the feedback variable of the loop.
Step 1: Select the two FFBs.
Step 2: Press the menu command Change FFB-execution sequence .
Result: The execution sequence has changed as follows:
228
33002204 12/2010
Function Block language FBD
Changing the execution order of FFBs which are executed according to the positioning order
The change operation permits the creation of a different, desired order (sometimes step by step if several FFBs are involved).
Result: The execution sequence has changed as follows:
33002204 12/2010
229
Function Block language FBD
Configuring Loops
Non-permitted Loops
Configuring loops exclusively via links is not permitted, as it is not possible to uniquely set the data flow (the output of one FFB is the input of the next FFB, and the output of this one is the input of the first).
Non-permitted Loops via Links
Resolution using an Actual Parameter
This type of logic must be resolved using actual parameters so that the data flow can be determined uniquely.
Resolved loop using an actual parameter: Variant 1
Resolved loop using an actual parameter: Variant 2
230
33002204 12/2010
Function Block language FBD
Resolution using Several Actual Parameters
Loops using several actual parameters are also allowed. With such loops, the execution order can later be influenced by executing – possibly several times – the menu command Objects →
).
Loop using several actual parameters
33002204 12/2010
231
Function Block language FBD
7.4
Code generation with the FBD Function Block language
Code Generation Options
Introduction
Using the Project
→
menu command, you can define options for code generation.
Include Diagnosis Information
If the Include Diagnosis information check box is checked, additional information for the process diagnosis (e.g. Transition Diagnosis
, diagnosis codes for diagnosis function blocks with extended diagnosis, such as e.g. XACT,
XLOCK etc. ) will be produced during code generation. This process diagnosis can be evaluated with MonitorPro or FactoryLink, for example.
Fastest Code (Restricted Checking)
If you check the Fastest code (Restricted Checking) check box, a runtimeoptimized code is generated. This runtime optimization is achieved by realizing the integer arithmetic (e.g. "+" or "-") using simple CPU commands instead of EFB invocations.
CPU commands are much quicker than EFB invocations, but they do not generate any error messages, such as, for example, arithmetic or array overflow. This option should only be used when you have ensured that the program is free of arithmetic errors.
If Fastest Code (Restricted Checking) was selected, the addition IN1 + 1 is solved with the "add" CPU command. The code is now quicker than if the ADD_INT EFB were to be invoked. However, no runtime error is generated if "IN1" is 32767. In this case, "OUT1" would overrun from 32767 to -32768!
232
33002204 12/2010
7.5
Function Block language FBD
Online functions of the FBD Function Block language
Online Functions
Introduction
There are two animation modes available in the FBD editor: z Animation of binary variables and links z Animation of selected objects
These modes are also available on display of a DFB item (command button
Refine...
in the dialog box Function block: xxx ).
NOTE: If the animated section is used as a transition section for SFC and the transition (and therefore also the transition section) is not processed, the status
DISABLED appears in the animated transition section.
Animation of binary variables and links
The animation of binary variables and links is activated with the menu command
Online
→
.
In this mode, the current signal status of binary variables, direct addresses in the 0x and 1x range and binary links is displayed in the Editor window.
Animation of selected objects
The animation of the selected objects is activated with the menu command Online
→ .
In this mode, the current signal status of the selected links, variables, multi-element variables and literals are displayed in the Editor window.
NOTE: If all variables/links of the section need to be animated, the whole section can be selected with CTRL + A and then Online → ( CTRL + W ) all variables and links of the section will be animated.
If a numerical value is selected on an input/output, the name of the variable, its direct address and I/O assignment (if available) and its comment will be displayed in the status bar.
NOTE: The selected objects remain selected even after "Animate selected" has been selected again, in order to keep these for a further reading, and/or to be able to easily modify the list of objects.
33002204 12/2010
233
Function Block language FBD
Color key
There are 12 different color schemes available for animation. An overview of the color scheme and the meaning of each color can be found in the Online help (Tip:
Search the online help for the index reference "Colors").
234
33002204 12/2010
7.6
Function Block language FBD
Creating a program with the FBD Function Block language
Creating a Program in the FBD Function Block Language
Introduction
The following description contains an example for creating a program in the function block language (FBD). The creation of a program in the function block language is divided into 2 main steps:
Step
1
2
Action
Creating a Section
Creating the Logic
Creating a Section
The procedure for creating a section is as follows:
Step
1
Action
Using the File
→
menu command, create a new section and enter a section name.
Note: The section name (max. 32 characters) is not case-sensitive and must be unique within the whole project. If the name entered already exists, you will be warned and you will have to choose a different name. The section name must comply with the IEC name conventions, otherwise an error message appears.
Note: In compliance with IEC1131-3 only letters are permitted as the first character of names. However, if you wish to use numbers as the first character, you can enable this using the Options
→ →
IEC Extensions...
→
Allow Leading Digits in Identifiers menu command.
33002204 12/2010
235
Function Block language FBD
Creating the Logic
The procedure for creating the logic is as follows:
Step
1
Action
To insert an FFB into the section, select the Objects → menu command.
Response: The FFB dialog box from the library is opened.
3
4
5
6
7
2 In this dialog box you can select a library and an FFB from it by using the
Library...
command button. You can, however, also display the DFBs that you created and select one of them using the DFB command button.
Place the selected FFB in the section.
When all FFBs have been placed, close the dialog box with Close .
Activate the selection mode with Objects
→
, click on the FFB and move the FFBs to the desired position.
Activate the link mode with Objects
→
and connect the FFBs.
Then re-activate select mode with Objects
→
and double-click on one of the unconnected inputs/outputs.
Response: The Connect FFB dialog box opens, where an actual parameter can be allocated to the input/output.
236
33002204 12/2010
33002204 12/2010
Step
8
9
Function Block language FBD
Action
Depending on the program logic you can allocate the following to the input/output: z Variable z Located variable z
You can allocate a hardware input/output signal to the input/output of the
FFB using a located variable.
The name of the variable is shown at the input/output in the editor window.
Unlocated variable z
You can use the unlocated variable allocated to the input/output of the
FFB as a discrete, i.e. when resolving loops, or when transferring values between different sections.
The name of the variable is shown at the input/output in the editor window.
Constant
You can allocate a constant to the input of the FFB. The constant can be transferred to other sections. You determine the value of the constant in the variable editor.
The name of the constant is shown at the input in the editor window.
z z
Literal
You can allocate a literal to the input, i.e. directly allocate a value to the input/output.
The value is shown at the input in the editor window.
Direct address
You can allocate a hardware input/output signal to the input/output using an address.
The address is shown at the input/output in the editor window.
Note: For an example for invocation of multi element variables see
.
Note: Unconnected FFB inputs are specified as "0" by default.
Save the FBD section with the menu command File
→
.
237
Function Block language FBD
238
33002204 12/2010
Ladder Diagram LD
33002204 12/2010
Ladder Diagram LD
8
Overview
This Chapter describes the Ladder Diagram LD which conforms to IEC 1131.
What's in this Chapter?
This chapter contains the following sections:
8.1
Section
8.2
8.3
8.4
8.5
8.6
Topic
General information about Ladder Diagram LD
Objects in Ladder Diagram LD
Working with the LD Ladder Diagram
Code generation with LD Ladder Diagram
Online functions with the LD Ladder Diagram
Creating a program withLD Ladder Diagram
Page
239
33002204 12/2010
Ladder Diagram LD
8.1
General information about Ladder Diagram LD
General Information about the LD Ladder Diagram Language
Introduction
This section describes the Ladder Diagram (LD) according to IEC 1131-3.
The structure of a LD section corresponds to a rung for relay switching. The window in the LD editor is shaded with a logic grid, on the left side of which there is the socalled left power rail. This left power rail corresponds to the phase (L ladder) of a rung. With LD programming, in the same way as in a rung, only the LD objects
(contacts, coils) which are linked to a power supply, that is to say connected with the left power rail, are "processed". The right power rail, which corresponds to the neutral ladder, is not shown optically. However, all coils and FFB outputs are linked with it internally and this creates a power flow.
Objects
The objects of the programming language LD (Ladder Diagram) help to divide a z z section into a number of: z Contacts
,
Coils
and
FFBs (Functions and Function Blocks)
.
These objects can be linked with each other through: z Links
or z Actual Parameters
.
Expansive logic can also be positioned in the LD section in the form of macros
(related topics Macros, page 521
).
Theoretically, each section can contain as many FFBs and also as many inputs and outputs as required. It is therefore advisable to subdivide a whole program into logical units, that is to say into different sections.
Comments can be provided for the logic of the section with text objects (related topics
Processing Sequence
Basically, LD sections are processed from top to bottom and from left to right.
Networks connected to the left power rail are processed from top to bottom.
The processing sequence of objects (contacts, coils, FFBs) is determined by the data flow within a network.
A detailed description can be found under Execution sequence, page 260 ).
240
33002204 12/2010
Ladder Diagram LD
Editing with the Keyboard
Normally editing in Concept is performed with the mouse, however it is also possible
with the keyboard (related topics Shortcut keys in the LD-Editor, page 841 ).
In order to make editing with the keyboard easier, you can specify the number of columns per section in the CONCEPT.INI
file, after which an automatic carriage return should appear when you are expanding a rung. This means that when you reach the last column, the next object is automatically placed in the second column of the next row. Objects on different rows are automatically linked, i.e. the objects are generated within a common rung.
IEC Conformity
For a description of the IEC conformity of the LD programming language see IEC conformity, page 849
.
33002204 12/2010
241
Ladder Diagram LD
8.2
Objects in Ladder Diagram LD
Overview
This section describes the objects in LD Ladder Diagram.
What's in this Section?
This section contains the following topics:
Topic
Contacts
Coils
Functions and Function Blocks (FFBs)
Link
Actual Parameters
Text object
Page
242
33002204 12/2010
Ladder Diagram LD
Contacts
At a Glance
Closer
A contact is an LD element that transfers a status on the horizontal link to its right side. This status comes from the boolean AND link of the status of the horizontal link on the left side, with the status of the relevant variable/direct address.
A contact does not change the value of the relevant variable/direct address.
z z z z
The following contacts are available:
Closer
Opener
Contact for detection of positive transitions
Contact for detection of negative transitions
On closing, the status of the left link is copied onto the right link, if the status of the relevant boolean variable is ON. Otherwise, the status of the right link is OFF.
Closer
Opener
On opening, the status of the left link is copied onto the right link, if the status of the relevant boolean variable is OFF. Otherwise, the status of the right link is OFF.
Opener
Contact for detection of positive transitions
With contacts for detection of positive transitions, the right link for a program cycle is ON if a transfer of the relevant boolean variable is made from OFF to ON and the status of the left link is ON at the same time. Otherwise, the status of the right link is
OFF.
Contact for detection of positive transitions
33002204 12/2010
243
Ladder Diagram LD
Contact for detection of negative transitions
With contacts for detection of negative transitions, the right link for a program cycle is ON if a transfer of the relevant boolean variable is made from ON to OFF and the status of the left link is ON at the same time. Otherwise, the status of the right link is
OFF.
Contact for detection of negative transitions
244
33002204 12/2010
Ladder Diagram LD
Coils
At a Glance
Start behavior of coils
In the start behavior of PLCs there is a distinction between cold starts and warm starts: z Cold start
Following a cold start (load the program with Load online → ) all variables
(independent of type) are set to "0" or, if available, their initial value.
z Warm start
In a warm start (stop and start the program or Online → ) different start behaviors are valid for located variables/direct addresses and unlocated variables: z z
Located variables/direct addresses
In a warm start all coils (0x registers) are set to "0" or, if available, their initial value.
Unlocated variable
In a warm start all unlocated variables retain their current value (storing behavior).
This different behavior in a warm start leads to particular characteristics in the warm start behavior of LD objects "Coil – set" and "Coil – reset". Warm start behavior is dependent on the variable type used (storing behavior in use of unlocated variables; non storing behavior in use of located variables/direct addresses)
If a buffered coil is required with a located variable or with direct addresses, the RS or SR Function Block from the IEC block library should be used.
Available coils
A coil is an LD element which transfers the status of the horizontal link on the left side, unchanged, to the horizontal link on the right side. The status is saved in the relevant variable/direct address.
z z z z z z
The following coils are available:
Coil
Coil - negated
Coil - set
Coil - reset
Coil – positive edge
Coil – negative edge
33002204 12/2010
245
Ladder Diagram LD
Coil
With coils, the status of the left link is copied onto the relevant Boolean variable and the right link.
Normally, coils follow contacts or EFBs, but they can also be followed by contacts.
Coil
Coil - negated
With negated coils, the status of the left link is copied onto the right link. The inverted status of the left link is copied onto the relevant Boolean variable. If the left link is
OFF, then the right link will also be OFF and the relevant variable will be ON.
Coil - negated
Coil – positive edge
With coils for detection of positive transfers, the status of the left link is copied onto the right link. The relevant Boolean variable is ON for a program cycle, if a transfer of the left link from OFF to ON is made.
Coil – positive edge
Coil – negative edge
With coils for detection of negative transfers, the status of the left link is copied onto the right link. The relevant Boolean variable is ON for a program cycle, if a transfer of the left link from ON to OFF is made.
Coil – negative edge
246
33002204 12/2010
Coil - set
Ladder Diagram LD
With "set coils", the status of the left link is copied onto the right link. The relevant
Boolean variable is set to ON status, if the left link is in ON status, otherwise it remains unchanged. The relevant Boolean variable can only be reset through the
"reset coil".
Coil - set
Coil - reset
With "reset coils", the status of the left link is copied onto the right link. The relevant
Boolean variable is set to OFF status, if the left link is in ON status, otherwise it remains unchanged. The relevant Boolean variable can only be set through the "set coil".
Coil - reset
33002204 12/2010
247
Ladder Diagram LD
Functions and Function Blocks (FFBs)
Introduction z z z
FFB is the generic term for:
EFB (Elementary Function and Elementary Function Block)
DFB (Derived Function Block)
UDEFB (Derived Elementary Function and Derived Elementary Function Block)
EFB z z
EFB is the generic term for:
Elementary Function
Elementary Function Block
EFBs are functions and function blocks that are available in Concept in the form of libraries. The logic of EFBs is built in C programming language and cannot be changed in the FBD editor.
NOTE: The EFBs AND_BOOL, NOT_BOOL, OR_BOOL, R_TRIG and F_TRIG are not available in LD. Their function is executed with contacts. The MOVE function cannot be used with the data type BOOL.
Elementary Function
Functions have no internal conditions. If the input values are the same, the value at the output is the same for all executions of the function. E.g. the addition of two values gives the same result at every execution.
An Elementary Function is represented graphically as a frame with inputs and outputs. The inputs are always represented on the left and the outputs always on the right of the frame. The name of the function, that is the function type, is displayed in the center of the frame. The function counter is displayed above the frame.
The function counter cannot be changed and always has an .n.m. structure.
.n = current section number
.m = current function number
Functions are only executed if the input EN=1 or if the input EN is grayed out (see
).
248
33002204 12/2010
Ladder Diagram LD
Elementary Function
Elementary Function Block
Function Blocks have internal conditions. If the inputs have the same values, the value at the output at every execution is another value. E.g. with a counter, the value on the output is incremented.
A function block is represented graphically as a frame with inputs and outputs. The inputs are always represented on the left and the outputs always on the right of the frame. The name of the function block, that is the function block type, is displayed in the center of the frame. The instance name is displayed above the frame. The instance name serves as a unique identification for the function block in a project.
The instance name is produced automatically with the following structure: FBI_n_m
FBI = Function Block Instance n = Section number (current number) m = Number of the FFB object in the section (current number)
The instance name can be edited in the Properties dialog box of the function block.
The instance name must be unique throughout the whole project and is not case sensitive. If the name entered already exists, you will be warned and you will have to choose another name. The instance name must comply with the IEC name conventions otherwise an error message appears.
NOTE: In compliance with IEC1131-3 only letters are permitted as the first character of instance names. Should numbers be required as the first character however, the
Options → Preferences → IEC Extensions... →
Identifiers menu command will enable this.
Function blocks are only executed if the input EN=1 or if the input EN is grayed out
(see also
).
33002204 12/2010
249
Ladder Diagram LD
Elementary Function Block
DFB
Derived Function Blocks are function blocks that have been defined in Concept
DFB.
With DFBs, there is no distinction between functions and function blocks. They are always treated as function blocks regardless of their internal structure.
A DFB is represented graphically as a frame with double vertical lines and with inputs and outputs. The inputs are always represented on the left and the outputs always on the right of the frame. The DFB name is displayed centrally within the frame. The instance name is displayed above the frame. The instance name serves as a unique identification for the function block in a project.
The instance name is produced automatically with the following structure: FBI_n_m
FBI = Function Block Instance n = Section number (current number) m = Number of the FFB object in the section (current number)
The instance name can be edited in the Properties dialog box of the DFB. The instance name must be unique throughout the whole project and is not case sensitive. If the name entered already exists, you will be warned and you will have to choose another name. The instance name must comply with the IEC name conventions otherwise an error message appears.
NOTE: In compliance with IEC1131-3 only letters are permitted as the first character of instance names. Should numbers be required as the first character however, the
Options
→
Preferences
→
IEC Extensions...
→
Permit Leading Figures in
Identifiers menu command will enable this.
Derived Function Blocks are only executed if the input EN=1 or if the input EN is grayed out (see also
).
250
33002204 12/2010
Ladder Diagram LD
Derived Function Block
UDEFB
Editing FFBs z z
UDEFB is the generic term for:
User-defined Elementary Function
User-defined Elementary Function Block
UDEFBs are functions and function blocks that have been programmed with
Concept EFB in C++ programming language and are available in Concept in the form of libraries.
In Concept, there is no functional difference between UDEFBs and EFBs.
FFBs are only edited if at least one Boolean input is linked with the left power rail. If the FFB has no Boolean input, the EN input of the FFB must be used. If the FFB is to be conditionally executed, the Boolean input can be pre-linked through contacts or other FFBs.
NOTE: If the EN input is not linked with the left power rail, it must be deactivated in the Properties dialog box, otherwise the FFB will never be edited.
NOTE: Each FFB without Boolean link to the left power rail gives rise to an error message when downloading onto the PLC.
33002204 12/2010
251
Ladder Diagram LD
Connection to an FFB with the left power rail:
EN and ENO
With all FFBs, an EN input and an ENO output can be configured.
EN and ENO configuration is switched on or off in the FFB properties dialog box.
The dialog box can be invoked with the Objects → menu command or by double-clicking on the FFB.
If the value of EN is equal to "0" when the FFB is invoked, the algorithms that are defined by the FFB will not be executed and all outputs keep their previous values.
The value of ENO is automatically set to "0" in this case.
If the value of EN is equal to "1", when the FFB is invoked, the algorithms which are defined by the FFD will be executed. After successful execution of these algorithms, the value of ENO is automatically set to "1". If an error occurs during execution of these algorithms, ENO will be set to "0".
NOTE: If the EN input is not linked with the left power rail, it must be deactivated in the Properties dialog box, otherwise the FFB will never be edited.
The output behavior of the FFBs does not depend on whether the FFBs are invoked without EN/ENO or with EN=1.
252
33002204 12/2010
Ladder Diagram LD
Link
Description
Links are connections between contacts, coils and FFBs.
Several links can be connected with one contact, one coil or one FFB output. The link points are identified with a filled circle.
NOTE: Unconnected contacts, coils and FFB inputs are specified as "0" by default.
Data Types
The data types of the inputs/outputs to be linked must be the same.
Editing Links
Links can be edited in select mode. An overlap with other objects is permitted.
Configuring Loops
No loop can be configured with links because in this case, the execution order in the section cannot be determined uniquely. Loops must be resolved with actual parameters (related topics
Configuring Loops, page 230 ).
Horizontal Links
Contacts and coils are automatically connected during positioning with a neighboring, unconnected contact/coil that has the same vertical position. A connection to the power rail is only established if the contact is placed nearby (also
see Defining the Contact Connection, page 1114
in the Concept INI-File chapter). If a coil or a contact is positioned on an existing horizontal link, the link is automatically separated and the contact/coil is inserted. When positioned, actual parameters may overlap another object, but they must not go outside the limits of the section frame.
If a link to another object is established, this link is checked. If this link is not permitted, you will receive a message and the link will not be generated.
Once objects are positioned, horizontal links with directly adjacent objects are automatically created.
Vertical Links
An exceptional link is the "vertical link". The vertical link serves as a logical OR. With this form of the OR link, 32 inputs (contacts) and 64 outputs (coils, links) are possible.
33002204 12/2010
253
Ladder Diagram LD
Actual Parameters
Possible Actual Parameters
In the program runtime, the values from the process or from other actual parameters are transferred to the FFB via the actual parameters and then re-emitted after processing.
Table of possible actual parameters
Element
Contacts
Coils
FFB inputs
FFB outputs
Actual Parameters z z z z z z z z z z z z z z
Direct addresses
Located variables
Unlocated variable
Direct addresses
Located variables
Unlocated variable
Direct addresses
Located variables
Unlocated variable
Constant
Literals
Direct addresses
Located variables
Unlocated variable
Direct Addresses
The information on/display of direct addresses can be given in various formats. The display format is set in the Options → Preferences → Common dialog box. Setting the display format has no impact on the entry format, i.e. direct addresses can be entered in any format.
The following address formats are possible: z Standard Format (400001) z
The five figure address comes directly after the first digit (the reference).
Separator Format (4:00001)
The first digit (the reference) is separated from the five figure address that follows by a colon (:).
z Compact format (4:1)
The first digit (the Reference) is separated from the address that follows by a colon (:) where the leading zeros are not specified.
254
33002204 12/2010
Ladder Diagram LD z IEC Format (QW1)
There is an IEC type designation in initial position, followed by the five-character z z z z address.
%0x12345 = %Q12345
%1x12345 = %I12345
%3x12345 = %IW12345
%4x12345 = %QW12345
Data Types
The data type of the actual parameter must be of BOOL type with contacts and coils.
With FFB inputs/outputs, the data type of the actual parameter must match the data type of the inputs/outputs. The only exceptions are generic FFB inputs/outputs, whose data type is determined by the formal parameter. If all actual parameters consist of literals, a suitable data type is selected for the function block.
Initial Values
FFBs, which use actual parameters on the inputs and coils that have not yet received a value assignment, work with the initial values of these actual parameters.
Unconnected Inputs
NOTE: Unconnected contacts, coils and FFB inputs/outputs are specified as "0" by default.
33002204 12/2010
255
Ladder Diagram LD
Text object
At a Glance
Text can be positioned in the form of text objects in the Ladder Diagram (LD). The size of these text objects depends on the length of the text. The size of the object, depending on the size of the text, can be extended vertically and horizontally to fill further grid units. Text objects may not overlap with other objects; however they can overlap with links.
Memory space
Text objects occupy no memory space on the PLC because the text is not downloaded onto the PLC.
256
33002204 12/2010
8.3
Working with the LD Ladder Diagram
Overview
This section describes working with LD Ladder Diagram.
What's in this Section?
This section contains the following topics:
Topic
Positioning Coils, Contacts, Functions and Function Blocks
Execution sequence
Configuring Loops
Ladder Diagram LD
Page
33002204 12/2010
257
Ladder Diagram LD
Positioning Coils, Contacts, Functions and Function Blocks
Positioning Objects
In the LD contact plan editor, the window has a logic grid in the background. The objects are aligned in the bars of this grid (52 x 230 fields) during positioning. With the exception of vertical shorts, FFBs and text fields, all elements require exactly one grid field. Objects can only be positioned within such a field. If an object is positioned between two fields, the object is automatically placed in the nearest field.
When objects are positioned outside the section frame with another object, an error message occurs and the object is not positioned.
When being positioned, contacts and coils are automatically linked with a directly adjacent, unconnected contact/coil, if the contact/ coil has the same vertical position. A link to the power rail is therefore created even if the contact is positioned
2 fields away. If contacts or coils are positioned on existing contacts or coils, the existing ones are replaced by the current ones (only applies to same types, i.e. when replacing coils with coils and contacts with contacts). If a coil or a contact is positioned on an existing horizontal short, the link is automatically separated and the contact/coil is inserted.
When positioned, actual parameters may overlap another object, but they must not go outside the limits of the section frame. If a link to another object is established, this link is checked. If this link is not permitted, you will receive a message and the link will not be generated. When producing links, overlaps and crossings with other links and objects are permitted.
If an FFB is selected, its comment is displayed in the first column of the status line.
If an actual parameter is selected, its name and, if applicable, its direct address and its comment are displayed in the first column of the status line.
Automatic Carriage Return
As a keyboard user, you have the possibility of determining the number of columns/fields in the CONCEPT.INI
file after which an automatic carriage return will appear during editing as soon as the last column/field is reached.
The following object is then inserted into the second column/field and linked to the last object of the previous row. I.e. the objects are created inside the same rung.
258
33002204 12/2010
Ladder Diagram LD
Selecting FFBs
Using Objects → Select FFB...
you can open a dialog for selecting FFBs. This dialog is modeless, which means it is not automatically closed once an FFB has been positioned, but remains open until you close it. If you have several LD sections open and you invoke the dialog, only one dialog box is opened and is available for all sections. The dialog box is not available for any other sections (not LD editor). If the
LD sections are changed into symbols (Minimize window), the dialog box is closed.
If one of the LD section symbols is invoked again, the dialog box is automatically reopened.
The first time Concept is started, the FFB is displayed oriented to the library. This means that to select an FFB, the corresponding library must first be selected using the Library command button. Then you can select the corresponding group in the
Group list box. Now, you can select the required FFB from the EFB type list box.
If you do not know which library/group the FFB required is located in, you can invoke an FFB-oriented dialog with the FFB sorted command button. This contains all
FFBs in all libraries and groups in an alphabetical list.
After each subsequent project start, the view that you select will appear.
Once the FFB has been selected, its position in the section must be selected. The cursor becomes a small FFB and the cross shows the position (upper left corner of the FFB) in which the FFB is placed. The FFB is positioned by clicking on the lefthand mouse button.
Change FFB-Type
With the Objects → menu command, the FFBs already positioned in the section can be replaced with FFBs of another type (e.g. an AND with an OR).
The variables given to the FFB remain if the data type and position of the inputs/outputs are the same in the "old" as the new FFB.
NOTE: FFBs with inputs/outputs of the ANY data type (generic FFBs) cannot be replaced.
Change contact/coil
Contacts and coils which are already positioned can simply be replaced. In order to do this, select the new element and click on the one to be replaced.
33002204 12/2010
259
Ladder Diagram LD
Execution sequence
Description
The following applies to the execution sequence in LD sections: z The execution sequence of networks which are only linked by the left power rail, is determined by the graphic position in which the networks are connected to the z left power rail.
The networks are processed from top to bottom.
See example below, Networks I-VI).
The execution sequences of objects (contacts, coils FFBs) are determined by the z data flow within a network. This means that the coils and FFBs whose inputs have already received value assignments will be processed first.
Current paths that begin at outputs (Pins) from FFBs are processed according to the vertical, graphical position of its first object (from top to bottom).
z
See example below, Network III):
Processing after the FFB (FBI_11_63) begins with the current path whose first object is located at the uppermost vertical position (13) and thus follows current path (13)->(14).
When current path (13)->(14) has been processed, processing of the next current path (15)->(19) begins.
If the first objects of 2 current paths that begin at outputs (pins) of FFBs, at the same height, the first current path to be processed is that of the object that is z farther left.
See example below, Network IV): (22)->(23) then (24)->(25).
The position of an FFB is determined by the upper left corner of the FFB.
See example below.
Network V: Upper left corner of FFB (FBI_11_76) above contact (30). Process:
(28)->(29) then (30)->(31).
Network VI: Upper left corner of FFB (FBI_11_82) same height as contact (34).
Process: (34)->(35) then (36)->(37).
260
33002204 12/2010
Example
LD section
Ladder Diagram LD
33002204 12/2010
261
Ladder Diagram LD
Configuring Loops
Non-permitted Loops
Configuring loops exclusively via links is not permitted, as it is not possible to make a unique specification of the data flow (the output of one FFB is the input of the next
FFB, and the output of this one is the input of the first).
Non-permitted Loops via Links
Resolution using an Actual Parameter
This type of logic must be resolved using actual parameters so that the data flow can be determined uniquely.
Resolved loop using an actual parameter: Variant 1
Resolved loop using an actual parameter: Variant 2
262
33002204 12/2010
Resolution using Several Actual Parameters
Loops using several actual parameters are also allowed.
Loop using several actual parameters
Ladder Diagram LD
33002204 12/2010
263
Ladder Diagram LD
8.4
Code generation with LD Ladder Diagram
Code Generation Options
Introduction
Using the Project → menu command, you can define options for code generation.
Include Diagnosis Information
If you check the Include Diagnosis Information check box, additional information for the process diagnosis (e.g. transition diagnosis, diagnosis codes for diagnosis function blocks with extended diagnosis, such as XACT, XLOCK etc.) will be created during code generation. This process diagnosis can be evaluated with MonitorPro or FactoryLink, for example.
Fastest Code (Restricted Checking)
If you check the Fastest code (Restricted Checking) check box, a runtimeoptimized code is generated. This runtime optimization is achieved by realizing the integer arithmetic (e.g. "+" or "-") using simple CPU commands instead of EFB invocations.
CPU commands are much quicker than EFB invocations, but they do not generate any error messages, such as, for example, arithmetic or array overflow. This option should only be used when you have ensured that the program is free of arithmetic errors.
If Fastest Code (Restricted Checking) was selected, the addition IN1 + 1 is solved with the "add" CPU command. The code is now quicker than if the ADD_INT EFB were to be invoked. However, no runtime error is generated if "IN1" is 32767. In this case, "OUT1" would overrun from 32767 to -32768!
264
33002204 12/2010
8.5
Ladder Diagram LD
Online functions with the LD Ladder Diagram
Online Functions
Introduction
There are two animation modes available in the LD editor: z z
Animation of binary variables and links
Animation of selected objects
These modes are also available when a DFB instance is displayed (command button Refine...
in the Function Block: xxx dialog box).
NOTE: If the animated section is used as a transition section for SFC and the transition (and therefore also the transition section) is not processed, the status
DISABLED appears in the animated transition section.
Animation of Binary Variables and Links
The animation of binary variables and links is activated using the Online
→
Booleans menu command.
In this mode, the current signal status of binary variables, direct addresses in the 0x and 1x range and binary links is displayed in the editor window.
Meaning of Colors
Color
Contact, coil, input/output, link red
Meaning
Contact, coil, input/output, link transferring the value 0
Left power rail, contact, coil, input/output, link green
Left power rail, contact, coil, input/output, link transferring the value 1
Variable highlighted in beige
Variable highlighted in purple
Variable forced
Variable cyclically set
The name of the multi-element variable (e.g. motor) highlighted in color.
In the editor, a multi-element variable (e.g. motor) is displayed, in which one or more elements is forced or cyclically set.
The whole element name of the multi-element variable (e.g. right.motor.on) is highlighted in color.
In the editor, an element of a multi-element variable (e.g. right motor on) that is forced or cyclically set is displayed.
The name of the multi-element variable (e.g. right.motor.on) is highlighted in color, but the name of the element is not.
In the editor, an element of a multi-element variable (e.g. right motor on) that is not forced or cyclically set is displayed, but a different element of this multi-element variable is cyclically set or forced.
33002204 12/2010
265
Ladder Diagram LD
Animation of Selected Objects
The animation of the selected objects is activated with the Online →
Selection menu command.
In this mode, the current signal status of the selected links, variables, multi-element variables and literals is displayed in the editor window.
NOTE: If you want to animate all variables/links in the section, you can select the whole section using CTRL + A and then animate all variables and links in the section using Online → ( CTRL + W ).
If a numerical value is selected on an input/output, the name of the variable, its direct address and I/O mapping (if existent) and its comment will be displayed in the status bar.
NOTE: The selected objects remain selected even after "animate selection" has been selected again, to retain these objects for a further reading, and/or to be able to easily modify the list of objects.
Color key
There are 12 different color schemes available for animation. An overview of the color scheme and the meaning of each color can be found in the Online help Tip:
Search the online hlep for the index reference "Colors").
266
33002204 12/2010
8.6
Ladder Diagram LD
Creating a program withLD Ladder Diagram
Creating a Program in LD
Introduction
The following description contains an example for creating a program in Ladder
Diagram (LD). The creation of a program in LD Ladder Diagram is divided into 2 main steps:
Step
1
2
Action
Creating a Section
Creating the Logic
Creating a Section
The procedure for creating a section is as follows:
Step
1
Action
Using the File
→
menu command, create a new section and enter a section name.
Note: The section name (max. 32 characters) is not case-sensitive and must be unique within the whole project. If the name entered already exists, you will be warned and you will have to choose a different name. The section name must comply with the IEC name conventions, otherwise an error message appears.
Note: In compliance with IEC1131-3 only letters are permitted as the first character of names. However, if you wish to use numbers as the first character, you can enable this using the Options
→ →
IEC Extensions...
→
Allow Leading Digits in Identifiers menu command.
33002204 12/2010
267
Ladder Diagram LD
Creating the Logic
The procedure for creating the logic is as follows:
Step
1
2
Action
To insert a contact or coil in the section, open the Objects main menu and select the desired contact or coil. Contacts and coils can also be selected using the tool bar. Place the contact or coil in the section.
To insert an FFB into the section, select the Objects → menu command.
Response: The FFBs from Library dialog box is opened.
268
7
8
4
5
6
3 In this dialog box you can select a library and an FFB from it by using the
Library...
command button. You can, however, also display the DFBs that you created and select one of them using the DFB command button.
Place the selected FFB in the section.
When all FFBs have been placed, close the dialog box with Close .
Activate select mode using Objects
→
, and move the contacts, coils and FFBs to the required position.
Activate link mode with Objects
→
, and connect the contacts, coils and
FFBs. Connect the contacts, FFBs and the left power rail.
Then re-activate select mode with Objects
→
, and double-click on a contact or coil.
Response: The Properties: LD objects dialog box is opened, in which you can allocate an actual parameter to the contact/coil.
33002204 12/2010
33002204 12/2010
Step
9
10
Ladder Diagram LD
Action
Depending on the program logic you can allocate the following to the contact/coil: z Variable z Located variable z
You can allocate a hardware input/output signal to the input/output using a located variable.
The name of the variable is shown at the input/output in the editor window
Unlocated variable
You can use the unlocated variable allocated to the input/output as a discrete, i.e. to resolve loops, or to transfer values between different sections.
The name of the variable is shown at the input/output in the editor window.
z Direct address
You can allocate a hardware input/output signal to the input/output using an address.
The address is shown at the input/output in the editor window.
Note: For an example for invocation of multi-element variables see
.
Note: Unconnected FFB inputs are specified as "0" by default.
To connect the FFB input/outputs to the actual parameters, double-click on one of the unconnected input/outputs.
Response: The Connect FFB dialog box is opened, in which you can allocate an actual parameter to the input/output.
269
Ladder Diagram LD
Step
11
12
Action
Depending on the program logic you can allocate the following to the input/output: z Variable z Located variable z
You can allocate a hardware input/output signal to the input/output using a located variable.
The name of the variable is shown at the input/output in the editor window
Unlocated variable z
You can use the unlocated variable allocated to the input/output as a discrete, i.e. to resolve loops, or to transfer values between different sections.
The name of the variable is shown at the input/output in the editor window.
Constant
You can allocate a constant to the input. The constant can be transferred to other sections. You determine the value of the constant in the variable editor.
The name of the constant is shown at the input in the editor window.
z z
Literal
You can allocate a literal to the input, i.e. directly allocate a value to the input/output.
The value is shown at the input in the editor window.
Direct address
You can allocate a hardware input/output signal to the input/output using an address.
The address is shown at the input/output in the editor window.
Note:
For an example for invocation of multi-element variables see Calling
.
Note: Unconnected FFB inputs are specified as "0" by default.
Save the LD section using the File
→
menu command.
270
33002204 12/2010
Sequence language SFC
33002204 12/2010
Sequence language SFC
9
Overview
This Chapter describes the sequence language SFC which conforms to IEC 1131.
What's in this Chapter?
This chapter contains the following sections:
9.1
Section
9.2
9.3
9.4
Topic
General information about SFC sequence language
SFC sequence language elements
Working with the SFC Sequence Language
Online functions of the SFC sequence language
Page
271
33002204 12/2010
Sequence language SFC
9.1
General information about SFC sequence language
General information about SFC language
At a Glance
The sequence language SFC is described in this section according to IEC 1131-3.
In the SFC (Sequential Function Chart) sequence language, a section is split into single configured sequential steps, through steps and transitions, which alternate in the sequence plan.
Objects z z z z z z z z z
A sequential control uses the following objects when creating a program:
Step
Transition
Jump
Connection
Alternative branch
Simultaneous branch
Alternative connection
Parallel connection
Text object
Structure of an SFC section
Steps and transitions are linked with one another through directional links. Two steps can never be directly linked, and must always be separated by a transition.
The processes of the active signal status take place along the directional links, triggered by the connecting of a transition. The direction of the string process follows the directional links and runs from the under side of the predecessor step to the top side of the successive step. Branches are processed from left to right.
A jump can be put in the place of a step. Step strings are always concluded with a jump to another step on the same step string. It is run down cyclically.
Nil or more action belong to every step. Steps without action are known as waiting steps. A condition for transition belongs to every transition.
Editing with the keyboard
Normally editing in Concept is performed with the mouse, however it is also possible with the keyboard (see also
Short Cut Keys in the FBD and SFC Editor, page 837 )
272
33002204 12/2010
Sequence language SFC
IEC conformity
For a description of the IEC conformity of the SFC programming language see IEC conformity, page 849
.
33002204 12/2010
273
Sequence language SFC
9.2
SFC sequence language elements
Overview
This section describes the SFC sequence language elements.
What's in this Section?
This section contains the following topics:
Topic
Step
Action
Transition
Transition section
Link
Jump
Alternative Branch
Alternative connection
Parallel branch
Parallel connection
Text object
Page
274
33002204 12/2010
Sequence language SFC
Step
Introduction
A step is represented using a block that contains a step name. Step names must be unique within the project.
A step becomes active when the upstream transition is satisfied and is normally inactive when the downstream transition is satisfied.
Initial Step
A special case with steps is the initial step. The initial status of a SFC section is characterized by the initial step, which is active when initializing the project containing the section. A step in a SFC section must always be defined as an initial step. In Concept it is possible to define a step in the middle of a step string as initial.
The initial step is denoted by double lined borders.
Waiting Step
Zero or more actions belong to every step. Steps without action are known as waiting steps.
Step Delay Time
A time can be entered, which is the least amount of time the step must be active for.
This is called the step delay time (step duration).
NOTE: This time is only applicable to the step, not for the actions allocated to it.
Individual times can be defined for these.
Maximum Supervision Time
The maximum supervision time specifies the maximum time in which the step should normally be active. If the step is still active after this period of time, an error message occurs, which you can view using the Online → Event Viewer . In animation mode, the error is additionally identified by a colored outline around the step object.
NOTE: This time supervision applies only to the step, not to the actions allocated to it. Individual times can be defined for these.
33002204 12/2010
275
Sequence language SFC
Minimum Supervision Time
The minimum supervision time sets the minimum time for which the step should normally be active. If the step is still active after this period of time, an error message occurs, which you can view in the Online → . In animation mode, the error is additionally identified by a colored outline around the step object.
NOTE: This time supervision applies only to the step, not to the actions allocated to it. Individual times can be defined for these.
Coordinating the Times
Step delay time< minimum supervision time< maximum supervision time
Setting the Times
In the properties dialog, the time values can be entered directly as time literals or can be set as multi element variables of data type SFCSTEP_TIMES. The values can be automatically determined in learn supervision time mode.
The time literals can be modified in animation mode.
’SFCSTEP_TIMES’ Variable
In ’SFCSTEP_TIMES’ variable usage, the learned times of these variables are assigned as the initial values. If these initial values are to be used for a long period of time, corresponding elements (min., max.) of these variables must not be written.
After the supervision times have been learned, the modified initial values must be downloaded to the PLC using Online → .
The ’SFCSTEP_TIMES’ variable can be used everywhere and has the following structure:
’varname’: SFCSTEP_TIMES
delay: TIME
min: TIME
max: TIME z z z
The elements have the following meaning:
’varname’.delay = delay time
’varname’.min = minimum supervision time varname’.max = maximum supervision time
276
33002204 12/2010
Step Variable
Sequence language SFC
Every step is implicitly allocated a (read only) variable of data type
SFCSTEP_STATE. This step variable has the name of the allocated step. The step variable can be used everywhere and has the following structure:
’Step name’: SFCSTEP_STATE
t: TIME
x: BOOL
tminErr: BOOL
tmaxErr: BOOL z z
The elements have the following meaning:
’Step name’.t = current dwell time in step
’Step name’.x
z z
1: Step active
0: Step inactive z z z
’Step name’.tminErr
1: Underflow of minimum supervision time
0: No underflow of minimum supervision time z z z
’Step name’.tmaxErr
1: Overflow of maximum supervision time
0: No overflow of maximum supervision time
33002204 12/2010
277
Sequence language SFC
Action
At a Glance
The actions, which are to be performed, as the step is active must be connected to the step.
Actions are declared in the properties dialog of the triggering step, see
.
A step can be assigned none or several actions. A step which is assigned no action, has a waiting function, i.e. it waits until the assigned transition is completed.
An action is a variable of BOOL data type.
The control of actions is expressed through the use of identifiers.
Signal assignment
The following signals can be assigned to an action: z Direct address
An action can be assigned a hardware output via a direct address. In this case, the action can be used as an enabling signal for a transition, as an input signal in another section and as an output signal for the hardware.
z Variable
The action can be used as an input signal with assistance from a variable in another section. This variable is also called action variable. z Unlocated variable
With Unlocated variablethe action can be used as an enabling signal for a transition and as an input signal in an FBD section. Unlocated variables are declared in the Variable Editor
.
z Located variable
With Located variable the action can be used as an enabling signal for a transition, as an input signal in another section and as an output signal for the hardware. Located variables are declared in the Variable Editor
.
278
33002204 12/2010
Sequence language SFC
Direct addresses
The information on/display of direct addresses can be given in various formats. The display format is set in the dialog box Options Presettings Joint . Setting the display format has no impact on the entry format, i.e. direct addresses can be entered in any format.
The following address formats are possible: z Standard format (X00001) z
The five-character address comes directly after the first digit (the Reference).
Separator format (X:00001)
The first digit (the Reference) is separated from the following five-character address by a colon (:).
z z
Compact format (X:1)
The first digit (the Reference) is separated from the following address by a colon
(:), and the leading zeros of the address are not given.
IEC format (XW1) z z z z
In first place, there is an IEC identifier, followed by the five-character address.
%0x12345 = %Q12345
%1x12345 = %I12345
%3x12345 = %IW12345
%4x12345 = %QW12345
33002204 12/2010
279
Sequence language SFC
Transition
Introduction
A transition specifies the condition through which the check of one or more pretransition steps passes on to one or more consecutive steps along the corresponding link.
Transition Condition
A transition condition is one of the variables of data type BOOL allocated to the transition.
Transition conditions are declared in the properties dialog of the transition, see also
Declaring a Transition, page 305 .
z z z
The transition condition can be: a direct address (input or output), a variable (input or output) or a Transition Section
.
Variable name position:
If...
If you allocate a direct address or a variable to the transition.
If you allocate a transition section to the transition.
Then...
Then the name of the address/variable is displayed below the transition icon.
Then the name of the transition section is displayed above the transition icon.
NOTE: The variable or address allocated to the transition is only read by the transition, never written.
Enabling a Transition
A transition is enabled if the steps immediately preceding it are active. Transitions whose immediately preceding steps are not active are not analyzed.
NOTE: If no transition condition is defined, the transition will never be active.
Transition Switch Time
The transition switch time can theoretically be as short as possible, but can never be zero. The transition switch time lasts at least the duration of the scan.
Transition Diagnosis
Transition switching can be supervised by the Transition Diagnosis
.
280
33002204 12/2010
Sequence language SFC
Transition Trigger Sweep
Transition trigger sweep occurs when the transition is enabled and the associated transition conditions are satisfied.
Triggering a transition leads to the disabling (resetting) of all immediately preceding steps that are linked to the transition, followed by the activation of all immediately following steps.
If triggering a transition leads to the activation of several steps at the same time, then the sequence belonging to these steps is called Parallel Chain
. After simultaneous activation, each of these chains is processed independently of each other. To emphasize this specific type of construction, the branch and connection of parallel chains are displayed with a double horizontal line.
33002204 12/2010
281
Sequence language SFC
Transition section
At a Glance
For every Transition
a transition section can be created. This is a section containing the logic of the transition condition and it is automatically linked with the transition.
Generating a transition section
Transition sections are generated in the properties dialog of the transition, see also
Declaring a Transition, page 305 .
Name of transition section
Name of transition section:
If…
If in the dialog Options → →
Graphical Editors...
the option Dynamically enumerated has been selected.
Then…
Then the alias designation of the transition is displayed in the Transition properties dialog automatically.
Should a name for the transition section be entered manually.
Please ensure that the name is unique throughout the whole project (the name is not case-sensitive). If the section name entered already exists, a warning is given, and another name must be chosen. The name must correspond to the IEC Name conventions, otherwise an error message appears.
NOTE: Do NOT alter the name of a transition section through Data file → properties , otherwise the link to the transition is will be lost.
Occupying a transition section
When first opening the transition section ( Edit...
key in the Transition properties dialog) this is automatically generated. The name of the transition section is displayed above the transition symbol in the SFC editor.
Altering the transition conditions
Should another option be selected after the creation of the transition section as
Transition section , a query appears, whether the transition section should be deleted. If the question is replied in the negative, the transition section remains.
A list can be displayed with the currently unused transition section with help from the command button Look up...
.
282
33002204 12/2010
Sequence language SFC
Programming languages for transition section
FBD, LD, IL and ST are possible as programming languages for transition sections.
The programming language to be used can be defined in the dialog Options →
Preferences... Common...
with the option Language for transition sections .
Should the FBD programming language be selected, the section is automatically preallocated with a UND block with 2 inputs whose outputs is preallocated with the name of the transition section. The proposed block can then be linked or altered. No such provision is evident for the other programming languages.
Editing function for transition section z z z
The editing function for transition sections is restricted as opposed to "normal" sections in the following ways: z The transition section only has one single output (transition variable), whose data type is BOOL. The name of this variable must be identical to the name entered in the Transition section field.
The transition variable can only be used once in written form.
Only functions can be used, Function Blocks cannot.
There is only one network, i.e. all functions used are linked with each other either z directly or indirectly.
Transition sections can only be reached via the menu command button Edit...
in the Transition properties dialog. They do not appear in the Open section dialog.
z In the Delete section dialog transition sections are denoted by a "T" in front of the section name.
Transition section animation
If the transition, and therefore the transition section, is not processed, the status
INHIBITED appears in the animated transition section.
33002204 12/2010
283
Sequence language SFC
Link
At a Glance
Links connect steps and transitions. Links are normally generated automatically when positioning objects. If objects are positioned in cells which do not immediately follow each other, a link must explicitly be made.
Simple sequences
The change of step and transition is consequentially repeated with simple sequences.
A process of S_5_10 to S_5_11 only takes place, if step 5_10 is in an active state and the condition for transition a is true.
284
33002204 12/2010
Sequence language SFC
Jump
General information
A jump enables a program to continue in another place. Jumps into a Parallel chain
in or out of a parallel chain are not possible.
Differences are made between chain jumps and chain loops with jumps.
Chain jump
A chain jump is a special case of alternative branch, with one or more branches containing no steps.
A process of S_5_10 via S_5_11 and S_5_12 after S_5_13 only occurs, if S_5_10 is active and the condition for transition a is true. A process of S_5_10 directly after
S_5_13 only occurs, if S_5_10 is active and the condition for transition b is true and a is false.
33002204 12/2010
285
Sequence language SFC
Chain loop
A chain loop is a special case of alternative branch, with which one or more branches lead back to a previous step.
A process of S_5_11 via S_5_10 only occurs if the condition for transition c is false and b is true.
286
33002204 12/2010
Sequence language SFC
Alternative Branch
Introduction
The alternative branch offers the possibility to program branches conditionally in the control flow of the SFC structure.
Structure
Processing Sequence
Branch transitions are processed from left to right. If a transition condition is satisfied, the remaining transitions are no longer processed The branch with the satisfied transition is activated. This gives rise to a left to right priority for branches.
If none of the transitions is switched, the currently set step remains set.
Processing
With alternative branches, as many transitions follow a step under the horizontal line as there are different sequences. Only one of these transitions can ever be switched. The branch to be solved is determined by the result of the transition conditions of the transitions, which come after the alternative branch.
Sequence processing:
If...
Then...
If S_5_10 is active and the transition condition a is true.
Then a sequence from S_5_10 to S_5_11 occurs.
If S_5_10 is active and the transition condition b is true and a is false.
Then a sequence from S_5_10 to S_5_12 occurs.
Sequence processing:
33002204 12/2010
287
Sequence language SFC
Alternative Branch after Parallel Joint
According to IEC 1131-3, alternative branches may not directly follow parallel joints.
The joint and the branch must be separated by a transition step sequence.
Example:
If you want to insert an alternative branch directly after a parallel joint, you can use the Options
→
Preferences
→
Graphic Editors
→ after Parallel Joints to do so.
Example:
Joint
288
All alternative branches must be rejoined to a single branch through Alternative
Joints
or Jumps
.
33002204 12/2010
Sequence language SFC
Alternative connection
At a Glance
In the alternative connection, the various branches of an alternative branch are again connected to one branch in which additional processing can be performed.
This connection can also be performed with a jump.
Processing
Sequence processing:
If… Then…
If S_5_10 is active and the transition condition d is true.
Then a process of S_5_10 to S_5_12 takes place.
If S_5_8 is active and the transition condition b is true, and therefore a jump to S_5_12 is performed.
Then a process of S_5_8 to S_5_12 takes place.
If S_5_11 is active and the transition condition e is true.
Then a process of S_5_11 to S_5_12 takes place.
NOTE: Only a single one of these branches is active, corresponding to the transition condition in the alternative branch.
Sequence processing:
33002204 12/2010
289
Sequence language SFC
Parallel branch
At a Glance
With parallel branches, the edit is split into two or more strings, which will be processed in parallel Only a joint transition immediately through the horizontal double synchronization lines is possible.
Processing
Processing a sequence:
If…
If S_5_10 is active and the transition condition a, which shares the same transition, is likewise true.
Then…
Then a process of S_5_10 to S_5_11,
S_5_12,… takes place.
NOTE: After the simultaneous activation of S_5_11, S_5_12 etc., the sequences run independent of each other.
Processing a sequence:
Definition of initial steps
If a step is to become an initial step within a parallel branch, a step must be defined as the initial step in each branch of the parallel branch.
290
33002204 12/2010
Sequence language SFC
Parallel connection
At a Glance
The parallel connection reconnects two or more parallel branches to a branch. The transition to a parallel connection is evaluated when all previous steps of the transition are set. Only a joint transition immediately through the double horizontal synchronisation lines is possible.
Processing
Processing a sequence:
If… Then…
If S_5_10, S_5_11 etc. are active at the same time and the transition condition d, sharing a joint transition, is true.
Then a process of S_5_10, S_5_11, …to
S_5_13 takes place.
Processing a sequence:
33002204 12/2010
291
Sequence language SFC
Text object
At a Glance
Text can be positioned in the form of text objects using SFC sequence language.
The size of these text objects depends on the length of the text. This text object is at least the size of a cell and can be vertically and horizontally enlarged to other cells according to the size of the text. Text objects can only be placed in free cells.
Memory space
Text objects occupy no memory space on the PLC because the text is not downloaded onto the PLC.
292
33002204 12/2010
9.3
Sequence language SFC
Working with the SFC Sequence Language
Overview
This section describes working with the SFC sequence language.
What's in this Section?
This section contains the following topics:
Topic
General information on editing objects
Declaring step properties
Declaring actions
Identifier
Declaring a Transition
Alias Designations for Steps and Transitions
Page
33002204 12/2010
293
Sequence language SFC
General information on editing objects
At a Glance
Maximum number of elements
To prevent step strings being subdivided, 99 linked steps with the transitions are vertically shown along with a locking jump with its transition. To limit the complexity and to enable the animation to be performed, the number of objects (Steps +
Transitions + Branches + Connections) in one section is limited to 2000.
Inserting Objects
The SFC object (Step, Transition etc.) can be inserted individually via the menu command in the main menu Objects or in the form of a a group (Step transition string, structured parallel string etc.) of the required size.
After selection of the object, a position in the step string can be selected, in which the object should be inserted. If the position selected is already occupied, space is made before insertion into the step string, if desired, and then the object placed in it. If the object is placed on a connection, it is separated, the object is inserted and a link to the newly placed object is generated.
Shifting objects
In the SFC editor the background consists of a logical grid. SFC objects can theoretically be placed in every unoccupied cell. If a link with another object is established (explicitly or by vertically placing objects in neighboring cells), this link will be tested. If this link is not permitted, a report of this is given and the object is not inserted.
Steps, transitions and jumps each require a cell. Parallel branches, parallel connections, alternative branches and alternative connections do not require a separate cell each, but are inserted into the corresponding cell of the step or transition.
If the object is shifted onto a connection, it is separated, the object is inserted and a link to the newly placed object is generated.
Copying steps
By copying and inserting it is possible to copy steps through projects. Since the definition of actions displays a reference to a variable, which is defined by the
Variable Editor for the particular project, copying between projects can result in this reference no longer being valid. In this instance, the action is deleted, the action list is updated and an error message is displayed.
294
33002204 12/2010
Sequence language SFC
Deleting steps
Steps can only be deleted after an action has been saved if the action(s) were unconnected before the step was performed.
Selecting an object
The procedure for selecting an object is as follows:
Step
1
2
Action
With Objects
→
go to selection mode.
Position the cursor on the object to be selected and left-click.
Reaction: The selected object is displayed in a blue border.
Selecting several objects (by pressing Shift)
The procedure for selecting several objects (by pressing Shift) is as follows:
Step
1
2
3
Action
With Objects
→
go to selection mode.
Position the cursor on the object to be selected first and left-click.
Press and hold the Shift key, select additional objects and left-click.
Reaction: The selected objects are displayed in a blue border.
Selecting several objects (by using the rubber band function)
The procedure for selecting several objects (by using the rubber band function) is as follows:
Step
1
2
Action
With Objects → go to selection mode.
Press and hold the left mouse button, and pull a border over the objects to be selected.
Reaction: On releasing the mouse key, all objects touching the border will be selected. The selected objects are displayed in a blue border.
Selecting all objects in a column/line
The procedure for selecting all objects in a column/line is as follows:
Step
1
2
Action
With Objects → go to selection mode.
In the column ruler/line ruler, click on the column number/line number whose objects are to be selected.
Note: To select several columns/lines, press and hold the Shift key.
Reaction: The selected objects are displayed in a blue border.
33002204 12/2010
295
Sequence language SFC
Inserting additional columns
The procedure for inserting additional columns within an existing step string is as follows:
Step
1
2
3
Action
With Objects
→
go to selection mode.
In the column ruler, click on the column number in front of which the insertion is to be performed.
Note: In order to insert several columns, press the Shift key to select several columns and insert a corresponding number of empty spaces.
Use the menu command Edit
→
.
Reaction: From the selected column, the entire step string is moved one column to the right. The links (branches) will remain intact.
Inserting additional lines
The procedure for inserting additional lines within an existing step string is as follows:
Step
1
2
3
Action
With Objects → go to selection mode.
In the line ruler, click on the line number in front of which the insertion is to take place.
Note: Should the insertion of several lines be required, several lines are selected and a corresponding number of empty spaces are inserted by pressing the Shift key.
Use the menu command Edit
→
.
Reaction: From the selected line, the entire step string is moved one line downwards. The links (branches) therefore remain even.
296
33002204 12/2010
Sequence language SFC
Declaring step properties
Introduction
The step properties are declared in the properties dialog of the step.
Declaring step properties:
33002204 12/2010
297
Sequence language SFC
Declaring step properties
The following description contains an example of declaring the step properties:
Step
1
2
3
4
5
6
Action
With Objects → go to selection mode.
Double-click on a step.
Result: The dialog Step properties of the step opens.
A name can be manually defined for the step, or the proposed name can remain.
If a name is to be assigned, please note that the step name (max. 32 characters) must be unique for the entire project. If the step name entered already exists, a warning is given and another name must be chosen. The step name must correspond to the IEC name conventions, otherwise an error message is displayed.
Note: In accordance with IEC1131-3, only letters are permitted as the first character of step names. Should numbers be required as the first character, however, use the menu command Options → IEC Extensions
Step names may not end in 4 digits (e.g. xxx_1234). This ending is reserved in case in Options → Graphical Editors...
the options button
Dynamic numbered is activated.
Instead of the free names an alias designation can also be selected, see also
Alias Designations for Steps and Transitions, page 307
This is then shown in
SFC and FBD sections and with search functions, application documentation and analysis.
Next, define whether or not the step is the initial step of the sequence. A initial step must be defined for each sequence.
If desired, the Supervision time and delay time can be defined for the step.
The time values can be entered in the properties dialog either directly as time duration literal (this can be automatically transmitted in the Learn Supervision time mode, see also
Learn monitoring times, page 316 ) or as multi-element
variable of SFCSTEP_TIMES data type, see also ’SFCSTEP_TIMES’ Variable, page 276
.
Here:
Delay time< minimum Supervision time< maximum Supervision time
Using the button Comment call up the dialog box Enter with comment , in which a comment on the step may be entered. This comment is shown in the status bar of the editor window, when the step is selected.
298
33002204 12/2010
Declaring actions
At a Glance
The actions are declared in the properties dialog of the step.
Declaring actions:
Sequence language SFC
33002204 12/2010
299
Sequence language SFC
Declaring actions
The following description contains an example of declaring the actions:
Step
1
2
3
4
5
6
Action
With Objects → go to selection mode.
Double-click on a step.
Reaction: The dialog Step properties of the step is opened.
From the Cdet list, select an Identifier
for the Action. In this way, the behavior of the action is determined (e.g. saving, non saving, delayed etc.).
Note: With the identifiers L, D, and DS, in the text box Time duration: an additional time duration of TIME data type must be defined.
Next define the type of action (variable or dirct address) in the zone Type: with the option buttons.
z z
If the Variable has been selected, it is possible with the button Var. declaration...
to open the Variable Editor and define a new output variable there.
Also with the command button Look up... a list of all the variables can be shown and one selected through Select.
If the Direct address has been selected, in the text box Direct address: the output address must be entered.
After all the definitions for the actions have been met, confirm this with the command button New
Note: Confirmation with the Enter key is not possible in this case and leads to an error message
Altering an action
The procedure for altering an action declaration is as follows:
Step
1
2
3
4
5
Action
With Objects
→
go to selection mode.
Double-click on a step.
Reaction: The dialog Step properties of the step is opened.
To alter an action declaration, select an action in the list.
Reaction: All definitions (identifiers, time duration, variable or address and type) of the action are transferred into the corresponding text boxes and lists.
If these definitions are altered, as described in the Declaring actions, page 300
section.
z z
Should it be necessary to assign these new definitions as a new action in the step, use the command button New .
Reaction: The action is additionally recorded in the list of actions.
Should it be necessary to overwrite the current action with the new action, use the command button Accept
Reaction: The old action is overwritten.
300
33002204 12/2010
Sequence language SFC
Deleting an action declaration
The procedure for deleting an action declaration is as follows:
Step
1
2
3
4
Action
With Objects → go to selection mode.
Double-click on a step.
Reaction: The dialog Step properties of the step is opened.
To delete an action declaration, select an action in the list.
Reaction: All definitions (identifiers, time duration, variable or address and type) of the action are transferred into the corresponding text boxes and lists.
Use the command button Delete .
Reaction: The selected action is deleted.
33002204 12/2010
301
Sequence language SFC
Identifier
At a Glance
Identifier N / none
The identifiers N and none have the same meaning and stand for "Not saved" and/or
"No identifier".
Identifier S
For every connection of an action to a step, an identifier must be defined for the action. The identifier must define the control of the action. The identifier can be introduced as the input of an internal Function Block for the configured link of the step with the action. If the step is active, the input of this internal Function Block is set to 1. The Function Block is then processed according to its type. If all conditions are satisfied, the output Q (action) is set to 1.
z z z z z z z
The following identifiers are usable in Concept:
N / none
S
R
L
D
P
DS
For the identifiers L, D and DS, a time duration of the data type TIME must additionally be defined.
The identifier S stands for "set (saved)".
The set action also remains active, when the associated step is inactive. The action first becomes inactive, when reset is used with the Identifier R
in another step.
NOTE: The identifier is automatically declared as unbuffered. This means that the value is reset to "0" after stop and cold restart, e.g. when voltage is on/off. Should a buffered output be required, please use the RS or SR Function Block from the IEC block library.
302
33002204 12/2010
Identifier R
Sequence language SFC
The identifier R stands for "overriding reset".
The action, which is set in another step with the Identifier S
, is reset.
The activation of any action can also be prevented.
NOTE: The identifier is automatically declared as unbuffered. This means that the value is reset to "0" after stop and cold restart, e.g. when voltage is on/off. Should a buffered output be required, please use the RS or SR Function Block from the IEC block library.
In the step S_5_10 the action ACT1 becomes and remains active, until the reset in step S_5_12.
Identifier L
Identifier D
33002204 12/2010
The identifier L stands for "Limited".
If the step is active, the action is also active. After the process of the time duration, defined manually for the action, the action returns to 0, even if the step is still active.
The action also becomes 0 if the step is inactive.
The identifier D stands for "delayed".
If the step is active, the internal timer is started and the action becomes 1 after the process of the time duration, which was defined manually for the action. If the step becomes inactive after that, the action becomes inactive as well. If the step becomes inactive before the process of the internal time, the action does not become active.
303
Sequence language SFC
Identifier P
The identifier P stands for "Pulse".
If the step becomes active, the action becomes 1 and this remains for one program cycle, independent of whether or not the step remains active.
Identifier DS
The identifier DS stands for "delayed and saved". It is a combination of the identifiers
D
and S
.
If the step becomes active, the internal timer is started and the action becomes active after the process of the manually defined time duration. The action first becomes inactive once again, when reset is used with the IdentifierR
in another step. If the step becomes inactive before the process of the internal time, the action does not become active.
304
33002204 12/2010
Sequence language SFC
Declaring a Transition
Introduction
Transitions are declared in the properties dialog of the transition.
Declaring a transition:
33002204 12/2010
305
Sequence language SFC
Declaring a transition:
The following example describes the procedure when declaring a transition:
Step
1
2
3
4
5
6
7
Action
With Objects → go to selection mode.
Double-click on a transition.
Response: The dialog Transition properties of the transition is opened.
Begin by determining Kind of transition condition: determine the type
( Transition section , Variable , Literal , Direct address ) of transition condition.
z z z z
After selecting the Transition section has been selected, enter in the text box Transition section the name of the transition section to be created. This is a section containing the logic of the transition condition and it is automatically linked with the transition. To process this section, press the command button Process...
.
After selecting the Variable has been selected, enter in the text box BOOL variable the name of the selected unlocated variable, located variable or constants.
Note:
For an example for invocation of multi-element variables see Calling
.
If the Literal has been selected, select in the field Value the value of the literal.
If the Dir. address , enter in the text box Direct address the required address.
The transition condition can now be inverted with the Invert trans. cond.
check box.
Response: An inverted transition condition is displayed with a (~) symbol in front of the name of the variable on the transition.
With the command button Comment click on the dialog box Enter with comment , in which a comment about the transistion can be entered. This comment is shown in the status bar of the editor window, if the transition is selected.
After all the definitions for the transition have been met, confirm this with the command button OK .
Copying transition conditions
By copying and inserting it is possible to copy transitions through projects. Since the definition of a transition displays a reference to a variable, which is defined by the
Variable Editor for the particular project, copying between projects can result in this reference no longer being valid. In this instance, the transition condition is deleted and an error message appears.
306
33002204 12/2010
Sequence language SFC
Alias Designations for Steps and Transitions
Introduction
Instead of free names you can also select alias designations for steps and transitions. These are then displayed in SFC and FBD sections during search functions, application documentation and analysis.
Import and export functions do not recognize the alias designations, since they are dynamically generated. The visualization can retrieve the alias designations dynamically, however they cannot be used for the configuration of fixed references, since they can change constantly.
The languages ST, IL and LD do not support alias designations and display the free names.
Name Definition
The alias designations are dynamically generated during editing procedures, and the same applies when the Dynamic Numbered option is switched on.
Alias designations remain empty until numbering can take place i.e. when all objects are linked to one chain.
The alias designations are made up of the position of the steps and transitions in the section and the section name.
The length of the section name part displayed in the alias designation is freely definable in the Options → Preferences → dialog.
You can define how many characters from the section name (beginning with the first character) should go into the alias designations here.
NOTE: The settings in this dialog are used in the project description (PRJ.DSK) and in the Concept installations description (CONCEPT.DSK), i.e. they are valid for the entire Concept installation.
If a project is opened, which was created using alternative settings (e.g. Settings from Presentation of Steps and Transitions numbered IEC_like in the project and
Dynamic numbered in the current Concept installation), errors can occur when opening projects.
Alias Designations for Steps
With steps, the lines and columns occupied by steps are each numbered beginning with the top left. A four-figure step number is made from the column and line numbers (ccll). The alias designation for steps is made from S_ string, part of the section name (nnn), a further underscore (_) and the step number (ccll) (S_nn_ccll).
33002204 12/2010
307
Sequence language SFC
Alias Designations for Transitions
The alias designations for transitions are derived from the alias designation of the preceding step cell, even when this is empty. The alias designation for transitions is made from the T_ string, part of the section name (nnn), a further underscore (_) and the number of the preceding step cell (ccll) (T_nn_ccll).
Activating the Alias Designations
The free name is entered as the default for steps and transitions. If you require alias designations, you can activate them in the Options → Preferences →
Editors Preferences dialog using the Dynamic Numbered option.
CAUTION
Danger of loss of data.
The free names ( IEC_like ) are overwritten by the alias names when this option is selected. If you want to restore the free names, close the project without saving.
Failure to follow these instructions can result in injury or equipment damage.
CAUTION
Danger of loss of data.
You must not switch between the IEC_like and Dynamic Numbered display modes if an FBD transition section is already open. Otherwise, this could result in section and variable names containing spaces. Therefore, close all FBD transition sections before you change the representation mode.
Failure to follow these instructions can result in injury or equipment damage.
308
33002204 12/2010
Example for Alias Designations
Example for alias designations:
Sequence language SFC
Inserting and Deleting Objects
When inserting and deleting objects (steps and transitions) the alias designations are renumbered.
33002204 12/2010
309
Sequence language SFC
9.4
Online functions of the SFC sequence language
Overview
This section describes the online functions of the SFC sequence language elements.
What's in this Section?
This section contains the following topics:
Topic
Animation
Controlling a Step String
Learn monitoring times
Transition diagnosis
Page
310
33002204 12/2010
Sequence language SFC
Animation
Introduction
In the animation mode the following are displayed in different colors in the editor z z z z window: the active steps, the time the steps are or were active for, time out errors of the steps and the status of the transitions (made, not made).
NOTE: If the transition, and therefore the transition section, is not processed, the status DISABLED appears in the animated transition section.
Activating the Animation
The animation is activated with the menu command Online → .
Color key
There are 12 different color schemes available for animation. An overview of the color scheme and the meaning of each color can be found in Online help (Tip:
Search the online help for the index reference "Colors").
Changing Values
In this mode the following can be changed: z With transitions: z the transition condition, if this is a literal. z z z z z
With steps: the maximum supervision time, the minimum supervision time, the delay time and the times of the actions.
These changes are sent online to the PLC.
33002204 12/2010
311
Sequence language SFC
Transition Animation
Normally, only the currently evaluated transitions are animated and their status
(transition condition satisfied/not satisfied) is displayed.
It is also possible to display the status of the transitions not currently being processed. This will only show the status of the transitions. It has no influence on the behavior of the sequence. To do this you require the XSFCCNTRL function block of the SYSTEM block library. Additionally, in the Options → Preferences → Graphical
Editors dialog, you must check the Animate All Conditions of the Transition
Section check box.
NOTE: This function leads to a considerable burden on the logic scan. This results from the fact that all the transitions in the affected section are solved and animated in one logic scan, whereas this is normally solved sequentially depending on the process status (preceding step active/inactive).
Displaying all Transition Conditions
The procedure for showing all transition conditions is as follows:
Step
1
2
3
4
5
6
Action
Create an FBD section and enter the XSFCCNTRL function block of the
SYSTEM block library.
Enter the names of the SFC section to be animated as the instance name (block name) of the XSFCCNTRL function block.
Assign the value "1" to the ALLTRANS input of the XSFCCNTRL function block
(using a literal or, depending on the process, a variable).
Response: By doing this, the calculation of all transition conditions is activated.
Otherwise an old status of the transition condition would be displayed.
With the menu command Project
→
(or the project browser) ensure that the FBD section is executed before the SFC section to be animated
Check the Animate All Conditions of the Transition Section check box in the
Options
→
Graphical Editors dialog.
Download the program to the PLC and start the animation of the SFC section.
Response: All transition conditions are then displayed.
312
33002204 12/2010
Sequence language SFC
Controlling a Step String
Introduction z z z
There are 3 ways of controlling a string: with the animation control with the menu commands in the main menu Online with the SFCCNTRL or XSFCCNTRL function block (SYSTEM block library)
If controlling a string through the different options simultaneously, these control operations have equal priority.
The control operations triggered using the menu commands in the Online main menu and using the animation panel can be locked by the function blocks
SFCCNTRL and XSFCCNTRL.
A control operation in one of the methods is also displayed in the other two methods.
Requirements
It is only possible to control the step string when the animation mode for the section is active.
Animation Panel
The animation panel is activated with the menu command Online →
Animation Panel .
The animation panel contains all the possibilities that are also available as menu commands.
Mode of Functioning
You can test the processing of an SFC section with the animation panel and the menu commands. For example, steps can be relayed, the processing of the string can be controlled (whether or not transitions and/or actions are to be processed), time errors can be reset or the string can be reset to initialization status.
33002204 12/2010
WARNING
Danger of unsafe, dangerous and destructive tool operations.
Set/Reset flag , Disable Transitions , Disable Actions , Step Unconditional ,
Step/Trans. dependant and Force Selected Steps should not be used for debugging on controllers of machine tools, processes or material maintenance systems when they are running. This can lead to unsafe, dangerous and destructive operation of tools or processes linked to the controller.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
313
Sequence language SFC
Set/Reset Flag
The Set/Reset flag resets the string and starts it as standard.
z Reset chain
To reset the string, activate Set/Reset Flag . This stops the chain and all actions are reset. No operator interventions are possible.
z Starting the chain in a standardized way
For a standardized start of the string, Set/Reset Flag must first be activated and then deactivated. With the 1 → activated.
Disable Time Check
If Disable Time Check is activated, there is no longer any time supervision of the steps. The step delay time, however, still remains active.
Disable Transitions
If Disable Transitions is activated, the transition conditions are no longer utilized.
The string remains in its current state, independent of the signals on the transitions.
The string can still only be used via the control commands ( Set/Reset Flag , Step
Unconditional , Step/Trans. Dependant ).
Disable Actions
If Disable Actions is activated, the step actions are no longer processed.
Step Unconditional
The next step is activated independently of the transition status, but not until the step delay time of the active step has elapsed.
With Step Unconditional , all branches are activated in parallel branches, and the left branch is always activated in alternate branches.
Step/Trans. dependent is used for activating process-dependent branches.
WARNING
Danger of unsafe, dangerous and destructive tool operations.
Step Unconditional activates the next step, even if the transition is not satisfied.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
314
33002204 12/2010
Sequence language SFC
Step/Trans. Dependent
The next step is activated when the transition conditions are satisfied.
Step/Trans. Dependent is advisable only when Disable Transitions is active.
By freezing the transitions ( Disable Transitions ) it is possible, with Step/Trans.
Dependent to process the string elements manually step by step. In this way the transitions commutate depending on the transition condition.
Reset Time Error
If Reset Time Error is activated, the error message display for time supervision in the SFC section is reset.
Force Selected Steps
The selected step(s) are activated independent of the status of the transitions and steps.
In alternative branches, only one single step and one single branch can be activated.
In parallel branches, steps can only be set, if the process is already located in the parallel branch and one step in every branch is active. If one step is set in a parallel branch, all other parallel branches remain unaffected by it.
WARNING
Danger of unsafe, dangerous and destructive tool operations.
Force Selected Steps activates the selected steps, even if the transition is not satisfied.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
This functionality is not available via the function blocks SFCCNTRL or
XSFCCNTRL (SYSTEM block library).
Select Active Steps
The active step of the step string is searched for and selected.
33002204 12/2010
315
Sequence language SFC
Learn monitoring times
At a Glance
In this mode, the minimum and maximum times, for which the steps were active, are determined. After mode deactivation, the determined times for the single steps are shown in the Learn step monitoring times dialog box. From there, the minimum
and maximum monitoring time
are accepted in the step properties. During the transfer, a factor can be specified for the minimum and maximum time.
NOTE: This functionality is not available via the Function Blocks SFCCNTRL or
XSFCCNTRL (Block library SYSTEM).
Note on determining values
Please ensure that at least 2 cycles typical for the process were gathered.
The determined values are first saved after the single step becomes inactive, i.e. if a step was never active during the "Learn monitoring times" mode, no value is determined for this step.
The storage of all determined step cells of a cycle can take some time. Because of this, very long step sequence times and very short individual step durations may be indeterminable, due to internal time overlaps.
Use of ’SFCSTEP_TIMES’ variable or constants
Should the step have been assigned a ’SFCSTEP_TIMES’ variable or constant in the Step properties dialog, the times learned for these variables/constants are shown as the initial value. Should these initial values be used for a long period of time, do not allow corresponding elements (min., max.) of these variables/constants to be written.
After learning the monitoring times, the altered initial values must be loaded into the
PLC.
z z
This is performed for variables with the menu command Online → .
This is performed for constants with the menu command Online → changes.
Calculating "learned" times
A factor can be defined for the determined values, which are multiplied when z z calculating the monitoring times.
Minimum monitoring time = minimum determined time x Minimum [%]
Maximum monitoring time = maximum determined time x Maximum [%]
316
33002204 12/2010
Sequence language SFC
Calculating "learned" times " Example 1 z z
Calculating "learned" times
The determined times for one step are: 1 s, 2 s, 2 s
Minimum [%]: 50 z Maximum [%]: 200
Following the above formula, this results in a minimum monitoring time of 500 ms and a maximum monitoring time of 4 s.
Calculating "learned" times " Example 2
If a delay time is given for the step, this is considered when calculating the minimum monitoring time. I.e. if the delay time is larger than the calculated value for the minimum monitoring time, the calculated value for the minimum monitoring time is ignored and set to 0 ms (i.e. there is no monitoring of the minimum time).
z z z z
Calculating "learned" times
The determined times for one step are: 1 s, 2 s, 2 s
Delay time: 2 s
Minimum [%]: 50
Maximum [%]: 200
This results in a minimum monitoring time of 0 ms and a maximum monitoring time of 4 s.
Calculating "learned" times " Example 3
If a delay time is given for the step, this is likewise considered when calculating the maximum monitoring time. I.e. if the delay time is larger than the calculated value for the maximum monitoring time, the calculated value for the maximum monitoring time is ignored and in its place, a suitable value is calculated.
In such a case 2 cases are considered: z A value for the minimum monitoring time is available.
Then the value for the maximum monitoring time is calculated according to the z z z z following formula: Minimum monitoring time + 20 ms
Example:
The determined times for one step are: 2 s, 2 s, 2 s
Delay time: 3 s
Minimum [%]: 200
Maximum [%]: 100
Following the above formula, this results in a minimum monitoring time of 4 s and a maximum monitoring time of 4s20ms.
33002204 12/2010
317
Sequence language SFC z z z z z
No value for the minimum monitoring time is available, see example 2 .
Then the value for the maximum monitoring time is calculated according to the following formula: Delay time + 20 ms
Example:
The determined times for one step are: 1 s, 2 s, 2 s
Delay time: 1 s
Minimum [%]: 50
Maximum [%]: 100
Following the above formula, this results in a minimum monitoring time of 0 s and a maximum monitoring time of 1s20ms.
318
33002204 12/2010
Sequence language SFC
Transition diagnosis
Preview
The transition diagnosis monitors that the immediately preceding step was active following the transition, commutated within a certain time in the step sequence (with parallel branches in the step sequences). Should this not be the case, the associated transition network (with alternative branches, the transition network of all associated transitions) is analysed, and the error, including the analysed signal, is entered in the signal buffer. This can now be evaluated using visualization software
(e.g. MonitorPro, Factory Link).
NOTE: The transition diagnosis only runs when the string is active.
Transition diagnosis vs. Reaction diagnosis
The performance of the transition diagnosis is about equal to that of the reaction diagnosis (see Function Block REA_DIA from the block library DIAGNO ). Contrary to the reaction diagnosis the re-registration of all the actions started and possible additional conditions are monitored here.
Activating the transition diagnosis
Activating the transition diagnosis:
Step
1
2
3
Action
Activate the transition diagnosis by entering a Mon. time in the field Maximum step properties of the immediately preceding step (see also
Learn monitoring times, page 316 ).
If the field remains empty or the time 0 is entered the transition monitoring is inactive.
Aktivate in the dialog Project
→
Code generation options...
the option Include diagnosis information to make memory available in the PLC for the error buffer.
Load the altered configuration into the PLC.
33002204 12/2010
319
Sequence language SFC
320
33002204 12/2010
Instruction list IL
33002204 12/2010
Instruction list IL
10
Overview
This Chapter describes the programming language instruction list IL which conforms to IEC 1131.
What's in this Chapter?
This chapter contains the following sections:
Section
10.1
10.2
10.3
10.4
10.5
10.6
10.7
Topic
General information about the IL instruction list
Instructions
IL instruction list operators
Call up of functions, Function Blocks (EFBs) and Derived
Function Blocks (DFBs)
Syntax check and Code generation
Online functions of the IL instruction list
Creating a program with the IL instruction list
Page
321
33002204 12/2010
Instruction list IL
10.1
General information about the IL instruction list
General Information about the IL Instruction List
Introduction
Spell Check
IEC Conventions
The IEC 1131 does not permit the input of direct addresses in the usual Concept
form. To input direct addresses see Operands, page 327 .
In accordance with IEC 113-3, key words must be entered in upper case. Should the use of lower case letters be required, they can be enabled in the dialog box Options
→ Preferences → IEC Extensions... → with the option Allow case insensitive keywords .
Blank spaces and tabs have no influence upon the syntax and can be used freely.
Context help
Spelling is immediately checked when key words, separators and comments are entered. If a key word, separator or comment is recognized, it is identified with a color surround. If unauthorized key words (instructions or operators) are entered, it is likewise identified in color.
With the right mouse button an object can be selected and at the same time a context sensitive menu called up. Therefore, for example, with FFBs the right mouse button can call up the associated block description.
Syntax Check
With assistance from the programming language (IL) instruction list e.g. Function
Blocks and functions can be called up conditionally or unconditionally, assignments can be performed, and jumps can be performed conditionally or unconditionally within a section.
A syntax check can be performed during the program/DFB creation with Project →
Analyze section
, see also Syntax Check, page 382
.
Codegeneration
Using the Project → menu command, you can define options for code generation, see also
.
322
33002204 12/2010
Instruction list IL
Editing with the Keyboard
Normally editing in Concept is performed with the mouse, however it is also possible
with the keyboard (see also Short Cut Keys in the IL, ST and Data Type Editor, page 834
).
IEC Conformity
For a description of the IEC conformity of the IL programming language see IEC conformity, page 849
.
33002204 12/2010
323
Instruction list IL
10.2
Instructions
Overview
This section contains an overview of the instructions for the programming language instruction list.(IL)
What's in this Section?
This section contains the following topics:
Topic
General information about instructions
Operands
Modifier
Operators
Tag
Declaration (VAR...END_VAR)
Comment
Page
324
33002204 12/2010
Instruction list IL
General information about instructions
At a Glance
An instruction list is composed of a series of instructions.
z z
Each instruction begins on a new line and consists of: an Operator
, if necessary with modifier
and z if necessary one or more operands
.
Should several operands be used, they are separated by commas. It is possible for a mark
to be in front of the instruction, which is followed by a colon.
A comment
can follow the instruction.
Example:
Structure of the programming language
IL is a so-called battery orientated language, i.e. each instruction uses or alters the current content of the battery (a form of internal cache). The IEC 1131 refers to this battery as the "result".
For this reason, an instruction list should always begin with the LD operand ("Load in battery command").
Example of an addition:
Command
LD 10
ADD 25
ST A
Meaning
The value "10" is loaded into the battery.
"25" is added to the battery content.
The result is stored in the "A" variable.
The content of the "A" variable and the battery is now "35". A possible ensuing instruction would be worked with the battery content "35", should it not begin with LD.
33002204 12/2010
325
Instruction list IL
Comparative operations likewise always refer to the battery. The Boolean result of the comparison is stored in the battery and is therefore the current battery content.
Example of a comparison:
Command
LD B
GT 10
ST A
Meaning
The value "B" is loaded into the battery.
"10" is compared with the battery content.
The result of the comparison is stored in the "A" variable.
If "B" is less than or equal to "10", the value of both the "A" variable, and the battery content is "0" (FALSE). If "B" is greater than or equal to "10", the value of both the "A" variable, and the battery content is "1" (TRUE).
326
33002204 12/2010
Instruction list IL
Operands
At a Glance z z z z z z
An operand can be: a literal, a variable, a multi-element variable, an element of a multi-element variable, a FB/DFB output or a direct address.
Access to the field variables
When accessing the field variable (ARRAY), only literals and variables of ANY_INT type are permitted in the index entry.
Example: Saving a field variable
LD var1[i]
ST var2.otto[4]
Type conversion
The operand and the current accu content must be of the same type. Should operands of various types be processed, a type conversion must be performed beforehand.
An exception is the data type TIME in conjunction with the arithmetic operators MUL and DIV. With both these operators, an operand of TIME data type can be processed together with an operand of ANY_NUM data type. The result of this instruction has in this instance the data type TIME.
Example: Integer variable and real variable
In the example the integer variable "i1" is converted into a real variable, before being added to the real variable "r4".
LD i1
INT_TO_REAL
ADD r4
ST r3
33002204 12/2010
327
Instruction list IL
Example: Integer variable and time variable
In the example the time variable "t2" is multiplied by the integer variable "i4" and the result is stored in the time variable "t1".
LD t2
MUL i4
ST t1
Default data types of direct addresses
The following table shows the default data types of direct addresses:
Input
%IX,%I
%IB
%IW
%ID
Output
%QX,%Q
%QB
%QW
%QD
Default data type
BOOL
BYTE
INT
REAL possible data type
BOOL
BYTE
INT, UINT, WORD
REAL, DINT, UDINT, TIME
Using other data types
Should other data types be assigned as default data types of a direct address, this must be done through an explicit declaration (VAR…END_VAR
).
VAR…END_VAR cannot be used in Concept for the declaration of variables. The variable declaration conveniently follows the Variable Editor
.
328
33002204 12/2010
Instruction list IL
Modifier
At a Glance
Modifier N
Modifiers influence the implementation of the preceding operators (see Operators, page 331
).
The Modifier N is used to invert the value of the operands bit by bit.
The modifier can only be used on operands with the ANY_BIT data type.
Example: N
Modifier C
In the example C will be "1", when A is "1" and B is "0".
LD A
AND N B
ST C
The modifier C is used to carry out the associated instruction, should the value of the battery be "1" (TRUE).
The modifier can only be used on operands with the BOOL data type.
Example: C
Modifier CN
Example: CN
In the example the jump after START is only performed, when A is "1" (TRUE) and
B is "1" (TRUE).
LD AAND BJMP C START
If the modifiers C and N are combined, the associated instruction is only performed, should the value of the battery be a Boolean "0" (FALSE).
In the example, the jump after START is only performed, when A is "0" (FALSE) and/or B is "0" (FALSE).
LD A
AND B
JMP CN START
33002204 12/2010
329
Instruction list IL
Left bracket modifier "("
The left bracket modifier "(" is used to move back the evaluation of the operand, until the right bracket operator appears. The number of right bracket operations must be equal to the number of left bracket modifiers. Brackets can be nested.
Example: Left bracket "("
In the example E will be "1", if C and/or D is "1", just as A and B are "1".
LD A
AND B
AND ( C
OR D
)
ST E
The example can also be programmed in the following manner:
LD A
AND B
AND (
LD C
OR D
)
ST E
330
33002204 12/2010
Instruction list IL
Operators
At a Glance z z z
An operator is a symbol for: an arithmetic operation to be executed, a configured operation to be executed or the function call up.
Operators are generic, i.e. they are automatically suited to the operands data type.
NOTE: Operators can be either entered by hand or generated with assistance from the menu Objects .
Table of operators
IL programming language operators:
Operator
LD
Operator key
Loads the operands value into the battery possible modifier
N
ST
S
R
AND
Saves the battery value in the operand
N
Sets the operand to 1, when the battery content is 1
Sets the operand to 0, when the battery content is 1
Configured AND N, N(, (
OR
XOR
Configured OR N, N(, (
Configured exclusive
OR
N, N(, ( possible operand see also
Literal, variable, direct address of
ANY data type
Variable, direct address of ANY data type
Variable, direct address of BOOL data type
Variable, direct address of BOOL data type
Literal, variable, direct address of
ANY_BIT data type
Literal, variable, direct address of
ANY_BIT data type
Literal, variable, direct address of
ANY_BIT data type
33002204 12/2010
331
Instruction list IL
332
Operator
ADD
SUB
MUL
DIV
GT
GE
EQ
NE
LE
LT
Operator key
Addition
Subtraction
Multiplication
Division
Comparison: >
Comparison: >=
Comparison: =
Comparison: <>
Comparison: <=
Comparison: < possible modifier
(
(
(
(
(
(
(
(
(
( possible operand see also
Literal, variable, direct address of
ANY_NUM data type or TIME data type
Addition (ADD and ADD ()), page 353
Literal, variable, direct address of
ANY_NUM data type or TIME data type
Literal, variable, direct address of
ANY_NUM data type or TIME data type
Literal, variable, direct address of
ANY_NUM data type or TIME data type
Division (DIV and DIV ()), page 357
Literal, variable, direct address of
ANY_ELEM data type
Literal, variable, direct address of
ANY_ELEM data type
Literal, variable, direct address of
ANY_ELEM data type
Literal, variable, direct address of
ANY_ELEM data type
Literal, variable, direct address of
ANY_ELEM data type
Literal, variable, direct address of
ANY_ELEM data type
"EQual to"(EQ and EQ ()), page 361
Equal to" (NE and NE ()), page 362
"Less Than"(LT and LT ()), page 364
33002204 12/2010
33002204 12/2010
Instruction list IL
Operator
JMP
CAL
FUNCNA
ME
)
Operator key
Jump to tag
Calling up a Function
Block or DFB
Performing a function
Editing on-hold operations possible modifier
C, CN
C, CN possible operand see also
TAG
FBNAME (item name)
(JMP, JMPC and JMPCN), page 365
Literal, variable, direct address (data type is dependent on function)
Right parenthesis ")", page 370
333
Instruction list IL
Tag
At a Glance
Properties
Destinations
Tags serve as destinations for Jumps
.
z z z z z z
Tag properties:
Tags must always be the first element in a line.
Tags must be unique throughout the project/DFB, and are not case-sensitive.
Tags can be 32 characters long (max.).
Tags must conform to the IEC name conventions.
Tags are separated by a colon ":" from the following instruction.
Tags are only permitted at the beginning of "Expressions", otherwise an undefined value can be found in the battery.
z z
Possible destinations are: z z z the first LD instruction of a FB/DFB call up with assignment of input parameters
(see start2 ), a normal LD instruction (see start1 ), a CAL instruction, which does not work with assignment of input parameters
(see start3 ), a JMP instruction (see start4 ), the end of an instruction list (see start5 ).
334
33002204 12/2010
Example start2: LD A
ST counter.CU
LD B
ST counter.R
LD C
ST counter.PV
CAL counter
JMPCN start4 start1: LD A
AND B
OR C
ST D
JMPC start3
LD A
ADD E
JMP start5 start3: CAL counter (
CU:=A
R:=B
PV:=C )
JMP start1 start4: JMPC start1 start5:
Instruction list IL
33002204 12/2010
335
Instruction list IL
Declaration (VAR...END_VAR)
At a Glance
Declaration of function blocks and DFBs
During declaration for each FB/DFB example, a unique example name is assigned.
The example name is used to mark the function block uniquely in a project. The example name must be unique in the whole project; no distinction is made between upper/lower case. The example name must correspond to the IEC Name conventions, otherwise an error message will be displayed.
After specifying the example name, the function block type, e.g.CTD_DINT is specified.
In the case of function block types no data type is specified. It is determined by the data type of the actual parameters. If all actual parameters consist of literals, a suitable data type will be selected.
Any number of example names may be declared for an FB/DFB.
NOTE: The dialog Objects → provides you with a form for creating the
FB-/DFB declaration in a simple and speedy manner.
NOTE: In contrast to grafic programming languages (FBD, LD), it is possible to call up multiple calls in FB/DFB examples within IL.
Example
The VAR instruction is used to declare the function blocks and DFBs used, and direct addresses if they are not to be used with the default data type. VAR cannot be used for declaring a variable in Concept. Declaring the variables may conveniently be done via the Variables editor.
The END_VAR instruction marks the end of the declaration.
NOTE: The declaration of the FBs/DFBs and direct addresses applies only to the current section. If the same FFB type or the same address are also used in another section, the FFB type or the address must be declared again in this section.
Declaration of function blocks and DFBs
336
33002204 12/2010
Instruction list IL
Declaration of direct addresses
In the case of this declaration, every direct address used whose data type does not correspond to the default data type will be assigned the required data type (see also
Default data types of direct addresses
).
Example
Declaration of direct addresses
VAR
AT %QW1 : WORD ;
AT %IW15 : UINT ;
AT %ID45 : DINT ;
AT %QD4 : TIME ;
END_VAR
33002204 12/2010
337
Instruction list IL
Comment
Description
Within the IL Editor, comments always start with the string (* and end in the string
*). Any comments may be entered between these two strings. Comments are shown in colors.
NOTE: In accordance with IEC 1131-1, comments are only permissible at the end of a line. However, if you wish to place theses elsewhere, you can do this by using
Options Preferences → IEC Extensions Allow comments anywhere in text (IL) .
NOTE: In accordance with IEC 1131-1, nested comments are not permissible.
However, if you wish to place theses elsewhere, you can do this by using Options
→ Preferences → IEC Extensions → .
338
33002204 12/2010
10.3
IL instruction list operators
Overview
This section describes the IL instruction list operators.
What's in this Section?
This section contains the following topics:
Topic
Load (LD and LDN)
Store (ST and STN)
Set (S)
Reset (R)
Boolean AND (AND, AND (), ANDN, ANDN ())
Boolean OR (OR, OR (), ORN, ORN ())
Boolean exclusive OR (XOR, XOR (), XORN, XORN ())
Invert (NOT)
Addition (ADD and ADD ())
Subtraction (SUB and SUB ())
Multiplication (MUL and MUL())
Division (DIV and DIV ())
Compare on "Greater Than" (GT and GT ())
Compare to "Greater than/Equal to" (GE and GE ())
Compare to "EQual to"(EQ and EQ ())
Compare to "Not Equal to" (NE and NE ())
Compare to "Less than/Equal to" (LE and LE ())
Compare to "Less Than"(LT and LT ())
Jump to label (JMP, JMPC and JMPCN)
Call Function Block/DFB (CAL, CALC and CALCN)
FUNCNAME
Right parenthesis ")"
Instruction list IL
33002204 12/2010
Page
339
Instruction list IL
Load (LD and LDN)
LD Description
With LD the value of the Operands is downloaded into the accumulator. The data width of the accumulator adapts itself automatically to the data type of the operand.
This also applies to derived datatypes.
Example LD
Example LD
Operation
LD A
ADD B
ST E
Description
The value of "A" is downloaded onto the accu.
The accu contents are added to the value of "B".
The result is saved in "E".
LDN Description
The downloaded operand can be negated with the Modifier N (only if the Operand is of data type ANY_BIT).
LDN Example
LDN Example
Operation
LDN A
ADD B
ST E
Description
The value of "A" is inverted and downloaded onto the accu.
The accu contents are added to the value of "B".
The result is saved in "E".
340
33002204 12/2010
Instruction list IL
Store (ST and STN)
ST Description
With ST the current value of the accu is saved in the operand. The data type of the operand must therefore agree with the "data type" of the accu.
Depending on whether an LD follows after ST or not, calculation proceeds with the
"old" result.
ST Example
ST Example
Operation
LD A
ADD B
ST E
ADD B
ST F
LD X
SUB 3
ST Y
Description
The value of "A" is downloaded onto the accu.
The accu contents are added to the value of "B".
The result is saved in "E".
Afterwards the value of "E" (current accu contents) is added to the value of "B" again
The result is saved in "F".
The value of "X" is now downloaded onto the accu.
3 is subtracted from the accu contents.
The result is saved in "Y".
STN Description
The operand to be saved can be negated with the N modifier (only if the operand is on the ANY_BIT data type).
STN Example
ST Example
Operation
LD A
ADD B
STN E
Description
The value of "A" is downloaded onto the accu.
The accu contents are added to the value of "B".
The result is inverted and saved in "E".
33002204 12/2010
341
Instruction list IL
Set (S)
Description
S sets the operand to "1" when the current content of the accu is a Boolean "1".
Example S
Example S
Command
LD A
S OUT
Description
The value of "A" is loaded into the accu.
If the content of the accu (the value of A) is "1", "OUT" is set to "1".
Use
Usually this operator is used together with the Reset operator R (flip flop) as a pair.
Example RS flip flop
The example shows an RS flip flop (Reset dominant).
Command
LD A
S OUT
LD C
R OUT
Description
The value of "A" is loaded into the accu.
If the content of the accu (the value of "A") is "1", "OUT" is set to "1".
The value of "C" is loaded into the accu.
If the content of the accu (the value of "C") is "1", "OUT" is set to "0".
342
33002204 12/2010
Instruction list IL
Start behavior
The start behavior of PLC’s is divided into cold and warm starts.
z Cold Start
Following a cold start (loading the program with Online → ) all variables are set (independently of their type) to "0" or, if available, to their initial z value.
Warm Start
On a warm start (stopping and starting of the program or Online → changes ) different start behavior applies for located variables/direct addresses and unlocated variables: z Located variables/direct addresses
During a warm start the located variable/direct address, is set to "0", or to its initial value if present, via the set instruction.
z Unlocated variables
On a warm start the unlocated variable, set via the set instruction, maintains its present value (storing behavior).
NOTE: Should a buffered located variable/direct address be required, please use the RS or SR function blocks from the block library IEC.
33002204 12/2010
343
Instruction list IL
Reset (R)
Description
R sets the operand to "0" when the current content of the accu is a Boolean "1".
Example R
Example R
Command
LD A
R OUT
Description
The value of "A" is loaded into the accu.
If the content of the accu (the value of "A") is "1", "OUT" is set to "0".
Use
Usually this operator is used together with the Set operator S (flip flop) as a pair.
Example SR flip flop
The example shows an SR flip flop (Set dominant).
Command
LD A
R OUT
LD C
S OUT
Description
The value of "A" is loaded into the accu.
If the content of the accu (the value of "A") is "1", "OUT" is set to "0".
The value of "C" is loaded into the accu.
If the content of the accu (the value of "C") is "1", "OUT" is set to "1".
344
33002204 12/2010
Instruction list IL
Start behavior
PLC start behavior is divided into cold and warm starts: z Cold Start
Following a cold start (loading the program with Online → ) all variables are set (independently of their type) to "0" or, if available, to their initial z value.
Warm Start
On a warm start (stopping and starting of the program or Online → changes ) different start behavior applies for located variables/direct addresses and unlocated variables: z Located variables/direct addresses
On a warm start the located variable/direct address, is set to "0", or to its initial value if present, via the reset instruction.
z Unlocated variables
On a warm start the unlocated variable, set via the reset instruction, maintains its present value (storing behavior).
NOTE: Should a buffered located variable/direct address be required, please use the RS or SR function blocks from the block library IEC.
33002204 12/2010
345
Instruction list IL
Boolean AND (AND, AND (), ANDN, ANDN ())
AND Description
With AND a logical AND link occurs between the accu contents and the operand.
For the data types BYTE and WORD the link is made by bit.
AND Example
In the example D is "1", if A, B and C are "1".
Operation
LD A
AND B
AND C
ST D
Description
The contents of "A" are downloaded onto the accu.
The accu contents are AND-linked with the contents of "B".
The accu contents (result of the AND link from "A" and "B") are ANDlinked with the contents of "C".
The link result is saved in "D".
AND () Description
AND can be used with the "(" left bracket modifier.
AND () Example
In the example D is "1", if A is "1" and B or C are "1".
Operation
LD A
AND (
LD B
OR C
)
ST D
Description
The contents of "A" are downloaded onto the accu.
The AND link is deferred until the right bracket is reached.
The contents of "B" are downloaded onto the accu.
The contents of "C" are OR-linked with the accu contents.
The deferred AND link is solved. The accu contents (result of the OR link from "B" and "C") are AND-linked with the contents of "A".
The link result is saved in "D".
ANDN Description
AND can be used with the N modifier.
346
33002204 12/2010
Instruction list IL
ANDN Example
In the example D is "1", if A is "1" and B and C are "0".
Operation
LD A
ANDN B
ANDN C
ST D
Description
The contents of "A" are downloaded onto the accu.
The contents of "B" are inverted and AND-linked with the accu contents.
The contents of "C" are inverted and AND-linked with the accu contents
(Result of the AND link from "A" and "B").
The link result is saved in "D".
ANDN () Description
AND can be used with the N modifier and the "(" left bracket modifier.
ANDN () Example
In the example D is "1", if A is "1", B is "0" and C is "1".
Operation
LD A
ANDN (
LD B
ORN C
)
ST D
Description
The contents of "A" are downloaded onto the accu.
The AND link is deferred until the right bracket is reached.
The contents of "B" are downloaded onto the accu.
The contents of "C" are inverted and OR-linked with the accu contents.
The deferred AND link is solved. The contents of "A" are inverted and
AND-linked with the accu contents (Result of the OR link from "B" and
"C").
The link result is saved in "D".
33002204 12/2010
347
Instruction list IL
Boolean OR (OR, OR (), ORN, ORN ())
OR Description
With OR a logical OR link occurs between the accu contents and the operand.
For the data types BYTE and WORD the link is made by bit.
OR Example
OR () Description
OR can be used with the "(" left bracket modifier.
OR () Example
In the example D is "1", if A is "1" or B and C are "1".
Operation
LD A
OR (
LD B
AND C
)
ST D
Description
The contents of "A" are downloaded onto the accu.
The OR link is deferred until the right bracket is reached.
The contents of "B" are downloaded onto the accu.
The contents of "C" are AND-linked with the accu contents.
The deferred OR link is solved. The accu contents (Result of the AND link from "B" and "C") are OR linked with the contents of "A".
The link result is saved in "D".
ORN Description
In the example D is "1", if A or B is "1" and C is "1".
Operation
LD A
OR B
AND C
ST D
Description
The contents of "A" are downloaded onto the accu.
The accu contents are OR-linked with the contents of "B".
The accu contents (result of the AND link from "A" and "B") are ANDlinked.
The link result is saved in "D".
ORN can be used with the N modifier.
348
33002204 12/2010
Instruction list IL
ORN Example
In the example D is "1", if A is "1" or B is "0" and C is "1".
Operation
LD A
ORN B
AND C
ST D
Description
The contents of "A" are downloaded onto the accu.
The contents of "B" are inverted and OR linked with the accu contents.
The contents of "C" are AND linked with the accu contents (result of the
OR link from "A" and "B").
The link result is saved in "D".
ORN () Description
ORN can be used with the N modifier and the "(" left bracket modifier.
ORN () Example
In the example D is "1", if A is "1" or B or C are "0".
Operation
LD A
ORN (
LD B
AND C
)
ST D
Description
The contents of "A" are downloaded onto the accu.
The OR link is deferred until the right bracket is reached.
The contents of "B" are downloaded onto the accu.
The contents of "C" are AND-linked with the accu contents.
The deferred OR link is solved. The accu contents (result of the AND link from "B" and "C") are OR linked with the contents of "A".
The link result is saved in "D".
33002204 12/2010
349
Instruction list IL
Boolean exclusive OR (XOR, XOR (), XORN, XORN ())
XOR description
With XOR, a logical exclusive OR link is made between the accu contents and the operand.
If more than two operands are linked the result is "1" for an odd number of 1 conditions and "0" for an even number of 1 conditions.
For the data types BYTE and WORD the link is made by bit.
XOR example
In the example, D is "1" if A or B is "1". If A and B have the same status (both "0" or both "1"), D is "0".
Operation
LD A
XOR B
ST D
Description
The contents of "A" are downloaded onto the accu.
The accu contents are linked with the contents of the "B" exclusive OR.
The equation result is saved in "D".
XOR () description
XOR can be used with the "(" left bracket modifier.
XOR () example
In the example, D is "1" if A or the AND link from B and C is "1". If A and the result of the AND link have the same status (both "0" or both "1"), D is "0".
Operation
LD A
XOR (
LD B
AND C
)
ST D
Description
The contents of "A" are downloaded onto the accu.
The exclusive OR link is deferred until the right bracket is reached.
The contents of "B" are downloaded onto the accu.
The contents of "C" are AND-linked with the accu contents.
The reset exclusive OR link is performed. The accu contents (result of the AND link from "B" and "C") are exclusive OR-linked with the contents of "A".
The equation result is saved in "D".
XORN description
XOR can be used with the N modifier.
350
33002204 12/2010
Instruction list IL
XORN example
In the example, D is "1" if A and B have the same contents (both "1" or both "0'). If
A and B do not have the same status, D is "0".
Operation
LD A
XORN B
ST D
Description
The contents of "A" are downloaded onto the accu.
The contents of "B" are inverted and exclusive OR-linked with the accu contents.
The equation result is saved in "D".
XORN () description
XORN can be used with the "(" left bracket and N modifiers.
XORN () example
In the example, D is "1" if A and the AND link from B and C have the same contents
(both "1" or both "0'). If A and B and the AND link from B and C do not have the same status, D is "0".
Operation
LD A
XORN (
LD B
AND C
)
ST D
Description
The contents of "A" are downloaded onto the accu.
The exclusive OR link is deferred until the right bracket is reached.
The contents of "B" are downloaded onto the accu.
The contents of "C" are AND-linked with the accu contents.
The reset exclusive OR link is performed. The accu contents (result of the AND link from "B" and "C") are exclusive OR-linked with the contents of "A".
The equation result is saved in "D".
33002204 12/2010
351
Instruction list IL
Invert (NOT)
NOT Description
The accumulator content is inverted with NOT.
NOT can only be used with Boolean data types (BIT, BYTE, WORD).
NOTE: This operator does not conform to IEC 61131-1.
Example NOT
Example NOT
Operation
LD A
NOT
ST B
Description
The contents of "A" are downloaded onto the accumulator.
The accumulator content is inverted.
The result is saved in "B".
352
33002204 12/2010
Instruction list IL
Addition (ADD and ADD ())
ADD Description
With ADD the value of the operand is added to the accu contents.
ADD Example
The example corresponds to the formula D = A + B + C
Operation
LD A
ADD B
ADD C
ST D
Description
The value of "A" is downloaded onto the accu.
The accu contents are added to the value of "B".
The accu contents (sum of "A"+"B") are added to the value of "C".
The result is saved in "D".
ADD () Description
ADD can be used with the "(" left bracket modifier.
ADD () Example
The example corresponds to the formula D = A + (B - C)
Operation
LD A
ADD (
LD B
SUB C
)
ST D
Description
The value of "A" is downloaded onto the accu.
The addition is deferred until the right bracket is reached.
The value of "B" is downloaded onto the accu.
The value of "C" is subtracted from the accu contents.
The deferred addition is solved. The accu contents (result of "B"-"C") are added to the value of "A".
The result is saved in "D".
33002204 12/2010
353
Instruction list IL
Subtraction (SUB and SUB ())
SUB Description
With SUB the value of an operand is subtracted from the accu contents.
SUB Example
The example corresponds to the formula D = A - B - C
Operation
LD A
SUB B
SUB C
ST D
Description
The value of "A" is downloaded onto the accu.
The value of "B" is subtracted from the accu contents.
The value of "C" is subtracted from the accu contents (result of "A"-"B").
The result is saved in "D".
Description SUB ()
SUB can be used with the "(" left bracket modifier.
Example SUB ()
The example corresponds to the formula D = A - (B - C)
Operation
LD A
SUB (
LD B
SUB C
)
ST D
Description
The value of "A" is downloaded onto the accu.
The subtraction is reset until the right bracket is reached.
The value of "B" is downloaded onto the accu.
The value of "C" is subtracted from the accu contents.
The reset subtraction is performed. The accu contents (result of "B"-
"C") are subtracted from the value of "A".
The result is saved in "D".
354
33002204 12/2010
Instruction list IL
Multiplication (MUL and MUL())
MUL Description
With MUL the accu contents are multiplied by the value of an operand.
MUL Example
The example corresponds to the formula D = A x B x C
Operation
LD A
MUL B
MUL C
ST D
Description
The value of "A" is downloaded onto the accu.
The accu contents are multiplied by the value of "B".
The accu contents (Result of "A"x"B") are multiplied by the value of "C".
The result is saved in "D".
Multiplication of TIME values
Normally the operand and the current accu contents must be of the same data type.
The TIME data type in relation to MUL is an exception. In this case the accu content of data type TIME can be used together with an operand of data type ANY_NUM.
After the execution of this instruction list the accu contents have, in this case, the data type TIME.
Example MUL with TIME values
The example corresponds to the formula t1 = t2 x i4.
Operation
LD t2
MUL i4
ST t1
Description
The value of the time variables "t2" are downloaded onto the accu.
The accu contents are multiplied by the value of the integer variable
"i4".
The result is saved in the time variable "t1".
Description MUL ()
MUL can be used with the "(" left bracket modifier.
33002204 12/2010
355
Instruction list IL
Example MUL ()
The example corresponds to the formula D = A x (B - C)
Operation
LD A
MUL (
LD B
SUB C
)
ST D
Description
The value of "A" is downloaded onto the accu.
The multiplication is reset until the right bracket is reached.
The value of "B" is downloaded onto the accu.
The value of "C" is subtracted from the accu contents.
The reset multiplication is performed. The accu contents (result of "B"-
"C") are multiplied by the value of "A".
The result is saved in "D".
356
33002204 12/2010
Instruction list IL
Division (DIV and DIV ())
DIV Description
With DIV the accu contents are divided by the value of an operand.
DIV example
The example corresponds to the formula D = A / B / C.
Operation
LD A
DIV B
DIV C
ST D
Description
The value of "A" is downloaded onto the accu.
The accu contents are divided by the value of "B".
The accu contents (result of "A"/"B") are divided by the value of "C".
The result is saved in "D".
Division of TIME values
Normally the operand and the current accu contents must be of the same data type.
One exception is the data type TIME in connection with DIV. In this case the accu contents of data type TIME can be processed with an operand of data type
ANY_NUM. After the execution of this instruction list the accu contents have, in this case, the data type TIME.
Example MUL with TIME values
The example corresponds to the formula t1 = t2 / i4.
Operation
LD t2
DIV i4
ST t1
Description
The value of the time variables "t2" is downloaded onto the accu.
The accu contents are divided by the value of the integer variable "i4".
The result is saved in the time variable "t1".
DIV () Description
DIV can be used with the "(" left bracket modifier.
33002204 12/2010
357
Instruction list IL
DIV () Example
The example corresponds to the formula D = A / (B - C)
Operation
LD A
DIV (
LD B
SUB C
)
ST D
Description
The value of "A" is downloaded onto the accu.
The division is reset until it the right bracket is reached.
The value of "B" is downloaded onto the accu.
The value of "C" is subtracted from the accu contents.
The reset division is performed. The value of "A" is divided by the accu contents (result of "B"-"C").
The result is saved in "D".
358
33002204 12/2010
Instruction list IL
Compare on "Greater Than" (GT and GT ())
Description GT
With GT the accu contents is compared with the operand contents. If the accu contents is greater than the operand contents, the result is a boolean "1". If the accu contents is less than or equal to the operand contents, the result is a boolean "0".
Example GT
Example GT
Command
LD A
GT 10
ST D
Description
The value of "A" is loaded into the accu.
The accu content is compared with the value ‘’0’’.
If the value of ‘’A’’ was less than ‘’10’’ (or equal ‘’10’’), the value ‘’0’’ is saved in ‘’D’’.
If the value of ‘’A’’ was greater than ‘’10’’, the value ‘’1’’ is saved in ‘’D’’.
Description GT ()
GT can be used witht the modifier left bracket "(".
Examplel GT ()
Example GT ()
Command
LD A
GT (
LD B
SUB C
)
ST D
Description
The value of "A" is loaded into the accu.
The comparison is deferred until the right bracket has been reached.
The value of "B" is loaded into the accu.
The value of "C" is subtracted from the accu content.
The deferred comparison is now carried out. The value of "A" is compared with the accu contents (result of "B"-"C").
If the value of "A" was less than "B"-"C" (or equal "B"-"C"), the value "0" is saved in "D".
If the value of ‘’A’’ was greater than "B"-"C", the value ‘’1’’ is saved in
‘’D’’.
33002204 12/2010
359
Instruction list IL
Compare to "Greater than/Equal to" (GE and GE ())
Description GE
With GE the accu contents is compared with the operand contents. If the accu contents is greater than or equal to the operand contents, the result is a Boolean "1".
If the accu contents is less than the operand contents, the result is a Boolean "0".
GE example
E.g. GE
Command
LD A
GE 10
ST D
Description
The value of "A" is loaded into the accu.
The accu content is compared with the value ‘’10’’.
If the value of ‘’A’’ was less than ‘’10’’, the value ‘’0’’ is saved in ‘’D’’.
If the value of ‘’A’’ was equal to or greater than ‘’10’’, the value ‘’1’’ is saved in ‘’D’’.
Description GT ()
GE can be used with the modifier left bracket "(".
GE () example
GE () example
Command
LD A
GE (
LD B
SUB C
)
ST D
Description
The value of "A" is loaded into the accu.
The comparison is deferred until the right bracket has been reached.
The value of "B" is loaded into the accu.
The value of "C" is subtracted from the accu content.
The deferred comparison is now carried out. The value of "A" is compared with the accu contents (result of "B"-"C").
If the value of ‘’A’’ was less than "B"-"C", the value ‘’0’’ is saved in ‘’D’’.
If the value of ‘’A’’ was equal to or greater than ‘’B’’ – "C", the value ‘’1’’ is saved in ‘’D’’.
360
33002204 12/2010
Instruction list IL
Compare to "EQual to"(EQ and EQ ())
EQ description
With EQ the accu contents are compared with the operand contents. If the accu contents are equal to the operand contents, the result is a Boolean "1". If the accu contents are not equal to the operand contents, the result is a Boolean "0".
EQ example
EQ example
Command
LD A
EQ 10
ST D
Description
The value of "A" is loaded into the accu.
The accu contents are compared with the value ‘’10’’.
If the value of ‘’A’’ was not equal to ‘’10’’, the value ‘’0’’ is saved in ‘’D’’.
If the value of ‘’A’’ was equal to ‘’10’’, the value ‘’1’’ is saved in ‘’D’’.
Description EQ ()
EQ can be used with the modifier left bracket "(".
EQ () example
EQ () example
Command
LD A
EQ (
LD B
SUB C
)
ST D
Description
The value of "A" is loaded into the accu.
The comparison is deferred until the right bracket has been reached.
The value of "B" is loaded into the accu.
The value of "C" is subtracted from the accu content.
The deferred comparison is now carried out. The value of "A" is compared with the accu contents (result of "B"-"C").
If the value of ‘’A’’ was not equal to "B"-"C", the value ‘’0’’ is saved in
‘’D’’.
If the value of ‘’A’’ was equal to "B"-"C", the value ‘’1’’ is saved in ‘’D’’.
33002204 12/2010
361
Instruction list IL
Compare to "Not Equal to" (NE and NE ())
NE description
With NE the accu contents are compared with the operand contents. If the accu contents are not equal to the operand contents, the result is a Boolean "1". If the accu contents are equal to the operand contents, the result is a Boolean "0".
NE example
NE example
Command
LD A
NE 10
ST D
Description
The value of "A" is loaded into the accu.
The accu contents are compared with the value ‘’10’’.
If the value of ‘’A’’ was equal to ‘’10’’, the value ‘’0’’ is saved in ‘’D’’.
If the value of ‘’A’’ was not equal to ‘’10’’, the value ‘’1’’ is saved in ‘’D’’.
Description NE ()
NE can be used with the modifier left bracket "(".
NE () example
NE () example
Command
LD A
NE (
LD B
SUB C
)
ST D
Description
The value of "A" is loaded into the accu.
The comparison is deferred until the right bracket has been reached..
The value of "B" is loaded into the accu.
The value of "C" is subtracted from the accu content.
The deferred comparison is now carried out. The value of "A" is compared with the accu contents (result of "B"-"C").
If the value of ‘’A’’ was equal to "B"-"C", the value ‘’0’’ is saved in ‘’D’’.
If the value of ‘’A’’ was not equal to "B"-"C", the value ‘’1’’ is saved in
‘’D’’.
362
33002204 12/2010
Instruction list IL
Compare to "Less than/Equal to" (LE and LE ())
Description
With LE the accu contents are compared with the operand contents. If the accu contents are less than or equal to the operand contents, the result is a Boolean "1".
If the accu contents are greater than the operand contents, the result is a Boolean
"0".
LE example
LE example
Command
LD A
LE 10
ST D
Description
The value of "A" is loaded into the accu.
The accu contents are compared with the value ‘’10’’.
If the value of ‘’A’’ was greater than ‘’10’’, the value ‘’0’’ is saved in ‘’D’’.
If the value of ‘’A’’ was less than or equal to ‘’10’’, the value ‘’1’’ is saved in ‘’D’’.
Description LE ()
LE can be used with the modifier left bracket "(".
LE () example
LE () example
Command
LD A
LE (
LD B
SUB C
)
ST D
Description
The value of "A" is loaded into the accu.
The comparison is deferred until the right bracket has been reached.
The value of "B" is loaded into the accu.
The value of "C" is subtracted from the accu content.
The deferred comparison is now carried out. The value of "A" is compared with the accu contents (result of "B"-"C").
If the value of ‘’A’’ was greater than "B"-"C", the value ‘’0’’ is saved in
‘’D’’.
If the value of "A" was less than "B"-"C" (or equal to "B"-"C"), the value
"1" is saved in "D".
33002204 12/2010
363
Instruction list IL
Compare to "Less Than"(LT and LT ())
LT description
With LT the accu contents are compared with the operand contents. If the accu contents are less than the operand contents, the result is a Boolean "1". If the accu contents are greater than or equal to the operand contents, the result is a Boolean
"0".
LT example
LT example
Command
LD A
LT 10
ST D
Description
The value of "A" is loaded into the accu.
The accu contents are compared with the value ‘’10’’.
If the value of ‘’A’’ was greater than ‘’10’’ (or equal to ‘’10’’), the value
‘’0’’ is saved in ‘’D’’.
If the value of ‘’A’’ was less than ‘’10’’, the value ‘’1’’ is saved in ‘’D’’.
Description LT ()
LT can be used with the modifier left bracket "(".
LT () example
LT () example
Command
LD A
LT(
LD B
SUB C
)
ST D
Description
The value of "A" is loaded into the accu.
The comparison is deferred until the right bracket has been reached.
The value of "B" is loaded into the accu.
The value of "C" is subtracted from the accu content.
The deferred comparison is now carried out. The value of "A" is compared with the accu contents (result of "B"-"C").
If the value of ‘’A’’ was greater than ‘’B’’-"C" (or equal to ‘’B’’-"C"), the value ‘’0’’ is saved in ‘’D’’.
If the value of ‘’A’’ was less than "B"-"C", the value ‘’1’’ is saved in ‘’D’’.
364
33002204 12/2010
Instruction list IL
Jump to label (JMP, JMPC and JMPCN)
JMP Description
With JMP a conditional or unconditional jump to a label is solved.
The label is used as an address and identifies the destination instruction. The destination instruction can be above or below the jump instruction. A label must always be the first element of a line. The label (max. 32 characters) must not be duplicated anywhere else in the project and there is no case sensitivity. The labels are separated by a colon ":" from the following instruction. Labels should only be at the beginning of "expressions", since otherwise an undefined value can be in the accu.
JMP Example
In the example an unconditional jump to the label "start" is solved.
Operation start: LD A
AND B
OR C
ST D
JMP start
Description
The value of "A" is downloaded onto the accu.
Logical AND link between the accu contents and the contents of "B".
Logical OR link between the accu contents and the contents of "C".
The result of the links is saved in "D".
Independent of the accu contents (value of "D") a jump to label "start" is solved.
JMPC and JMPCN Description
JMP can be used with the modifiers C and CN (only if the operand is of data type
ANY_BIT).
33002204 12/2010
365
Instruction list IL
JMPC Example
In the example a conditional jump (with "1") to label "start" is solved.
Operation start: LD A
AND B
OR C
ST D
JMPC start
Description
The value of "A" is downloaded onto the accu.
Logical AND link between the accu contents and the contents of "B".
Logical OR link between the accu contents and the contents of "C".
The result of the links is saved in "D".
The jump is only solved if the accu contents (value of "D") has the value "1".
JMPCN Example
In the example a conditional jump (by "0") to label "start" is solved.
Operation start: LD A
AND B
OR C
ST D
JMPCN start
Description
The value of "A" is downloaded onto the accu.
Logical AND link between the accu contents and the contents of "B".
Logical OR link between the accu contents and the contents of "C".
The result of the links is saved in "D".
The jump is only solved if the accu contents (value of "D") has the value "0".
366
33002204 12/2010
Addresses
33002204 12/2010
Instruction list IL z z
Possible addresses are: each LD instruction (see start1) each CAL instruction (see start2) z the end of an instruction list (see start3)
Jumps cannot be made into other sections.
Example for possible addresses:
Operation
VAR
Timer_1 : TON;
END_VAR
LD IN1_BOOL
ST OT1_BOOL
JMPC start1
LD IN1_BOOL
AND IN2_BOOL
JMPCN start2
ST OT2_BOOL start1: LD IN1_INT
ADD IN2_INT
ST OT1_INT
JMP start3
Description
Declaration of the function blocks TON.
Jump to start1, if
OT1_BOOL = 1
Jump to start2, if
OT1_BOOL = 0 start2: CAL Timer_1 (IN:=IN3_BOOL, PT:=t#6s)
LD Timer_1.ET
ST OT1_TIME
LD Timer_1.Q
ST OT3_BOOL start3
Unconditional jump after start3, JMPC/JMPCN is not allowed here as the accu contents are not of type BOOL.
367
Instruction list IL
Call Function Block/DFB (CAL, CALC and CALCN)
CAL Description
With CAL a function block or a DFB is conditionally or unconditionally called.
CALC and CALCN Description
CAL can be used with the Modifiers C and CN (only if the operand is of data type
ANY_BIT).
Use of Function Blocks and DFBs
Use of Function Blocks and DFBs, page 372
368
33002204 12/2010
Instruction list IL
FUNCNAME
Description
A function is performed with the function name (see Function call, page 379 ).
33002204 12/2010
369
Instruction list IL
Right parenthesis ")"
At a Glance
With the right parenthesis ")" the editing of the reset operator is started. The number of right parenthesis operations must be equal to the number of left bracket modifiers.
Brackets can be nested.
Example
In the example E will be "1", if C and/or D is "1", just as A and B are "1".
LD A
AND B
AND( C
OR D
)
ST E
370
33002204 12/2010
10.4
Instruction list IL
Call up of functions, Function Blocks (EFBs) and
Derived Function Blocks (DFBs)
Overview
This section describes the call up of functions, Function Blocks (EFBs) and Derived
Function Blocks (DFBs).
What's in this Section?
This section contains the following topics:
Topic
Use of Function Blocks and DFBs
Invoking a Function Block/DFB
Function call
Page
33002204 12/2010
371
Instruction list IL
Use of Function Blocks and DFBs
Use of Function Blocks and DFBs
Function blocks are provided by Concept in the form of libraries. The function block logic is created in C++ programming language and cannot be altered in the IL Editor.
The names of the available function blocks can be taken from the block libraries.
DFBs are function blocks, which have been defined in Concept-DFB. There is no difference between functions and function blocks for DFBs. They are always handled as function blocks regardless of their internal structure.
z z z
The use of function blocks and DFBs consists of three parts in IL: the declaration
, the function block/DFB invocation
, the use of the function block/DFB outputs
.
NOTE: The declaration of the function block/DFB invocation can take place manually or you can create the block end and the assignment of the parameters using the menu command Objects → .
Function Blocks with Limited Use
Use of the following EFBs from the DIAGNO block library is limited in IL (the function z z z z z z blocks can be used, but the expanded diagnostic information cannot be evaluated):
XACT, XACT_DIA,
XDYN_DIA,
XGRP_DIA,
XLOCK,
XPRE_DIA, z
XLOCK_DIA,
XREA_DIA
Function Blocks with Limited Invocation z z
For EFBs which have one or more outputs with data type ANY but no inputs with data type ANY (generic outputs/inputs), the block invocation can only take place in compact form
. e.g. in the block library LIB984 :
GET_3X
GET_4X
Unusable Function Blocks
Unusable Function Blocks: z EFBs which use several registers with only the entry for the first register on the input/output (e.g. MBP_MSTR from the COMM block library) cannot be used.
z EFBs, which contain outputs with input information (e.g. GET_BIT, R2T from the
LIB984 block library) cannot be used
372
33002204 12/2010
Instruction list IL z z z z z z z z z z
The following EFBs from the COMM block library cannot be used for the technical reasons listed above:
CREADREG
CREAD_REG
CWRITREG
CWRITE_REG
READREG
READ_REG
WRITEREG
WRITE_REG
MBP_MSTR z The following EFBs from the LIB984 block library cannot be used for the technical z z z z z z z z reasons listed above:
FIFO
GET_BIT
IEC_BMDI
LIFO
R2T
SET_BIT
SRCH
T2T
Declaration
Before invoking the function block/DFBs, they must be declared using VAR and
END_VAR
.
Function Block/DFB Invocation
Invoking a Function Block/DFB, page 374
Use of the Function Block/DFB Outputs
The outputs of the function block/DFBs can always be used when a variable (read only) can also be used.
33002204 12/2010
373
Instruction list IL
Invoking a Function Block/DFB
At a Glance z z z z
The invocation can be made in 4 forms: using CAL with a list of the input parameters
, using CAL with a list of the input/output parameters (compact form)
, using CAL and Load/Save the input parameters
, when using the input operators
.
NOTE: Even if the function block has no inputs or the input parameters are not to be defined, the function block should be invoked ( CAL EFB_XY () ) before the outputs can be used. Otherwise the initial values for the outputs are given, i.e. "0".
NOTE: In IL, unlike the graphic programming languages (FBD, LD), FB/DFB instances can be invoked multiple times.
CAL with a list of the input parameters
Function blocks/DFBs can be invoked using an instruction consisting of the CAL instruction followed by the instance names for the FBs/DFBs and a list, in brackets, of value assignments (current parameters) to formal parameters. The order of the formal parameters in a function block invocation is not significant. The list of the current parameters can be broken straight after a comma. It is not necessary for all formal parameters to be assigned a value. If a formal parameter is not assigned a value, the initial value defined in the variable editor is used when executing the function block. If an initial value is not defined, the default value (0) is used.
NOTE: Inputs of type VARINOUT
always have to be assigned a value.
Using the CAL (..) instruction, setting the parameters for the function blocks/DFBs is ended. Then no more values can be sent to the FB/DFB. Only the output values can be read.
374
33002204 12/2010
Example
CAL with a list of the input parameters
Instruction list IL or
Invocation of the function block in FBD.
33002204 12/2010
375
Instruction list IL
CAL with a list of the input/output parameters (compact form)
Block invocation and the assignments for the inputs/outputs are also possible in a more compact form, which saves runtime:
VAR
CLOCK : SYSCLOCK ;
COUNT : CTU_DINT ;
END_VAR
CAL CLOCK () ;
CAL COUNT (CU:=CLOCK.CLK3, R:=%IX10, PV:=100, Q=>out)
CAL with Loading/Saving of Input Parameters
Function blocks/DFBs can be invoked using an instruction list, which consists of loading the current parameters, followed by saving them in the formal parameters, followed by the CAL instruction. The order in which the parameters are loaded and saved is not significant. The list of the current parameters can be broken directly after a comma. It is not necessary for all formal parameters to be assigned a value.
If a formal parameter is not assigned a value, the initial value defined in the variable editor is used when executing the function block. If an initial value is not defined, the default value (0) is used.
NOTE: Inputs of type VARINOUT
always have to be assigned a value.
Using the CAL FBNAME instruction, setting the parameters for the function blocks/DFBs is ended. Then no more values can be sent to the FB/DFB. Only the output values can be read.
Only load and save instructions for the current FB/DFBs to be configured are allowed to be between the first load instruction for the current parameters and invocation of the function block/DFBs. All other instructions are not allowed in this position.
376
33002204 12/2010
Example
CAL with Loading/Saving of Input Parameters
Instruction list IL
Using the Input Operators
Function blocks can be called using an instruction list which consists of loading the current parameters, followed by saving them in the formal parameters, followed by an input operator. The order in which the parameters are loaded and saved is not significant. The list of the current parameters can be broken directly after a comma.
It is not necessary for all formal parameters to be assigned a value. If a formal parameter is not assigned a value, the initial value defined in the variable editor is used when executing the function block. If an initial value is not defined, the default value (0) is used.
NOTE: Inputs of type VARINOUT
always have to be assigned a value.
The possible input operators for the different function blocks can be taken from the table. Other input operators are not available.
Input operator
S1, R
S, R1
CLK
CLK
CU, R, PV
CD, LD, PV
CU, CD, R, LD, PV
IN, PT
IN, PT
IN, PT
FB Type
SR
RS
R_TRIG
F_TRIG
CTU_INT, CTU_DINT, CTU_UINT, CTU_UDINT
CTD_INT, CTD_DINT, CTD_UINT, CTD_UDINT
CTUD_INT, CTUD_DINT, CTUD_UINT, CTUD_UDINT
TP
TON
TOF
33002204 12/2010
377
Instruction list IL
Example
Using input operator invocation, setting the parameters for the function blocks is ended. Then no more values can be sent to the FB. Only the output values can be read.
Only load and save instructions for the current FB being configured are allowed to be between the first load instruction for the current parameters and the input operator for the function block. All other instructions are not allowed in this position.
Using the Input Operators
378
33002204 12/2010
Instruction list IL
Function call
Use of functions
Functions are provided by Concept in the form of libraries. The logic of the functions is created in the programming language C++ and cannot be changed in the IL editor.
You will find the names of the available functions in the block libraries.
Functions are called using an instruction list consisting of loading the first actual parameter into the battery and the name of the function. If necessary, this will be followed by a list of further actual parameters. The sequence in which the formal parameters in a function call are enumerated is not significant. Immediately following a comma, the list of the actual parameters may be wrapped. The result of the function becomes the battery content after the function has been executed, and can be saved using ST
in an operand, or may directly be processed further.
NOTE: The declaration of function calls may either be generated manually, or you may generate the block rump and the allocation of the parameters using the menu command Objects →
The picture shows calling a function in IL.
The picture shows calling a function in FDP.
Functions which cannot be used
Functions having one or more outputs of data type ANY but no inputs of data type
ANY (generic outputs/inputs) cannot be used in IL.
33002204 12/2010
379
Instruction list IL
Calling a function with an input
If the function to be executed has only got one input, the name of the function is not followed by a list of actual parameters.
Calling a function with multiple inputs
If the function to be executed has several inputs, there are two possibilities for assigning the actual parameters.
z The name of the function is followed by a list of the actual parameters z The name of the function is followed by a list of the value assignments (actual parameters) to the formal parameters.
Function calls including processing of the battery value
If the value to be processed is already in the battery, it is not necessary to use the loading instruction.
LIMIT_REAL B,C
ST result
Function calls including further direct processing of the result
If the result is immediately to be processed further it is not necessary to include the memory instruction.
LD A
LIMIT_REAL B,C
MUL E
380
33002204 12/2010
Instruction list IL
10.5
Syntax check and Code generation
Overview
This section describes the syntax check and the code generation with the IL instruction list.
What's in this Section?
This section contains the following topics:
Topic
Syntax Check
Code generation
Page
33002204 12/2010
381
Instruction list IL
Syntax Check
Introduction
A syntax check can be performed during the program/DFB creation with Project →
Analyze section .
Syntax Check Options
With the menu command Options → Preferences → IEC extensions... → extensions the syntax check options can be defined.
NOTE: The settings in this dialog are used in the project description (PRJ.DSK) and in the Concept installations description (CONCEPT.DSK), i.e. they are valid for the entire Concept installation.
If a project is opened, that was created using different settings (e.g. Allow nested comments in the project and not in the actual Concept Installation), errors can occur when opening the project.
Allow Case Insensitive Keywords
If the check box Allow case insensitive keywords is checked, upper and lower case for all keywords is enabled.
Allow nested comments
If the check box Nested comments authorized is checked, nested comments can be entered. There are no limits to the nesting depths.
Comments everywhere in the text permitted (IL)
If the check box Comments everywhere in the text permitted (IL) is checked, comments can be placed anywhere in the IL section.
Additional Variable Names Permitted (IL)
If the check box Additional variable names permitted (IL) is checked, the use of additional variable names (e.g. "S1" or "IN") is possible in IL. (These variables can always be used in FBD, LD and ST.)
Allow Leading Digits in Identifiers
If the check box Allow leading digits in identifiers is checked, figures as the first character of identifiers (i.e. variable names, step names, EFB names) are possible.
Identifiers, which consist solely of figures are, however, not authorized, they must contain at least one letter.
382
33002204 12/2010
Instruction list IL
Unused Parameters Cause Warnings
The IEC 1131-3 permits functions and Function Blocks to be called up without calling up the assignment of all the input parameters. These unused parameters are implicitly assigned a 0, or they retain the value from the last call up (Function Blocks only).
If in the menu command Options → Preferences → Analysis... → the check box Unused parameters lead to warnings is checked, a list of these unused parameters is displayed in the message window when generating the code.
33002204 12/2010
383
Instruction list IL
Code generation
At a Glance
The menu command Project → is used to define options for code generation.
Fastest code (restricted check)
If the check box Fastest Code (restricted check) is activated, a runtime-optimized code will be generated.
This runtime optimization is achieved with integer arithmetic (e.g. "+" or "-") with simple process commands instead of EFB calls.
Process commands are much faster than EFB calls, but they generate no error messages, such as e.g. Arithmetic or Array overrun. This option should only be used if it has been ensured that the program is free of arithmetic errors.
Example: Fastest Code
LD in1
ADD 1
ST out1
If Fastest Code (restricted check) is selected, the addition "in1 + 1" is executed with the process command "add". The code is now faster than if EFB ADD_INT had been called up. However, no runtime error is generated if "in1" is 32767. In this case,
"out1" would overrun from 32767 to -32768!
Activate loop control
This check box activates a software watchdog for continuous loops.
If this check box is checked, with loops within IL and ST sections, it is tested whether these loops are again exited within a certain time. The time authorized depends on the manually defined watchdog time. The authorized time for all loops combined constitutes 80% of the Hardware watchdog time. In this way triggering of the hardware watchdog by endless loops is disabled. If a time consuming loop or an endless loop is detected, processing of the affected section will stop, an entry in the
Event display will be generated and processing of the next section will begin. In the next cycle, the segment will be re-processed until a time consuming loop or an endless loop is detected once again, or until the segment is completed correctly.
NOTE: If the hardware watchdog stops the PLC when a time consuming loop or an endless loop is detected, this option should not be activated. The hardware watchdog itself is not switched off by this function.
384
33002204 12/2010
10.6
Online functions of the IL instruction list
Instruction list IL
Overview
This section describes the online functions of the IL instruction list.
What's in this Section?
This section contains the following topics:
Topic
Animation
Monitoring field
Page
33002204 12/2010
385
Instruction list IL
Animation
At a Glance z z
There are two animation modes available in the IL and ST editor:
Animation of binary variables
Animation of selected variables
Animation of binary variables
The animation of the selected objects is activated with the menu command Online
→ .
In this mode, the current signal status of binary values is shown in the editor window.
The animation of direct addresses and direct FB input/outputs is not possible.
Animation of selected variables
The dialog box for the display of the current signal status of selected variables is activated with the menu command Online → .
Furthermore, at least one variable, which can be animated, must be selected.
Variables and multi-element variables that can be selected are denoted by red, green or yellow script.
Properties of the dialog box
The name of the selected variables or multi-element variables are shown in the dialog box, with the data type and current value.
The dialog box is modeless, i.e. it remains open until it is closed or the animation is terminated. If several text language sections are open and clicked on in this dialog box, a dialog box is opened for each section. The name of the section is displayed in the dialog box heading.
Color key
There are 12 different color schemes available for animation. An overview of the color scheme and the meaning of each color can be found in the Online help (Tip:
Search the online help for the index reference "Colors").
Inserting several variables
The procedure for inserting several variables is as follows:
Step
1
2
Action
Select the desired variables or multi-element variables.
Accept this with Online
→
in the dialog box.
386
33002204 12/2010
Instruction list IL
Inserting all variables
The procedure for inserting all the variables is as follows:
Step
1
2
Action
Select the whole section with CTRL + A .
Migrate all variables and multi-element variables of the dialog section with
Online → to the dialog box.
Altering column width
The procedure for altering the column width is as follows:
Step
1
2
Action
Position the mouse pointer on the right margin button.
Reaction: The mouse pointer changes its shape to .
Alter the column width by dragging with the left mouse button depressed.
Multi-element variables
With multi-element variables the display of the elements can be switched on or off.
Action
Click on symbol + or key +
Function
The next component level for the current line is shown.
Condition
When using the keyboard, the cursor must remain on a + symbol.
Key x (number lock) All component levels for the current line are shown.
The cursor must remain on a + symbol.
Click on symbol or key -
All component levels for the current line, which are shown, are grayed out.
When using the keyboard, the cursor must remain on a symbol.
CTRL + +
CTRL lock)
CTRL
+
+ x
-
(number
The display of the components of the current line is restored (Restoration of display before the last activation of -
The cursor must remain on a + symbol.
The cursor must remain on an element of a multi-element variable.
All component levels of the current multi-element variables are shown.
All component levels of the current multi-element variables are grayed out.
The cursor must remain on an element of a multi-element variable.
CTRL + end
CTRL + Pos1 to go to the end of the table to go to the start of the table
33002204 12/2010
387
Instruction list IL
Saving and restoring animation
With the menu command Save animation the settings (e.g. Position of monitoring fields) of the current animation can be saved. After terminating this animation, the animation can be restored with the same settings via the menu command Restore animation .
NOTE: To avoid inconsistencies between the program on the PC and the PLC and to also have the animation available in the next Concept sitting, the project must be saved when quitting Concept
388
33002204 12/2010
Instruction list IL
Monitoring field
At a Glance
With the menu command Online → a monitoring field can be entered in the section. The current value of the assigned variables is shown in this monitoring field.
Limitations
The generation of monitoring fields for direct addresses and direct FB input/outputs
(INST.Q) is not possible.
Display of multi-element variables
With multi-element variables, the value of the first element is shown.
If a view of more elements is desired, this can be defined in the dialog Settings for monitoring field , which is called up by double clicking on the monitoring field.
Minimum and maximum values
In the dialog Settings for monitoring field , which can be called up with a double click on the monitoring field, a minimum and maximum value can be defined for the monitored variable. If the variable violates one of these thresholds, this will be displayed in color in the monitoring field.
An overview of the color scheme and the meaning of each color can be found in the
Online help (Tip: Search the online help for the index reference "Colors").
Generating a monitoring field
The procedure for generating a monitoring field is as follows:
Step
1
2
3
Action
Select a variable (e.g. double-click on variable).
Execute the menu command Online
→
.
Reaction: The section animation is started (gray section background) and the cursor symbol changes into box symbol.
Position the cursor to any position in the section and click with the left mouse button.
Reaction: A monitoring field, consisting of variable name and value, is generated for the selected variable on the chosen position.
33002204 12/2010
389
Instruction list IL
10.7
Creating a program with the IL instruction list
Creating a program in the IL instruction list.
At a Glance
The following description contains an example of creating a program in IL instruction list. The creation of a program in IL instruction list is organized into 2 main steps:
Step
1
2
Action
Generating a section
Creating the logic
Generating a section
The procedure for generating a section is as follows:
Step
1
Action
Using the menu command File
→
and enter a section name.
Note: The section name (max. 32 characters) must be clear throughout the project, so that there is no difference regarding case sensitivity. If the name entered already exists, a warning is given and another name must be chosen.
The section name must correspond to the IEC name conventions, otherwise an error message arises.
Note: In accordance with IEC1131-3, only letters are permitted as the first character of names. Should numbers be required as the first character, however, the menu command Options Presettings
→ → leading figures in identifiers .
390
33002204 12/2010
Instruction list IL
Creating the logic
The procedure for creating the logic is as follows:
Step
1
2
3
4
Action
Declare the Function Block and DFBs, which are to be used, with assistance from VAR…END_VAR.
Example:
VAR
RAMP_UP, RAMP_DOWN, RAMP_X : TON ;
COUNT : CTU_DINT ;
END_VAR
Declare the variables and their initial value in the Variable Editor.
Create the logic of the program.
Example:
LD A
SIN_REAL
MUL_REAL B,C
ST D
LD Y
AND X
JMPC endl
LD M
SIN_REAL
MUL_REAL N,O
ST P
JMP end2 end1: LD D
ST %QD4 end2: LD P
ST %QD5 save the section with the menu command Data file → .
33002204 12/2010
391
Instruction list IL
392
33002204 12/2010
Structured text ST
33002204 12/2010
Structured text ST
11
Overview
This Chapter describes the programming language structured text ST which conforms to IEC 1131.
What's in this Chapter?
This chapter contains the following sections:
Section
11.1
11.2
11.3
11.4
11.5
11.6
11.7
11.8
Topic
General information about structured Text ST
Expressions
Operators of the programming language of structured ST text
Assign instructions
Call up of functions, Function Blocks (EFBs) and Derived
Function Blocks (DFBs)
Syntax check and code generation
Online functions of the ST programming language
Creating a program with the structured ST text
Page
393
33002204 12/2010
Structured text ST
11.1
General information about structured Text ST
General Information about the ST Structured Text
Introduction
With the programming language of structured text (ST), it is possible, for example, to call up Function Blocks, perform functions and assignments, conditionally perform instructions and repeat tasks.
Spell Check
Spelling is immediately checked when key words, separators and comments are entered. If a key word, separator or comment is recognized, it is identified with a color surround. If unauthorized key words (instructions or operators) are entered, it is likewise identified in color.
IEC Conventions
The IEC 1131 does not permit the input of direct addresses in the usual Concept
form. To input direct addresses see Operands, page 397 .
In accordance with IEC 113-3, key words must be entered in upper case. Should the use of lower case letters be required, they can be enabled in the dialog box Options
→
Preferences
→
IEC Extensions...
→
with the option Allow case insensitive keywords .
Blank spaces and tabs have no influence upon the syntax and can be used freely.
Context help
With the right mouse button an object can be selected and at the same time a context sensitive menu called up. Therefore, for example, with FFBs the right mouse button can call up the associated block description.
Syntax Check
A syntax check can be performed during the program/DFB creation with Project
→
Analyze section
, see also Syntax Check, page 449
.
Codegeneration
Using the Project → menu command, you can define options for code generation, see also
.
394
33002204 12/2010
Structured text ST
Editing with the Keyboard
Normally editing in Concept is performed with the mouse, however it is also possible
with the keyboard (see also Short Cut Keys in the IL, ST and Data Type Editor, page 834
).
IEC Conformity
For a description of the IEC conformity of the ST programming language see IEC conformity, page 849
.
33002204 12/2010
395
Structured text ST
11.2
Expressions
Overview
This section contains an overview of the expressions in the programming language of structured text ST.
expressions consists of operands and operators.
What's in this Section?
This section contains the following topics:
Topic
Operands
Operators
Page
396
33002204 12/2010
Structured text ST
Operands
At a Glance z z z z z z z
An operand can be: a literal, a variable, a multi-element variable, an element of a multi-element variable, a function call up, a FB/DFB output or a direct address.
Access to the field variables
When accessing field variables (ARRAY), only literals and variables of ANY_INT type are permitted in the index entry.
Example: Using field variables var1[i] := 8 ; var2.otto[4] := var3 ; var4[1+i+j*5] := 4 ;
Type conversion
Data types, which are in an instruction of processing operands, must be identical.
Should operands of various types be processed, a type conversion must be performed beforehand.
An exception is the data type TIME in conjunction with the arithmetic operators "*"
(multiplication) and "/" (division). With both these operators, an operand of TIME data type can be processed together with an operand of ANY_NUM data type. The result of this instruction has in this instance the data type TIME.
Example: Integer variable and real variable
In the example the integer variable i1 is converted into a real variable before being added to the real variable r4.
r3 := r4 + SIN_REAL(INT_TO_REAL(i1)) ;
Example: Integer variable and time variable
In the example the time variable t2 is multiplied by the integer variable i4 and the result is stored in the time variable t1.
t1 := t2 * i4 ;
33002204 12/2010
397
Structured text ST
Default data types of direct addresses
The following table shows the default data types of direct addresses:
Input
%IX,%I
%IB
%IW
%ID
Output
%QX,%Q
%QB
%QW
%QD
Default data type
BOOL
BYTE
INT
REAL possible data type
BOOL
BYTE
INT, UINT, WORD
REAL, DINT, UDINT, TIME
Using other data types
Should other data types be assigned as default data types of a direct address, this must be done through an explicit declaration (VAR…END_VAR
).
VAR…END_VAR cannot be used in Concept for the declaration of variables. The variable declaration is performed conveniently by using the Variable Editor
.
398
33002204 12/2010
Structured text ST
Operators
Introduction z z z
An operator is a symbol for: an arithmetic operation to be executed or a configured operation to be executed or the function call up.
Operators are generic, i.e. they are automatically matched with the operands data type.
NOTE: Operators can be either entered manually or generated with assistance from the menu Objects → .
Expression Evaluation
The evaluation of an expression consists of applying the operators to the operands, in the sequence, which is defined by the order of the operators rank (see table). The operator with the highest rank in an expression is performed first, followed by the operator with the next highest rank etc. until the evaluation is complete. Operators with the same rank are performed from left to right, as they are written in the expression. This sequence can be altered with the use of parentheses.
Table of Operators
ST programming language operators:
Operator
()
Meaning
Use of parentheses: possible operand
Expression
FUNCNA
ME
(current parameter list)
Function editing
(call up)
Negation
Expression, literal, variable, direct address of ANY data type
2
NOT Complement
Expression, literal, variable, direct address of
ANY_NUM data type
3
Expression, literal, variable, direct address of ANY_BIT data type
3
Order of rank
1
(highest) see also
Use of parentheses "()", page 403
Complement formation (NOT), page 407
33002204 12/2010
399
Structured text ST
400
/
Operator
**
*
MOD
+
-
<
>
<=
>=
=
<>
Meaning
Exponentiation
Multiplication
Division
Modulo
Addition
Subtraction
Less-than comparison
Greater-than comparison
Less or equal to comparison
Greater or equal to comparison
Equality
Inequality possible operand
Expression, literal, variable, direct address of REAL data type (basis), ANY_NUM
(exponent)
4
Order of rank
Expression, literal, variable, direct address of
ANY_NUM data type or
TIME data type
5
Expression, literal, variable, direct address of
ANY_NUM data type
5
Expression, literal, variable, direct address of ANY_INT data type
5
Expression, literal, variable, direct address of
ANY_NUM data type or
TIME data type
6
Expression, literal, variable, direct address of
ANY_NUM data type or
TIME data type
6
Expression, literal, variable, direct address of
ANY_ELEM data type
7
Expression, literal, variable, direct address of
ANY_ELEM data type
7
Expression, literal, variable, direct address of
ANY_ELEM data type
7
Expression, literal, variable, direct address of
ANY_ELEM data type
Expression, literal, variable, direct address of
ANY_ELEM data type
Expression, literal, variable, direct address of
ANY_ELEM data type
7
8
8 see also
33002204 12/2010
Structured text ST
Operator
&, AND
XOR
Meaning
Configured exclusive OR possible operand configured AND Expression, literal, variable, direct address of ANY_BIT data type
9
Expression, literal, variable, direct address of ANY_BIT data type
Order of rank
10
OR Configured OR Expression, literal, variable, direct address of ANY_BIT data type
11
(lowest) see also
33002204 12/2010
401
Structured text ST
11.3
Operators of the programming language of structured ST text
Overview
This section describes the operators of the programming language of structured ST text.
What's in this Section?
This section contains the following topics:
Topic
Use of parentheses "()"
FUNCNAME
Exponentiation (**)
Negation (-)
Complement formation (NOT)
Multiplication (*)
Division (/)
Modulo (MOD)
Addition (+)
Subtraction (-)
Comparison on "Greater Than" (>)
Comparison on "Greater than/Equal to" (>=)
Comparison with "EQual to" (=)
Comparison with "Not Equal to" (<>)
Comparison with "Less Than"(<)
Comparison with "Less than or Equal to" (<=)
Boolean AND (AND or &)
Boolean OR (OR)
Boolean Exclusive OR (XOR)
Page
402
33002204 12/2010
Structured text ST
Use of parentheses "()"
Description
Brackets are used to alter the execution sequence of the operators.
Example of parentheses "()"
If the operands A, B, C, and D have the values "1", "2", "3", "and -4",
A+B-C*D has the result 15 and
(A+B-C)*D has the result 0.
33002204 12/2010
403
Structured text ST
FUNCNAME
Description
The function processing is used to perform functions (see Function Invocation, page 446
).
404
33002204 12/2010
Structured text ST
Exponentiation (**)
Description
For exponentiation "**" the value of the first operand (basis) is potentiated with that of the second operand (exponent).
NOTE: Exponentiation operates in the ST programming languageand with a resolution of 23 bits. For the graphic languages the exponentiation operates with a resolution of 24 bits..
Example: Exponentiation "**"
In the example OUT will be"625.0", when IN1 is "5.0" and IN2 is "4.0".
OUT := IN1 ** IN2 ;
33002204 12/2010
405
Structured text ST
Negation (-)
Description
During negation "-" a sign reversal for the value of the operand takes place.
Example: Negation "-"
In the example OUT will be "-4", when IN1 is "4".
OUT := IN1 ;
406
33002204 12/2010
Structured text ST
Complement formation (NOT)
Description
In NOT a bit by bit inversion of the operands takes place.
Example: NOT
In the example OUT will be"0011001100", when IN1 is "1100110011".
OUT := NOT IN1 ;
33002204 12/2010
407
Structured text ST
Multiplication (*)
Description
For multiplication "**" the value of the first operand is multiplied with that of the second operand (exponent).
Example: Multiplication "*"
OUT := IN1 * IN2 ;
Multiplication of TIME values
Normally the data types of the operands to be processed must be identical to an instruction. However, the multiplication forms an exception when combined with data type TIME. In this case an operand with the datentype TIME combined with an operanden of data type ANY_NUM can be processed. In this case the result of this instruction has the data type TIME.
Example: Multiplication of TIME values
In the example the Time variable t2 is multiplied by the integer variables i4 and the result is deposited in the t1 Time variables.
t1 := t2 * i4 ;
408
33002204 12/2010
Structured text ST
Division (/)
Description
For division "/" the value of the first operand is divided by that of the second operand
(exponent).
Example: Division "/"
OUT := IN1 / IN2 ;
Division of TIME values
Normally the data types of the operands to be processed must be identical to an instruction. However the division forms an exception when combined with data type
TIME. In this case an operand with the data type TIME combined with an operand of data type ANY_NUM can be processed. In this case the result of this instruction has the data type TIME.
Example division of TIME values
In the example the Time variable t2 is divided by the integer variables i4 and the result is deposited in the t1 Time variables.
t1 := t2 / i4 ;
33002204 12/2010
409
Structured text ST
Modulo (MOD)
Description
For MOD the value of the first operandis divided by that of the second operand and the remainder of thedivision (Modulo) is displayed as the result.
Example: MOD
OUT := IN1 MOD IN2 ;
410
33002204 12/2010
Structured text ST
Addition (+)
Description
For the addition "+" the value of the first operand is added to that of the second operand.
Example: Addition "+"
OUT := IN1 + IN2 ;
33002204 12/2010
411
Structured text ST
Subtraction (-)
Description
For the subtraction "-" the value of the second operand is subracted from that of the first operand.
Example: Subtraction "-"
OUT := IN1 IN2 ;
412
33002204 12/2010
Structured text ST
Comparison on "Greater Than" (>)
Description
With ">" the value of the first operand is compared with that of the second operand.
If the first operand is greater than the second, the result is a boolean "1". If the first operand is less than or equal to the second, the result is a Boolean "0".
Example: Greater Than ">"
In the example "OUT" will be "1" if "IN1" is greater than "10" and "0", if "IN1" is less than "0".
OUT := IN1 > 10 ;
33002204 12/2010
413
Structured text ST
Comparison on "Greater than/Equal to" (>=)
Description
With ">=" the value of the first operand is compared to that of the second operand.
If the first operation is greater than or equal to the second, the result is a Boolean
"1". If the first operand is less than the second, the result is a Boolean "0".
Example: Greater Than/Equal ">="
In the example "OUT"will be "1"if "IN1" is greater than/equal to "10" and otherwise
"0".
OUT := IN1 >= 10 ;
414
33002204 12/2010
Structured text ST
Comparison with "EQual to" (=)
Description
The value of the first operation is compared with the value of the second with "=". If the first operation is equal to the second, the result is a Boolean "1". If the first operation is not equal to the second, the result is a Boolean "0".
Example: Equal "="
In the example, "OUT" will be "1", if "IN1" is equal to "10" – otherwise it will be "0".
OUT := IN1 = 10 ;
33002204 12/2010
415
Structured text ST
Comparison with "Not Equal to" (<>)
Description
The value of the first operation is compared with the value of the second with "<>".
If the first operation is not equal to the second, the result is a Boolean "1". If the first operation is equal to the second, the result is a Boolean "0".
Example: Not Equal "<>"
In the example, "OUT" will be "1", if "IN1" is not equal to "10" – otherwise it will be "0".
OUT := IN1 <> 10 ;
416
33002204 12/2010
Structured text ST
Comparison with "Less Than"(<)
Description
The value of the first operation is compared with the value of the second with "<". If the first operation is smaller than the second, the result is a Boolean "1". If the first operation is bigger than or the same size as the second, the result is a Boolean "0".
Example: Less Than "<"
In the example, "OUT" will be "1", if "IN1" is less than "10" – otherwise it will be "0".
OUT := IN1 < 10 ;
33002204 12/2010
417
Structured text ST
Comparison with "Less than or Equal to" (<=)
Description
The value of the first operation is compared with the value of the second with "<=".
If the first operation is less than or equal to the second, the result is a Boolean "1".
If the first operation is greater than the second, the result is a Boolean "0".
Example: Less Than or Equal "<="
In the example, "OUT" will be "1", if "IN1" is less than or equal to "10" – otherwise it will be "0".
OUT := IN1 <= 10 ;
418
33002204 12/2010
Structured text ST
Boolean AND (AND or &)
Description
With "AND" or "&" a configured AND link occurs between the operations.
With the BYTE and WORD data types, the link is performed bit by bit.
Example: Boolean "AND or &"
In the examples, "OUT" will be "1" if "IN1", "IN2" and "IN3" are "1".
OUT := IN1 AND IN2 AND IN3 ; or
OUT := IN1 AND IN2 AND IN3 ;
33002204 12/2010
419
Structured text ST
Boolean OR (OR)
Description
With OR, a configured OR link occurs between the operations.
With the BYTE and WORD data types, the link is performed bit by bit.
Example Boolean OR "OR"
In the example, "OUT" will be "1" if "IN1", "IN2" or "IN3" is "1".
OUT := IN1 OR IN2 OR IN3 ;
420
33002204 12/2010
Structured text ST
Boolean Exclusive OR (XOR)
Description
With XOR, a configured Exclusive OR link occurs between the operations.
With the BYTE and WORD data types, the link is performed bit by bit.
Example: Boolean Exclusive OR "XOR"
In the example "OUT" will be "1", if "IN1" and "IN2" are not equal. If "IN1" and "IN2" have the same state (both "0" or "1"), "OUT" is "0".
OUT := IN1 XOR IN2 ;
Linking more than 2 operations
If more than two operations are linked, the result is "1" with an odd number of 1- states and "0" with an even number of 1-states.
Example: Linking more than 2 operations
In the example, "OUT" will be "1" if 1, 3 or 5 operations are "1". "OUT" will be "0" if
0, 2 or 4 operations are "1".
OUT := IN1 XOR IN2 XOR IN3 XOR IN4 XOR IN5;
33002204 12/2010
421
Structured text ST
11.4
Assign instructions
Overview
This section describes the instructions for the programming language of structured
ST text.
What's in this Section?
This section contains the following topics:
Topic
Instructions
Assignment
Declaration (VAR...END_VAR)
IF...THEN...END_IF
ELSE
ELSIF...THEN
CASE...OF...END_CASE
FOR...TO...BY...DO...END_FOR
WHILE...DO...END_WHILE
REPEAT...UNTIL...END_REPEAT
EXIT
Empty instruction
Comment
Page
422
33002204 12/2010
Structured text ST
Instructions
Description
Instructions are the "commands" of the ST programming language.
Instructions must be completed by semicolons. Several instructions can be entered in one line (separated by semicolons).
NOTE: Instructions can be either entered manually or generated using the menu
Objects .
33002204 12/2010
423
Structured text ST
Assignment
At a Glance
When an assignment is performed, the current value of a single or multi-element variable is replaced by the result of the evaluation of the expression
An assignment consists of a variable specification on the left side, followed by the assignment operator ":=", followed by the expression to be evaluated. Both variables must be of the same data type.
Assigning the value of a variable to another variable
Assignments are used to assign the value of a variable to another variable.
The instruction
A := B ; is for instance used to replace the value of the variable "A" by the current value of the variable "B". If "A" and "B" are of an elementary data type, the individual value
"B" is passed to "A". If "A" and "B" are of a derived data type, the values of all elements are passed from "B" to "A".
Assigning the value of a literal to a variable
Assignments are used to assign a literal to variables.
The instruction
C := 25 ; is for instance used to assign the value "25" to the variable "C".
Assigning the value of an FFB to a variable
Assignments are used to assign a value to a variable which is returned by a function or a function block.
The instruction
B := MOD_INT(C,A) ; is for instance used to assign the modulo of the variables "C" and "A" to the variable
"B".
The instruction
A := TON1.Q ; is for instance used to assign to the variable "A" the value of the output "Q" of the function block TONI.
424
33002204 12/2010
Structured text ST
Assigning the value of an operation to a variable
Assignments are used to assign to a variable a value which is the result of an operation.
The instruction
X := (A+B-C)*D ; is for instance used to assign to the variable "X" the result of the operation "(A+B-
C)*D".
33002204 12/2010
425
Structured text ST
Declaration (VAR...END_VAR)
At a Glance
Declaration of function blocks and DFBs
Every time a FB/DFB example is used, a unique example name is assigned when it is declared. The example name is used to mark the function block uniquely in a project. The example name must be unique in the whole project; no distinction is made between upper/lower case. The example name must correspond to the IEC
Name conventions, otherwise an error message will be displayed.
After specifying the example name, the function block type, e.g.CTD_DINT is specified.
In the case of function block types no data type is specified. It is determined by the data type of the actual parameters. If all actual parameters consist of literals, a suitable data type will be selected.
Any number of example names may be declared for an FB/DFB.
NOTE: The dialog Objects → provides you with a form for creating the
FB-/DFB declaration in a simple and speedy manner.
NOTE: In contrast to grafic programming languages (FBD, LD), it is possible to execute multiple calls in FB/DFB examples within ST.
Example
The VAR instruction is utilized for declaring the function blocks used and DFBs and declaring direct addresses if they are not to be used with the default data type. VAR cannot be used for declaring a variable in Concept. Declaring the variables may conveniently be done via the Variables editor.
The END_VAR instruction marks the end of the declaration.
NOTE: The declaration of the FBs/DFBs and direct addresses applies only to the current section. If the same FFB type or the same address are also used in another section, the FFB type or the address must be declared again in this section.
Declaration of function blocks and DFBs
426
33002204 12/2010
Structured text ST
Declaration of direct addresses
In the case of this declaration, every direct address used whose data type does not correspond to the default data type will be assigned the required data type (see also
Default data types of direct addresses
).
Example
Declaration of direct addresses
VAR
AT %QW1 : WORD ;
AT %IW15 : UINT ;
AT %ID45 : DINT ;
AT %QD4 : TIME ;
END_VAR
33002204 12/2010
427
Structured text ST
IF...THEN...END_IF
Description
The IF instruction determines that an instruction or a group of instructions will only be executed if its related Boolean expression has the value 1 (true). If the condition is 0 (false), the instruction or the instruction group will not be executed.
The THEN-command identifies the end of the condition and the beginning of the command(s).
The END_IF instruction marks the end of the instruction(s).
NOTE: Any number of IF…THEN…ELSE…END_IF commands may be nested to generate complex selection commands.
Example IF...THEN...END_IF
If FLAG is 1, the instructions will be executed; if FLAG is 0, they will not be executed.
IF FLAG THEN
C:=SIN_REAL(A) * COS_REAL(B) ;
B:=C - A ;
END_IF ;
Example IF NOT...THEN...END_IF
Using NOT, the condition may be inverted (execution of both instructions at 0).
IF NOT FLAG THEN
C:=SIN_REAL(A) * COS_REAL(B) ;
B:=C - A ;
END_IF ;
Related topic(s)
ELSE
ELSEIF
428
33002204 12/2010
Structured text ST
ELSE
Description
The ELSE command always comes after an IF…THEN-, ELSIF…THEN- or CASEcommand.
If the ELSE command comes after IF or ELSIF, the command or group of commands will only be executed if the associated Boolean expressions of the IF and ELSIF command have the 0 value (false). If the condition of the IF or ELSIF command is 1
(true), the command or group of commands will not be executed.
If the ELSE command comes after CASE, the command or group of commands will only be executed if no identification contains the value of the selector. If an identification contains the value of the selector, the command or group of commands will not be executed.
NOTE: As many IF…THEN…ELSE…END_IF-commands as required can be encapsulated to create complex selection commands.
Example ELSE
IF A>B THEN
C:=SIN_REAL(A) * COS_REAL(B) ;
B:=C - A ;
ELSE
C:=A + B ;
B:=C - A ;
END_IF ;
Related topic(s)
IF
ELSIF
CASE
33002204 12/2010
429
Structured text ST
ELSIF...THEN
Description
The ELSIF-command always comes after an IF…THEN-command. The ELSIFcommand establishes that a command or group of commands will only be executed if the associated Boolean expression of the IF-command has the 0 value (false) and the associated Boolean expression of the ELSIF command has the 1 value (true). If the condition of the IF-command is 1 (true) or the condition of the ELSIF-command is 0 (false), the command or group of commands will not be executed.
The THEN-command identifies the end of the ELSIF-condition(s) and the beginning of the command(s).
NOTE: As many IF…THEN…ELSIF…THEN…END_IF-commands as required can be encapsulated to create complex selection commands.
Example ELSIF…THEN
IF A>B THEN
C:=SIN_REAL(A) * COS_REAL(B) ;
B:=SUB_REAL(C,A) ;
ELSIF A=B THEN
C:=ADD_REAL(A,B) ;
B:=MUL_REAL(C,A) ;
END_IF ;
Example encapsulated commands
IF A>B THEN
IF B=C THEN
C:=SIN_REAL(A) * COS_REAL(B) ;
ELSE
B:=SUB_REAL(C,A) ;
END_IF ;
ELSIF A=B THEN
C:=ADD_REAL(A,B) ;
B:=MUL_REAL(C,A) ;
ELSE
C:= DIV_REAL (A,B) ;
END_IF ;
Related topic(s)
IF
ELSE
430
33002204 12/2010
Structured text ST
CASE...OF...END_CASE
Description
The CASE instruction consists of an INT data type expression (the "selector") and a list of instruction groups. Each group is provided with a marke which consists of one or several whole numbers (ANY_INT) or zones of whole number values. The first group is executed by instructions, whose marke contains the calculated value of the selector. Otherwise none of the instructions will be executed.
The OF instruction indicates the start of the mark.
An ELSE instruction may be carried out within the CASE instruction, whose instructions are executed if no mark contains the selector value.
The END_CASE instruction marks the end of the instruction(s).
Example CASE...OF...END_CASE
Example CASE...OF...END_CASE
Related topic(s)
ELSE
33002204 12/2010
431
Structured text ST
FOR...TO...BY...DO...END_FOR
Description
The FOR instruction is used when the number of occurrences can be determined in advance. Otherwise WHILE
or REPEAT
are used
The FOR instruction repeats an instruction sequence until the END_FOR instruction. The number of occurrences is determined by start value, end value and control variable. Start value, end value and the control variable must be the same type of data (DINT or INT) and may not be modified by one of the repeated instructions. The FOR instruction increments the control variable value of one start value to an end value. The increment value has the default value 1. If a different value is to be used, it is possible to specify an explicit increment value (variable or constant). The control variable value is checked before each renewed loop running.
If it is outside the start value and end value range, the loop will be left.
Before running the loop for the first time a check is made to determine whether incrementation of the control variables, starting from the initial value, is moving towards the end value. If this is not the case (e.g. initial value ≤ negative increment), the loop will not be processed.
Using this ruler, continuous loops will be prevented.
NOTE: For the end value of the data type DINT the range of values -2 147 483 646 to 2 147 483 645 will apply.
The DO command identifies the end of the repeat definition and the beginning of the instruction(s).
Repetition may be terminated early by using the EXIT instruction. The END_FOR instruction marks the end of the instruction(s).
Example: FOR with increment "1"
FOR with increment "1"
432
33002204 12/2010
Structured text ST
FOR with increment not equal to "1"
If an increment other than "1" is to be used, this can be defined by BY. The increment, the initial value, the end value, and the control variable must be of the same data type (DINT or INT). The criterion for the processing direction (forward, backward) is the sign of the BY expression. If this expression is positive, the loop will run forward; if it is negative, the loop will run backward.
Example: Counting forward in two steps
Counting forward in two steps
Example: Counting backward
Counting backward
FOR i:= 10 TO 1 BY -1 DO (* BY < 0 : Backward loop *)
C:= C * COS_REAL(B) ; (* Application will be executed 10 x *)
END_FOR ;
Example: "Unique" loops
The loops in the example are run once precisely, as the initial value = end value. In this context it does not matter whether the increment is positive or negarive.
FOR i:= 10 TO 10 DO (* Unique Loop *)
C:= C * COS_REAL(B) ;
END_FOR ; or
FOR i:= 10 TO 10 BY -1 DO (* Unique Loop *)
C:= C * COS_REAL(B) ;
END_FOR ;
33002204 12/2010
433
Structured text ST
Example: Critical loops
If in the example there is the increment j > 0, the instructions will not be executed, as the situation initial value > end value only permits an increment ≤ loop can only arise if the increment is 0. If this situation is identified during the section analysis, an error message will be generated. If the error is identified during running time, an error message will be generated in the event viewer.
FOR i:= 10 TO 1 BY j DO (* Backward loop *)
C:= C * COS_REAL(B) ;
END_FOR ;
If in the example there is the increment j < 0, the instructions will not be executed, as the situation initial value < end value only permits an increment ≥ 0. A continuous loop can only arise if the increment is 0. If this situation is identified during the section analysis, an error message will be generated. If the error is identified during running time, an error message will be generated in the event viewer.
FOR i:= 1 TO 10 BY j DO (* Forward loop *)
C:= C * COS_REAL(B) ;
END_FOR ;
Example: Illegal loops
Illegal loops
FOR i:= 1 TO 10 BY 0 DO (* Error with Section- *)
C:= C * COS_REAL(B) ; (* Analysis, as continous loop *)
END_FOR ; or
FOR i:= 1 TO 10 BY j DO (* at j=0, Error message *)
C:= C * COS_REAL(B) ; (* in of Event indicator *)
END_FOR ;
434
33002204 12/2010
Structured text ST
WHILE...DO...END_WHILE
Description
The WHILE instruction has the effect that a sequence of instructions will be executed repeatedly until its related Boolean expression is 0 (false). If the expression is false right from the start, the group of instructions will not be executed at all.
The DO command identifies the end of the repeat definition and the beginning of the command(s).
The occurrence may be terminated early using the EXIT.
The END_WHILE instruction marks the end of the instruction(s).
WARNING
Risk of program crashing
WHILE must not be used to carry out synchronization between processes, e.g. as a "waiting loop" with an externally determined end condition. This means that a continous loop must not be created, unless you prevent this using the function
Project Code generation options... Enable Loop Control .
Failure to follow these instructions can result in death, serious injury, or equipment damage.
WARNING
Risk of program crashing
WHILE must not be used in an algorithm for which fullfilling the loop end condition or the execution of an EXIT instruction can not be guaranteed. This means that a continuous loop must not be created, as this may result in crashing the program, unless you prevent this by using the function Project → options... → .
Failure to follow these instructions can result in death, serious injury, or equipment damage.
33002204 12/2010
435
Structured text ST
Example WHILE...DO...END_WHILE
var := 1
WHILE var <= 100 DO
var := var + 4;
END_WHILE ;
Related topic(s)
EXIT
436
33002204 12/2010
Structured text ST
REPEAT...UNTIL...END_REPEAT
Description
The REPEAT instruction has the effect that a sequence of instructions is executed repeatedly (at least once), until its related Boolean condition is 1 (true).
The UNTIL instruction marks the end condition.
The occurrence may be terminated early using the EXIT.
The END_REPEAT instruction marks the end of the instruction(s).
WARNING
Risk of program crashing
REPEAT must not be used to carry out synchronization between processes, e.g. as a "waiting loop" with an externally determined end condition. This means that a continous loop must not be created, unless you prevent this using the function
Project Code generation options... Enable Loop Control .
Failure to follow these instructions can result in death, serious injury, or equipment damage.
WARNING
Risk of program crashing
REPEAT must not be used in an algorithm for which fullfilling the loop end condition or the execution of an EXIT instruction can not be guaranteed. This means that a continuous loop must not be created, as this may result in crashing the program, unless you prevent this by using the function Project → generation options... → .
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Example REPEAT...UNTIL...END_REPEAT
var := -1
REPEAT
var := var + 2
UNTIL var >= 101
END_REPEAT ;
Related topic(s)
EXIT
33002204 12/2010
437
Structured text ST
EXIT
Description
The EXIT command is used to terminate repeat instructions (FOR, WHILE,
REPEAT) before the end condition has been met.
If the EXIT instruction is within a nested occurrence, the innermost loop (in which
EXIT is situated) is left. Next, the first instruction following the loop end (END_FOR,
END_WHILE or END_REPEAT) is executed.
Example EXIT
If FLAG has the value 0, SUM will be 15 following execution of the instructions.
If FLAG has the value 1, SUM will be 6 following execution of the instructions.
SUM : = 0 ;
FOR I := 1 TO 3 DO
FOR I := 1 TO 2 DO
IF FLAG=1 THEN EXIT ;
END_IF;
SUM := SUM + J ;
END_FOR ;
SUM := SUM + I ;
END_FOR
Related topic(s)
CASE
WHILE
REPEAT
438
33002204 12/2010
Empty instruction
Description
Empty instructions are generated by a semicolon (;).
Structured text ST
33002204 12/2010
439
Structured text ST
Comment
Description
Within the ST editor, comments start with the string (* and end in the string *). Any comments may be entered between these two strings. Comments may be entered in any position in the ST editor. Comments are shown in colour.
NOTE: In accordance with IEC 1131-1, nested comments are not permissible.
However, if you wish to place theses elsewhere, you can release them by using
Options Preferences → IEC Extensions Allow nested comments .
440
33002204 12/2010
11.5
Structured text ST
Call up of functions, Function Blocks (EFBs) and
Derived Function Blocks (DFBs)
Overview
This section describes the call up of functions, Function Blocks (EFBs) and Derived
Function Blocks (DFBs).
What's in this Section?
This section contains the following topics:
Topic
Function Block/DFB Invocation
Function Invocation
Page
33002204 12/2010
441
Structured text ST
Function Block/DFB Invocation
Use of Function Blocks and DFBs
Function blocks are provided by Concept in the form of libraries. The logic of the function blocks is created in C++ programming language and cannot be altered in the ST Editor. The names of the available function blocks can be taken from the block libraries.
DFBs are function blocks which can be defined in Concept-DFB. There is no difference between functions and function blocks for DFBs. They are always handled as function blocks regardless of their internal structure.
z z
The use of function blocks and DFBs consists of three parts in ST: the declaration
, the function block/DFB invocation
, z the use of the function block/DFB outputs
.
NOTE: The declaration of the function block/DFB invocation can take place manually or you can create the block end and the assignment of the parameters using the menu command Objects → .
Function Blocks with Limited Use z z z z z z z
Use of the following EFBs from the DIAGNO block library is limited in ST (function blocks can be used, but the expanded diagnostic information cannot be evaluated):
XACT, XACT_DIA
XDYN_DIA
XGRP_DIA
XLOCK,
XPRE_DIA
XLOCK_DIA
XREA_DIA
Function Blocks with Limited Invocation
For EFBs which have one or more outputs with data type ANY but no inputs with data type ANY (generic outputs/inputs), the block invocation can only take place in z z compact form
. e.g. in the block library LIB984 :
GET_3X
GET_4X
442
33002204 12/2010
Structured text ST
Unusable Function Blocks
Unusable Function Blocks: z EFBs which use several registers with only the entry for the first register on the z input/output (e.g. MBP_MSTR from the COMM block library) cannot be used.
EFBs which contain outputs with input information (e.g. GET_BIT, R2T from the z
LIB984 block library) cannot be used
The following EFBs from the COMM block library cannot be used for the technical z z z z z z z z reasons listed above:
CREADREG
CREAD_REG
CWRITREG
CWRITE_REG
READREG
READ_REG
WRITEREG z
WRITE_REG
MBP_MSTR z z z z z z z z z
The following EFBs from the LIB984 block library cannot be used for the technical reasons listed above:
FIFO
GET_BIT
IEC_BMDI
LIFO
R2T
SET_BIT
SRCH
T2T
Declaration
Before invoking the function block/DFBs, they must be declared using VAR and
END_VAR
.
Function Block/DFB Invocation
Function blocks/DFBs are invoked using an instruction consisting of the instance name for the FB/DFB, which is followed by a list, in brackets, of value assignments
(current parameters) to formal parameters. The order of the formal parameters in a function block invocation is not significant. It is not necessary for all formal parameters to be assigned a value. If a formal parameter is not assigned a value, the initial value defined in the variable editor is used when executing the function block. If an initial value is not defined, the default value (0) is used.
NOTE: Inputs of type VARINOUT
always have to be assigned a value.
33002204 12/2010
443
Structured text ST
Function block/DFB invocation:
NOTE: In ST, unlike the graphic programming languages (FBD, LD), FB/DFB instances can be called multiple times.
NOTE: Even if the function block has no inputs or the input parameters are not to be defined, the function block should be invoked before the outputs can be used.
Otherwise the initial values for the outputs are given, i.e. "0".
Declaration and invocation of a function block in ST:
VAR
CLOCK : SYSCLOCK ;
COUNT : CTU_DINT ;
END_VAR
CLOCK () ;
COUNT (CU:=CLOCK.CLK3, R:=reset, PV:=100) ; out:=COUNT.Q ; current:=COUNT.CV ;
Invocation of the function block in FBD.
444
33002204 12/2010
Structured text ST
Function Block/DFB Invocation in Compact Form
The block invocation and the assignments for the inputs/outputs are also possible in a more compact form, which saves runtime:
VAR
CLOCK : SYSCLOCK ;
COUNT : CTU_DINT ;
END_VAR
CLOCK () ;
COUNT (CU:=CLOCK.CLK3, R:=reset, PV:=100,
Q=>out, CV=>current) ;
Use of the Function Block/DFB Outputs
The outputs of the function block/DFBs can always be used when a variable (read only) can also be used.
33002204 12/2010
445
Structured text ST
Function Invocation
Using Functions
Functions are provided by Concept in the form of libraries. The logic of the function is created in C++ and cannot be edited in the ST Editor. The names of the available function can be taken from the block libraries.
NOTE: The declaration of the function invocation can take place manually or you can create the block end and the assignment of the parameters using the menu command Objects → .
Invoking a function in ST: out := LIMIT_INT (MN:=0, IN:=in1, MX:=5 + var) ;
Invoking the function FBD:
Unusable Functions
Functions which have one or more outputs with data type ANY but no inputs with data type ANY (generic outputs/inputs) cannot be used in ST.
Invoking a Function: Variant 1
The function can also be invoked using an instruction consisting of a current parameter (variable) followed by the instruction assignment ":=" followed by the name of the function followed by a list of value assignments (current parameters) for the formal parameters in brackets. The order of the formal parameters in a function block invocation is not significant.
446
33002204 12/2010
Structured text ST
Invoking a Function: Variant 2
Functions are invoked using an instruction. The instruction consists of the current parameter (variable) for the output followed by the instruction assignment ":=" followed by the name of the function followed by a list of current input parameters in brackets. The order of the current parameters in a function invocation is significant.
33002204 12/2010
447
Structured text ST
11.6
Syntax check and code generation
Overview
This section describes the syntax check and the code generation of the structured
ST text.
What's in this Section?
This section contains the following topics:
Topic
Syntax Check
Code generation
Page
448
33002204 12/2010
Structured text ST
Syntax Check
Introduction
A syntax check can be performed during the program/DFB creation with Project →
Analyze section .
Syntax Check Options
With the menu command Options → Preferences IEC extensions... IECextensions the syntax check options can be defined.
NOTE: The settings in this dialog are used in the project description (PRJ.DSK) and in the Concept installations description (CONCEPT.DSK), i.e. they are valid for the entire Concept installation.
If a project is opened, that was created using different settings (e.g. Allow nested comments in the project and not in the actual Concept Installation), errors can occur when opening the project.
Allow Case Insensitive Keywords
If the check box Allow case insensitive keywords is checked, upper and lower case for all keywords is enabled.
Allow nested comments
If the check box Nested comments authorized is checked, nested comments can be entered. There are no limits to the nesting depths.
Allow Leading Digits in Identifiers
If the check box Allow leading digits in identifiers is checked, figures as the first character of identifiers (i.e. variable names, step names, EFB names) are possible.
Identifiers, which consist solely of figures are, however, not authorized, they must contain at least one letter.
Unused Parameters Cause Warnings
The IEC 1131-3 permits functions and Function Blocks to be called up without calling up the assignment of all the input parameters. These unused parameters are implicitly assigned a 0, or they retain the value from the last call up (Function Blocks only).
If in the menu command Options → Preferences → Analysis... → Analysis the check box Unused parameters lead to warnings is checked, a list of these unused parameters is displayed in the message window when generating the code.
33002204 12/2010
449
Structured text ST
Code generation
At a Glance
The menu command Project → is used to define options for code generation.
Fastest code (restricted check)
If the check box Fastest Code (restricted check) is activated, a runtime-optimized code will be generated.
This runtime optimization is achieved with integer arithmetic (e.g. "+" or "-") with simple process commands instead of EFB calls.
Process commands are much faster than EFB calls, but they generate no error messages, such as e.g. Arithmetic or Array overrun. This option should only be used if it has been ensured that the program is free of arithmetic errors.
Example: Fastest code
IF i <= max THEN (*i and max are of INT type*)
i := i +1 ;
END_IF;
If Fastest Code (restricted check) is selected, the addition "i1 + 1" is executed with the process command "add". The code is now faster than if EFB ADD_INT had been called up. However, no runtime error is generated if "max" is 32767. In this case, "i" would overrun from 32767 to -32768!
Activate loop control
This check box activates a software watchdog for continuous loops.
If this check box is checked, with loops within IL and ST sections, it is tested whether these loops are again exited within a certain time. The time authorized depends on the manually defined watchdog time. The authorized time for all loops combined constitutes 80% of the Hardware watchdog time. In this way triggering of the hardware watchdog by endless loops is disabled. If a time consuming loop or an endless loop is detected, processing of the affected section will stop, an entry in the
Event display will be generated and processing of the next section will begin. In the next cycle, the segment will be re-processed until a time consuming loop or an endless loop is detected once again, or until the segment is finished correctly.
NOTE: If the hardware watchdog stops the PLC when a time consuming loop or an endless loop is detected, this option should not be activated. The hardware watchdog itself is not switched off by this function.
450
33002204 12/2010
11.7
Structured text ST
Online functions of the ST programming language
Online functions
Description
The online functions available in the programming language Instruction List (IL) are available here (see
Online functions of the IL instruction list, page 385
).
33002204 12/2010
451
Structured text ST
11.8
Creating a program with the structured ST text
Creating a program in structured ST text
At a Glance
The following description contains an example of the creation of a program in the programming language of structured ST text. This creation is divided into 2 main steps:
Step
1
2
Action
Generating a section
Creating the logic
Generating a section
The procedure for generating a section is as follows:
Step
1
Action
Using the menu command File
→
and enter a section name.
Note: The section name (max. 32 characters) is not case-sensitive and must be unique throughout the project. If the name entered already exists, a warning is given and another name must be chosen. The section name must correspond to the IEC name conventions, otherwise an error message is displayed.
Note: In accordance with IEC1131-3, only letters are permitted as the first character of names. Should numbers be required as the first character, however, the menu command Options Presettings
→ → leading figures in identifiers .
452
33002204 12/2010
Structured text ST
Creating the logic
The procedure for creating the logic is as follows:
Step
1
2
3
4
Action
Declare the Function Block and DFBs, which are to be used, with assistance from VAR…END_VAR.
Example:
VAR
RAMP_UP, RAMP_DOWN, RAMP_X : TON
COUNT : CTU_DINT ;
END_VAR
Declare the variables and their initial value in the Variable Editor.
Create the logic of the program.
Example:
SUM : = 0 ;
FOR I = 1 TO 3 DO
FOR J = 1 TO 2 DO
IF FLAG = 1 THEN EXIT;
END_IF;
SUM := SUM + J ;
END_FOR ;
SUM = SUM + I ;
END_FOR
Save the section with the menu command Data file → .
33002204 12/2010
453
Structured text ST
454
33002204 12/2010
Ladder Logic 984
33002204 12/2010
Ladder Logic 984
12
Introduction
This chapter describes the programming language Ladder Logic 984.
What's in this Chapter?
This chapter contains the following sections:
Section
12.1
12.2
12.3
12.4
12.5
Topic
General about Ladder Logic 984
Working with Ladder Logic 984
Subroutines
Equation Network Editor
LL984 Programming Modes
Page
455
33002204 12/2010
Ladder Logic 984
12.1
General about Ladder Logic 984
General about Ladder Logic 984
Introduction
Ladder logic is displayed in a graphic window. Each window contains exactly one ladder logic section. One or more different ladder sections can be viewed or edited
(multiple windows of the same section is not supported).
If you are adding a new section the section number is posted for your reference.
Correlation between Sections and Segments
Each ladder logic section becomes tied to a PLC ladder logic segment (e.g., one section equals one segment) by a segment number entry in the Section Properties dialog.
One network at a time is visible in each section.
Using the Keyboard
Editing in Concept is ordinarily done with the mouse, but it is also possible with the keyboard (see also
Short Cut Keys in the LL984-Editor, page 847 ).
456
33002204 12/2010
Ladder Logic 984
Project Analyzation
Ladder logic is analyzed before the program is downloaded to the controller.
z z z z z
The editor permits only valid Ladder Logic to be entered in the editor, e.g.: z Only those logic elements supported by the current PLC configuration are visible for selection. You must configure the controller before entering logic.
z z
The analyzer does not allow references outside the range of the current configuration.
The analyzer does not allow duplicate coils unless supported by the current configuration.
The analyzer does not allow loadables that are not in the current configuration.
All subroutines must exist in a single section.
The section containing subroutines cannot be scheduled.
All jumptosubroutine instructions must reference the same section.
Multiple variables per reference are supported. A user preference is available to enable or disable this feature. When multiple variables are declared for a given reference either a warning or error is generated, depending on this preference.
NOTE: Your changes to configuration may cause the program to become incompatible with the configuration.
NOTE: Contacts or coils may be entered without references. This not allowed, but not covered by the project analyzation.
Capacity and Limitations z z
Capacity and Limitations:
Editor cannot permit more sections than number of segments
Editor cannot permit more networks than can fit in controller memory
33002204 12/2010
457
Ladder Logic 984
12.2
Working with Ladder Logic 984
Introduction
This section describes how to work with Ladder Logic 984.
What's in this Section?
This section contains the following topics:
Topic
Entering and Editing Logic Objects
Entering and Editing Variables
Ladder and Network Editing
Reference Zoom and DX Zoom
Search and Replace
Page
458
33002204 12/2010
Ladder Logic 984
Entering and Editing Logic Objects
Prerequisite Requirements
Only those logic objects supported by the current PLC configuration are visible for your selection. You must configure the controller before entering logic.
For Loadables that require settings in Project → Configurator → Configure →
Config. extensions , provisions must be made before inclusion in a Ladder program.
Navigation
When you are in the middle of a section, the next or previous network can be viewed by scrolling with PgUp and PgDn keys.
When you are at the top or bottom of a section, the next or previous section can be viewed by scrolling with PgUp and PgDn keys, if the section exists.
For instance if you are at the end of networks in the last section (and it is not section
32), you are prompted with a dialog to allow appending a new section. Each network is compared against the database on PgUp / PgDn (in Combo-Mode).
You can go to a network within a section by using the Go to Network dialog. You can select the first or last network within the current section, or go to a network by entering a network name or number. A sortable list of networks (with names) is provided.
Dialog Interaction
Your actions for entering and editing Ladder Logic follow the standards of MS-
Windows and conventions of major MS-Windows applications. When an element is selected with the mouse, the mouse cursor changes to a graphical picture that represents the logic item. The application programmer places the logic item in the edit area by clicking or pressing the Enter key.
A keyboard cursor is shown as a high lighted cell (block) within the Ladder Logic network. For each editing mouse action there is a corresponding keyboard action
(see also
Short Cut Keys in the LL984-Editor, page 847 ). When the keyboard is
used to enter a logic item, there is no initial selection step the logic item is immediately placed in the network at the keyboard cursor.
33002204 12/2010
459
Ladder Logic 984
Ladder Logic sample network:
Placing Objects
The entire range of programming objects is available from the Object main menu and selected sub menu items.
Occupied nodes of equivalent height can be overwritten.
Instructions can be entered by typing the name in a dialog.
NOTE: When possible, Concept uses Ctrl key in place of the Modsoft Alt key (see
also Modsoft Keys with Concept Equivalents, page 1008
).
Online Restriction z z
Online restrictions:
Online deletes require user confirmation.
Concept does not support drag/drop of programmed elements when online.
460
33002204 12/2010
Ladder Logic 984
Entering and Editing Variables
Introduction
References of nodes in logic items can be viewed or edited by double clicking an item in a network or by pressing the Enter key on an item that has the focus. An
Object Properties dialog is presented when you double click on a highlighted object or by pressing the Enter key on an item that has the focus.
You can view the already created variables by clicking on the Lookup button.
You can create new variables by clicking on the Variable declarations button.
Editing References
References of each node of the logic element (e.g., multi-node) can be edited. When applicable, you can enter the sub-function name (from a drop-down list). If both a constant and a reference can be entered, the # sign must be entered before a constant beginning with 0, 1, 3, or 4. You may enter a variable name for references.
33002204 12/2010
461
Ladder Logic 984
Object properties with Lookup Variables dialog:
Entry Format of Reference Values
When entering references, the first digit is always the reference type (e.g., 0x) and the following digits are the reference number. You may change the format of the displayed references by setting Options Preferences Common .
462
33002204 12/2010
Ladder Logic 984
Status Bar
The variable name (if applicable) is shown on the display status line, for the element in focus. When online, the value of the reference is also shown. The initial display format of the reference value depends on the instruction in the program. You can change the display format using the following keys in combination to define the data precision and then format.
Table of display formats:
Precision
L (32bit)
S (16bit)
Format
D (signed decimal)
U (unsigned)
A (ascii)
H (hex)
D (signed decimal)
U (unsigned)
A (ascii)
H (hex)
Reference Offsetting
Program references can be offset using Edit → . Multiple references can be offset in the same step (while offline). Sections/networks that are being offset are selectable. You are asked to put in the first and last reference to be affected and put in the number you want the offset to be.
33002204 12/2010
463
Ladder Logic 984
Ladder and Network Editing
Introduction
Ladder and network edit functions are available from the main menus Edit and
Networks .
NOTE: Menu items in diminished brightness are not selectable given the current configuration, status, etc,.
Undo Delete
The Edit → function, is an ofline mode function that allows up to the most current 5 deletes to be undone. The Undo delete is provided for each ladder logic section and includes element and network cut/delete events.
Insert , Append or Reorder network operations cause a reset of the delete-save area therby assuring the network numbers are not contaminated.
Select/De-select All, Cut, Copy and Paste
Select all , Cut , Copy , and Paste operations on individual language elements occur within a single network (at a time). Your can select-all or unselect-all elements in a single network. You can also select, cut, copy, and paste language elements within and between ladder logic networks or sections.
In an online paste operation, the item being pasted is done in increments of scans until complete.
Selecting Elements
You cannot select multiple language elements (e.g., accumulate selections) across networks or sections.
Setting focus to an element is done by moving the cursor (either with mouse or arrow key) to the element.
Selection of elements is done by clicking or pressing the Spacebar key on the element which has the focus.
Multiple elements can be selected by using mouse-rubber-band actions. Multiple elements can also be selected by holding down the Shift key and then clicking on the elements or pressing the Spacebar key on the elements.
An entire row or column can be selected by clicking on the rung or column header in the network.
The mouse provides a finer level of selection than the keyboard. If two or more elements appear in a cell (e.g., both a vertical short and a contact), pressing the
Spacebar key selects all items in that cell. Clicking the mouse selects the element closest to the mouse pointer.
464
33002204 12/2010
Ladder Logic 984
Open Row
A new row is opened at the current cursor position. This command is executed only if there is enough free space (i.e., the last row is empty). The rest of the network is shifted down accordingly. Function boxes and other objects with a height of more than one node are not split by this command.
Open Column
If the rightmost node column is free, the rest of the network is shifted right, and an empty column is opened at the current cursor position.
Close Row
If the node row on which the cursor is positioned is empty, all node elements below are shifted up one row, and an empty bottom row remains.
Close Column
If the node column on which the cursor is positioned is empty, all node elements to the right are shifted left one column and an empty right column remains.
Network
By using the Networks main menu and it’s subcommands, you can insert (before) or append (after) a single empty network or delete one or more networks.
In addition, within a single section, you can cut/copy a network then you can copy/paste networks in any section. You are provided with a list of networks to consider for the cut/copy operation
Reorder Networks
Network execution reordering is an offline function. You may change the execution order of networks within a single section. Networks are solved in the order they appear in the section.
The execution order of networks is changed by using the Network Execution Order dialog. i.e. select Network → .
Network Comments
A section description can be included. Each network can be individually commented using network comments and online comments.
A network name can be entered in the Network Comment dialog.
33002204 12/2010
465
Ladder Logic 984
Reference Zoom and DX Zoom
Introduction z z
Concept offers you two different zoom types: the Reference Zoom the DX Zoom
Reference Zoom
Some programming elements allow parameters to be set which in effect customize a network implementation for this specific element. Such features as ranges and limits etc., are input using this zoom edit capability.
Information on individual references can be viewed or edited.
z z z
The Reference Zoom dialog shows the following information about a reference:
State-ram value
The drop/rack/slot if the reference is in I/O map
If reference is 0x or 1x, then the disable/enable state is shown
The initial display format of 3x and 4x reference values depends on the instruction in the program. The display format can be changed. The state ram value or disable/enable state (if applicable) can also be changed. Constants cannot be zoomed. You cannot zoom on variables without a reference. Reference Zoom dialogs can be used for 4x references and for 0x references that are disabled.
DX Zoom
The DX Zoom editor allows you to edit registers for DX functions. These registers used by the DX function also have text descriptions associated with them to aid with
DX programming. There is both keyboard and mouse access to DX zoom from the
Ladder Logic editor.
The DX Zoom dialog allows you to edit registers for given DX functions. The DX zoom screen contains text for each register, bit, or group of bits.
The allowed data types are:
Data Type
Unsigned Integer
Signed Integer
Unsigned Long Integer
Signed Long Integer float bit (flag) bitfield
Length
16 bit
16 bit
32 bit
32 bit
32 bit
1 bit
1-16 bits
466
33002204 12/2010
Ladder Logic 984
The allowed complex data types are:
Complex Data Types equation
ASCII
Length
1-16 bits
String up to 80 characters
Absolute addressing is the only addressing method allowed. There is no support for indirect addressing
In addition to data entry, DX zoom has the capability to display textual information associated with a particular register. Each register entry will have an associated descriptor as well as context sensitive help.
33002204 12/2010
467
Ladder Logic 984
Search and Replace
Trace
The Online → Trace function finds coils from 0x references in the program. You can trace a coil by first setting focus to a 0x reference and then running the trace function. The result of trace is to position the network with the found coil on the edit area. After a successful trace, with Online → you can go back to the initial
0x reference.
Online Search
A separate dialog is available for Project → in direct mode. The Online
Search dialog. On each find, the choice to search previous or next is provided.
Search can be canceled at any time.
There is no support for searching variable names if in Ladder Logic direct mode.
Replace References
Search and replace of references occur throughout an entire program. You can select which sections/networks are being searched.
The Edit → dialog is modal. Request may be prompted for each individual replace, or request to replace all with no prompting. Replaced references are listed in the Project Search Search History list.
You may exclude DX functions with discrete references from the search. DX functions require 0x and 1x references to be on a 16 bit boundary.
468
33002204 12/2010
Ladder Logic 984
12.3
Subroutines
Subroutines
Example
The example below shows a series of three user logic networks, the last of which is used for an up-counting subroutine. Segment 32 has been removed from the orderof-solve table in the segment scheduler.
33002204 12/2010
469
Ladder Logic 984
Description of Example
Description of example:
Stage
1
2
3
Description
When input 10001 to the JSR block in network 2 of segment 1 transitions from
OFF to ON, the logic scan jumps to subroutine #1 in network 1 of segment 32.
Result: The subroutine will internally loop on itself ten times, counted by the
ADD block.
The first nine loops end with the JSR block in the subroutine (network 1 of segment 32) sending the scan back to the LAB block.
Upon completion of the tenth loop, the RET block sends the logic scan back to the scheduled logic at the JSR node in network 2 of segment 1.
470
33002204 12/2010
12.4
Equation Network Editor
Introduction
This section describes the LL984 equation network editor.
What's in this Section?
This section contains the following topics:
Topic
Introduction
Equation Editing
Syntax and Semantics
Ladder Logic 984
Page
33002204 12/2010
471
Ladder Logic 984
Introduction
Overview
The equation network is a combination of both Ladder Logic and an algebraic equation. This network type allows a control designer to incorporate an algebraic equation into a Ladder Logic program The Equation Network Editor dialog has no row/column numbers since they have no significance. The grid display option is not available for the equation network because the row/column concept does not apply to this new network type. You have the ability, using Ladder Logic notation, to indicate when the equation will be solved.
Equation network is a special type of Ladder Logic network that allows you to specify the value of a result register in algebraic notation. If your PLC has an floating point processor, equation network will take advantage of this feature for faster processing.
It uses a full Ladder Logic network to compose the equation, with a contact or horizontal short as the enabling input and up to five output coils to describe the state of the result.
Available Menu Items
The Networks main menu includes two submenu entries to support equation networks: Insert Equation and Append Equation . If you page through the networks and reach the start/end of the section, you have the opportunity to insert/append a new equation network, in addition to the other choices available
(insert/append ladder network, cancel, etc.).
Representation
The Ladder Logic network display changes to accommodate an initialized equation network. The row and column numbers are removed and also the grid lines are removed if they are currently being displayed.
472
33002204 12/2010
Ladder Logic 984
The initial display is replaced by the figure below when you double click on the default equation body.
33002204 12/2010
473
Ladder Logic 984
Equation Editing
Equation Entries
In the first column of the network, row 1 column 1, the legal equation enable entries are: z Normally open contact ( -| |- )
When a normally open contact is entered as the first node of the network the equation is solved when the contact’s referenced coil or input is ON. z z
Normally closed contact ( -|/|- )
When a normally closed contact is entered as the first node of the network the equation is solved when the contact’s referenced coil is OFF.
Horizontal short ( ----- )
When a horizontal short is entered as the first node of the network the equation to be solved on every scan.
The horizontal short is used for display purposes only and is not sent to the PLC as part of the network; the absence of an enabling contact node in the network z sent to the PLC indicates that the network should always be solved.
Horizontal open ( - --- )
When a horizontal open is entered as the first node of the network the execution of the equation network is prevented.
Equation Results
Equation network can produce five possible outputs from the top five rows of the network to describe the result of the equation. You choose the outputs you want to use by assigning 0x reference numbers to them.
The outputs are displayed as coils in the last column of the equation network.
The row in which the output coils are placed determines their meanings: z Done without error ( -( √ ) )
When the equation passes power to the output from the top row, the equation has z completed successfully without an error.
Result < 0 ( -(< 0) )
When the equation passes power to the output from the second row, the equation has completed successfully and the result is less than zero.
z z
Result = 0 ( -(= 0) )
When the equation passes power to the output from the third row, the equation has completed successfully and the result is equal to zero.
Result > 0 ( -(> 0) ) z
When the equation passes power to the output from the fourth row, the equation has completed successfully and the result is greater than zero.
Done with error ( -(!) )
When the equation passes power to the output from the fifth row, the data in the equation has caused a calculation error.
474
33002204 12/2010
Ladder Logic 984
Cut, Copy and Paste
Text may be pasted into the edit box of an Equation Network Editor dialog. These are standard Windows text operations, and are the only cut/copy/paste operations allowed within equation networks. No validation is performed at the time of a cut or paste; the equation is validated when the user decides to terminate the dialog with the OK button.
You can cut/copy/paste equation networks using Network → in which a netwotk is manipulated in its entirety.
When a network is cut or copied it may be pasted as a new equation network. In this case, "paste" means "insert new network". This is the same operation as is used with ladder networks.
Validity Check
When OK is selected in the Equation Network Editor dialog, the equation is checked for validity. If an error is detected the cursor is placed as near to the error as possible and an error message is displayed.
33002204 12/2010
475
Ladder Logic 984
Syntax and Semantics
Operators
The operators are listed below in order of precedence highest to lowest. If required competing operators are evaluated left to right.
Operator Group
Unary
Operators
-
Exponentiation
Multiply/divide *
~
**
Add/subtract
Bitwise
-
&
/
+
Relations
-
< <
> >
^
<
< =
=
Conditional
< >
= >
>
?:
Description
Negation
Ones complement
Exponentiation
Multiply
Divide
Addition
Subtraction
And
Or
Left shift
Right shift
Xor
Less than
Less than or equal
Equal
Not equal
Greater than or equal
Greater than
Test
476
33002204 12/2010
Ladder Logic 984
Functions
Additionally the following functions are recognized (and predefined) in an equation:
FIX
FLOAT
LN
LOG
SIN
SIND
SQRT
TAN
TAND
Function
ABS
ARCCOS
ARCSIN
ARCTAN
COS
COSD
EXPE
Description
Absolute value
Arc Cosine
Arc Sine
Arc Tangent
Cosine of Radians
Cosine of Degrees
Exponential function, e** argument
Convert float to integer, presumes floating point argument
Convert Integer to Floating point
Natural Logarithm (base e)
Common Loagarithm (base 10)
Sine of Radians
Sine of Degrees
Square Root
Tangent of Radians
Rangent of Degrees
Equation Syntax
Equation syntax conventions:
Command
[abc]
[a-z] expr* expr+
Description
Any one of a b c
Any characters in the range a trough z
Zero or more expr
One or more expr
33002204 12/2010
477
Ladder Logic 984
Lexical Classes
Table of lexical classes letter bit octal_digit digit hex_digit letter_or_digit identifier assignment_op relational_op bitwise_op add_sub_op
Mul_div_op exp_op unary_op optional_sign
Constants z z z z
Constants consist of: binary_const 2# bit binary_const_body decimal_const digit decimal_const_body octal_const 8# octal_digit octal_const_body z hex_const 16# hex_digit hex_const_body float_const mantissa exponent a-z A-Z
0-1
0-7
0-9
0-9 a-f A-F letter | digit letter letter_or_digit*
:=
> < >= <= = <>
& | ^ >> <<
+ -
* /
**
- ~
+ - /*nothing*/
478
33002204 12/2010
Ladder Logic 984
Register References reg_rvalue consists of: discrete_rvalue int_reg_rvalue uint_reg_rvalue long_reg_rvalue
0 digit+
3 digit+
U3 digit+
L3 digit+ ulong_reg_rvalue UL3 digit+ float_reg_rvalue F3 digit+ reg_lvalue consists of: int_reg_lvalue uint_reg_lvalue long_reg_lvalue ulong_reg_lvalue float_reg_lvalue
4 digit+
U4 digit+
L4 digit+
UL4 digit+
F4 digit+
1 digit+
4 digit+
U4 digit+
L4 digit+
UL4 digit+
F4 digit+
Note
6 digit+
U6 digit+
L6 digit+
UL6 digit+
F6 dgit+
6 digit+
U6 digit+
L6 digit+
UL6 digit+
F6 dgit+
Because of Concept IEC standards, placement of lexical identifiers differ between
Modsoft and Concept. However, an existing Modsoft Equation is properly transformed using the Modsoft program converter.
For example a Modsoft equation
400100F := 400001UL + 400002U + 400003L + #23 becomes a Concept equation
%F400100 := %UL400001 + %U400002 + %L400003 +23
33002204 12/2010
479
Ladder Logic 984
12.5
LL984 Programming Modes
LL984 Programming Modes
Direct Programming
There are two situations that determine how direct mode ladder editing is applied: z The first is where there is no open project and you are connected to a PLC that has a valid program in it. When you select the command Direct-mode 984LL
Editor the first program in the first segment is displayed. You can see the direct mode status at the right side of the status bar and the network window is labled
984LL Direct .
z The second case occurs when you have a project open and you are connected to the PLC (but not EQUAL ). When you select Direct-mode 984LL Editor in this case a dialog is displayed listing segments and the number of networks contained in each. Click on the segment you want click on OK and the Network edit window is displayed with a window labeled 984LL Direct . If you have an orignal edit window it will remain on the display.
Combination Mode
Combination programming occurs when the programming panel is online. Valid program changes are immediately written to both the controller and the program database simultaneously.
480
33002204 12/2010
DFBs (Derived Function Blocks)
33002204 12/2010
DFBs (Derived Function Blocks)
13
Overview
This Chapter describes the procedure for creating DFBs (Derived Function Blocks) with help from Concept DFB.
What's in this Chapter?
This chapter contains the following sections:
Section
13.1
13.2
Topic
DFBs (Derived Function Blocks)
Programming and calling up a DFB
Page
481
33002204 12/2010
DFBs (Derived Function Blocks)
13.1
DFBs (Derived Function Blocks)
Overview
This section provides an overview on creating and applying DFBs (Derived Function
Blocks).
What's in this Section?
This section contains the following topics:
Topic
General information about DFBs (Derived Function Blocks)
Global / Local DFBs
Use of variables in DFBs
Combined Input/Output Variables (VARINOUT Variables)
Global Variables
Creating Context Sensitive Help (Online Help) for DFBs
Page
482
33002204 12/2010
DFBs (Derived Function Blocks)
General information about DFBs (Derived Function Blocks)
At a Glance
DFBs are created with the help of the Concept DFB software.
DFBs (Derived Function Blocks) can be used for setting both the structure and the hierarchy of a program.
In programming terms, a DFB represents a subroutine.
z z z z z z z
Meaning:
Delivery/transfer of defined values to/from the subroutine
Any complex program
Nesting of one or more DFBs in a DFB
Multiple DFB call up in the whole program, where the program code is bound only once during the whole program
DFB specific local variables
Initial value for variables freely definable Interface
Programming languages
DFBs can be created in the Function Block language (FBD), ladder diagram (LD), instruction list (IL) and structured text (ST) programming languages.
Structure of a DFB
A DFB firstly provides an empty space, which contains a manually defined input/output and any manually programmed logic. The hierarchic structure of this logic corresponds to a project in Concept which consists of one or more sections.
These sections contain the actual logic.
Internal structure of the DFB in the FBD editor:
Processing sequence
The processing sequence of the logic, the programming rules and the usable FFBs and DFBs correspond overall to those of the FBD, LD, IL and/or ST programming.
33002204 12/2010
483
DFBs (Derived Function Blocks)
Nesting
It is possible to call up one or more already existing DFBs in a DFB, where the called up DFBs themselves can call up one or more DFBs. A DFB cannot however contain itself. A nesting depth of 5 should not be exceeded. The exact border depends, among other factors, upon parameterization (e.g. the number of DFB input/output variables) of the CPU in use and its configuration.
NOTE: If nested DFBs are used, the whole nested DFB hierarchy is not checked consistently in the DFB editor, but only the DFB on the next level. This means that, for example, with a DFB with 3 or 4 levels, the deep nested DFBs can be altered (i.e.
Pin assignment), without this being apparent. In Concept, an error is not reported until project analysis.
NOTE: NEVER use diagnostic EFBs (diagnostic library) in DFBs.
Context help
Personalized context-sensitive help (online help) can be created for DFBs (see
Creating Context Sensitive Help (Online Help) for DFBs, page 499 ).
Calling up a DFB
DFBs are visually denoted in the FBD and LD editor window by double vertical lines on the DFB border. Using the command button Despeckle… in the properties dialog box of the DFB a document window can be opened, in which the programmed logic of the DFB can be viewed (even when it was created with IL or ST). This document window has a gray background, which denotes that the DFB in this document window cannot be edited.
DFBs are treated as Function Blocks after they are called into Concept.
Call up of the DFB in the FBD editor:
Archiving and Documentation
The archiving and documentation of a DFB is the same as with projects (see
Documentation and Archiving, page 729 ).
484
33002204 12/2010
DFBs (Derived Function Blocks)
Global / Local DFBs
Description
Global and local DFBs differ in the locality of their directory hierarchy.
Depending on the directory or subdirectory in which the DFB is stored, it can be called up globally, i.e. within all the projects created under Concept, or locally, in a specific project.
In the
Defining the Storage of Global DFBs during Upload, page 1110 you can
ensure that during the IEC upload process a GLB directory containing the global
DFBs is created in the project directory. By doing this, the existing global DFBs in the Concept → DFB will not be overwritten and therefore it will not have any effect on other projects.
Directory structure without uploaded project:
33002204 12/2010
485
DFBs (Derived Function Blocks)
Directory structure according to INI settings ( [Upload]: PreserveGlobalDFBs=1 ) for uploaded projects:
486
If a local and a global DFB have the same name, the local DFB is given priority.
NOTE: The length of the DOS path name in which the DFBs are stored is limited to
29 characters. Care should be taken that the DFB directory does not exceed this limit.
33002204 12/2010
DFBs (Derived Function Blocks)
Use of variables in DFBs
Introduction z z
When programming DFBs, two forms of variables are distinguished:
Internal variables
Formal parameters (Input/Output variables)
Internal variables
Internal variables are variables that are only used within the logic of DFBs. These variables can only be altered in Concept DFB itself. This alteration is therefore valid for all instances of this DFB. z z z z
The following are permitted as types of variables:
Unlocated variables,
Unlocated Multi-element variables,
Constant variables z
Literals and
Located variables.
NOTE: Located variables can be used if in the IEC Extentions dialog box you activate the Allow located variables in DFBs option (see also section
).
These variables are declared in the Variable editor
.
Formal parameters
Input and output variables are required to transfer values to or from a DFB. These types of variables are called formal parameters. These variables are taken from the
DFB and displayed as input/output when calling up the DFB.
In the Variable editor
define the formal parameter names (the names of the inputs/outputs), the type of data and the position of the inputs/outputs
(for the FBD /LD editor) on the DFB.
A maximum of 32 input and 32 output variables are possible. The width of the DFB symbol is automatically matched to the length of the name of the inputs/outputs.
Input and output variables are always Unlocated variables.
An initial value can also be defined for input variables. Input variables, i.e. inputs, are always shown to the left of the DFB in the FBD/LD editor. Output variables, i.e. outputs, are always shown to the right of the DFB.
A special form of input/output variables are the VARINOUT variables
.
33002204 12/2010
487
DFBs (Derived Function Blocks)
Transfer of values during the program runtime
During program runtime, the value of the current parameters in the DFB program are passed and redistributed via the formal parameters. The value of these formal parameters are determined by the value of the current parameters, which have been linked with the corresponding DFB input/output. The current parameters can be direct addresses, located variables, unlocated variables, located multi-element variables, unlocated multi-element variables, elements from multi-element variables, constants or literals.
Through this, the same DFB type can be called up several times and each copy of the DFB assigned with individual parameters.
Exchanging positions
If all 32 possible input or output variables are occupied when creating the DFB and the exchange of the positions of 2 variables is required, a variable can be placed in position 33 in the meantime. This enables the alteration of the variable positions.
However, saving a DFB with 33 input or output variables is not possible. Position 33 only serves as an auxiliary position when editing.
488
33002204 12/2010
DFBs (Derived Function Blocks)
Combined Input/Output Variables (VARINOUT Variables)
Introduction
Combined input/output variables are a special form of input/output variables. These are also called VARINOUT variables.
Application Purpose
DFBs are often used to read a variable on input (input variables), to process it and to restate the altered values of the same variable (output variables). If the variables are structured variables and elements unaffected by the processing are also to be output again at the output, it is necessary to copy the complete variable within the
DFB from the input to the output. This is also necessary when only a single element of a structured variable is processed in the DFB. To save memory and shorten the execution time, it is sensible to use VARINOUT variables in this case. This variable type can (must) be used simultaneously at DFB inputs and the associated DFB outputs.
Creating a VARINOUT variable in DFB z z z z
The following conditions must be noted when creating a VARINOUT variable: z Like all input/output variables, VARINOUT variables are created in the Variable z
Editor.
VARINOUT variables are declared twice. Once as input variables and once as output variables.
The same formal parameter names must be used in both declarations.
The same data types must be used in both declarations.
The same pin positions must be used in both declarations.
z
The input variable is declared first, and then the output variable.
After confirming the declaration with OK , it is no longer possible to modify the input variable.
Specific Features during Creation
The following special features are to be noted when creating DFBs with VARINOUT inputs/outputs.
z If the DFB VARINOUT input has been assigned an initial value, this is not used, as it is imperative that the input is switched on.
33002204 12/2010
489
DFBs (Derived Function Blocks)
Example
DFB logic:
Declaration of inputs:
490
33002204 12/2010
Declaration of outputs:
DFBs (Derived Function Blocks)
Use of the DFB in FBD/LD
The DFB is invoked and used in FBD/LD editor (see also
FBD Function Block dialog, page 515 and
Calling up a DFB in Ladder Diagram LD, page 517
) just like any other DFB. The inputs/outputs of type VARINOUT are characterized by a dotted line.
Use of the DFB in the FBD editor:
Specific features in usage z z z z z
The following special features are to be noted when using DFBs with VARINOUT inputs/outputs.
z It is essential that VARINOUT inputs/outputs are linked. Otherwise an error message appears during the section analysis.
z The same variables/variable components must be attached at the VARINOUT input and the VARINOUT output.
No graphical links can be attached to VARINOUT inputs/outputs.
No literals or constants can be attached to VARINOUT inputs/outputs.
No Boolean variables can be attached to VARINOUT inputs/outputs, because this leads to problems in the code generation.
No negations can be used at VARINOUT inputs/outputs.
If a DFB with VARINOUT inputs/outputs is used within another DFB (nested
DFBs), the VARINOUT inputs/outputs of the inner DFB can be linked to those of the outer DFB.
33002204 12/2010
491
DFBs (Derived Function Blocks)
Use of the DFB in ST
The DFB is invoked and used in ST Editor (see also
Function Block/DFB Invocation, page 442
) like any other DFB.
Use of the DFB in the ST Editor:
(* Function Block declaration *)
VAR
Instance_Name : DFBX;
END_VAR
(* Block invocation *)
Instance_Name (IN1 := V1,
IO1 := V5,
IN2 := V2);
(* Assignments *)
V4 := Instance_Name.OUT1;
V3 := Instance_Name.OUT3; z z
The following special features are to be noted when using DFBs with VARINOUT inputs/outputs.
z It is essential that VARINOUT inputs be assigned a value on DFB invocation.
Otherwise an error message will appear during the section analysis i.e. the z z following block invocation is not allowed, because the assignment of a value at the VARINOUT input "V5" is missing:
Instance_Name (IN1 := V1,
IN2 := V2);
VARINOUT outputs are not to be assigned a value. Otherwise an error message will appear during the section analysis i.e. the following output assignment is not allowed, because a value has been assigned at the VARINOUT output:
V5 := Instance_Name.IO1;
No literals or constants are to be assigned to VARINOUT inputs.
No Boolean variables can be attached to VARINOUT inputs/outputs, because this leads to problems in the code generation.
If a DFB with VARINOUT inputs/outputs is used within another DFB (nested
DFBs), the VARINOUT inputs/outputs of the inner DFB can be linked to those of the outer DFB.
492
33002204 12/2010
DFBs (Derived Function Blocks)
Use of the DFB in IL
The DFB is invoked and used in IL editor (see also Use of Function Blocks and
DFBs, page 372 ) like any other DFB.
Use of the DFB in the IL editor:
(* Function Block declaration *)
VAR
Instance_Name : DFBX;
END_VAR
(* Block invocation *)
CAL Instance_Name (IN1 := V1, IO1 := V5, IN2 := V2)
(* Assignments *)
LD Instance_Name.OUT1
ST V4
LD Instance_Name.OUT3
ST V3 z z
The following special features are to be noted when using DFBs with VARINOUT inputs/outputs.
z It is essential that VARINOUT inputs be assigned a value on DFB invocation.
Otherwise an error message will appear during the section analysis i.e. the z z following block invocation is not allowed, because the assignment of a value at the VARINOUT input "V5" is missing:
CAL Instance_Name (IN1 := V1, IN2 := V2)
VARINOUT outputs are not to be assigned a value. Otherwise an error message will appear during the section analysis i.e. the following output assignments are not allowed, because a value has been assigned at the VARINOUT output:
LD Instance_Name.IO1
ST V5
No literals or constants are to be assigned to VARINOUT inputs.
No Boolean variables can be attached to VARINOUT inputs/outputs, because this leads to problems in the code generation.
If a DFB with VARINOUT inputs/outputs is used within another DFB (nested
DFBs), the VARINOUT inputs/outputs of the inner DFB can be linked to those of the outer DFB.
33002204 12/2010
493
DFBs (Derived Function Blocks)
Special features when modifying
There are 3 general possibilities for modifying VARINOUT variables: z Modify existing VARINOUT variables: z z z
Rename the variables
Change the data type
Change the pin position z z
Two existing variables can be joined in one VARINOUT variable
Split a VARINOUT variable into two variables
Change existing VARINOUT variables
To change (rename, change data type, change pin position) existing VARINOUT variables, proceed as follows:
Step
1
2
3
4
Action
Open the Variable Editor ( F8 ).
Select the Outputs option.
Implement the required changes.
Response: The changes are automatically transferred to the input variable.
Confirm the changes with OK .
Join variables to VARINOUT variable
To join two variables to a VARINOUT variable, perform the following steps:
Step
1
2
3
4
5
6
7
8
Action
Open the Variable Editor ( F8 ).
Select the Inputs option.
Create a new input variable (e.g. INOUT1).
Select the Outputs option.
Create a new output variable with the same name (e.g. INOUT1), data type and pin position as the input variable.
Confirm the changes with OK .
Replace all uses of the input and output variable with the VARINOUT variable in your program.
Open the Variable Editor ( F8 ) and delete the now redundant input and output variable.
494
33002204 12/2010
DFBs (Derived Function Blocks)
Splitting VARINOUT variable
To split a VARINOUT variable into two variables, proceed as follows:
Step
1
2
3
6
7
4
5
8
Action
Open the Variable Editor ( F8 ).
Select the Inputs option.
Create a new input variable (e.g. IN1).
Select the Outputs option.
Create a new output variable (e.g. OUT1).
Confirm the changes with OK .
Replace all usages of the VARINOUT variable with the input and output variables in your program.
Open the Variable Editor ( F8 ) and delete the now redundant VARINOUT variable.
33002204 12/2010
495
DFBs (Derived Function Blocks)
Global Variables
Introduction
Global variables are located variables which are declared in Concept-DFB and
Concept.
Global variables in DFBs can only be declared if the Allow Located Variables in
DFBs check box is activated in the IEC Extensions dialog box. Then the the
Address column is available in the DFB Variable Editor, i.e. located variables can now be declared.
Global validity of the variables is defined as soon as the DFB is used in the project and the respective located variables are declared in the Concept Variable Editor.
When declaring the variables, make sure that the same name, address and data type is used as in the DFB Variable Editor. All reference ranges can be used (0x, 1x,
3x and 4x).
Declaration errors are found and error messages are given when the program is analyzed ( Project → ). If global validity is recognized, the global variables are shown with a gray background in the Concept Variable Editor and are write protected in Concept. That means global variables canonly be changed in the
DFB Variable Editor. Then the declaration for the changed variables must be updated in the Concept Variable Editor to restore global validity.
NOTE: If inconsistencies are found between the declaration of global variables in the DFB and the program when analyzing the program (e.g. the address is declared differently), the program cannot be downloaded to the PLC.
Execution in Concept-DFB
To create global variables in DFB, carry out the following steps in Concept-DFB:
Step
1
2
3
4
Action
Close Concept and Start Concept-DFB.
Select Options → IEC Extensions...
, and activate the check box Allow Located Variables in DFBs .
Create a DFB (see section
).
Create the logic (example: see section Creating the Logic in FBD Function Block
).
496
33002204 12/2010
Step
5
DFBs (Derived Function Blocks)
Action
Select Project
→
. To declare the located variables, activate the Variables option button.
Note: All reference ranges can be used (0x, 1x, 3x and 4x) for addressing.
6
7
8
9
Now re-activate the selection mode with Objects
→
and doubleclick on one of the unconnected inputs.
Result: The Connect FFB dialog box is opened, where you can assign a current parameter to the input.
In Connect with , activate the Variable option button.
Open the variable editor using he Variable declaration...
command button.
Then select the unlocated variable (STOP) and click OK .
Result: The selected variable is transferred to the text box in the Connect FFB dialog box.
With OK , the variable (STOP) is assigned to the selected input on the module.
33002204 12/2010
10 Save the DFB using the menu command File
→
.
497
DFBs (Derived Function Blocks)
Execution in Concept
To create global variables in DFB, carry out the following steps in Concept:
Step
1
2
Action
Close the Concept DFB and Start Concept.
Call the DFB (example: see section
Calling up a DFB in the FBD Function Block dialog, page 515
).
3
4
5
Select Project
→
. To declare the located variables
(STOP), activate the Variables option button.
Transfer the variable names, data type and the address of the located variables, exactly as they were declared in the Concept-DFB variable editor.
Analzye the program using Project
→
.
Result: The Messages window is opened and shows that the global variable
"STOP" was found in the DFB.
The global validity of the variable is recognized, therefore it is shown with a gray background in the Concept Variable Editor.
498
6 In the DFB Editor, you can open the Function Block dialog box by doubleclicking on the DFB. Using the Refine...
command button, open a document window with the inner logic of the DFB (the global variable STOP is also shown here).
33002204 12/2010
DFBs (Derived Function Blocks)
Creating Context Sensitive Help (Online Help) for DFBs
Introduction
In Concept, help is provided for each EFB, which can be invoked according to the context (the Help on Type command key in the EFBs properties dialog). There are of course no corresponding help texts in Concept for the DFBs created by you.
You can, however, create your own help for each DFB, which can be invoked in
Concept with Help on Type .
File Format: z z z z z z z
You can create your help in the following file formats:
.chm
(Microsoft Windows compiled HTML help file)
.doc
(Microsoft Word format)
.htm
.hlp
.rtf
.txt
(Hypertext Markup Language)
(Microsoft Windows help file (16- or 32-Bit Format))
(Adobe Portable Document Format
(Microsoft Rich Text Format)
(Plain ASCII Text-Format)
Name
The name of the help file must be exactly the same as the name of the DFB (e.g.
SKOE.ext)
The only exceptions are standardized DFB names (e.g. SKOE_BOOL,
SKOE_REAL etc.) In these cases the help file name is the DFB name without the datatype extension (e.g. DFB name) SKOE_BOOL has the help file SKOE.ext).
Directory z z z z
The help file can be stored in the following directories:
Concept directory
Concept Help directory (if defined in the file Concept.ini, see readme)
Global DFB directory
Local DFB directory
33002204 12/2010
499
DFBs (Derived Function Blocks)
Invoking the Help File
Concept carries out the following procedure to invoke the help file:
Phase
1
2
3
4
Description
Search for the help file DFBName.ext
in the local DFB-directory.
The help file is searched for in the following sequence: z z z z z z z
.hlp
.chm
.htm
.rtf
.doc
.txt
Result: If the search result is positive the help file will be displayed, otherwise it will continue with phase 2.
Search for the help file DFBName.ext
in the global DFB-directory.
For the order, see phase 1.
Result: If the search result is positive the help file will be displayed, otherwise it will continue with phase 3.
Search for the help file DFBName.ext
in the Concept-directory or Concept-Help directory.
For the order, see phase 1.
Result: If the search result is positive the help file will be displayed, otherwise it will continue with phase 4.
Display of the comment created in Concept DFB with Project → .
500
33002204 12/2010
13.2
DFBs (Derived Function Blocks)
Programming and calling up a DFB
Overview
This section describes programming and calling up a DFB.
What's in this Section?
This section contains the following topics:
Topic
At a Glance
Creating the DFB
Creating the Logic in FBD Function Block Language
Creating the Logic in LD Ladder Diagram
Creating the Logic in IL Instruction List
Creating the Logic in ST Structured Text
Calling up a DFB in the FBD Function Block dialog
Calling up a DFB in Ladder Diagram LD
Calling up a DFB in the IL instruction list
Calling up a DFB in structured text ST
Page
33002204 12/2010
501
DFBs (Derived Function Blocks)
At a Glance
At a Glance
Programming and calling up a DFB is divided into 3 main steps:
Step
1
2
3
Action
Occupying the DFB
Creating the logic in: z z z z
Function Block language (FBD)
Ladder diagram (LD)
Instruction list (IL)
Structured text (ST)
Calling up the DFB in: z z z z
Function Block language (FBD)
Ladder diagram (LD)
Instruction list (IL)
Structured text (ST)
502
33002204 12/2010
DFBs (Derived Function Blocks)
Creating the DFB
Description
The procedure for creating the DFB is as follows:
Step
1
2
3
4
5
6
7
8
Action
Close Concept and start Concept DFB.
Create a new DFB using the menu command Data file
→
.
Reaction: The name now appears on the title bar: [untitled] .
Using the menu command Data file
→
, generate a new section and enter a section name.
The section name (max. 32 characters) must be clear throughout the DFB, and is not case-sensitive. If the section name entered already exists, a warning is given and another name must be chosen. The section name must correspond to the IEC Name conventions, otherwise an error message appears.
Note: In accordance with IEC1131-3, only letters are permitted as the first character of names. If, however numbers are required as the first character, this can be enabled using the menu command Options
→
IEC
Expansions...
→
Enable leading figures in identifiers .
Select a programming language for the section: z z z z
Function Block language (FBD)
Ladder diagram (LD)
Instruction list (IL)
Structured text (ST)
The menu command Project
→
can be used to generate a comment about the DFB.
Reaction: This comment can be shown in Concept in the DFB properties box with the command button Help for type .
Save the DFB with the menu command Data file
→
.
Reaction: The first time the Save is used, the Save as dialog box opens – specify the DFB name and directory where it is to be saved here.
Select the directory to be occupied by the DFB. Attention should be paid to the
difference between global and local DFBs (see also Global / Local DFBs, page 485 ).
Enter the DFB name (max. 8 characters, always with the .DFB extension).
The name must be clear throughout the directory, and is not case-sensitive. If the section name entered already exists, a warning is given and another name must be chosen.
33002204 12/2010
503
DFBs (Derived Function Blocks)
Creating the Logic in FBD Function Block Language
Description
The procedure for creating the logic in FBD function block language is as follows:
Step
1
Action
To insert an FFB into the section, select the Objects
→
menu command.
Result: The FFB dialog box from the library is opened.
3
4
5
6
2 In this dialog box you can select a library and an FFB from it by using the
Library...
command button. You can, however, also display the DFBs that you created and select one of them using the DFB command button.
Place the selected FFB in the section.
When all FFBs have been positioned, close the dialog box with OK
Activate select mode with Objects
→
, click on the FFB and move the FFBs to the desired position.
Activate the link mode with Objects
→
and connect the FFBs.
For example:
504
33002204 12/2010
33002204 12/2010
Step
7
DFBs (Derived Function Blocks)
Action
Activate the Variables Editor with Project
→
to declare the DFB variables and inputs/outputs (formal parameters).
Example (inputs):
Example (outputs):
505
DFBs (Derived Function Blocks)
Step
8
9
Action
Then re-activate the select mode with Objects
→
and double-click on one of the unconnected inputs/outputs.
Result: The Connect FFB dialog box opens, in which you can allocate a current parameter to the input/output.
Back up the DFB with the File
→
menu command.
For example:
506
33002204 12/2010
DFBs (Derived Function Blocks)
Creating the Logic in LD Ladder Diagram
Description
The procedure for creating the logic in LD ladder diagram is as follows:
Step
1
2
Action
To insert a contact or coil in the section, open the Objects main menu and select the desired contact or coil. Contacts and coils can also be selected using the tool bar. Place the contact or coil in the section.
To insert an FFB into the section, select the Objects
→
menu command.
Result: The FFBs from Library dialog box is opened.
3
4
5
6
In this dialog box you can select a library and an FFB from it by using the
Library...
command button. You can, however, also display the DFBs that you created and select one of them using the DFB command button.
Place the selected FFB in the section.
When all FFBs have been positioned, close the dialog box with OK
Activate select mode using Objects
→
, and move the contacts, coils and FFBs to the required position.
33002204 12/2010
507
DFBs (Derived Function Blocks)
Step
7
Action
Activate link mode with Objects
→
, and connect the contacts, coils and
FFBs. Connect the contacts, FFBs and the left power rail.
For example:
508
33002204 12/2010
Step
8
DFBs (Derived Function Blocks)
Action
Activate the Variables Editor with Project
→
to declare the DFB variables and inputs/outputs (formal parameters).
Example (inputs):
Example (outputs):
33002204 12/2010
9 Then re-activate select mode with Objects
→
, and double-click on a contact or coil.
Result: The Properties: LD Objects dialog box is opened, in which you can allocate an actual parameter to the contact/coil.
509
DFBs (Derived Function Blocks)
Step
10
11
Action
To connect the FFB input/outputs to the current parameters, double-click on one of the unconnected input/outputs.
Result: The Connect FFB dialog box is opened, in which you can allocate a current parameter to the input/output.
Back up the DFB with the File
→
menu command.
For example:
510
33002204 12/2010
DFBs (Derived Function Blocks)
Creating the Logic in IL Instruction List
Description
The procedure for creating the logic in Instruction List (IL) is as follows:
Step
1
2
Action
Declare the function block and DFBs to be used using VAREND_VAR.
Note: Functions do not have to be declared:
Example:
VAR
CLOCK : CLOCK_DINT ;
END_VAR
Declare the variables and their initial value in the Variable Editor.
Example (inputs):
Example (outputs):
33002204 12/2010
511
DFBs (Derived Function Blocks)
Step
3
4
Action
Create your program's logic.
For example:
LD IN1
ADD IN2
MUL (
LD IN3
SUB IN4
)
ST OUT
Back up the section with the File
→
menu command.
512
33002204 12/2010
DFBs (Derived Function Blocks)
Creating the Logic in ST Structured Text
Description
The procedure for creating the logic in ST structured text is as follows:
Step
1
2
Action
Declare the function block and DFBs to be used using VAREND_VAR.
Note: Functions do not have to be declared:
Example:
VAR
CLOCK : CLOCK_DINT ;
END_VAR
Declare the variables and their initial value in the Variable Editor.
Example (inputs):
Example (outputs):
33002204 12/2010
513
DFBs (Derived Function Blocks)
Step
3
4
Action
Create your program's logic.
For example:
OUT := (IN1 + IN2) * (IN3 - IN4)
Back up the section with the File
→
menu command.
514
33002204 12/2010
DFBs (Derived Function Blocks)
Calling up a DFB in the FBD Function Block dialog
Note
When a DFB is called up, it is not significant which program languages it was created in. The DFB can be called up in all the IEC sections.
Description
The procedure for calling up a DFB in the FBD Function Block dialog is as follows:
Step
1
2
3
4
Action
Close the Concept DFB and start Concept.
Open or create a project and open or create a section.
As with an EFB, the DFB is called up using the command button: Objects →
Select FFB...
.
Reaction: The dialog box FFBs from library is opened.
Press the DFB command button to display the global and local DFBs.
For example:
33002204 12/2010
5 Now click on the desired DFB in the list, and position it in the Editor window.
For example:
515
DFBs (Derived Function Blocks)
Step
6
7
Action
Double-clicking on the DFB opens the Properties: Derived Function Block dialog box, where the Refine...
command button can be used to open a document window with the internal DFB logic. The gray background indicates that the DFB cannot be edited in this document window.
Now only the actual parameter needs to be defined. This is performed in a way corresponding to the normal EFB link using the Link FFB dialog box (doubleclick on the inputs/outputs to be parametered.
For example:
516
Reaction: As is clear from the example, two different sets of parameters are used in the DFB calls 1 and 2. The formal parameters are the same in both calls because the program code of the DFB is only occupied once.
33002204 12/2010
DFBs (Derived Function Blocks)
Calling up a DFB in Ladder Diagram LD
Note
When a DFB is called up, it is not significant which program languages it was created in. The DFB can be called up in all the IEC sections.
Description
To call up a DFB in Ladder Diagram LD, do the following:
Step
1
2
3
4
Action
Close the Concept DFB and start Concept.
Open or create a project and open or create a section.
As with an EFB, the DFB is called up using the command button: Objects →
Select FFB...
.
Reaction: The dialog box FFBs from library is opened.
Press the DFB command button to display the global and local DFBs.
For example:
33002204 12/2010
5 Now click on the DFB required in the list, and position it in the Editor window.
For example:
517
DFBs (Derived Function Blocks)
Step
6
7
8
Action
Double-clicking on the DFB opens the Properties: Derived Function Block dialog box, where the Refine...
command button can be used to open a document window with the internal DFB logic. The gray background indicates that the DFB cannot be edited in this document window.
Use the left power rail to link the EN input.
Now only the actual parameter needs to be defined. This is performed in a way corresponding to the normal EFB link using the Link FFB dialog box (doubleclick on the inputs/outputs to be parametered.
For example:
518
Reaction: As is clear from the example, two different sets of parameters are used in the DFB call 1 and 2. The formal parameters are the same in both calls because the program code of the DFB is only occupied once.
33002204 12/2010
DFBs (Derived Function Blocks)
Calling up a DFB in the IL instruction list
Note
When a DFB is called up, it is not significant which program languages it was created in. The DFB can be called up in all the IEC sections.
Description
To call up a DFB in the IL instruction list, do the following:
Step Action
1 Close the Concept DFB and start Concept.
2 Open or create a project and open or create a section.
3 Calling up a DFB in the IL is performed like Calling up a Function Block
.
For example:
VAR
SKOE1, SKOE2 : SKOE; (* Instancing the DFBs *)
END_VAR
CAL SKOE1(IN1:=VALUE1,IN2:=VALUE2,IN3:=VALUE3,IN4:=VALUE4)
LD SKOE1.out (* DFB Call 1 *)
ST RESULT1
CAL SKOE2(IN1:=VALUE5,IN2:=VALUE6,IN3:=VALUE7,IN8:=VALUE4)
LD SKOE2.out (* DFB Call 2 *)
ST RESULT2
Reaction: As is clear from the example, two different sets of parameters are used in the DFB calls 1 and 2. The formal parameters are the same in both calls because the program code of the DFB is only occupied once.
33002204 12/2010
519
DFBs (Derived Function Blocks)
Calling up a DFB in structured text ST
Note
When a DFB is called up, it is not significant which program languages it was created in. The DFB can be called up in all the IEC sections.
Description
The procedure for calling up a DFB in structured text ST is as follows:
Step Action
1 Close the Concept DFB and start Concept.
2 Open or create a project and open or create a section.
3 Calling up a DFB in the ST is performed like Calling up a Function Block
.
For example:
VAR
SKOE1, SKOE2 : SKOE; (* Instancing the DFBs *)
END_VAR
SKOE1(IN1:=VALUE1, IN2:=VALUE2, IN3:=VALUE3, IN4:=VALUE4);
RESULT1:=SKOE1.OUT ; (* DFB Call 1 *)
SKOE2(IN1:=VALUE5, IN2:=VALUE6, IN3:=VALUE7, IN4:=VALUE8);
RESULT2:=SKOE2.OUT ; (* DFB Call 2 *)
Reaction: As is clear from the example, two different sets of parameters are used in the DFB calls 1 and 2. The formal parameters are the same in both calls because the program code of the DFB is only occupied once.
520
33002204 12/2010
Macros
33002204 12/2010
Macros
14
Overview
This Chapter describes the procedure for creating macros with help from Concept
DFB.
What's in this Chapter?
This chapter contains the following sections:
Section
14.1
14.2
Topic
Macro
Programming and calling up a macro
Page
521
33002204 12/2010
Macros
14.1
Macro
Overview
This section provides an overview on creating and applying macros.
What's in this Section?
This section contains the following topics:
Topic
Macros: general
Global / Local Macros
Exchange marking
Creating Context Sensitive Help (Online Help) for Macros
Page
522
33002204 12/2010
Macros
Macros: general
At a Glance
Macros are used to duplicate frequently used sections and networks (including their logic, variables and variable declaration).
Creating macros
Macros are created with the help of the Concept DFB software.
Programming languages
Macros can only be created in the FBD and LD programming languages.
Properties z z z z z z z z
Macros have the following properties:
Macros only contain one section.
Macros can contain a section of any complexity.
z From the point of view of program technology, there is no difference between an instanced macro, i.e. a macro inserted into a section and a conventionally created section.
z
It is possible to call up DFBs in a macro.
It is possible to declare macro-specific variables for the macro.
It is possible to use data structures specific to the macro
Automatic transfer of the variables declared in the macro.
Initial values are possible for the macro variables.
It is possible to instance a macro many times in the entire program with different variables.
The name of the section, variable names and data structure names can contain up to 10 different exchange marks (@0 to @9).
Hierarchic structure
The hierarchic structure of a macro corresponds to a project in Concept which consists of only one section. This section contains the actual logic.
Context help
Personalised context-sensitive help (online help) can be generated for macros (see
Creating Context Sensitive Help (Online Help) for Macros, page 529
).
Processing sequence
The processing sequence of the logic, the programming rules and the usable FFBs and DFBs correspond overall to those of the FBD or LD programming.
33002204 12/2010
523
Macros
Calling up a macro
A macro can be called up from SFC, FBD and LD sections.
There is a fundamental difference here: z Call from an SFC Section
When a macro is called up (instanced) from an SFC section (e.g. as a network z for the action variable), a new FBD/LD section containing only the macro’s logic is automatically created
Calling up an FBD/LD section
When a macro is called up from an FBD or LD section, the macro’s logic is inserted into the current FBD or LD section. In this case a new section is not created.
Archiving and Documentation
The process for archiving a macro is the same as for archiving and documenting a
project (see Documentation and Archiving, page 729 ).
524
33002204 12/2010
Macros
Global / Local Macros
Description
Global and local macros differ in the locality of their directory hierarchy.
Depending on the directory or subdirectory in which the macro is stored, it can be called up globally, i.e. within all the projects created under Concept, or locally, in a specific project.
In the
Defining the Storage of Global DFBs during Upload, page 1110 you can
ensure that during the IEC upload process a GLB directory containing the global macros is produced in the project directory. By doing this, the existing global macros in the Concept → will not be overwritten and therefore it will not have an effect on other projects.
Directory structure without uploaded project:
33002204 12/2010
525
Macros
Directory structure according to INI settings ( [Upload]: PreserveGlobalDFBs=1 ) for uploaded projects:
526
If a local and a global macro have the same name, the name of the local macro is displayed in lower case letters and that of the global macro in upper case letters when they are inserted.
NOTE: The length of the DOS path name in which the macros is stored is limited to
29 characters. Care should be taken that the macro directory does not exceed this limit.
33002204 12/2010
Macros
Exchange marking
At a Glance
The exchange markings (@0 to @9) in macros are used to insert the macro in a
Concept section. When inserting a macro into a section, you will input a character string that will replace the character strings. It is therefore possible to use a logically identical macro with different variables, data structures and comments, because different series of character strings can be pre-set during each insertion.
z z
The exchange flags can be used in the following elements:
Section names
Variable names z Comments
Comment on exchange markings
A comment on the macro’s exchange marking can be written using File →
Properties . This comment will be displayed when the macro is called up in Concept the in the exchange marking’s replacement dialog.
Exchange marking in the section name
When a macro is instanced, i.e. when it is called up from an SFC section, a new section is automatically occupied with the name of the macro section, as well as other procedures. The section name must be changed with each instancing so that the macro can be instanced several times in one project. The exchange marking in the section name is used for this. Therefore an exchange marking (@0 to @9) should always be entered when a section is created in the macro. Otherwise the macro can only be called up once from an SFC section and used in the project.
When a macro is called up from an FBD/LD section, the section name of the macro is not significant because no new section is created in this case.
Exchange marking in variable names
Input and output variables are required to transfer values to or from a network.
These variables are already declared in the macro and are connected to the macro’s
EFBs.
To declare these variables, the variable name (with exchange markings), the data type and possibly a comment (possibly with exchange markings) should be declared in the variables editor. An initial value can also be defined for input variables.
When a macro is instanced in Concept, the exchange markings in all the variable names are replaced with the pre-set character strings. This ensures that the variables required for each use of the macro are clearly declared. If a variable is used in all cases of macro instancing, it should be given a name without the exchange marking.
33002204 12/2010
527
Macros
The same applies to variables with Derived Data Types (data structures). This means that the type of one data structure can be used in as many macros as required as often as required.
Exchange markings in the Variables Editor
NOTE: If the macro is to be connected as an action to a step in a sequence, it is advisable to denote the variable designated as an action variable only with the @0 exchange marking. In this case, the designated action variable will automatically be connected to the step when the macro is instanced. Care should be taken that the action variables are always of the BOOL type. If the macro contains several action variables (e.g. for the forward and backward running of a motor), it is advisable to define these action variables in a Derived Data Type (data structure) and to denote the variable which this data type is assigned to with the @0 exchange marking only.
Since a clear variable is assigned to each input/output during the instancing of the macro, only unlocated variables can be assigned to the macro when it is created. It is not possible to use direct addresses and located variables in the macro. If located variables are to be used, the corresponding variables can be assigned a direct address in the variables editor after the macro is instanced. If direct addresses are to be used, no variables should be assigned to the corresponding inputs/outputs in the macro and the inputs/outputs should be linked to the address desired after the macro is instanced. If variables have already been declared, they are used
(references and initial values are retained).
Exchange marking in comments
When a macro is instanced in Concept, the exchange markings in all the comments are replaced with the pre-set character strings. The same applies to text objects in the section and to variable comments in the variables editor.
528
33002204 12/2010
Macros
Creating Context Sensitive Help (Online Help) for Macros
Introduction
In Concept, help is provided for each EFB, which can be invoked according to the context (the Help on Type command button in the EFB properties dialog). There is of course no corresponding help text in Concept for the macros that you created.
You can, however, create your own help for each macro, that can be invoked in
Concept with Help on Type .
File Format: z z z z z z z
You can create your help in the following file formats:
.CHM
(Microsoft Windows compiled HTML help file)
.DOC
(Microsoft Word format)
.HTM
.HLP
.RTF
.TXT
(Hypertext Markup Language)
(Microsoft Windows help file (16- or 32-Bit Format))
(Adobe Portable Document Format
(Microsoft Rich Text Format)
(Plain ASCII Text-Format)
Name
The name of the help file must be exactly the same as the name of the macro (e.g.
SKOE.EXT)
The only exceptions are standardized macro names (e.g. SKOE_BOOL,
SKOE_REAL etc.). In these cases the help file name is the macro name without the datatype extension (e.g. macro name) SKOE_BOOL has the help file SKOE.EXT).
Directory z z z z
The help file can be stored in the following directories:
Concept directory
Concept Help directory (if defined in the file CONCEPT.INI, see readme)
Global macro directory
Local macro directory
33002204 12/2010
529
Macros
Invoking the Help File
Concept carries out the following procedure to invoke the help file:
Phase
1
2
3
4
Description
Search for the help file MacroName.EXT
in the local macro-directory.
The help file is searched for in the following sequence: z z z z z z z
.HLP
.CHM
.HTM
.RTF
.DOC
.TXT
Result: If the search result is positive the help file will be displayed, otherwise it will continue with phase 2.
Search for the help file MacroName.EXT
in the global macro-directory.
For the order, see phase 1.
Result: If the search result is positive the help file will be displayed, otherwise it will continue with phase 3.
Search for the help file MacroName.EXT
in the Concept-directory or Concept-
Help directory.
For the order, see phase 1.
Result: If the search result is positive the help file will be displayed, otherwise it will continue with phase 4.
Display of the comment created in Concept DFB with Project → .
530
33002204 12/2010
Macros
14.2
Programming and calling up a macro
Overview
This section describes programming and calling up a macro.
What's in this Section?
This section contains the following topics:
Topic
At a Glance
Occupying the macro
Creating the logic
Calling up a macro from an SFC section
Calling a macro from an FBD/LD section.
Page
33002204 12/2010
531
Macros
At a Glance
At a Glance
Programming and calling up a macro is divided into 3 main steps:
Step
1
2
3
Action
Occupying the macro
Creating the logic
Calling up the macro in: z z z
Sequence language (SFC)
Function Block language (FBD)
Ladder Diagram language (LD)
532
33002204 12/2010
Macros
Occupying the macro
Description
The procedure for occupying the macro is as follows:
Step
1
2
3
4
5
6
7
8
9
Action
Close Concept and start Concept DFB.
Create a new macro using File
→
menu command.
Reaction: The name now appears on the title bar: [untitled] .
Using the menu command File
→
generate a new section and enter a section name (with an exchange marking such as @0).
The section name (max. 32 characters) must be clear throughout the macro, and it is not case-sensitive. If the section name entered already exists, a warning is given and another name must be chosen. The section name must correspond to the IEC Name conventions, otherwise an error message appears.
Note: In accordance with IEC1131-3, only letters are permitted as the first character of names. If, however numbers are required as the first character, this can be enabled using the menu command Presettings
→
IEC
Expansions...
→
Enable leading figures in identifiers .
Select a programming language for the section: z z
Function Block language (FBD)
Ladder Diagram (LD)
The menu command Project
→
can be used to generate a comment on the macro.
Reaction: The comment can then be displayed in Concept using the Help for type command key in the selection dialog for macros.
The menu command File
→
can be used to generate a comment on the exchange markings.
Reaction: This comment then appears automatically in the Replace dialog for the exchange markings.
Save the macro with the menu command File
→
.
Reaction: The first time the Save is used, the Save as dialog box opens – specify the macro name and directory where it is to be saved here.
Select the directory to be occupied by the macro. Attention should be paid to the difference between global and local macros (see also
Global / Local Macros, page 525 ).
Enter the macro name (max. 8 characters, always with the Extension Mac).
The name must be clear throughout the directory, and it is not case-sensitive. If the section name entered already exists, a warning is given and another name must be chosen.
33002204 12/2010
533
Macros
Creating the logic
Description
The procedure for creating the logic is as follows:
Step
1
Action
To insert an FFB into the section, select the menu command Objects
→
FFB...
.
Reaction: The FFBs in IEC library dialog box opens.
3
4
5
6
2 In this dialog box a library can be selected and an FFB selected from it by using the Library...
command button. Also with the command button DFB the manually generated DFBs can be shown and one selected from them.
Place the selected FFB in the section.
When all FFBs have been positioned, close the dialog box with Close
Activate the selection mode with Objects → , click on the FFB and move the FFBs to the position required.
Activate the link mode with Objects → and connect the FFBs.
534
33002204 12/2010
33002204 12/2010
Step
7
Macros
Action
Activate the Variables Editor with Project
→
to declare the variables.
For unlocated variables, declare a name here (with exchange markings), a data type, an initial value and a comment if necessary (possibly with exchange markings).
For constants, declare a name here (with exchange markings), a data type, a value and a comment if necessary (possibly with exchange markings).
For example:
Note: If located variables are to be used, the corresponding unlocated variables can be assigned a direct address in the variables editor after the macro is instanced.
If direct addresses are to be used, no variables should be assigned to the corresponding inputs/outputs in the macro and the inputs/outputs should be linked to the address required after the macro is instanced.
Note: If a variable or constant is to be used in all cases of macro instancing, this variable or constant should be given a name without any exchange marking.
535
Macros
Step
8
Action
Then re-activate the selection mode with Objects
→
and double-click on one of the unconnected inputs/outputs.
Reaction: The Link FFB dialog box opens, where an actual parameter can be assigned to the input/output.
9 Save the macro with the menu command File
→
.
For example:
536
33002204 12/2010
Macros
Calling up a macro from an SFC section
Description of the action
The procedure for calling up a macro from an SFC section is as follows:
Step
1
2
3
4
5
Action
Close Concept DFB.
Start Concept, open or create a project and open or create an SFC section.
Double-click to open the step properties of the step which the macro is to be connected to.
Use the command button Instance section...
to call up the dialog for instancing the macros.
Select the desired macro from the list.
If section groups have been created in the Project Browser, the section group where the section is to be inserted can be selected in the Insert into section group text field.
Confirm with OK .
Example:
Reaction: The dialog Replace is opened to replace the exchange markings.
33002204 12/2010
537
Macros
Step
6
Action
Pre-set for the text fields @0 to @9 the character strings which the exchange markings are to be replaced with in the macro.
Example:
538
33002204 12/2010
33002204 12/2010
Step
7
8
Macros
Action
Confirm the inputs with OK .
Reaction:
The following occurs after the procedure described above has been performed: z A section is now automatically created whose name consists of the macro section name and of the pre-set character strings in place of the exchange marking.
Note: This section is not automatically opened. To perform any editing, open by clicking on the variable name in the step properties dialog.
z All the variables declared in the macro are transferred into the variables declaration of the current project and the exchange marking is also replaced with the current character string. If variables have already been declared, they are used (references and initial values are retained). The same applies z z z to any comments containing the exchange flags.
If the macro contains a single Boolean input variable, it is automatically transferred as an action variable.
If the macro contains several Boolean input variables, the Select one of these variables dialog opens, where the variable desired can be selected as an action variable.
If a data structure has been marked individually with the exchange flag, the
Select Bool type elements dialog is called up and the Boolean variable desired for the action can be selected there.
This action can be used to call the macro as often as required without any name collisions occurring. The instanced macro and its variables are completely identical to the sections and variables generated beforehand.
Example of an instanced macro:
539
Macros
Calling a macro from an FBD/LD section.
Description of the action
The procedure for calling up a macro from an FBD/LD section is as follows:
Step
1
2
3
Action
Close Concept DFB.
Start Concept, open or create a project and open or create an FBD/LD section.
With the menu command Objects
→
the dialog Select macro to insert macros into FBD/LD sections.
4
5
Select the desired macro from the list and confirm with OK .
Reaction: The dialog Replace is opened to replace the exchange markings.
Pre-set for the text fields @0 to @9 the character strings which the exchange markings are to be replaced with in the macro.
Example:
540
33002204 12/2010
Step
6
7
Macros
Action
Confirm the inputs with OK .
Reaction:
The following occurs after the procedure described above has been performed: z There is now an automatic shift to Insert mode and the macro’s logic can be z inserted in any position in the FBD or LD section.
Moreover, all the variables declared in the macro are transferred into the variable declaration of the current project and the exchange marking is also replaced with the current character string. The same applies to any comments containing the exchange markings.
This action can be used to call the macro as often as required without any name collisions occurring. The inserted macro and its variables are completely identical to the sections and variables generated conventionally.
Example of an instanced macro:
33002204 12/2010
541
Macros
542
33002204 12/2010
Variables editor
33002204 12/2010
Variables editor
15
Overview
This Section contains information about declaring variables in the variables editor.
What's in this Chapter?
This chapter contains the following topics:
Topic
General
Declare variables
Searching and replacing variable names and addresses
Searching and Pasting Variable Names and Addresses
Exporting located variables
Page
543
33002204 12/2010
Variables editor
General
At a Glance
The Variables-Declaration serves as data exchange in user program. Hence you can address Variables (Located and Unlocated Variables) and/or assign a value to constants
Variables or direct addresses will be assigned via the addressing of the I/O-Map and can be used with symbolic names (variable) or with the direct addresses in the programming. In so doing, values will be exchanged between different Sections via the variables or the direct addresses.
NOTE: In accordance with IEC1131-3, only letters are permitted as the first character of variable names. If, however numbers are required as the first character, this can be enabled using the menu command Options → Presettings → IEC
Expansions... IEC Expansions Enable leading figures in identifiers enable.
NOTE: Undeclared variables will be denied during programming.
544
33002204 12/2010
Variables editor
Declare variables
At a Glance
At variable declaration the Data type, address and symbolic name are determined.
Via the addressing define the inputs (1x/3x) and outputs (0x/4x), assigned in the user program with the selection of the data type of the respective function, or the respective Function Blocks.
An initial value may also be provided for each variable; this will be transferred into the PLC during the first load.
A comment may be written for each Variable or direct address, to aid recognition of the assignment of a function.
If Declarations are changed, deleted or added, this alteration will be identified through certain symbols in the first column.
Changes in ONLINE mode
Variable names and addresses can be changed online. Apart from that, an unlocated variable can be changed into a located variable (i.e. it will be assigned its own address or the address will be deleted). Clicking on the command button OK transfers the changes to the affected sections i.e. the sections in which the changed variables will be used.
This has the following effects:
If… an affected section is animated,
Then… the variables are modified, the status of all affected sections will be set to MODIFIED and the affected sections must be loaded into the PLC using Online
→
.
a transition section is affected by the modifications, the SFC section assigned to it is also set to the status
MODIFIED.
the animation is aborted.
a modified variable is used in the reference data editor, no more variables can be inserted into the editor window, and the animation of the reference data editor is stopped. This is valid until the modifications are loaded into the PLC using
Online
→
and the status EQUAL is restored.
NOTE: The assignment of direct addresses and comments can also occur outside
Concept on completion of the programming.
33002204 12/2010
545
Variables editor
Variable declaration outside the variable editor
Procedure for completing variable declaration outside the variable editor:
Step
1
2
3
4
Action
Export the variable declaration using File → Variables: Text delimited .
Open the exported file.
Enter the addresses and comments.
Import the edited variable declaration using File → Variables: Text delimited .
Copying rows in the variable editor
It is possible to copy individual rows and whole blocks of rows and to paste them into another position in the variable editor, before editing them. This operation is performed using shortcut keys.
Copying and pasting can only take place inside the open variable editor; pasted rows are marked red. These rows must subsequently be changed or they will disappear on exiting the dialog. Identical settings are not permitted in the variable editor.
NOTE: A maximum of 500 rows can be copied.
Procedure for copying and pasting
To copy and paste entire rows proceed as follows:
Step
1
2
3
4
Action
Select the relevant row in the first column in the table.
Reaction: The entire row is displayed in a different color.
Note: When copying a block of rows, select the first row in the block, and press
Shift , while simultaneously selecting the last row in the block.
To copy use the shortcut Ctrl + Insert or Ctrl + Alt + c .
Reaction: The selected rows are copied into the cache.
Select the row off which is to be pasted.
Reaction: The entire row is displayed in a different color.
To paste use the shortcut Shift + Insert or Ctrl + Alt + v .
Reaction: The copied rows are pasted off the selected row in the table, and are marked red.
Note: When pasting between two existing rows, the selected row is moved down according to the number of copied rows.
546
33002204 12/2010
Variables editor
Printing the variable list
Printing the variable list is done in the main menu File . Using the menu command
Print...
open the dialog Document contents , in which the print undertaking is set by checking the box Variable list .
NOTE: It should be noted that all 32 characters (maximum) of the symbol name do not always appear on the paper when printing.
33002204 12/2010
547
Variables editor
Searching and replacing variable names and addresses
At a Glance
Use command button Search/Replace to call up a dialog box to search and replace variable names and addresses. Therefore, unlike Search/Insert the existing variable names/addresses are changed.
Use option button Name and Address to choose whether to search for variable names or addresses.
If Search and Replace are to be restricted to a certain area of variables or addresses, this area can be selected. In this case, searching and replacing is only carried out in the selected area. If nothing is selected, search and replace are applicable to all variables and addresses in the variable editor.
On activating check box Extend address the addresses specified in text box
Address are automatically extended to Standard format.
Use of wildcards
The following wildcards can be used for searching and replacing:
* This character is used to represent any number of characters. * can only be used at the beginning or the end of a line.
?
This character is used to represent exactly one character. If several characters are to be ignored, a certain number of ?
have to be used.
The wildcards can be combined. The combinations *?
and ?* are, however, not permitted.
NOTE: When searching and replacing, the number of wildcards in the Search character sequence and the Replace character sequence have to be equal. See also the following examples in the table.
548
33002204 12/2010
Variables editor
Examples of Search/Replace
The example shows different search methods and the respective results when replacing:
Search:
Name1
???123
Name1*
*123
*123*
???123*
Replace with:
Name2
???456
Name2*
*456
*456*
???456* available names
Name1
Name1A
Name A
Name B abc123 cde123 abcd123 abc1234
Name1A
Name1B
NameAB abc123 cde123 abc1234 abcde123 abc123abc cde123defghi abcde123def abc123abc cde123defghi abcde123def
Result
Name2
Name1A
NameA
NameB abc456 cde456 abcd123 abc1234
Name2A
Name2B
NameAB abc456 cde456 abc4564 abcde456 abc456abc cde456defghi abcde456def abc456abc cde456defghi abcde123def
Search and replace name
Select this option button to search and replace variable names. However, the search for the occurrence of the character sequence to be found is exclusively carried out in column Variable name of the variable editor.
Search and replace address
Select this option button, to search and replace addresses. However the search for the occurrence of the address to be found is exclusively carried out in column
Address of the variable editor.
33002204 12/2010
549
Variables editor
Search for:
Replace with:
Enter a character sequence, according to which the variables or addresses are to be searched.
Without entering a character sequence that leads to a successful search result, none of the possible functions of the dialog are executed.
NOTE: Entries in the field Search remain intact for future use, even after closing the dialog box.
Enter a character sequence, which replaces the character sequence to be searched for in the new variables or addresses
NOTE: Entries in the field Replace with remain intact for future use even after closing the dialog box.
Find Next
Description of function Find Next :
Stage
1
2
3
4
5
6
Description
The command button Find Next starts the search process at the beginning of the variable editor table or the selected area and marks the found variable.
A query appears, asking whether a search for further occurrences of the character sequence is required.
By activating command button Yes , the next location of the searched character sequence is selected.
By activating command button No , the search is terminated.
When the search process has reached the end of the variable editor table, the system asks whether or not the search process should be restarted at the beginning of the variable editor table or the selected area.
By activating command button Yes , the next location of the searched character sequence is selected.
By activating command button No , the search is terminated.
If no further occurrences of the character sequence are found, a message appears, indicating that the search is terminated.
550
33002204 12/2010
Replace
Replace all
Variables editor
Description of function Replace :
Stage
1
2
3
4
5
6
7
Description
The command button Replace starts the search process at the beginning of the variable editor table or the selected area and marks the found variable.
Note: This function cannot be undone.
The system asks whether the found character sequence is to be replaced.
By activating command button Yes , the variable/address is replaced by the character sequence in the text box Replace with:
By activating command button No , the search is terminated.
If there are several uses of the searched character sequence, the next site where it is found is selected and a new query appears.
When the search process has reached the end of the variable editor table, the system asks whether or not the search process should be restarted at the beginning of the variable editor table or the selected area.
By activating command button Yes , the next location of the searched character sequence is selected.
By activating command button No , the search is terminated.
If no further occurrences of the character sequence are found, a message appears, indicating that the search is terminated.
Searches for all occurrences of the character sequence and replaces these (without first querying) with the inputs in the text box Replace with: . When the search process has reached the end of the variable editor table, the system asks whether or not the search process should be restarted at the beginning of the variable editor table or the selected area.
NOTE: This function cannot be undone.
33002204 12/2010
551
Variables editor
Searching and Pasting Variable Names and Addresses
Introduction
The Search/Paste command button can be used to invoke a dialog for creating new variables based on existing ones. Unlike with Search/Replace, a copy of the existing variables with a new name/address is generated.
If, for example, you have already declared the variables for a motor and you want to declare the same variables but with different names and addresses for another motor, this is easily achieved with this dialog.
If you simply want to generate further variables from a specific range of variables, this area can be selected. In this case, a search will only be carried out in the selected range. If nothing is selected, search and paste applies to all variables in the variable editor.
If you check the Extend Address check box, the addresses entered in the Address text box are automatically extended to Standard format.
Using Wildcards
The following wildcards can be used for searching and pasting:
* This character is used to represent any number of characters. * can only be used at the beginning or the end of a line.
?
This character is used to represent exactly one character. If several characters are to be ignored, the corresponding number of ?
have to be used.
The wild cards can be combined. The combinations *?
and ?* are, however, not permitted.
NOTE: When searching and pasting, the number of wildcards in the Search string and the Replace string has to be equal.
Find Name
If you select this option button, you can search for variable names. Occurrences of the string to be found are searched for exclusively in the Variable Name column of the variable editor.
Find Address
This field is only unavailable for constants.
If you select this option button you can search for addresses. Occurrences of the address to be found are searched for exclusively in the Address column of the variable editor.
552
33002204 12/2010
Variables editor
Find What:
Enter a string to be searched for in variables or addresses.
The search is only carried out in the Variable Name and Address columns in the variable editor table. A search in other areas (e.g. Data type) is not possible.
If you do not enter a string that leads to a successful search result, none of the possible functions of the dialog are executed.
NOTE: Entries in the Search field are retained for future use, even after the dialog box is closed.
Replace With:
Enter a string to be replaced in the new variable or address with the string being searched for.
If the name entered already exists, no new variable is created.
NOTE: Entries in the Replace With field are retained for future use even after the dialog box is closed.
Offset Address By:
This field is only unavailable for constants.
Enter a value by which the addresses of the existing variables are to be increased.
NOTE: If you do not enter an offset value, the new variable will be placed in the same address as the one already present.
With unlocated variables, it is not necessary to enter a value.
Entries in this field are retained for future use even after the dialog has been closed.
Example of Offset Address By
SKOE1 has the address 000012
Find What: SKOE1
Replace With: SKOE2
Offset Address By: 1
This results in the creation of the following new variable:
SKOE2 on address 000013
33002204 12/2010
553
Variables editor
Find Next
Start Paste
554
Description of Find Next function:
Stage
1
2
3
4
5
6
Description
The Find Next command button starts the search process at the beginning of the variable editor table or the selected area and marks the found variable.
A query appears, asking whether a search for further occurrences of the string is required.
If the Yes command button is pressed, the next location of the string being searched for is marked.
If the No command button is pressed, the search is finished.
When the search process has reached the end of the variable editor table, a query appears asking whether or not the search process should be restarted at the beginning of the variable editor table or the selected area.
If the Yes command button is pressed, the next location of the string being searched for is marked.
If the No command button is pressed, the search is finished.
If no further occurrence of the string is found, a message appears to inform you that the search is done.
Description of Start Paste function:
Stage
1
2
3
4
5
6
Description
The Start Paste command button is used to start the search process at the beginning of the variable editor table or the selected area and the found variable is marked.
Note: This function cannot be undone.
A query appears asking whether a new variable with the displayed name and address should be created.
If the Yes command button is pressed, the variable is created and the process continued until all occurrences of the string being searched for have been
"exhausted".
If the No command button is pressed, the search is finished.
When the search process has reached the end of the variable editor table, the system asks whether the search process should be restarted at the beginning of the variable editor table or the selected area.
If the Yes command button is pressed, the next location of the string being searched for is marked.
If the No command button is pressed, the search is finished.
If no further occurrence of the string are found, a message appears to inform you that the search is finished.
33002204 12/2010
Paste All
Variables editor
Searches for all occurrences of the string to be found and replaces them (without asking first) with the new variables given in the Replace With: text box. This process is carried out until all occurrences of the string being searched for have been exhausted, or until an error appears.
If an error appears, the function is immediately cancelled. However, all the previously created variables are retained.
NOTE: This function cannot be undone.
33002204 12/2010
555
Variables editor
Exporting located variables
At a Glance
For data exchange with MMI units, all Located variables in the column Exp can be selected and transferred using the Export function in the main menu File .
Located variables can be exported via ModLink, Factory Link and via export format
"text delimited".
Removing the selection
After export, the selection (in the column Exp ) of the exported variables using the shortcut Ctrl + Alt + F3 can be removed at once.
NOTE: This removal cannot be undone, not even with the command button Cancel .
556
33002204 12/2010
Project Browser
33002204 12/2010
Project Browser
Overview
This chapter describes the Project Browser.
What's in this Chapter?
This chapter contains the following topics:
Topic
General information about the Project Browser
Detailed view in the project browser
Operating the Project Browser
16
Page
557
33002204 12/2010
Project Browser
General information about the Project Browser
Introduction
The Project browser can be used to create groups of sections to make the layout clearer and to facilitate operations. These groups have unique names and can contain sections and further section groups. The display and operations are performed graphically by means of Structure tree. The Project browser functions represent a convenient, more extensive way of operating as an alternative to the
Concept functions present.
You can open an additional window in the Project browser for viewing existing DFBs, sections with control blocks and transition sections.
Project browser:
558
33002204 12/2010
Project Browser
Functions z z z z z z z z z z z z z z z z z z z z
The Project browser provides the following functions:
Create new section
Open section (override the editor)
Changing section properties (names, comments)
Changing the execution order
Delete section
Creating section groups
Opening section groups (showing the substructure)
Closing section groups (hiding the substructure)
Renaming section groups z
Finding section groups or sections in the Project browser
Moving sections groups or sections (modification of the execution sequence results!)
Start up offline memory prognosis
Deleting section groups
Opening the Configurator
Minimize open windows
Open minimized windows
Close all windows
Set maximizing window size z
Show exact view
Excluding individual sections from the alignment between the primary CPU and standby CPU with Hot Standby systems.
Animate enable states (animation of the structure tree)
Switch enable state
Restrictions z z
Attention should be paid to the following restrictions:
Section groups can only be created with the Project browser.
z
Transition sections are not displayed in the Project browser.
It is only possible to modify the execution sequence via Project → order if no section groups exist in the Project browser. After the first section group has been created, no further modifications can be performed via Project →
Execution order change.
z It is only possible to change the enable status of a section if the variable belonging to the section (.disable) has not been used.
Special features for LL984 z z
Attention should be paid to the following special features when using LL984: z If one or several LL984 sections exist, the Project browser automatically generates an LL984 section group.
LL984 sections cannot be moved.
No IEC sections can be put into or before the LL984 section groups.
33002204 12/2010
559
Project Browser
Special features of I/O Events and Timer Events z z
Please take note of the following special features when using interrupt sections: z If one or several LL984 sections exist, the Project browser automatically generates an I/O Event or Timer Event section group.
Interrupt sections cannot be moved.
No IEC sections can be put into or before the interrupt section group.
560
33002204 12/2010
Project Browser
Detailed view in the project browser
Introduction
In the shortcut menu for the project, you can divide the project browser window vertically using the menu command Show detailed view . The right side of the window contains the detailed information concerning the selected element in the project structure tree.
The type of information depends on the selected element:
Element
Project
Group
LL984 section
FBD/LD
ST/IL
SFC
Information
Call hierarchy for all DFBs used in the project.
No display
No display
Call hierarchy for all DFBs used in the section. If no DFBs are used, a message is given (!).
Call hierarchy for all DFBs used in the section. If no DFBs are used, or if the analysis fails, a message is given (!).
The SFC info module can contain the following information: z Section which contains the control module (e.g. SFC_CTRL) for z this SFC section.
Message with red exclamation point(!): The SFC section is in the z z execution order before the section with the control module.
Message with a black exclamation point(!): No transition sections are used.
All transition sections used.
33002204 12/2010
561
Project Browser
Detailed view in the right window of the project browser:
562
33002204 12/2010
Project Browser
Operating the Project Browser
Introduction
The browser allows keyboard and mouse operation.
Mouse operation
Operating the project browser with the mouse:
Function
Selecting a group or section
(during selection, a section which is already open is put before all other open sections)
Key left mouse button
Switching off the context menu right mouse button
Using the first menu entry of the context menu Double-click with the left mouse button
Moving a group or section
Opening or closing a section group left-click on the corresponding symbol and hold the mouse button, select the target position by moving the mouse and release the mouse button or
Call context menu (right mouse button)
→
Select Move Find target position by cursor up/down
→
Enter click on the corresponding + / symbol with the left mouse button
NOTE: Context menus do not only appear when symbols are clicked on. The following way to insert a new group or section is available: If the cursor is positioned to the right of the connecting line between two symbols, it changes to show that a context menu can be called in this location by clicking with the right mouse button.
This means that a new group or section can be inserted in the line selected.
33002204 12/2010
563
Project Browser
Keyboard operation
Operating the project browser with the keyboard:
Function selecting the next/previous group/section
(during selection, a section which is already open is put before all other open sections)
Selecting a group/section on the next or previous page
Selecting a project symbol selecting the last group or section
Scrolling with the keyboard
Switching off the context menu
Key
Cursor up
Scroll up /
/ Cursor down
Scroll down
Pos1
End
CTRL + Cursor up / Cursor down or
CTRL + Scroll up / Scroll down
SWITCH + F10 or List
Carrying out the first menu entry
Moving a group/section
Entry
Call context menu (SWITCH + F10) →
Select Move Find target position by cursor up/down →
Enter or
CTRL + SWITCH →
Scroll up/down →
Enter
Opening or closing a section group + or where: + restores the status before the last -
Opening a section group and all sub-groups *
Deleting a group or section
Selecting the group above
Selecting the first section/group in a group
Canceling the move
Delete
Cursor left or backspace delete
If the element actually selected is a group when cursor left is used, the group is closed before the higher group is selected.
Cursor right
If the group is closed and contains a section or groups, it is opened.
ESC
564
33002204 12/2010
Derived data types
33002204 12/2010
Derived data types
17
Overview
This Chapter describes the data type editor and the procedure for creating derived data types.
What's in this Chapter?
This chapter contains the following sections:
Section
17.1
17.2
17.3
17.4
Topic
General information on Derived Data Types
Syntax of the data type editor
Derived data types using memory
Calling derived data types
Page
565
33002204 12/2010
Derived data types
17.1
General information on Derived Data Types
Overview
This section contains general information about Derived Data Types.
What's in this Section?
This section contains the following topics:
Topic
Derived Data Types
Global / Local Derived Data Types
Extended Data Type Definition (larger than 64 Kbytes)
Page
566
33002204 12/2010
Derived data types
Derived Data Types
Introduction
Derived data types are defined using the data type editor. All the elementary data types that already exist in a project and the Derived Data Types can be used to define new data types.
NOTE: Open the Data Type Editor in Concept/Concept-DFB using File → Open →
File Format Data Type Files (*.DTY) .
NOTE: Note that the File Save and File Save as menu commands are not available in this editor. To save the Derived Data Types, select the menu command
File → .
Using Derived Data Types
Various block parameters can be transferred as one set through Derived Data
Types. This set is then divided into individual parameters again in the DFBs and
EFBs; these are processed and then output again as a set or as individual parameters.
33002204 12/2010
567
Derived data types
Using Derived Data Types in a DFB:
NOTE: For a definition of the Derived Data Types IN and OUT, see
.
Definition of Derived Data Types
The definition of Derived Data Types appears in textual form.
When text is entered, all the standard Windows services for word processing are available. The data type editor also contains some further commands for text processing.
Spelling is immediately checked when key words, separators and comments are entered. If a key word, separator or comment is recognized, it is identified with a color surround.
568
33002204 12/2010
Derived data types
Name Conventions
The following name conventions apply to derived data types: z Multi-element variable
If a Derived Data Type is assigned to a variable (field or structure), it is designated as a multi-element variable.
z Structured variable
If a derived data type is assigned to a variable consisting of several elements, it is designated as a structured variable. If this is the case, the declaration contains the keyword STRUCT
. This also applies if the derived data type z only contains ARRAY declarations. e.g.
TYPE
EXP:
STRUCT
PAR1: ARRAY [0..1] OF INT;
PAR2: REAL;
PAR3: TEST;
END_STRUCT;
END_TYPE
Field variable
If a derived data type is assigned to a variable which consists of several ARRAY
Declarations
, it is designated as a field variable. The key word
STRUCT is not used in this case.
e.g.
TYPE
TEST: ARRAY [0..1] OF UINT;
END_TYPE
33002204 12/2010
569
Derived data types
Global / Local Derived Data Types
Description
Concept differentiates between global Derived Data Types and local Derived Data
Types. Global Derived Data Types can be used in any project (Concept) or in any
DFB (Concept DFB). Global Derived Data Types must be placed in the DFB subdirectory of the Concept Directory. Local Derived Data Types are only recognized in the context of a project or its local DFBs and can only be used there.
Local Derived Data Types must be located in the DFB subdirectory of the project directory.
In the General information on the Concept INI file, page 1107 you can specify that a
GLB directory containing the global Derived Data Types is generated in the project directory during the IEC upload process. This means existing global Derived Data
Types in Concept → are not overwritten, and there is no effect on other projects.
NOTE: This file structure should be noted at the creation stage of the Derived Data
Types, because the menu command File → is not available for these. For this reason it is imperative to ensure that the correct path has been selected prior to pressing OK .
Directory structure without uploaded project:
570
33002204 12/2010
Derived data types
Directory structure after setting up INI file ( [Upload]: PreserveGlobalDFBs=1 ) for uploaded projects:
Number of data type files
Concept only supports one single local data type file for each project and only one single global data type file. To ensure consistency between the host computer and the PLC, the project containing one of the Derived Data Types must be reloaded into the PLC after either of these files is edited.
If a local and a global Derived Data Type have the same name, the local Derived
Data Type is given priority.
Maximum File Size
NOTE: The maximum file size (.DTY) for global and local Derived Data Types (i.e. the definitions and including all comments) is 64 kbytes. If this maximum file size is too small, the data type definitions can be shared between the global and local data type file. T
33002204 12/2010
571
Derived data types
Extended Data Type Definition (larger than 64 Kbytes)
At a Glance
The maximum file size (*.dty) for global and local derived data types is 64 KBytes
(this includes the definitions and all comments). To extend this limitation for local derived data types, you can create an Include file (*.inc), without increasing the size of the database. This file contains a list of any data type files with the extension *.ddt.
However, the file cannot contain any DTY data type files.
A DDT data type file is structured just like a DTY data type file. Unlike DTY data type files, a backup copy is not made in the database for DDT data type files. Therefore it is impossible to determine exactly which data type was recently changed. Each data type in the DDT data type file looks as if it was changed if the DDT data type file was changed in any location. All initial values for variables with data types defined in this DDT data type file are set to 0. The program status will be NOT
EQUAL as well.
The Include file is only allowed to be in the local DFB directory and contains the name of the project, e.g. TESTPRJ.INC. Changing an Include file is monitored with check digits.
The Include file has priority over the DTY data type file.
NOTE: Only one Include file can be in the local DFB directory.
The definition of global derived data types has not changed.
Create INC file
572
4
5
2
3
An Include file can only contain existing data type files (*.ddt), i.e. the data type files must exist in the project before creating an Include file.
The DDT data type files can be compared to DTY data type files, they are created in the same way
and can therefore have the same contents.
The Include file is created in the Include file editor.
Carry out the following steps to open the Include file editor:
Step
1
Action
Select File
→
and then go to the List files of type list box and select the option Datatype file (*.dty...) .
Reaction: The file types *.dty,*.ddt,*.inc are shown in the File name text box.
In the Folder text box, you must select the local DFB directory for your project.
In the File name text box, delete all data types except for *.inc.
Enter the name of the project as file name, e.g. TESTPRJ.INC.
Select OK and another window is opened. Confirm the question of if this file should be created with Yes .
Reaction: The Include file editor is opened.
33002204 12/2010
Derived data types
With this editor, the Include file created is automatically opened and now contains all data type files (*.ddt) in the project. The data type files can then be added to the contents of the Include file to define the Include file.
Only file names are allowed for data type file list, no path entries.
Example of the contents of an Include file:
Limitations
The check digits are automatically generated by Concept when opening the project.
Changes in a DDT data type file or in the Include file do not cause this data type check. Concept automatically carries out a data type check. The check consists of many general tests which require a large amount of time.
This smallest change causes the program status to go to NOT EQUAL.
33002204 12/2010
573
Derived data types
17.2
Syntax of the data type editor
Overview
This section describes the syntax to be noted when generating Derived Data Types.
What's in this Section?
This section contains the following topics:
Elements of the Derived Data Types
Topic
Key Words
Names of the derived datatypes
Separators
Comments
Page
574
33002204 12/2010
Derived data types
Elements of the Derived Data Types
At a Glance z z z z
The following elements can be used to generate the Derived Data Types:
Key words
Names
Separators
Comments
Indents
Indents and line breaks can be inserted at any position where a blank character is also allowed to make the layout clearer. This does not affect the syntax.
33002204 12/2010
575
Derived data types
Example of a Derived Data Type
Defining Derived Data Types:
576
33002204 12/2010
Derived data types
Key Words
Introduction z z z z
The following key words can be used to define the Derived Data Types:
TYPE ... END_TYPE
STRUCT ... END_STRUCT
ARRAY
"Data types"
In accordance with IEC 113-3, key words must be entered in upper case. If lower case is also to be used, however, this can be enabled in the dialog box IEC
Extensions using the option Allow case insensitive keywords .
If a key word is recognized, it is identified in colour.
TYPE ... END_TYPE
The key word TYPE denotes the beginning of the data type definitions. The key word
TYPE is only entered once at the beginning of the data type definitions and is then valid for all subsequent data type definitions.
The key word END_TYPE denotes the end of the data type definitions. The key word
END_TYPE is only entered once at the end of the data type definitions.
STRUCT ... END_STRUCT
The key word STRUCT denotes the beginning of the elements of a Derived Data
Type. Structures are collections of various Elementary and Derived Data Types.
Variables, to which a Derived Data Type like this is assigned, are designated as structured variables.
The key word END_STRUCT denotes the end of the elements of a Derived Data
Type.
Syntax for STRUCT
STRUCT
NAME1: Data type;
NAME2: Data type;
NAMES: Data type;
END_STRUCT;
33002204 12/2010
577
Derived data types
Example: STRUCT ... END_STRUCT
TYPE
Example1:
STRUCT
Name1: BOOL; (* Comment *)
Name2: INT; (* Comment *)
Name3: ARRAY [0..5] OF BOOL; (* Comment *)
END_STRUCT ;
END_TYPE
ARRAY
If several consecutive elements with the same data type are in use, they can be defined as a field with the key word ARRAY.
After the key word ARRAY, the zone is given, i.e. the number of elements and the number of the elements’ sub-elements if need be. Finally, the data type common to all the elements is given. Elementary or Derived Data Types can also be used.
If a Derived Data Type is assigned to a variable in the variable editor consisting of an ARRAY declaration, it is designated as a field variable.
Syntax for ARRAY
NAME: ARRAY [No. 1.Element .. No. last element, no. 1st element .. no. last element etc. ] OF data type;
Encapsulation Depth
The encapsulation depth is practically unlimited but should be restricted to a few stages, e.g. to 2 or 3 dimensions to ensure clarity. The maximum size of a data type file should not exceed 64KB.
Restrictions
ARRAY indices can not be used in generic functions/function blocks (i.e. SEL and
MUX).
The following operations would generate an error: k := Arr[a,b,MUX(i,in1=2)];
Arr30[0,1,MUX_INT( K := K, IN0 := 0, IN1 := 1, IN2 := 0)];
ARRAY indices can be used in all other functions/function blocks.
The following operation is possible:
B[8] := Arr3[REAL_TO_INT(TAN_REAL(ie.real1[2]),j,2]);
578
33002204 12/2010
Derived data types
Example: One-dimensional ARRAYs
In the following example, a Derived Data Type is defined with the name par. This
Derived Data Type contains 6 elements (par[0] to par [5]) of the BOOL data type.
par: ARRAY [0..5] OF BOOL;
It is not absolutely necessary to begin the range with "0". Any range can be defined.
In this example the Derived Data Type contains 14 elements (par[51] to par [64]) of the BOOL data type.
par: ARRAY [51..64] OF BOOL;
Example: A one-dimensional ARRAY in a structured variable
ARRAYs can also be used as elements in structured variables (definition with the key word STRUCT):
Par3: STRUCT
Name1: ARRAY [0..5] OF INT);
Name2: BOOL;
Name3: REAL;
END_STRUCT; z z
Variables of the Par3 data type contain 3 elements: z Name1 with 6 sub-elements (Par3.Name1[0] to Par3.Name1[5] of the INT data type
Name2 with 1 element of the BOOL data type
Name3 with 1 element of the REAL data type
Multi-dimensional ARRAYs
In multi-dimensional ARRAYs the statements in [ ] are expanded by the number of sub-elements of each element. i.e. the element given in the ARRAY contains in turn a specific number of elements of the same data type.
Example: Two-dimensional ARRAY
The following example shows a two-dimensional ARRAY.
Par4: ARRAY [0..5, 1..3] OF BOOL;
Variables of the Par4 data type contain 6 elements of the BOOL data type each with z z
3 sub-elements of the BOOL data type:
Par4 [0,1] to Par4 [0,3]
Par4 [1,1] to Par4 [1,3] and so on up to z Par4 [5,1] to Par4 [5,3]
33002204 12/2010
579
Derived data types
Example: Three-dimensional ARRAY
The following example shows a three-dimensional ARRAY.
Par5: ARRAY [0..5, 1..4, 11..14] OF REAL; z z
Variables of the Par5 data type contain 6 elements of the REAL data type each with
4 sub-elements of the REAL data type: Each sub-element contains 4 further subz z elements of the REAL data type:
Par5 [0,1,11] to Par5 [0,1,14]
Par5 [0,2,11] to Par5 [0,2,14] and so on up to z
Par5 [0,4,11] to Par5 [0,4,14]
Par5 [1,1,11] to Par5 [1,1,14] and so on up to
Par5 [5,4,11] to Par5 [5,4,14]
Example: A multi-dimensional ARRAY in a structured variable
As for one-dimensional ARRAYs, multi-dimensional ARRAYs can also be used as elements in structured variables (definition with the key word STRUCT).
Par6: STRUCT
Name1: ARRAY [0..5, 1..3] OF INT;
Name2: BOOL;
Name3: REAL;
END_STRUCT;
Variables of the Par6 data type contain 3 elements: z Name1 with 18 sub-elements: z Par6.Name1[0,1] to z Par6.Name1[5,3] of the INT data type z z
Name2 with 1 element of the BOOL data type
Name3 with 1 element of the REAL data type
Example: Step by step definition of multi-dimensional ARRAYs
Multi-dimensional ARRAYs can also be defined step-by-step.
Par71: ARRAY [1..100] OF WORD;
Par72: ARRAY [1..3] OF Par71;
Par73: ARRAY [1..33] OF Par6;
580
33002204 12/2010
"Data types"
Derived data types
The names of the elementary data types and the names of already defined Derived
Data Types are recognized as a key word (in contrast with the names of elementary data types, the names of derived data types are not displayed in color). Data types must be closed with the separator ";".
If a different Derived Data Type is in use while defining a Derived Data Type, it must be defined before it can be invoked.
33002204 12/2010
581
Derived data types
Names of the derived datatypes
Description
Names are given to the derived data types and the elements in the data type editor.
Names should not be longer than 24 characters and must be ended with the separator ":"
Names are displayed in black
NOTE: Names should not begin with figures even if the option Options →
Preferences → IEC expansions... → is activated.
NOTE: Within the data type editor it is possible to use special symbols (umlauts, accents etc.). These symbols are also permitted in Concept EFBs created with
Concept-EFB can NOT be used however. The above is based on the internal processes of Borland products. It is therefore strongly recommended that NO special symbols are used in names.
582
33002204 12/2010
Derived data types
Separators
Introduction z z z z
The following separators can be used to define the derived data types:
: (colon)
; (semi-colon)
[ ] (square brackets)
.. (full stops)
Separator ":" (colon)
Marks the end of a name (name of the derived data type, name of the element).
Example:
TYPE
Example1 :
STRUCT
Name1 : BOOL; (* Comment *)
Name2 : INT; (* Comment *)
Name3 : ARRAY [0..5] OF BOOL; (* Comment *)
END_STRUCT;
END_TYPE
Separator ";" (semi colon)
Indicates the end of an instruction.
Example:
TYPE
Example1:
STRUCT
Name1: BOOL; (* Comment *)
Name2: INT; (* Comment *)
Name3: ARRAY [0..5] OF BOOL; (* Comment *)
END_STRUCT ;
END_TYPE
Separator "[ ]" (square brackets)
Encloses the range specification of the keyword ARRAY.
33002204 12/2010
583
Derived data types
Example:
TYPE
Example1:
STRUCT
Name1: BOOL; (* Comment *)
Name2: INT; (* Comment *)
Name3: ARRAY [ 0..5
] OF BOOL; (* Comment *)
END_STRUCT;
END_TYPE
Separator ".." (full stops)
Separates the beginning and end of range for the keyword ARRAY.
Example:
TYPE
Example1:
STRUCT
Name1: BOOL; (* Comment *)
Name2: INT; (* Comment *)
Name3: ARRAY [0 ..
5] OF BOOL; (*Comment *)
END_STRUCT;
END_TYPE
584
33002204 12/2010
Derived data types
Comments
Description
In the data type editor begin comments with the character sequence (* and end with the character sequence *). Between these character sequences any comments can be entered.
Comments can be entered at any position in the data type editor
Comments are displayed in color.
Using the menu command Options → Preferences → IEC Extensions → Nested comments authorized you can enable nested comments to be authorized. There are then no limits to the nesting depths.
Example: Comments
TYPE
Example1:
STRUCT
Name1: BOOL; (* Comment *)
Name2: INT; (* Comment *)
Name3: ARRAY [0..5] OF BOOL; (* Comment *)
END_STRUCT;
END_TYPE
33002204 12/2010
585
Derived data types
17.3
Derived data types using memory
Use of Memory by Derived Data Types
Boolean Elements
Boolean elements are conveyed as bytes, the bit information is in the first bit.
Storage of Boolean elements:
WORD Elements
There are no gaps when Derived Data Types are stored in memory.
Example of a Derived Data Type:
TYPE
SKOE:
STRUCT
PAR1: BOOL;
PAR2: WORD;
PAR3: BOOL;
PAR4: WORD;
END_STRUCT;
END_TYPE
586
33002204 12/2010
Storage of the Derived Data Type in memory:
Derived data types
It should be ensured that WORD elements begin with word addresses (a dummy bit could be inserted).
NOTE: If the structured variable is associated with a direct address and is further processed externally (e.g. is read by a visualisation system from the PLC), the
WORD elements (including ANY_NUM elements) absolutely must begin with a word address.
Located Derived Data Types
If derived data types are passed to the hardware (located Derived Data Types) they may only be stored in the 3x or 4x registers. Storage in the 0x or 1x registers is not possible.
33002204 12/2010
587
Derived data types
17.4
Calling derived data types
Calling Derived Data Types
Introduction
When a derived data type is defined in the data type editor, the name of the derived data type appears automatically in the variables editor (Column Data type ). The assignment of a variable to a derived data type occurs in the same way as for elementary data types.
Multi-element variables can be called as a text input of the individual elements or using a dialog box Lookup variables . In such a case, the corresponding elements are chosen according to the selection of a multi-element variable in the Select
Component of Type dialog box.
Addressing a structure element
To address a structure element the variable names are first assigned and then separated from the element name by a dot
(e.g.VARIABLE_NAME.ELEMENT_NAME). If this element also consists of a
Derived data type as well, it is again separated from the next element name by a full stop (e.g. VARIABLE_NAME.ELEMENT_NAME.SUB_ELEMENT_NAME) etc.
Example: Addressing a structure element
Addressing a structure element:
Step
1
2
3
Action
Define a derived data type.
For example:
TYPE
Example1:
STRUCT
Par1: BOOL;
Par2: INT;
END_STRUCT;
END_TYPE
Declare a new variable in the variable editor (e.g. with the name TEST).
Assign these variables the data type of the derived data type created (e.g.
Example1).
588
33002204 12/2010
Derived data types
Step
4
5
Action
Close the variable editor with OK .
Reaction: A new multi-element variable called "TEST" of data type "Example1" is now created.
To address this multi-element variable in its "entirety", simply enter the name of the variable (TEST) into the program as usual.
To address only a single element of this multi-element variable (e.g. the element
"Par1"), enter the variable name and (separated by a dot) the name of the element (e.g. TEST.Par1) into the program.
Addressing an ARRAY element
To address an ARRAY element the variable name comes first followed by the element number in square brackets (e.g. VARIABLE_NAME[4]).
Example: Addressing an ARRAY element
Addressing an ARRAY element
Step
1
2
3
4
5
Action
Define a derived data type.
For example:
TYPE
Example2: ARRAY [0..5] OF BOOL;
END_TYPE
Declare a new variable in the variable editor (e.g. with the name MY_VAR).
Assign these variables the data type of the derived data type created (e.g.
Example2).
Close the variable editor with OK .
Reaction: A new multi-element variable called "MY_VAR" of data type
"Example2" was created.
To address this "entire" multi-element variable, simply enter the name of the variable (MY_VAR) into the program as usual.
To address only a single element of this Multi-element variable (e.g. the 4th element of the ARRAY), enter into the program the variable name and in square brackets the number of the element (e.g. MY_VAR[4]).
Addressing an ARRAY element in a structure
To address an ARRAY element which is part of a structure the variable name is entered first, followed by a dot and the element name, followed by the element number in square brackets (e.g. VARIABLE_NAME.ELEMENT[4])
33002204 12/2010
589
Derived data types
Example: Addressing an ARRAY element in a structure
Addressing an ARRAY element in a structure:
Step
1
2
3
4
5
Action
Define two derived data types (in which the second derived data type uses the first as an element).
For example:
TYPE
Example3:
STRUCT
Par1: BOOL;
Par2: ARRAY [0..5] OF BOOL;
Par3; BOOL;
END_STRUCT;
Example4:
STRUCT
Elem1: Example3:
Elem2: INT;
END_STRUCT;
END_TYPE
Declare a new variable in the variable editor (e.g. with the name
COMPLEX_VAR).
Assign these variables the data type of the derived data type created (e.g.
Example4).
Close the variable editor with OK .
Reaction: A new multi-element variable called "COMPLEX_VAR" of data type
"Example4" is now created.
To address this "entire" multi-element variable, simply enter the name of the variable (COMPLEX_VAR) into the program as usual.
For example, if you only want to address one individual element of this multielement variable (e.g. you want to call the 5th element of the ARRAY from element "Par2" (derived data type "Example3") as an element of "Elem1"), enter the variable names in your program and the element name separated by a dot,
(in your "current" derived data type, here "Example4"), and the name of the elements of the derived data type called by the "current" derived data type separated by a dot (here "Example3") and followed by the element number in square brackets (e.g. COMPLEX_VAR.Elem1.Par2[5]).
Range Monitoring for Indexed Access
Indexed access to Arrays in ST are monitored for over range violations. If the index is a constant, monitoring is carried out on the compile level in the programming device. If the index is a variable, monitoring is carried out during runtime in the PLC during every cycle.
590
33002204 12/2010
Derived data types
In order to optimize program run time, the index for multi-dimensional arrays or arrays that are embedded in structures are only checked for the starting and end address of the memory area reserved for the variable. This means that an invalid component is overwritten even though it is always located inside the structure. An error message is only generated in the event display dialog box when the index for the memory area allocated for this structure is exited: "ARRAY Index exceeds range
(..)". Data access is diverted to the memory starting address of the structure.
CAUTION
Data can be overwritten!
The index ARRAY does not serve as the range boundary, but always the entire memory range allocated to the variable.
With multi-dimensional Arrays or Arrays within a structure, an error message is first returned when the index is displayed on a memory address outside of the memory area allocated for the entire array or entire structure.
Failure to follow these instructions can result in injury or equipment damage.
Example 1 one dimensional structure
Defining a derived data type in the data type editor:
Variable definition:
Sequence in text language:
33002204 12/2010
If the Index ( indx ) is too large (>7) or too small (<4), and data access is made outside the range( Otto ), the first element is automatically accessed in the PLC runtime system ( Otto[4] ) and an error message is generated.
591
Derived data types
Example 2 Array embedded in a structure
Defining a derived data type in the data type editor:
Variable definition:
Sequence in text language:
In this case the range boundary is determined by the total amount of memory occupied by the Otto variables. The range monitoring is first activated when indx <2 or indx >9 occurs. An over range then accesses the address Otto.F1
!
Access with indx = 2-3 or indx = 8-9 is not recognized as faulty, but the elements
F1 (indx = 2-3)or F3 (indx = 8-9) are overwritten!
Example 3 multi-dimensional array
Defining a derived data type in the data type editor:
592
33002204 12/2010
33002204 12/2010
Derived data types
Variable definition:
Sequence in text language:
In this case when the first index indx_x of the range boundary is exceeded it directly results in a error message. For the second index indx_y , the range monitoring becomes active when the address created from the two indexes are outside the memory area for the entire array (4*4 words).
Examples: for indx_x = 1 , it can become indx_y = 16 before the range monitoring is put into effect.
for indx_x = 4 , range monitoring becomes active when indx_y = 5 .
593
Derived data types
594
33002204 12/2010
Reference data editor
33002204 12/2010
Reference data editor
18
Overview
This Chapter describes the reference data editor (RDE) and its use with activated animation.
What's in this Chapter?
This chapter contains the following topics:
Topic
General Information about the Reference Data Editor
Converting RDE templates
Changing signal states of a Located variable
Cyclical Setting of Variables
Unconditional locking of a section
Animation
Replacing variable names
Load reference data
Page
595
33002204 12/2010
Reference data editor
General Information about the Reference Data Editor
At a Glance
Variables can be displayed in animation mode, 0x and 1x references can be blocked
(forced) and unlocated element variables or elements of structures can be set cyclically using the Reference Data Editor (RDE). The behavior of the variables can be followed and modified online through directly accessing the variables and direct addresses used in the IEC program. Variable states are displayed in animation mode with different colors (disabled, cyclically set).
Maximum 250 entries are possible in the Reference Data Editor. If this limit is exceeded a warning message is generated when saving.
Creating RDE Templates
To create an RDE template, use the variables declared in the variable editor. There are various possibilities here:
If ...
You make a double click on the corresponding numerical field in the first column,
You enter the variable names of a declared variable in the column Variable name ,
You enter the direct address in the column
Address ,
You use menu command
Addresses...
blocks into the column
Insert
to insert entire reference
Address ,
Then you open the dialog Lookup variables , for selecting a declared variable or component of a structure.
the declared parameters are entered into the
RDE template.
then the value, the format and in some cases the defined name of the corresponding signal are entered in the RDE template.
the values and the formats of the corresponding signals are entered into the
RDE template.
Display Signal States
Stored signal states are always overwritten by the current values in the PLC with an activated animation ( Online → ) when opening an RDE template.
The signal states in the PLC can be displayed in online mode using menu instruction
Controller status...
. When starting the PLC, you can view signal states corresponding with the program progress in animation mode.
596
33002204 12/2010
Reference data editor
Printing RDE Templates
To print an open RDE template, click in the RDE main menu on the menu instruction
Print . An exact copy of the screen image of the RDE template will be created on paper.
NOTE: We recommend that you modify the printer properties to landscape paper format in the operating system (Windows). This will give you the complete image of the RDE template on a single page.
Using RDE Templates
Using an RDE template in more than one project is not recommended. This can cause doubled variable names to appear as well as variable names that did not exist in the original RDE template. The variables in the RDE templates are always displayed with the current reference addresses.
Converting RDE Templates
This procedure can be found in the description Converting RDE Templates
.
33002204 12/2010
597
Reference data editor
Converting RDE templates
Introduction
RDE templates from an earlier version of Concept are automatically converted into the template format of the new Concept version. To differentiate between the converted RDE templates and the other RDE templates, they are saved with the file extension *.RDF.
CAUTION
Incomplete RDE templates are created!
Before the conversion make sure that the variables in the RDE template are declared in the opened project in the new version of Concept. New variables are listed in an error message and cannot be displayed in the RDE template (*.RDF) created from it.
Failure to follow these instructions can result in injury or equipment damage.
598
33002204 12/2010
Reference data editor
Automatic Conversion
Automatic Conversion is performed when the RDE template of a previous version of
Concept is opened:
Step
1
2
5
6
3
4
7
8
Action
Start the new version of Concept and open the project.
In the Online main menu click on the Reference data editor menu command.
Result: The RDE main menu appears in the men bar.
In the Online main menu click on the Reference data editor menu command.
Select the directory, in which the RDE template (*.RDE) is saved (e.g.
D:\CONCEPT_OLD).
Result: All existing RDE templates (*.RDE or *.RDF) are displayed.
Note: The files with the *.RDF extension come from the conversion of generated
RDE templates (*.RDE).
Select the *RDE RDE template to be converted.
Click on the command button OK .
Result: The RDE AutoConvert message appears. This informs you that the
*RDE template was created in a previous version of Concept and is now being saved in a new format, so that it can be used in this version of Concept. The converted template is saved in a file with the *.RDF extension.
Click on the command button OK .
Result: The converted RDE template (*.RDF) is displayed.
Warning: All RDE template variables must be declared beforehand in the project. For new variables, the RDE Template Errors error message appears now, in which all faulty variables are listed. After closing the window, the converted RDE template opens, but only containing the declared variables.
Using the Save reference data table under...
menu command, it is possible to save the converted RDE template in the directory in the new version of Concept
(C:\CONCEPT_NEW).
Result: The converted RDE template is stored in the Concept directory with the
*.RDF file extension.
33002204 12/2010
599
Reference data editor
Changing signal states of a Located variable
Introduction
Located variables can be changed by checking the corresponding signal box in the column Disable and editing the value. Upon locking, the variable is separated from the hardware and is only used in the logic again if the disablement is undone. In this way, the changed signal states of all editors (FBD, SFC, LD, ST, LL984) are taken into account.
Unintended setting of values
Confirm values that were entered in an RDE table with the Input key. However, authorized values are also transferred if you switch to another input field using the cursor key or the mouse or if you leave the RDE table.
You can cancel an entry using the ESC key.
WARNING
UNINTENDED SETTING OF VALUES
Do not leave the RDE table (for example by clicking on another window) if you have already entered an authorized value in an input field, since otherwise the value will be transferred and unintended setting of values can occur.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Forcing inputs and outputs
When inputs are forced, signal states are transferred until the value in the RDE table is changed again. When outputs are forced, the new value appears at the beginning of each program cycle. When a subsequent change is made using the program logic, this value is not saved in the state RAM until the locking of the output has been removed.
CAUTION
All changed signal states are loaded directly onto the PLC.
Though not in the case of forced located variables.
Failure to follow these instructions can result in injury or equipment damage.
600
33002204 12/2010
Reference data editor
Display of disabled variables
Variables that have been disabled by checking the check mark are shaded in color in the editor display. By removing the check symbol, the colored background of the corresponding variable is also no longer visible.
Loading reference data
Cyclically set values and disabled variables can be loaded onto the PLC using the menu command Load reference data .
These settings then remain the same until the user makes a change in the RDE
Template, or the PLC loses the loaded data (e.g. by loading a different project).
NOTE: In an open RDE Template, the changed date is then automatically saved using the menu command Load reference data . The menu command Save table then no longer needs to be used.
33002204 12/2010
601
Reference data editor
Cyclical Setting of Variables
Introduction
Variables and structure elements can be changed by entering a set value corresponding to the data type of the variable in the Set Value column. This value will be written uniquely, if the corresponding signal's box in the Cyclic Set column is subsequently checked. The new signal state is loaded directly onto the PLC and is transferred to the cyclically set variables administrator. The signal state of the variable, attained after logic editing at the end of the cycle, is specified in the Value column. In animation mode, the cyclical setting of variables in IEC sections is displayed.
Unintended setting of values
Confirm values that were entered in an RDE table with the Input key. However, authorized values are also transferred if you switch to another input field using the cursor key or the mouse or if you leave the RDE table.
You can cancel an entry using the ESC key.
WARNING
UNINTENDED SETTING OF VALUES
Do not leave the RDE table (for example by clicking on another window) if you have already entered an authorized value in an input field, since otherwise the value will be transferred and unintended setting of values can occur.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
602
33002204 12/2010
Cyclic Set
Reference data editor
NOTE: Cyclical setting of variables can only be performed ONLINE and in EQUAL mode, not in animation mode. Depending on logic, the displayed value may deviate from the cyclically set value.
When the cyclical setting check box is checked, the set value in the Set Value column can still be changed.
If the box in the column Cyclic Set is unchecked, the signal state in the column
Value is loaded onto the PLC and is used in the logic.
A maximum of 300 variables can be cyclically set. For cyclical setting, the length of the entry is limited to 150 characters in the column Variable Name , because this name is sent to control. If a variable is used several times in the reference data editor, the most recently entered value will always be the one taken into account for cyclical setting.
NOTE: All changed signal states are loaded directly onto the PLC.
CAUTION
Modified variable names are not recognized by replacements.
When a variable is cyclically set, the spelling of the variable name should not be changed in the variables editor.
Failure to follow these instructions can result in injury or equipment damage.
Cyclical setting and locking of signal states in the operating modes:
Mode
LOCAL
ONLINE
LOCAL
ONLINE
Option
Disable
Disable
Cyclic Set
Cyclic Set
Meaning
The variables declared in the Variable Editor can be written in the RDE Template in local mode. The signal states specified in online mode are displayed in local mode but cannot be changed and have no effect.
The changed signal states of located variables are transferred directly from the program logic.
Cyclical setting of variables cannot be executed in local mode.
The signal state in the column Set Value is used in logic editing by checking the box (check mark visible), and supplies a value at the end of the cycle, which is displayed in the column Value .
33002204 12/2010
603
Reference data editor
Getting/deleting cyclical set list
The cyclical values set in animation mode can be inserted into the RDE Template in disabled animation using the menu command Get CSL .
Cyclically set values are recognized in the RDE Template by the check mark in the column Cyclic Set , and are automatically recognized row by row. It is therefore referred to as a cyclical set list. Using the menu command Online → this recognized list will be inserted dependently from the selected row in the RDE table.
Getting and inserting the cyclical set list can be done as often as required. The most recent cyclical set list is always located on the clipboard and can only be deleted using the menu command Delete CSL . Thereafter, getting and inserting is no longer possible until values are cyclically set at the next animation.
NOTE: Each time, the system gets all cyclically set values .
Loading reference data
Cyclically set values and disabled variables can be loaded onto the PLC using the menu command Load reference data .
These settings then remain the same until the user makes a change in the RDE
Template, or the PLC loses the loaded data (e.g. by loading a different project).
NOTE: In an open RDE Template, the changed date is then automatically saved using the menu command Load reference data . The menu command Save table then no longer needs to be used.
604
33002204 12/2010
Reference data editor
Unconditional locking of a section
At a Glance
At the section to be inhibited, the logic must carry a BOOL data type "output" and it should be noted that the section is disabled at configured "1".
CAUTION
Risk of unwanted process states.
Locking a section does not mean that programmed outputs within the section are deactivated. If an output was already set during a previous cycle, this state also remains after the section has been inhibited. It only ceases to be possible to change the state of these outputs once the section has been inhibited.
Failure to follow these instructions can result in injury or equipment damage.
NOTE: A section that contains a logic to lock/release other sections should not be disabled, if possible. Output state disabled sections cannot be changed.
Procedure for unconditional locking of a section.
The following procedure is performed to disable a section unconditionally in the RDE table:
Step
1
2
3
4
5
6
Action
By double-clicking in a text box in the first column in the table (1 … 100) open the dialog box Look up variables .
In the zone Data type select the option button Structured and from the list select
SECT_CTRL .
Reaction: The names of all sections are displayed.
Select the name of the file to be disabled and using the command button
Elements...
open the dialog box Select elements by type .
Select the line disable : BOOL and confirm with OK .
Reaction: The structured variable (Sectionname.disable) to which the section to be disabled is assigned, is entered in the RDE table.
Link the PLC and the programming device ( Online
→
), and load the user program onto the PLC ( Online
→
).
Reaction: The PLC is in ONLINE and ANIMATIONS mode.
In the column Value enter a configured "1".
Reaction: The section is disabled and will not be processed.
33002204 12/2010
605
Reference data editor
Animation
At a Glance
Animation can only take place in ONLINE mode. By activating Animation in the
Reference data editor it is possible to display the signal states of the variables, and to observe the behavior of the output signals while the program is running.
During animation, signal states can be changed online also. The new values are automatically loaded onto the PLC and are taken into account during the next cycle.
NOTE: When changing a value it should be ensured that the locking of the variable is subsequently removed. It is impossible to animate disabled variables correctly.
Animation status
The column Animation status specifies the status of entered unlocated Variables during animation.
This table provides an overview of the animation status possibilities:
Display
Not used
Note: In LOCAL mode, this display changes to "Unequal program"
Mode
ONLINE,
ANIMATED
Inhibited I/O flag bits ONLINE
Cause
A variable not used in the user program, which is declared in the Variable Editor, was entered in the
RDE table.
Unequal program
Unequal program
Note: In ONLINE mode, this display changes to "Not used".
ONLINE
LOCAL
An unlocated variable was cyclically set during the
ANIMATIONS mode.
A variable that is used in the user program, which is declared in the Variable Editor, was entered in the
RDE table. The program is in MODIFIED mode.
A variable not used in the user program, which is declared in the Variable Editor, was entered in the
RDE table.
606
33002204 12/2010
Reference data editor
Display of forced and cyclically set signals in ANIMATIONS mode
The variables that are forced or cyclically set in the reference editor are labelled with a colored background in the individual editors.
Forced variables are displayed in the following way:
Editor
IEC editors (FBD, LD, SFC, IL, ST)
Display
When forcing occurs, variable names are shaded in ochre (brown-yellow).
LL984 editor When forcing contacts, variable names are underlined.
When forcing spools, an opened contact ("inhibited") is displayed before the spool.
Monitoring fields and Display dialog When forcing occurs, variable names are shaded in ochre (brown-yellow).
Cyclically set variables are displayed in the following way:
Editor
IEC editors (FBD, LD, SFC, IL, ST)
Display
When cyclical setting occurs, the variable name is shaded in violet.
Monitoring fields and Display dialog When cyclical setting occurs, the variable name is shaded in magenta.
NOTE: In LD (Ladder Diagram) spools and contacts are displayed in color.
However, due to forcing and cyclical setting, it is possible that the colors of the variable names will be different from the color display of spools and contacts.
Display of forced and cyclically set element structured variables in ANIMATIONS mode
If a structured variable element is forced or cyclically set, there are different display possibilities.
Display
The name of the structured variable
(e.g. motor) is shaded in color.
The name of the structured variable element (e.g. right motor on) is shaded in color.
The name of the structured variable element (e.g. right motor on) is shaded in color, but the name of the element is not.
Cause
In the editor, a multi-element variable (e.g. motor) is displayed, in which one or more elements is forced or cyclically set.
In the editor, a forced or cyclically set element of a multi-element variable (e.g. right motor on) is displayed.
In the editor, an element of a multi-element variable that is not forced or cyclically set is displayed, but a different element of this multi-element variable is cyclically set or forced.
33002204 12/2010
607
Reference data editor
Replacing variable names
At a Glance
When using an open RDE table it is possible to simultaneously edit the Variable
Editor. If variable names are changed in the Variable Editor using the Find/replace function, these changes are automatically adopted in the open RDE table. In this case the RDE animation is initially terminated and the RDE table must be reloaded.
Procedure and reaction
For the automatic adoption of replaced variable names in the simultaneously open
RDE table, the following steps are to be performed:
Step
1
2
3
4
5
6
7
8
9
Action
Open a section and create an online link.
Note: The state between PLC and programming device must be EQUAL. If not, load the program into the PLC.
Start the animation ( Online
→
).
Reaction: The signal states of the section are displayed in color.
Open an existing RDE table ( RDE
→
).
Reaction: The RDE animation is started.
Open the Variable Editor ( Project
→
).
Using the command button Find/replace open the dialog Find/replace .
Replace an existing variable name with a new name (Command button
Replace ).
Reaction: The variable name was changed in the Variable Editor.
Exit the Variable Editor using OK .
Reaction: The section is automatically updated, and the RDE animation is terminated.
Close the RDE table and save the changes (Command button Yes ).
Reopen the saved RDE table ( RDE
→
).
Reaction: The RDE animation with the changed variable name is recovered.
608
33002204 12/2010
Reference data editor
Load reference data
At a Glance
In the same cycle, the variables changed in the reference data editor are sent to the
PLC, using the menu command Online → Load reference data .
NOTE: To perform the loading, the animation must be disabled.
33002204 12/2010
609
Reference data editor
610
33002204 12/2010
ASCII Message Editor
33002204 12/2010
ASCII Message Editor
19
Introduction
This chapter describes the ASCII message editor.
What's in this Chapter?
This chapter contains the following sections:
Section
19.1
19.2
19.3
19.4
Topic
ASCII Editor Dialog
User Interface of ASCII Message Editor
How to Continue after Getting a Warning
ASCII Editor in Offline/Combination/Direct Modes
Page
611
33002204 12/2010
ASCII Message Editor
19.1
ASCII Editor Dialog
Introduction
This section describes the ASCII editor dialog.
What's in this Section?
This section contains the following topics:
Topic
Generals to ASCII editor dialog
Text
Variables
Control code
Spaces
Carriage Return
Flush (buffer)
Repeat
Page
612
33002204 12/2010
ASCII Message Editor
Generals to ASCII editor dialog
Introduction
Use the ASCII message editor to create, edit, and simulate ASCII messages. The
ASCII message text/control that is created in the editor can be transferred to the selected PLC. Conversely, the ASCII messages internal to the controller can be uploaded to the editor.
An ASCII message set consists only of a list of messages that satisfy certain rules.
The number of messages allowed and the maximum length of the ASCII message set is defined as part of the PLC configuration. Each message consists of a list of
ASCII message fields separated by commas.
z z z z z z z
The following fields are currently supported:
Preconditions z z
This function is only available when using:
Concept for Quantum
The modules J892 or P892 z Programming language LL984
33002204 12/2010
613
ASCII Message Editor
Text
Introduction
The text messages defined by text fields take the format ’Hello World’ whereby
Hello World becomes the text to be forwarded. The single quotation marks are the delimiters. The ASCII message editor development dialog provides a development area and a simulator area where the composed message is interpreted and displayed for you to make any necessary edits before leaving the editor dialog.
Message Length
An ASCII message can be as long as 134 words. Three words are for overhead plus the actual message maximum of 131 words (2 characters per word).
Message words are used up as follows:
Field type
ASCII text
Return
Flush 0, 1
Flush 2, 3
Control
Variable
Repeat
Space
1
2
2
1
1
1
1
Field length (in words)
1 + length of text / 2 rounded up
614
33002204 12/2010
ASCII Message Editor
Variables
Introduction
Data Types
Example
A variable will be given the format NTF.
z z
The meaning of this is: z N representing the decimal number (1...99) of the data fields of the data type defined by T.
T is the data type of the variable.
F the decimal field width for the variable.
The data types supported are:
Type
A = ASCII character
B = binary number
H = hexadecimal
Repetition factor
1
1 to 16
1 to 4
I = integer 1 to 8
L = integer with leading 0s 1 to 8
O = octal 1 to 6 z z
For example: 2H2 means:
2 registers (N) in hexadecimal (T) z containing 2 hexadecimal numbers (F)
N can fit into the number of data registers needed, but it is not an absolute requirement.
The relationship is:
Type
A
B
H
I and L
O
Relationship
Number of registers = N/2 (next upper integer value)
Number of registers = N for 1
≤
4... Number of registers = N for 5 ≤ 8... Number of registers = 2 x N
The same as H
Number of registers = N
33002204 12/2010
615
ASCII Message Editor
Control code
Meaning of Control Code
A control code is given the format "Null", with Null being a three characters OOO, and the double quotation marks are delimiters.
For example: "017"
616
33002204 12/2010
ASCII Message Editor
Spaces
Meaning of Spaces
A space field is given the format ddx, with dd being a decimal number (1..99) used to determine how many spaces are to be added to the message.
Representation of Dialog
Many spaces between text:
33002204 12/2010
617
ASCII Message Editor
Carriage Return
Meaning of Carriage Return
A carriage return field will add a carriage return to the output information, and it has the format, /.
Representation of Dialog
Carriage return:
618
33002204 12/2010
ASCII Message Editor
Flush (buffer)
Meaning of Flush
This will expressly specify for the P892 only how the input message buffer is to be cleared. This field has the format <*>/.
The * can be any of the following:
*
0
1;bbb
2;hhhh
Meaning
Remove all characters in the buffer. An example is: <0> clears all.
Removing the number of characters specified by bbb, whereby bbb is a number
(1...255). For example, <1;100> flushes the first 100 characters in a buffer.
Scanning the message for the 2 characters that are specified by the hexadecimal numbers hhhh. If a match is found, delete all characters up to but not including the match.
An example is: <2;5445> causes the buffer ‘12TEST’ to become "TEST".
3;rrr;hhhh Scanning the message for the 2 characters that are specified by the hexadecimal numbers hhhh. If a match is found, delete all characters up to and including the match. The search is to be performed as often as specified by rrr, whereby rrr is representing a decimal number 1...255.
Example: <3;2;5445> causes the buffer ‘12TEST3456TEST789TEST’ to become ST789TEST.
33002204 12/2010
619
ASCII Message Editor
Repeat
Meaning of Repeat
Use this message field to specify that a number of message fields will be repeated several times. This field has the format dd(*), with dd being a decimal repetition factor (1....99), ( ) are delimiters, and * is a series of message fields.
Representation of Dialog
Repeated text:
620
33002204 12/2010
19.2
ASCII Message Editor
User Interface of ASCII Message Editor
Introduction
This section describes the user interface of the ASCII message editor.
What's in this Section?
This section contains the following topics:
Topic
How to Use the ASCII Message Editor
Message Number
Message Text
Simulation Text
Page
33002204 12/2010
621
ASCII Message Editor
How to Use the ASCII Message Editor
Invocation of ASCII Message Editor
The ASCII message editor is invoked from the ASCII messages...
menu item in the
Project menu. This editor allows you to add/modify/delete messages in a temporary work space, then save or cancel the changes.
Add New Messages
To add a new message, type the new message number into the Message text box and type a syntactically correct message into the message text box. As you enter a message into the message text box, its corresponding simulation is displayed in the
Simulation text box. When the message is syntactically incorrect, it is displayed in red.
Modify Existing Messages
To modify an existing message, select a message from the Message number list and change the text.
Delete Messages
To delete a message, select a message from the Message number list and click on
Delete .
Clicking on the button Delete All will remove all messages in the temporary workspace. The button is active if there is at least one ASCII message in the message set. Selecting this option results in the display of a confirmation dialog.
View
Clicking at the button View will produce a view of the displayed ASCII message dialog. The view message format is message number followed by message text.
You can select from the choices available. To download the editor from the view list, click on the message and on OK .
Save Changes
Use the button OK to save processes performed while working with the ASCII editor and to close the dialog. Each message that has been created or changed is checked for syntactic correctness at this point. The checking begins at the current message and wraps around until all messages are checked. If a syntax error is detected, a definition of the error is displayed first, and as soon as the error dialog is cleared, the message itself appears with the cursor on the faulty character. Every attempt to add
ASCII characters which will cause the size of the entire message area set in the configuration to be exceeded will generate an error.
622
33002204 12/2010
ASCII Message Editor
Length, Used and Free
These fields display the length of the current message (in words), the number of words used and the number of words remaining.
33002204 12/2010
623
ASCII Message Editor
Message Number
Introduction
The combo box Message number is a dialog that contains a message selection list with a check mark next to the currently selected message.
Use this dialog to select existing message numbers and/or to add new message numbers. As long as there are no messages, text box and list are empty. If there are messages, the editor is initially displayed with the text box containing the first message number and a list of message numbers for existing messages. The message number that relates to the currently displayed message is posted above the list box.
Action
For the selection of an existing message, click at the list button and mark a number in the list or type the number into the text field. A new message number can be inserted by typing the number into the text field.
Effects
If the message number assigned to an existing message is changed (either text or list entry), the text box Message will display the message text for the message number and the box Simulation shows the simulation of the message. If a new message number has been entered, the text boxes Message and Simulation will be cleared.
624
33002204 12/2010
ASCII Message Editor
Error handling
The following errors can be appearing:
If...
Then ...
an unauthoried character is entered in the number field of the message.
a message field dialog will show: "Message number contains illegal characters".
After acknowledging the error, the message number is reset and the process will continue in the text box
Message .
the text box out.
Message is not filled a message field dialog will show: "There must be a message number before text can be entered" .
After acknowledging the error, the message number is reset and the process will continue in the text box
Message .
the number is greater than the maximum number set in Configure
→ .
a message field dialog will show: " Message number exceeds maximum set in configuration" .
After acknowledging the error, the message number is reset and the process will continue in the text box
Message .
33002204 12/2010
625
ASCII Message Editor
Message Text
Introduction
The text box Message is a text editor with free format for the entry of ASCII messages. This editor allows one arbitrarily long line of free-format text. Although the text should follow the ASCII message syntax, it does not necessarily have to be syntactically correct prior to activating the OK button, even though a view note regarding validity will appear already during entry of the messages.
Actions
A currently selected message is made available for editing, otherwise a new message can be entered. The standard Windows edit operations ( Cut , Paste ,
Copy , ...) are allowed.
Effects
If the message is syntactically correct, its text will be displayed in normal textual color, if not, the display will be in red. Text wraps so there is never a case where horizontal scrolling is required.
626
33002204 12/2010
ASCII Message Editor
Simulation Text
Introduction
The text box Simulation is a read-only multi-line field. The simulated output of the current message is displayed in this window. As messages are added or changed, the simulated output is displayed in the simulation window.
Special Considerations
The simulation of control codes is shown as the ASCII character that corresponds to the controller, except those control codes that are not authorized in Windows text control and are written as an ’l’.
NOTE: Any simulation greater than 32 k characters is truncated to this maximum.
33002204 12/2010
627
ASCII Message Editor
19.3
How to Continue after Getting a Warning
How to Continue after Getting a Warning
Introduction
A few conditions will allow continuing work with the ASCII editor although with possibly restricted functionality.
NOTE: To match a configuration, messages may be deleted.
Exceeding the Total Messages
Message numbers that are above the maximum limit set in Configure →
Setup...
will only be available for display or delete. These messages appear grayed out.
The accompanying warning reads: "Warning: Some message numbers exceed the highest message number xx, defined in Configure.
All messages beyond xx can only be displayed or deleted."
Exceeding the Message Area Size
If the size of the message in the data base is greater than the size defined in
Configure → ASCII Setup...
, a warning will appear. You can continue to view, change, or delete but changes cannot be saved unless the size falls below the configuration setting.
This warning reads: "Warning: The size of the ASCII message area, xx, exceeds the maximum size, xx, defined in Configure."
Tips
NOTE: To match a configuration, messages may be deleted.
NOTE: Information about the ASCII character set can be found in the PLC User’s
Guide.
628
33002204 12/2010
19.4
ASCII Message Editor
ASCII Editor in Offline/Combination/Direct Modes
ASCII Message Editor in Offline/Combination/Direct Modes
Offline
When using Concept to program in offline mode, the ASCII message editor is displayed with the set of messages saved in the data base. By activating the OK button, these messages will be saved in the database.
Direct
When using Concept to program in direct mode, the ASCII message editor will be displayed with the set of messages saved in the controller. By clicking on the OK button, the changes made to the ASCII messages will be downloaded to the controller.
Combination Mode
When entering the Combination mode, Concept checks whether the information in the controller matches the information in the data base. If a match is found, the controller is considered EQUAL to the database. A mismatch is marked as NOT
EQUAL . If the status is EQUAL , the ASCII message editor will be displayed with the
ASCII message set taken from the data base. If a displayed editor message is changed, these changes will be saved to the database and the controller after clicking the OK button.
33002204 12/2010
629
ASCII Message Editor
630
33002204 12/2010
Online functions
33002204 12/2010
Online functions
20
Overview
This chapter describes the various online functions.
What's in this Chapter?
This chapter contains the following sections:
Section
20.1
20.2
20.3
20.4
20.5
20.6
20.7
20.8
Topic
General information about online functions
Connect to PLC
Setting up and controlling the PLC
Selecting Process information (status and memory)
Loading a project
Section animation
Online Diagnosis
Logging Write Access to the PLC
Page
631
33002204 12/2010
Online functions
20.1
General information about online functions
General information
At a Glance
After setting up a link via Modbus, Modbus Plus or TCP/IP between the programming device and the PLC the project can be loaded onto the PLC. Now special online functions for displaying and changing the current value in the PLC state RAM are available in the separate editors. The PLC can be controlled.
CAUTION
A communication timeout or a general memory protection failure could occur if the system clock of the programming device is changed while it is online.
If the running program cannot be terminated, all animated program sections should be closed , or the animation should be turned off in order to reduce the possibility of getting into a time critical operation.
Failure to follow these instructions can result in injury or equipment damage.
632
33002204 12/2010
20.2
Connect to PLC
Overview
This section contains information about connecting the PLC.
What's in this Section?
This section contains the following topics:
Topic
General
Presettings for ONLINE operation
Modbus Network Link
Modbus Plus Network
Modbus Plus Bridge
TCP/IP-Network Link
Connecting IEC Simulator (32 bit)
State of the PLC
Online functions
Page
33002204 12/2010
633
Online functions
General
Introduction
A connection can be created between a programming device and the PLC.
In monitor operation (it is not supported by M1E PLCs), it is possible to make alterations to the IEC sections, but these cannot be downloaded to the PLC. When exiting Concept a warning will be displayed.
NOTE: Only one programming device may be connected to the PLC.
Limited PLC Login
When logging into the PLC, the following restrictions are imposed for Quantum
CPUs 140 434 12 A and 534 14 A/B: z If a programming device is already connected with the PLC in programming z mode, then no other programming devices can be connected with the PLC.
If a programming device is already connected with the PLC in Monitor mode then other programming devices can be only connected with the PLC in Monitor mode.
An attempt to connect with the PLC in another operating mode is not possible for the other programming devices.
Consistency check
If a project is open and a connection between the programming device and the PLC is to be created, a consistency check is automatically carried out between the program, EFBs and DFBs on the programming device, and the PLC. The result of this check ( EQUAL , MODIFIED or NOT EQUAL ) is displayed in the status bar and written in a file. This file is located in the project directory of Concept and has the name PROJEKTNAME.RMK. It functions for internal usage and automatically changes its contents. The meaning of the individual entries can be found in the following diagram.
634
33002204 12/2010
Online functions
Status descriptions
Status descriptions: z EQUAL z
The program on the programming device and the PLC is consistent.
NOT EQUAL z
The program on the programming device and the PLC is not consistent. To establish consistency use the menu command Online → Download...
.
MODIFIED
The program on the programming device was modified. The modifications can be made online in the PLC with the menu command Online → .
Note: Even when changes that are not relevant to the code (e.g. creating/changing comments in IL/ST, moving objects (without affecting logic) exist in FDB/LD/SFC), the MODIFIED status is displayed temporarily. When the section is next analyzed ( Project Analyze project , Project Analyze section or Online → ), the program automatically reverts to the
EQUAL status (if no changes have been carried out that are relevant to the code).
Even if changes that are relevant to the code have been carried out, only these sections appear in the Download changes dialog box.
33002204 12/2010
635
Online functions
Relationships between states
The diagram shows the relationships between the different program states:
636
Unk UNKNOWN
Dis DISCONNECTED
!Eq NOT EQUAL
Mod MODIFIED
E!S EQUAL but not saved
EqS EQUAL and saved
33002204 12/2010
Online functions
Presettings for ONLINE operation
At a Glance
The dialog box Link PLC to can be used to specify settings for both the PLC link and ONLINE mode resulting from it.
Access
It is possible to specify which functions will be executed in the ONLINE operation, i.e. which menu commands are available in the Online main menu.
Protocol types
To link the programming device and PLC, it is important to know which network the communicating nodes are in so that the correct protocol type is selected.
Use the table to decide which protocol type fits the network link used:
Linking the network nodes
Serial Interface
SA85-/PCI85-Adapter
NOE-module (on Ethernet-Bus SINEC H1)
TCP/IP Interface map (32-Bit Simulation)
Protocol type
Modbus
Modbus Plus
TCP/IP
IEC Simulator (32-Bit)
NOTE: The programming device can always only be linked to one PLC. This means that before a link is made to another PLC, any existing link must be terminated with the Terminate Link menu command.
33002204 12/2010
637
Online functions
Modbus Network Link
Introduction
For a Modbus network link, the settings of the modbus interface must correspond with the settings on the PLC.
The interface is edited in the Modbus Port Settings dialog ( PLC Configuration →
Modbus Port Settings...
).
Protocol Settings for Modbus
When the Modbus protocol type is selected, specify further data in the Protocol
Settings: Modbus range. Specify the Node Address (Node No.) on the PLC and enter this in the corresponding text box. You can determine the transfer mode for communication between the PLC and the host computer.
The following modes are available according to the application:
Application
Communication with various host devices. The ASCII mode works with 7 data bits.
Mode
ASCII
Communication with an IBM compatible personal computer. The
RTU mode works with 8 data bits.
RTU
After the serial interface for the Modbus network link has been specified, using the
Settings...
command button, open the Settings for COMx dialog. Enter the settings for the interface here, as in the Modbus port settings dialog.
Use the OK command button to create the ONLINE link.
638
33002204 12/2010
Online functions
Modbus Plus Network
Introduction
For a Modbus Plus network connection, enter in the Protocol settings: Modbus
Plus range whether the 16-Bit IEC-Simulator ( Port 0 ) or the Modbus Plus interface
( Port 1 ) is being used.
All nodes on the local network are displayed in the list. Additionally, the routing path of the token rotation sequence in the network, which can contain up to 5 Node addresses is displayed. Up to 64 nodes can be addressed on one network, i.e. a routing path address can be between 1 and 64. Several networks can be linked via a bridge.
NOTE: The node list of a different network can be displayed by double-clicking on a listed bridge.
To pass the program execution to the Modbus Plus device driver, Concept triggers a MS DOS Software Interrupt. The preset Interrupt number for this is 5C (hex).
NOTE: If no virtual Modbus Plus driver is installed, the virtual MS DOS environment in Windows NT has problems when reacting to the software interrupt. If a share violation (Exception) occurs under certain conditions, change the Interrupt number to 5D (hex) in the MODICON.INI file:
[PORTS] mbp0=5d
If the Interrupt 5D from the NTVDM.EXE is activated the share violation should no longer occur.
IEC Simulator (16 Bit)
The simulator simulates a coupled PLC via Modbus Plus. The address of the programming device is displayed in the list in the routing path.
The simulator is active if in the Protocol settings: Modbus Plus: area, the option
Port 0 is selected.
NOTE: When the simulator is active, no further nodes can be displayed.
The simulator is only available for the IEC languages (FBD, SFC, LD, IL and ST).
PLC as Modbus Plus Node
When the PLC is a Modbus Plus node, the address which the PLC has in the routing path is displayed in the list. This address corresponds to the node address which is set with a rotary switch on the back of the CPU.
33002204 12/2010
639
Online functions
SA85/PCI85 as Modbus Plus Node
The SA85 module is a Modbus Plus adapter for an IBM-AT or compatible computer.
The port address is displayed in the list. The address shows in which network the
SA85/PCI85 is installed.
Displaying a routing path with SA85/PCI85:
Bridge Plus as Modbus Plus Node
A Bridge Plus (BP85) links nodes within two Modbus Plus networks. The Bridge is displayed in the list box, and the next Modbus Plus network can be accessed by double-clicking on the Bridge.
640
33002204 12/2010
Displaying a routing path with a Bridge Plus BP85:
Online functions
33002204 12/2010
Example:
The example shows a routing path across 3 Modbus Plus networks. The task is to send a message from node 5 in network A to node 12 in network C.
The routing path here is 22.20.12.00.00 and it is made up as follows:
Path
22
20
12
00.00
Meaning
The first address contains the network A Bridge Plus address from Network A from output node 5. This means the message is sent from output node 5 across this Bridge to the next network, B.
The second address contains the Bridge Plus address of the next network, B.
Here, the message is sent from network B to the third network, C.
The third address contains the address of node 12, the destination segment.
Addresses four and five are set to 0 because there are no further forwarding addresses.
641
Online functions
Bridge as Modbus Plus Node
A link between the Ethernet and the Modbus Plus network or between two Modbus
Plus networks is created via the Modbus Plus Bridge.
The Modbus Plus Bridge should be regarded as a host computer and must be configured in the Protocol settings: TCP/IP area. Enter the IP address or the host name of the Bridge, and finally in the text box Protocol type: change to Modbus
Plus network setting.
The Modbus Plus Bridge is only listed in the list of nodes in the Modbus Plus network as a host name which was previously entered in the Protocol Settings: TCP/IP area. A double-click on the corresponding host name opens the Modbus Plus
Bridge dialog box for 5 byte routing path configuration.
Further action in the dialog box can be found in the chapter"
".
Example:
In the dialog box Modbus Plus Bridge , create the routing path 25.8.17.33.0, which defines the following link (from A to D):
642
A The message sent from the host computer contains the 5 byte Modbus Plus Routing Path.
The first byte with the node address of the host computer refers to the Modbus Plus Bridge linked to it. The Modbus Plus Bridge 1 receives the message on internal path 8, as specified in byte 2.
33002204 12/2010
Online functions
B The TCP Index No. 17 (byte 3) administered in the Modbus Plus Bridge passes the message on to the configured node with the IP address 205.167.8.10. In this case the node with this IP address is another Modbus Plus Bridge.
C Modbus Plus Bridge 2 receives the message. The MBP Index No. 3 given in 4 byte and administered by the bridge passes the message on to the configured Modbus Plus node.
In this case the node 12.0.0.0.0.
D The message has reached its destination, Modbus Plus node 12.
Bridge Multiplexer as Modbus Plus Node
The BM85 Bridge Multiplexer links up to four Modbus devices or Modbus networks to a Modbus Plus network.
See also "User’s Guide BM85 Modbus Plus Bridge/Multiplexer."
Displaying a routing path with a Bridge Multiplexer BM85:
33002204 12/2010
643
Online functions
Modbus Plus Bridge
At a Glance
Enter the 5 byte routing path which defines the link from the host computer to the
Ethernet node in this dialog box.
Making settings
The following table describes how to define the routing path:
Setting zone
Bridge Path
IP routing byte
MB+ routing byte
Complete address
Routing path byte Meaning
2. Byte A maximum of 8 links can go out from the
Bridge to the other network, and one of these should be selected.
3. Byte
4. Byte
Enter an index no. which is assigned to an IP address. This IP address should correspond to an Ethernet node address where the message is then sent. If this IP address is being sent to another Modbus Plus Bridge in the
Ethernet,another node address (MB+ routing byte) must be given for it to be transferred further into the Modbus Plus network.
If a link is displayed between two Modbus Plus networks via two Modbus Plus bridges, the index no. of the Modbus Plus node must be entered here. This index no. is also assigned to a node address. If there is no link across a different bridge, the value "0" is entered.
5. Byte The whole 5 byte routing path is displayed according to the setting. The first byte is then automatically adjusted to the node address of the host computer.
644
33002204 12/2010
Online functions
Modbus Plus index no.
The assignments of the Modbus Plus index no. are pre-set and can be selected between 0 and 255. Note that index no. 255 is reserved for specific operations.
When this index no. is selected, data selection or loading is permitted between a
TCP/IP node and the Modbus Plus Bridge via an internal command. Index nos. 250
– 253 are reserved and cannot be used.
The index in the Modbus Plus routing path is shown in the following table:
Index
1 ... 64
65 ... 128
129 ... 192
193 ... 249
Modbus Plus routing path
1.0.0.0.0 ... 64.0.0.0.0
2.1.0.0.0 ... 2.64.0.0.0
3.1.0.0.0 ... 3.64.0.0.0
3.2.1.0.0 ... 3.2.57.0.0
TCP/IP Index No.
The assignments of the TCP index no. follow automatically after the IP address of the Modbus Plus Bridge has been specified in the Link → Protocol Settings:
TCP/IP dialog box. Each index is assigned to an IP address where the first 3 bytes are assigned to the first 3 bytes of the Modbus Plus Bridge IP address. The 4th byte is counted upwards from 1 to 255 at the most.
Example:
For a Modbus Plus Bridge IP address of 205.167.4.65, the TCP/IP addresses are automatically pre-set, as in the following table:
Index
1
2
...
255
IP address
205.167.4.1
205.167.4.2
...
205.167.4.255
NOTE: Refer to the "174 CEV 200 30 TSX Momentum Modbus Plus to Ethernet
Bridge User Guide" for a detailed description of the Ethernet Bridge.
33002204 12/2010
645
Online functions
TCP/IP-Network Link
Introduction
For an Ethernet link, select the protocol type TCP/IP in the Connect to PLC dialog box.
Protocol Settings for TCP/IP
To connect to other Ethernet nodes, specify the IP address or the host name of the
Ethernet node in the Protocol Settings: TCP/IP range.
To connect to the Ethernet via Modbus Plus node, specify the IP address or the host name of the Modbus Plus Bridge in the Protocol Settings: TCP/IP range (see also
"Bridge as Modbus Plus Node
").
Connecting Quantum to the Ethernet
You can connect the Quantum to the Ethernet Bus by configuring the NOE module.
By doing this, it is possible to communicate with other automation components in the
Ethernet Bus system via the host computer.
646
33002204 12/2010
Online functions
Connecting IEC Simulator (32 bit)
Introduction
The simulator simulates a PLC connected via TCP/IP, where the signal status of the
I/O modules can also be simulated. Up to 5 host computers are connected to the simulated PLC at the same time.
To activate the simulator, select the protocol type IEC simulator (32 bit) in the
Connect to PLC dialog box.
Protocol Settings for IEC Simulator (32 bit)
The simulator is active, if you specify the address of your TCP/IP interface board in the Protocol Settings: IEC Simulator (32 bit) range.
The TCP/IP address can be obtained on the title bar of the Concept simulator program PLCSIM32.
NOTE: At the present time the simulator is only available for IEC languages (FBD,
SFC, LD, IL and ST).
33002204 12/2010
647
Online functions
State of the PLC
At a Glance
With a network link, the state of the PLC is displayed in the list of nodes in the
Modbus Plus network in the Link to PLC dialog box.
States of the PLC
All the states which can arise are listed in the following table:
State
Running
Stopped
Unknown
Not configured
Meaning
Identifies a PLC with a program running.
Identifies a PLC with a program which has stopped.
Identifies an unknown PLC.
Identifies a PLC without a hardware configuration, i.e. no online functions are possible.
648
33002204 12/2010
Online functions
20.3
Setting up and controlling the PLC
Overview
This chapter contains information about setting up and controlling the PLC.
What's in this Section?
This section contains the following topics:
General Information
Setting the Time for Constant Scans
Topic
Single Sweeps
Deleting memory zones from the PLC
Speed optimized LL984-Processing
Save To Flash
Reactivate flash save
Set PLC Password
Page
33002204 12/2010
649
Online functions
General Information
Introduction
The PLC and CPU functions can be controlled in ONLINE mode. The PLC must be connected to the host computer to establish ONLINE mode.
z z z z z z z
You can control the PLC directly with the following commands:
Set Scan Time
Single Scan Function
Clear Controller
Set Clock
Run Optimized Solve
Save in Flash
Set Password for PLC
The commands for setting up and controlling the PLC can be found in Online →
Online Control Panel .
650
33002204 12/2010
Online functions
Setting the Time for Constant Scans
Introduction
A constant cycle time for processing the user program can be specified in the Online
→ Online control panel → Invoke constant sweep → dialog box.
However, if the actual cycle time is longer than the constant cycle time specified the system ignores the user settings and uses the normal cycle running time ( Cycle time in free running mode ).
If a constant cycle time is selected which is longer than the actual cycle time, the control will wait during each cycle until the set cycle time has been reached.
NOTE: Inputs/outputs connected via communication experts may not be used for updating constant I/O requests, as there can be highly variable I/O response times.
NOTE: This function cannot be performed when there is a link with the simulator.
Selection condition
This dialog box is only available if the link has been established between the PLC and the programming device (ONLINE mode).
Settings for constant cycle
A tab (4x) must be specified first to determine the constant cycle. You also need to enter the scan time (10-200m) that is allocated to the register.
NOTE: The scan time increases if several windows are open in Concept, e.g. several sections are displayed in animation mode. Therefore if you are using several windows you should reduce the scan time.
Exiting Constant Scan
After starting the constant scan with the Invoke constant sweep...
changes the designation of the command button in Cancel constant sweep...
. Clicking on this command button exits the function.
33002204 12/2010
651
Online functions
Single Sweeps
Introduction
You can specify single sweeps times for processing the user program in the Online
→ Online Control Panel → Single Sweep On… → Settings for Single Sweeps dialog box.
After the specified number of scans has been performed the logic editing stops. This function is helpful for diagnostic purposes. It allows the checking of edited logic, modified data and calculations that have been carried out.
WARNING
It can lead to unsafe, dangerous and destructive operations of the tools or processes that are attached to the controller.
Single sweeps should not be used for searching for errors in controlling machine tools, processes or material maintenance systems if these are running. When the number of scan times given has been processed, all the outputs will be retained in their last state. Since no more logic editing is taking place, the controller ignores all input information. Therefore the single sweeps function should only be used for searching for errors during start up.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Selection Condition
This dialog box is only available if the link has been established between the PLC and the host computer (ONLINE mode). Single sweeps are only performed in PLC
RUN mode.
Settings for Single Sweeps
To determine the single sweeps, the scan time (10 – 200ms) and the number of scans being performed must be specified. A maximum of 15 single sweeps is possible.
Execution of Single Sweeps
After the scan time and number have been specified you can perform the single sweeps with the Trigger Sweep command button.
NOTE: The Trigger Sweep command button is only available in PLC RUN mode.
652
33002204 12/2010
Online functions
Exiting Single Sweeps Function
After the single sweeps function has been started with the Single Sweep On command button, the designation of the command button changes to Single
Sweeps Off . Clicking on this command button terminates the function again, and the Settings...
and Trigger Sweep command buttons no longer appear in the dialog box.
33002204 12/2010
653
Online functions
Deleting memory zones from the PLC
At a Glance
Specific memory zones can be deleted from the PLC by activating the corresponding options key in the Online → Online Control → Delete PLC... →
PLC contents dialog box.
The menu command Load...
can be used to load the deleted memory areas back onto the PLC.
Condition for dial-in
This dialog box is only available if the link has been established between the PLC and the programming device (ONLINE mode) and the PLC is in STOP mode.
Deleting a configuration
If the hardware function of a PLC is deleted, no further online functions can be performed. The NOT CONFIGURED and NOT EQUAL TO modes are displayed in the status bar.
Deleting a program
If the user program is deleted in the PLC, the PLC cannot be started. The NOT
EQUAL TO state is displayed in the status bar.
Deleting state RAM
If the state RAM is deleted, the initial values of the located variables in the PLC are set to 0.
654
33002204 12/2010
Online functions
Speed optimized LL984-Processing
At a Glance
A speed optimized LL984 Processing can be optimized in the dialog box Online →
Online Control with the Opt. processing in command button.
After the command button is activated its designation changes in Opt. Processing out . This means that a click on this command button will deactivate the speed optimization which is running again.
NOTE: This function only influences the LL984- program.
Condition for dial-in
This dialog box is only available if the link has been established between the PLC and the programming device (ONLINE mode) and the PLC is in STOP mode.
33002204 12/2010
655
Online functions
Save To Flash
Introduction
For data protection purposes, you can save parts of the RAM in the PLC's Flash-
EPROM. After a power failure, the contents of the Flash-EPROM is loaded back onto the CPU RAM for the restart.
WARNING
Modified process status after next start!
It is important to choose the right time for saving to Flash, as there could be signal values in the Flash memory which are downloaded later following a power failure, and which do not correspond to the process status for the next start.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
Selection condition
This function is available when using all 140 CPU 434 12 and 140 CPU 534 14 TSX
Compact, Momentum and Quantum modules.
This function is not available with IEC Hot Standby operation with Quantum.
The Flash memory function is not available when using the simulator.
Procedure
Carry out the following steps to Save To Flash:
Step
1
2
3
4
Action
In the Flash Type area, select the Internal or PC Card option button depending on the hardware used.
Note: Applications that require more than 480 kBytes must be saved in the PC
Card Flash.
In the Controller State area, select the operating mode (RUNNING or
STOPPED) the PLC should be in after a restart.
Check the Allow Editing After Power Up check box if you want to edit the uploaded Flash program when the voltage supply returns.
Caution: Since these later modifications were not downloaded onto the Flash-
EPROM, this data is lost if there is a power failure.
Check the Save State Ram check box if you want to save all 4x registers to
Flash-EPROM.
Note: This selection is not available with the Momentum family, i.e. all applications are always downloaded to Flash-EPROM.
656
33002204 12/2010
Online functions
Step
5
6
Action
If you have checked the Save State Ram check box, you must enter the number of registers to save in the Number of registers to save text box. The corresponding register area, which is downloaded onto Flash-EPROM, is then set from the 400001 address.
Select the Save To Flash command button to load the user program, the configuration, the IEC programming initial values from the RAM to the Flash
EPROM.
Edit Flash program
As soon as the Allow Editing After Power Up check box is checked, on saving to
Flash, information is loaded to the Flash-EPROM, which after uploading the contents of Flash (e.g. in the case of the return of the power supply) allows the program to be edited. Since these later modifications were not downloaded onto the
Flash-EPROM, this data is lost if there is a power failure. To prevent this, changes should be downloaded to Flash-EPROM by using the Save To Flash command button.
Modification of the Flash program is not allowed.
As soon as the Allow Editing After Power Up check box is unchecked, the program can be modified after reading the Flash contents (e.g. in the case of the return of the power supply), but cannot be loaded to the Flash EPROM.
Modifying the program leads to the following reactions when uploading:
Procedure: a) b)
Changes protected with Download changes...
Yes
Yes
Changes protected with Save project
No
Yes
The following status is established after connection:
EQUAL
NOT EQUAL
If the EQUAL status is established in the above case a), the contents of the host computer are different from the contents of the Flash-EPROM. After a power failure the Flash-EPROM is uploaded, resulting in the loss of all changes.
If the NOT EQUAL status is established in the above case b), the contents of the
Flash-EPROM are different from the contents of the host computer. After a power failure the Flash-EPROM is uploaded, resulting in the loss of all changes.
NOTE: To download a program change to Flash EPROM again, the Save To Flash command button must be available again. Specific steps must be carried out to do this, as described in the
Reactivate flash save, page 659
section.
33002204 12/2010
657
Online functions
M1 Ethernet CPU
The password protected application is automatically downloaded on each switching on/off cycle. This procedure cannot be undone if you forget the password. The PLC must be sent for repair.
658
33002204 12/2010
Online functions
Reactivate flash save
Introduction
If you have not checked the check box in Flash Save Allow Editing after Power Up the program saved in Flash EPROM can no longer be changed. After a power failure the Flash-EPROM will finish on restarting the PLC. However, the command buttons
Save to Flash and Clear Flash are not available.
Reactivate Flash Save
In order to enable the Flash Save again, the following steps are necessary:
Step
1
2
3
4
5
6
Action
Turn off the controller.
Compact CPUs: Set the "Memory Protect" switch (Memory Protect) to ON.
Quantum CPUs: Set the switch to the "stop" position.
Turn the controller on again.
Compact CPUs: Set the "Memory Protect" switch (Memory Protect) to OFF.
Quantum CPUs: Set the switch to the "start" position.
Make the link between the host computer and the controller ( Online →
Connect...
).
Open the dialog box Save to Flash ( Online → Flash
Program...
).
Result: The command buttons Save to Flash and Clear Flash are now available again.
33002204 12/2010
659
Online functions
Set PLC Password
Introduction
You can use a password to prevent the PLC being written to without permission.
Before you can set a new password, however, you must first download the configuration to the PLC. Then enter the password that is to loaded to the PLC. The password is now saved so that password protection operates when a connection is made between the host computer and the PLC (password required).
NOTE: When setting a Quantum password, a specific time can also be set for the automatic cancel function in the Quantum Security Parameter dialog box. This function is found in the preference setting Never . This function means that the user is logged out after the time specified as soon as no read or write access occurs from the programming device to the PLC through this connection within the predefined amount of time.
Valid characters for the PLC password and user name z z z z
The following characters are permitted within the character length of 616 characters: a ... z
A ... Z
0 ... 9
_
NOTE: Spaces, umlauts (e.g.: ä, ö, ü) and special characters are not allowed!
Selection conditions
This function is available when using all TSX Compact CPUs, a Quantum CPU 434
12 A/534 14 A/B or a Momentum Ethernet CPU.
Note z z
The following passwords can be assigned in Concept:
PLC password
Concept Password
(in Concept Security)
660
33002204 12/2010
Online functions
Set new PLC password
To set a new PLC password, proceed as follows:
Step
1
2
5
6
3
4
Action
Using Online → load the configuration onto the PLC
Using Online → Set PLC password...
open the dialog Change PLC Password .
Enter your new password in the Enter New Password: text box.
Enter the new password in the Confirm New Password: text box again.
Enter the user name in the User name text box, e.g. "anyname".
Press the OK command button.
Reaction: The dialog box is closed and the password is automatically downloaded to the PLC
Change Old PLC Password
To change an old PLC password, proceed as follows:
Step
1
4
5
2
3
6
7
Action
Using Online → Set PLC password...
open the dialog
Change PLC Password .
Enter your old password in the Enter Old Password: text box.
Enter your new password in the Enter New Password: text box.
Enter the new password in the Confirm Password: text box again.
Enter the user name in the User name text box.
Press the OK command button.
Reaction: The dialog box is closed.
Using Online
→
load the configuration onto the PLC
Reaction: The password was loaded onto the PLC, and will be requested the next time the PLC and the host computer are connected.
33002204 12/2010
661
Online functions
If You Forget Your Password
If the PLC password has been forgotten the procedure depends on the PLC platform used.
Quantum and Compact:
3
4
Step
1
2
5
Action
Switch off the power supply to the PLC.
Move the Memory Protect switch on your hardware module to the MEM_PROT position.
Remove the lithium battery from the PLC.
Wait 5 minutes and then switch on the power supply to the PLC again.
Reaction: By doing this, the battery backup RAM is deleted without downloading the PLC program from Flash-EPROM. In this way, the start status of the PLC (configuration-free and without log on password) is re-established.
Continue with the step table
Set new PLC password, page 661
.
Momentum without Flash:
2
3
Step
1
4
Action
Switch off the power supply to the PLC.
Remove the battery from the interface adapter.
Wait 5 minutes and then switch on the power supply to the PLC again.
Continue with the step table
Set new PLC password, page 661
.
Momentum with Flash:
Step
1
2
Action
Switch off the power supply to the PLC.
Send the module back to the product manufacturer (Schneider Automation
GmbH).
662
33002204 12/2010
20.4
Online functions
Selecting Process information (status and memory)
Overview
This chapter contains information about selecting the process information.
What's in this Section?
This section contains the following topics:
Topic
General information
PLC state
Memory Statistics
Page
33002204 12/2010
663
Online functions
General information
At a Glance
Certain processes and their storage occupancy can be controlled during operation of the automation equipment.
NOTE: Errors can occur when selecting a configuration that has been generated by another configuration tool (e.g. SyCon, CMD). The selection is based on removing the memory, whereby this is not always compatible with the other software programs. Therefore please use the Modsoft Converter to transfer the Modsoft application according to Concept.
Read status bits.
Status bits provide information about the hardware communication with other modules as well as existing errors in the running of the program. The user specifies the status register already during configuration. In this register , status bits that change their state as soon as a faulty signal is set in the process or a timeout word is not observed are saved. The user can recognize via defined status states (0 or 1) whether the process is faulty.
Read storage occupancy
The user can control the storage occupancy for the current project in the memory statistics. In an overview the total memory, free memory space and used memory for the user program, as well as the user files and FFB libraries are displayed.
664
33002204 12/2010
Online functions
PLC state
At a Glance
All the PLC states are displayed in the multi-page dialog box.
There are 67 pages altogether, containing various state information
Condition for dial-in
This function is only available if a link has been established between the PLC and the programming device. When the simulator is active the PLC states cannot be retrieved.
Programming states
The following status information is obtained through the programming: z Number of segments z End of logic pointer address z Run/Download/Debug Status
Hardware states
The following state information is given about the hardware: z CPU state z S911 Hot Standby State z Machine State z State of the I/O processor z Quantum I/O state z DIO-State
Error codes
The following state information is given about errors arising: z Machine stop code z Quantum start error code S908
Transfer and communication states
The following state information is given about transfer and communication executions: z Data transfer state z Message transfer state z Communication state
33002204 12/2010
665
Online functions
Cable A + B states
The following state information is given about the A + B cable: z Cable A + B error counter z A + B global state z Cable A + B communication error counter
666
33002204 12/2010
Online functions
Memory Statistics
At a glance
An overview of the IEC memory data for the open project is provided in the Memory
Statistics dialog box. The current scan time will be displayed if a real PLC is used
(i.e. not the simulator). This dialog box does not show information concerning LL984 memory. Information for IEC HSBY memory, which is part of the state RAM (number of input registers), is not shown either.
Total IEC memory
The value shown for the total memory is the value specified in the PLC Selection dialog box.
Modifying the total IEC memory size
The total IEC memory consists of the IEC program memory, the global data, and the
EFB memory. Additional space is required in the total IEC memory for program expansions and for the administration of program changes. The general recommendation is to set the value in such a way that 20-30% of the value entered in the Used text box will remain free.
NOTE: Changes can only be made offline and are only applied once the program has been loaded onto the PLC.
33002204 12/2010
667
Online functions
IEC Program Memory
The program memory includes the program code, the EFB code, program data
(section data and DFB instance data), upload information, diagnosis information, and administration information.
Memory information
Configured
Free
Meaning
Once you have defined the size of the total IEC memory, the global data, and the size of the EFB memory, you will obtain information regarding the size of the IEC program memory
(IEC program memory = total IEC memory - global data - EFB memory).
Shows the available IEC program memory.
The values displayed correspond to the memory space used for: z Program code z EFB code z Program data (section and DFB instance data) z Upload information z Diagnostic information z Administration information
Defragmentation
The value displayed corresponds to the current Defragmentation status.
Defragmentation is enabled in the PLC Selection dialog box. Defragmentation is a continuous process that ends with a value of 0 after a certain period. "0" in this case means that there are no more gaps in the PLC's memory.
Since this continuous process affects the scan time, it can be disabled in the PLC
Selection dialog box.
Global Data
The memory statistics cover the following information:
Memory information
Configured
Free
Meaning
The value shown corresponds to the memory space set for unlocated variables in the PLC Selection dialog box.
The available memory for unlocated variables is shown here.
668
33002204 12/2010
Online functions
Changing the memory space used for global data
You can change the memory space used for global data. It should be noted that increasing the memory space for global data will decrease the IEC program memory size. Each object, e.g. FFB instance, variable, step etc., takes up several bytes in the IEC program memory.
Since deleting unlocated variables does not free up more memory space automatically, we recommend making plans so as to have sufficient memory space.
The general recommendation is to set the value in such a way that 20-30% of the value entered in the Used text box will remain free.
NOTE: Changes can only be made offline and are only applied once the program has been loaded onto the PLC.
EFB Memory
The EFB memory is used by the user program that contains the EFB code. The latter must not be moved during the memory defragmentation process:
Memory information
Configured
Free
Meaning
The EFB memory size configured in the PLC Selection dialog box for PLC memory defragmentation is shown here.
Shows the available EFB memory.
Scan Time
The value displayed corresponds to the current scan time. With the first call, the I/O station is standardized so that a scan time of 0 ms/scan is shown. After initialization, the scan time is calculated as an average value.
NOTE: If you are using the simulator, the scan time is not shown. na means “not available”.
33002204 12/2010
669
Online functions
20.5
Loading a project
Overview
This chapter contains information about loading a project.
What's in this Section?
This section contains the following topics:
Topic
General information
Loading
Download Changes
Uploading the PLC
Upload Procedure
Page
670
33002204 12/2010
Online functions
General information
At a Glance
To carry out an online command a transfer has to be made to the PLC after setting up or changing sections. Otherwise a complete project can be transferred from the
PLC to the programming device. As soon as the user program is consistent on the programming device and the PLC, the EQUALS status is displayed in the status bar.
The status display MODIFIED identifies the program in which at least one section has been changed or where changes to the variable editor were performed. With command button Load changes...
the consistency between the programming device and the PLC is restored. Status display NOT EQUALS identifies a program in which critical changes were performed. Critical changes are for example changes to EFBs, DFBs or derived data types. With command button Load...
the consistency between the programming device and the PLC is restored.
Loading, loading changes and selecting are not possible in the animation mode.
With command button Select...
the following project areas can be selected from the z z z z z z
PLC:
Configuration
IEC sections
984 Ladder Logic sections
ASCII messages
State RAM z
Initial values
Extended memory
Process for loading
Loading the PLC can take place in two parts:
1.
The exportable code (machine code) is always loaded onto the PLC.
2.
The complete compressed user program is loaded onto the PLC
NOTE: The user program, consisting of user defined EFBs, DFBs, derived data types and the program (variables, sections, etc.), is only loaded onto the PLC if in dialog Options for generating codes ( Project → codes...
) check box contain IEC selection information was activated beforehand.
The option to also load the comments contained in the check box onto the PLC, thereby making them available as selection information, is available, as well.
During selection the entire user program can be transferred from the empty project to the programming device.
33002204 12/2010
671
Online functions
Loading
Introduction
With menu command Load...
the configuration, the entire user program (IEC or
LL984 sections) ASCII messages (only with Concept for Quantum) and the state
RAM with the initial values of a project can be sent to the PLC. This establishes consistency between the user program on the programming device and the PLC so the online functions are executable.
Loading single parts onto the PLC
Single parts to be loaded onto the PLC can be selected.
The following table contains the available options and their meaning:
Option to be loaded
Configuration
IEC Sections
984 Ladder Logic
ASCII messages
State RAM + Initial
Values
Only state RAM
Only initial values
Expanded memory
Meaning
This option sends the hardware configuration to the PLC.
Note: The Hardware Configuration can only be sent to the PLC when a corresponding access privilegehas been authorized. This option is not available with a Modbus Plus connection.
This option sends the code from all the sections created with an
IEC programming language (FBD, SFC, LD, IL, ST) to the PLC.
This option sends the code from all the sections created with an
LL984 programming language to the PLC.
This option sends ASCII messages for Ladder Logic to the PLC.
Note: This function is only available when using Concept for
Quantum.
With this option, at first all initial values of the Located 4x-
Variables are copied from the Variable Editor into the state RAM mirror (image). Then, the initial values and all blocked 0x- and 1x-
I/O bits from the state RAM mirror (Image) are loaded into the
PLC.
Note: While the PLC is running, all non-blocked 0x-variables are reset by the firmware in the PLC. Thus, values of 0x- and 1xvariables are only loaded if the variables are in blocked status.
With this option, the initial values of the Located 4x-variables and all blocked 0x and 1x I/O bits are loaded from the state RAM mirror (Image) into the PLC.
With this option, exclusively initial values of the Located 4x-
Variables are loaded from the Variable Editor into the state RAM.
This option assigns the PLC an extended memory allocation (6xreferences).
Note: This function is only available when using Concept for
Quantum.
672
33002204 12/2010
Online functions
Loading IEC selection information
To obtain a complete project when uploading from the PLC Options for code generation the check box Include IEC Upload Information must be activated in the dialog box before loading. If this check box is not activated only the executable code (machine code) is loaded onto the PLC.
If loading is not possible
There are several possibilities why loading is not possible: z An active screen saver can lead to loading errors. It is therefore recommended to deactivate the screen saver.
z If loading the program is not possible due to insufficient program data memory,
the memory size can be optimized.
Main structure of PLC Memory and optimization of memory, page 155
.
NOTE: If, while loading the program, a warning appears due to inconsistent DFB versions, use the menu command Project → .
33002204 12/2010
673
Online functions
Download Changes
Introduction
Download changes is always used if sections have been changed, added or deleted, whether online or offline, and the program is in MODIFIED state. In this way the changes are indicated and can be transferred to the PLC.
The changes are loaded into the PLC and the consistency between the user program on the programming device and the PLC is restored.
With changes that do not influence the logic of the program (e.g. renaming a step name, renaming a section, renaming a variable, graphic moving of a component, etc.), the state of the program between PLC and host computer will remain EQUAL and cannot be downloaded to the PLC using the Download changes function.
However, the changes will not be lost. They can be updated with the Download changes function during the change, which will result in the state of CHANGED. Or the entire project is downloaded to the PLC using the Online → function.
NOTE: However, if you wish to update your changes immediately, simulate a Modify code (e.g. delete and restore), so that the state of the program changes to
MODIFIED. Then carry out the Download changes function.
z z
If the changes cannot be downloaded because there is too little memory in the PLC, there are 2 possibilities for proceeding:
Sequential loading of modified sections
Optimize Project
NOTE: If, while loading the program, a warning appears due to inconsistent DFB versions, use the menu command Project → Synchronize nested DFB versions .
ID for specific sections
The following sections contain additional ID information as they are different from z z cyclically set sections:
E for " E vent Section" (I/O Event and Timer Event Section = Interrupt-Section)
T for " T ransition Section"
674
33002204 12/2010
Online functions
Sequential loading of modified/new sections
The user can download changed/new segments onto the PLC one after the other.
When segments are downloaded sequentially, the following points must be noted: z If the constants value has been changed, it is not possible to download the changed segments sequentially.
z z
All deleted IEC segments will be automatically deleted the first time the user downloads sequentially onto the PLC.
All initial values of new variables, all modified values of literals are automatically loaded onto the PLC on the first sequential loading.
z z
If new sections already contain used variables, the value of these variables remains.
When closing a project ensure that it is saved before loading changes onto the
PLC. Otherwise it might not be possible to continue the project after it is reopened with the remaining changes loaded, or there will be "newer" sections (previously loaded changes) on the PLC than on the programming device.
CAUTION
Risk of unwanted and dangerous process states
Loading sections sequentially on a running PLC can lead to unwanted and dangerous process states. It is therefore recommended to stop the PLC during sequential loading.
Failure to follow these instructions can result in injury or equipment damage.
Modified Initial values
Modified initial values are no longer loaded onto the PLC. The initial value during the first download ( Download...
/ Download changes...
) that was downloaded to the
PLC cannot be overwritten with the menu command Download changes...
. The initial values can however be changed in the Reference data editor.
Procedure for sequential loading
The procedure for downloading changes sequentially is as follows:
Step
1
2
3
4
5
Action
Stop the PLC with Online
→
Stop controller .
Select the segment(s) which must be downloaded from the list.
Confirm using OK .
Call the dialog box again and repeat the process until all modified/new sections are loaded onto the PLC and EQUAL mode is reached.
Start the PLC with Online
→
Start PLC .
33002204 12/2010
675
Online functions
Loading IEC upload information
If, in the Code generation options dialog, the check box Include IEC upload information is checked, IEC upload information is loaded onto the PLC with the
Download changes...
menu command.
Optimize the Project
It may be possible to eliminate existing gaps in the program data memory management of the PLC with the menu command Optimize project and enable loading again in this way. However, the PLC must be stopped and the complete program must be downloaded again. Furthermore, it may be necessary to adjust the size of program data memory, see Memory statistics
.
It is still possible to optimize use of the program data memory with the menu command Online → .
CAUTION
Modifications are only transferred when the program is loaded onto the PLC.
After optimizing the project or modifying the program data memory size the PLC must be stopped and the program loaded onto the PLC.
Failure to follow these instructions can result in injury or equipment damage.
676
33002204 12/2010
Online functions
Uploading the PLC
Introduction
With menu command Upload...
the configuration, the entire user program (IEC and/or LL984 sections), the ASCII messages and the state RAM with a project’s initial values can be transferred from the PLC to the host computer.
NOTE: Upload information (PLC configuration), which was generated by the
Software programs as Concept, is possibly erroneous. The upload is based on removing the memory, so that it is not always compatible with other software programs. Please use the Modsoft converter for transferring your Modsoft application to Concept.
Reading Individual Parts from the PLC
Individual parts to be loaded from the PLC to the host computer can be selected.
The following table contains the available options and their meaning:
Option to be loaded
Configuration
IEC sections
984 Ladder Logic
ASCII messages
Upload state RAM + update initial values
Meaning
This option sends the hardware configuration to the host computer.
Note: The hardware configuration can only be sent from the PLC when a relevant authorization is granted in the Access Rights.
This option is not available with a Modbus Plus connection.
This option transfers the revertive presentation information of all the sections created with an IEC programming language (FBD,
SFC, LD, IL, ST) to the host computer. In this process, however, no current signal values from variables and registers are loaded.
This option sends the revertive information from all the sections created with an LL984 programming language to the host computer.
This option transfers ASCII messages for Ladder Logic to the host computer.
Note: This function is only available when using Concept for
Quantum.
With this option, first all Located 0x-, 1x- and 4x-values are read from the SPS, and saved in the state RAM mirror (Image). Then, the initial values of the 4x-variables are overwritten with the value from the state RAM mirror (Image). With the upload process, the dialog box Upload initial values is then opened. With the command button Yes you confirm the overwriting of the initial value displayed with the new value.
Note: Uploaded state RAM values can be overwritten in the RDE by Online Operations. This behavior can be changed, however, in the CONCEPT.INI-file
.
33002204 12/2010
677
Online functions
Option to be loaded Meaning
Only update initial values With this option, the initial values of the Located 4x-Variables are overwritten by the Variable Editor with values from the state
RAM.
Only upload State RAM With this option, all Located 0x-, 1x- and 4x-values are read from the SPS, and saved in the state RAM mirror (Image). The initial values in the Variable Editor are not overwritten.
Expanded memory This option transfers the PLC’s available extended memory (6x references) into the configuration.
Note: This function is only available when using Concept for
Quantum.
678
33002204 12/2010
Online functions
Upload Procedure
Introduction
If the IEC upload information was being taken into account during loading into the
PLC ( Project → Code Generation Options → ), a new project containing the IEC upload information is generated in Concept during upload. In this way, the entire user program and user EFB libraries are always downloaded, i.e. individual sections, EFBs etc, cannot be selected for transfer.
NOTE: During loading ( Online → ) of the IEC upload information, additional memory is required so that this function should only be used, when you want to upload the project loaded into the PLC again.
Requirements
In order to carry out a PLC upload, an empty project must first be created.
There are several ways of doing this.
Selectio n
1
2
3
Action
You can create an empty project using the File → menu command.
Then execute the Online → menu command.
Result: The Upload to project dialog is opened. Here you can determine (e.g.
D:\NEW\TESTPRJ.PRJ) where the project will be uploaded to.
Note: You can select a different directory or even create a new directory so as not to come into conflict with existing projects. The preset project name corresponds to the project name downloaded in the PLC and does not necessarily have to be changed.
Using the File → menu command you can create a new project (e.g.
D:\NEW\TESTPRJ.PRJ) Then execute the Online → menu command.
Result: The Upload Controller dialog is opened.
There is no project open and you have established a connection with the PLC using the Online
→
menu command. Then execute the Online
→
Upload...
menu command.
Result: The Upload to project dialog is opened. Here you can determine (e.g.
D:\NEW\TESTPRJ.PRJ) where the project will be uploaded to.
Note: You can select a different directory or even create a new directory so as not to come into conflict with existing projects. The preset project name corresponds to the project name downloaded in the PLC and does not necessarily have to be changed.
33002204 12/2010
679
Online functions
Procedure
To upload loaded IEC information, proceed as follows:
Step
1
2
3
Action
Open a new project.
Note: If, during upload, there is a second project still open, it must be closed. In this case a query appears asking whether the project should be saved before it is closed and all changes are lost.
Establish a connection between the PLC and the programming unit ( Online →
Connect...
).
Start the upload procedure ( Online → ).
Result: A window appears in which you can determine the path for the project that is to be uploaded.
Double Designation
Conflicts with existing names can occur during the upload procedure.
Double designation is prevented for each program sequence as follows:
Program sequence process
User EFB library A query appears, which can interrupt uploading. If not, a query appears, asking whether the user EFB library should be overwritten, and whether a backup of the old EFB library should therefore be created.
DTY File (derived data types)
DFB library
A query appears, which can interrupt uploading. If not, the DTY file of the same name is automatically overwritten. No backup is made of the old file.
A query appears, which can interrupt uploading. If not, the DFB file of the same name is automatically overwritten. No backup is made of the old file.
680
33002204 12/2010
Online functions
20.6
Section animation
Overview
This chapter describes the basic principles for animating sections. The details can be found in the chapters on individual programming languages.
What's in this Section?
This section contains the following topics:
Topic
IEC-Sections animation
LL984 Programming Modes
Page
33002204 12/2010
681
Online functions
IEC-Sections animation
At a Glance
IEC sections can be animated, i.e. the program’s current states in the PLC /simulator will be displayed.
Animation is possible with both a running and a stationary PLC. Display data is automatically refreshed when the PLC is running. The static state of the program on the PLC is displayed when the PLC is stationary.
Load and Load changes is not possible in animations mode. Should these commands be executed, animation will be stopped automatically.
Requirements for animation
Requirements for animation z The section to be animated in the programming device and the section loaded onto the PLC must be consitent. Otherwise, establish consistency using Online
Load...
(if mode UNEQUAL ) or Online Load changes...
(if mode
MODIFIED ).
z
Note: Even when the program mode is MODIFIED , the sections that have not been changed can be animated. The mode displayed in the footer refers to the program and not to the currently displayed program.
To animate, the programming device and the PLC must be online. Otherwise, establish the link using Online → .
Active animation display z z
The active animations mode is indicated: z by a check mark before the menu command, in the ANIMATED box on the status bar, by a depressed animations button on the symbol bar and by the gray window background.
Animating more than one section
If several sections are animated, an animated section is updated in each cycle. This means that the more animations are active, the "older" the values of the individual animations. Additionally, the animation increases the load on the PLC cycle. For this reason, animations that are no longer necessary should be terminated. This also applies to the animation of many variables or very large derived data types.
NOTE: When coupling using Modbus Plus, it is recommended that no more than 10 sections should be animated at one time.
NOTE: When coupling using Modbus, it is recommended that no more than 5 sections should be animated at one time.
682
33002204 12/2010
Online functions
Animating a disabled section
If a disabled section is animated, the state INHIBITED is displayed in the status bar.
Animation of a transition section
If the animated section is used as a transition section for the sequential control
(SFC), and the transition (and therefore also the transition section) is not processed, the status INHIBITED appears in the transition section.
Changing a animated section into a symbol
If an animated section is changed into a symbol, the animation with the most current values stops, and then restarts automatically once the section is called.
33002204 12/2010
683
Online functions
LL984 Programming Modes
Direct Programming
There are two situations that determine how direct mode ladder editing is applied.
The first is where there is no open project and you are connected to a PLC that has a valid program in it. When you select the command Direct Mode LL Editor the first program in the first segment is displayed. You can see the direct mode status at the right side of the status bar and the network window is labled 984 LL Direct .
The second case occurs when you have a project open and you are connected to the PLC (but not EQUAL ). When you select Direct Mode LL Editor in this case a dialog is displayed listing segments and the number of networks contained in each.
Click on the segment you want click on OK and the network edit window is displayed with a window labeled 984 LL Direct . If you have an orignal edit window it will remain on the display.
Combination Mode
Combination programming occurs when the programming panel is online. Valid program changes are immediately written to both the controller and the program database simultaneously.
684
33002204 12/2010
Online functions
20.7
Online Diagnosis
Diagnostics Viewer
Introduction
Using the diagnostics viewer in Concept ( Online → ) it is possible to view the content of the PLC diagnostics error buffer.
Selection Condition
The diagnostics viewer is only available if the PLC is in online mode and the EQUAL status has been created between the PLC and host computer.
The diagnostics viewer only works with the SFC, FBD and LD programming languages and with the diagnostics blocks of the EXTENDED group.
Conditions of the Diagnostics Viewer
To activate diagnostics, a supervision time must first be set for the step (Transition diagnostics) or the diagnostics block (Reaction diagnostics). In addition, in the Code generation options dialog ( Project → ), the Include diagnosis information check box must be checked. As a result memory space is prepared on the PLC (max. 64 diagnostics entries) for the diagnostics error buffer.
Behavior of the error buffer
A maximum of 64 events (errors) and a maximum 20 signals per event are read. If the diagnostics error buffer overflows all further signals (21 onwards) are lost. The next event (error) coming is only entered once an event (error) which has gone has been acknowledged in the error buffer.
A diagnostics error buffer overflow is displayed in the dialog status line.
NOTE: A maximum of 16 events (errors) can be scheduled within one SFC section.
All further errors (17 onwards) are lost. The next event (error) is only entered once a past event (error) has been acknowledged in the error buffer.
Transition Diagnosis
Information on this can be found in the Transition diagnosis, page 319 section.
Reaction diagnosis
Information on this can be found in the "Diagnostics Block Library" handbook.
33002204 12/2010
685
Online functions
Diagnostics viewer
After analysis, the events (errors) and the analyzed signals are written in the buffer and displayed in the diagnostics viewer in Concept. z z
The following specific information is contained in transition diagnostics: z Denotes the transition preventing the active step from being executed to the next step.
Denotes the TRANS type for transition in a PLC section z
Denotes the active step, which is not executed.
If this is a transition section in the named transition, the analyzed signals are also listed.
z z z
The following specific information is contained in reaction diagnostics: z Denotes the diagnostics block preventing a reaction from being triggered due to incorrect signals.
Denotes type ACT, PRE, GRP, LOCK, REA for diagnostics blocks
Diagnostics block drop number
The analyzed signals are listed.
686
33002204 12/2010
Online functions
20.8
Logging Write Access to the PLC
Logging and Encrypted Logging
Introduction z z z z z z z z
Logging the write access to the PLC can record the following data among others:
Section name
EFB/DFB Instance name, FB type name
Pin-Name
[variable name] [literal] [address]
Old value
New value
User name (if the Concept (Login) password is activated in Concept Security)
Date and Time (see also Address format in LOG file [Logging], page 1116
) z z z
The following logging can be carried out during log-on:
Modification of the user rights
Deleted user
Aborted log-on
Besides the log which can be read in the *.LOG file, an encrypted log can be created in an *.ENC file. The file name is made up of the current date, e.g. 20020723.LOG or 20020723.ENC.
Encrypting the protocol file is done to protect the file contents from being changed.
The view tool is only provided so that the user can read the log file. Saving the file in another readable format is not possible. Editing the file so that it is not recognizable is impossible since the ASCII file only displays unrecognizable characters.
NOTE: Log files are not archived by Concept and no backup files are created.
Log *.LOG
Logging is activated in Concept using the Options
→
Preferences
→
Common...
→
Common preferences with the File option dialog box. Use the text box Directory for Log-File: to define a new path for the log file (e.g. 20020723.LOG).
33002204 12/2010
687
Online functions
Dialog Common Preferences :
The current logfile can be viewed in Concept with menu command File →
Logfile .
Encrypted Logfiles *.ENC
In addition, any repetitive strings are displayed in separate encrypted strings in the logfile.
In Concept, the encryption can be activated with two different settings: z With menu command Options
→
Preferences
→
Common
→
Preferences and the activation of the check box Encypt Logfile .
z
Note: The check box is only available if no project is open.
Indirectly with the menu command Project → and the activation of the check box Secure Application .
Note: This dialog box is only available in offline mode.
688
33002204 12/2010
Dialog Project Properties :
Online functions
View Tool
If the encryption is activated after an unencrypted logfile (*.LOG) has been created, then a second encrypted logfile (*.ENC) is created. The storage location for the
*.ENC file is defined in the Common Preferences ( Directory for Log-File: ) dialog box.
NOTE: Supervisor rights are required for activating the encrypted logging procedure.
The View tool can be used for reading encrypted logfiles. Editing and saving so that the file can be read normally is not possible but the logfile can be printed. Supervisor rights are required in this case as well. With menu command File → the View tool is opened automatically if encryption has been activated for the current log.
z z
The logfile is stamped with an electronic signature and the following tests are performed:
The logfile is created by Concept.
The logfile is not a counterfeit.
33002204 12/2010
689
Online functions
690
33002204 12/2010
Import/Export
33002204 12/2010
Import/Export
21
Overview
This chapter describes the various import and export options for sections, variables and PLC configurations.
What's in this Chapter?
This chapter contains the following sections:
Section
21.1
21.2
21.3
21.4
21.5
21.6
Topic
General Information about Import/Export
Exporting sections
Exporting variables and derived data types
Section import
Variables import
Import/Export of PLC Configuration
Page
691
33002204 12/2010
Import/Export
21.1
General Information about Import/Export
General Information about Import/Export
Export functions
The following export options are available:
Program
Concept
Concept DFB
Concept
Concept
Concept
Converter
Path
File
→
Export files z z z z z z
Sections from a source project and import into a target project
Sections from a source DFB and import into a target DFB
Sections from a source DFB and import into a target project
Sections from a source project and import into a target DFB
FBD, SFC and LD sections into IL or ST files
Variable declarations into an ASCII file
(Concept only)
PLC configuration (Concept only) z
Edit
→ z Contents of IL or ST sections into an ASCII file z Definitions of Derived data types from the
Data type editor
File
→
File
→ →
Configuration
Relevant project files (compressed)
PLC Configuration
692
33002204 12/2010
Import/Export
Import functions
The following import options are available:
Program
Concept
Concept DFB
Path
File →
Concept
Concept
Concept
Converter
Edit →
File →
File →
Import files z z z z z
Exported sections from a source project or source DFB
Exported or externally created IL/ST files into IL/ST sections
Exported or externally created IL/ST files into FBD/SFC sections (with conversion)
Variable declarations from an ASCII file
(Concept only)
PLC configuration exported with Concept
(Concept only) z z
Contents of ASCII files IL or ST sections
Definitions of Derived data types into the
Data type editor
Relevant project files (decompressed)
PLC Configuration
33002204 12/2010
693
Import/Export
21.2
Exporting sections
Exporting Sections
Introduction
In Concept it is possible to export projects or DFBs selectively from a source project/source DFB, and if desired, to then import them immediately into the current target project.
Requirements
The project from which the export is to take place must be stable (check using
Project → Analyze Program ).
NOTE: When exporting IL and ST sections, ensure that the settings for nested comments ( Options
→
Preferences
→
IEC Extensions
→ comments ) are identical in the source and target projects.
Export range z z
The following are exported: z the selected sections with their accompanying variables, DFBs, EFBs and data types.
In the case of SFC, the accompanying transition sections are also exported.
The PLC configuration is not exported.
Exporting more than one section
When more than one section is exported, a "pseudo SFC" is generated to maintain the execution order. To do this, the following code is generated:
INITIAL_STEP SECTION_SCHEDULER:
Section1 (N);
Section2 (N);
:
SectionN (N);
END_STEP
Exporting FBD, SFC and LD Sections
Using File → Export → Program: IEC Text FBD, SFC and LD sections can be exported to IL and ST. The text languages of both export files follow the grammar of
IEC text languages, shown in IEC 1131-3 and in the process tables 52 - 56 of IEC
1131-3.
694
33002204 12/2010
Import/Export
The exported code is displayed in a PROGRAM … END_PROGRAM or
FUNCTION_BLOCK ... END_FUNCTION_BLOCK frame and contains all project or
DFB variables in a VAR ... END_VAR frame at the start of the file.
If more than one section is being exported, the code separation is expressed as an artificial PLC frame, which is not a component of the original program. It only has one INITIAL_STEP for all sections linked to it as actions (with the identifier N). These actions (sections) are executed every time the step is active, which is always the case. The actions follow as sections, which do not have variable declarations.
The artificial INITIAL_STEP has the name SECTION_SCHEDULER. It displays the execution order as it was specified in the section execution order dialog box. The artificial SFC frame is left out when re-importing in Concept. The criterion for this omission is the specific name SECTION_SCHEDULER.
The ASCII file can be re-imported into a FBD or SFC section using the IEC text import. Using exports and imports it is possible, for example, to convert a LD section into a FBD section. Importing into a LD section is not possible.
If the EN and ENO optional imports/exports have been used in the FBD/LD sections, they are ignored when exporting to IL/ST.
FBD section logic before export:
FBD section logic after import:
33002204 12/2010
The LD elements "N.C. contact" and "N.O. contact" are converted to AND and
ANDNOT.
The ASCII file can, however, also be imported into an IL or ST section using the
Insert Text File function. In this case, however, manual correction of the files is necessary, since the extensions described above must be removed again from the file.
695
Import/Export
SFC Export Limitations z z z z
The following limitations should be noted when using SFC import:
Only variables are permitted as actions. Direct addresses cannot be exported.
Only literals are allowed as time variables for identifiers. Variables are converted to literals with the value 0.
Transition section names are changed to standard names.
Step monitoring times and step delay times are lost when exporting.
Exporting IL and ST Sections
Using Process → it is possible to export the contents of IL or ST sections into an ASCII file.
This export function is a simple text export function, which can also be performed via the clipboard (cut/copy/paste). Data conversion does not take place. For this reason, the required variable declarations, for example, are not exported with the section contents. If the ASCII files are to be converted to an FBD or SFC section using File → Import → , all information necessary for the project
(e.g. program frame, section name (see also
Importing (insert file) IL and ST programs into IL or ST sections, page 712
manually.
696
33002204 12/2010
21.3
Import/Export
Exporting variables and derived data types
Exporting variables and Derived Data Types
Exporting variables in "Text delimited" format
Using File Export Variables: Text delimited a project’s variables can be
exported into a ASCII file in text delimited format (refer to Importing Variables in
"Text Delimited" Format, page 717
and
Importing structured variables, page 720
).
The ASCII file can be re-imported into a Concept project with the help of the
importing text delimited (refer to Importing Variables in "Text Delimited" Format, page 717
).
Exporting variables for Factory Link
Using File Export Variables: Factory Link a project’s variable declarations can be exported into a ASCII file in "Factory Link" format.
If your Factory Link version of Concept is not supported, please call our hotline.
The ASCII file can be re-imported into a Concept project with the help of Factory Link import
.
Exporting variables for Modlink
Using File Export Variables: Modlink a Modlink configuration file can be generated, which can be used directly in Modlink.
The Modlink configuration file contains all those Located variables, which are selected to be exported in the Variable Editor.
If no Located variables are selected to be exported, an error message appears and a configuration file will not be generated.
Related information about Modlink is found in Modicon ModLink, User Guide .
Exporting Derived Data Types
In the data type editor, using Process
→
definitions of Derived
Data Types can be exported to a ASCII file.
33002204 12/2010
697
Import/Export
21.4
Section import
Overview
This section describes the import of sections.
What's in this Section?
This section contains the following topics:
Topic
Importing Sections
Procedure for importing sections
Importing IL and ST Programs to FBD, SFC, IL or ST Sections (with
Conversion)
Importing (insert file) IL and ST programs into IL or ST sections
Procedure for "Copying" an IL section from an existing project into a new project.
Procedure for converting FBD sections from an existing project into IL sections of a new project.
Page
698
33002204 12/2010
Import/Export
Importing Sections
Introduction
In Concept, the possibility exists to export individual sections selectively from a source project or source DFB, and if desired, to then import them immediately into the current target project or DFB: z Section export from source project, followed by section import into the target project z
This transfers section information, including transition sections at SFC, all used global and local DFBs used, as well as all the variable declarations used.
Data types defined in data type files are not transferred, (refer to notes).
Section export from source DFB, followed by section import into the target DFB z
This transfers section information, all global and local DFBs used as well as all declarations of variables, inputs and outputs used.
Data types defined in data type files are not transferred, (refer to notes).
Section export from source project, followed by section import into the target DFB
This transfers section information, all global and local DFBs used as well as all used declarations of unlocated variables.
Direct address and Located variable declarations must be deleted before export, since they are not authorized in a DFB. Data types defined in data type files are z not transferred, (refer to notes).
Section export from source DFB, followed by section import into the target project
This transfers section information, all global and local DFBs used as well as all declarations of variables used.
Declarations of inputs/outputs in this DFB must be deleted before export, since they are not authorized in a Concept project. Data types defined in data type files are not transferred, (refer to notes).
Notes z z
Attention should be paid to the following notes:
The imported sections will be inserted at the end of existing sections.
The PLC configuration is not automatically imported. Instead, it must be imported explicitly (refer to
Import/Export of PLC Configuration using Concept, page 727
.
z If projects with different local data structures are being imported (different DTY files in the local DFB directories), they must be brought together in an individual
DTY file before import. This common file must then be saved in the local DFB directories for source and target projects. Afterwards, open these files to make z them known to the individual projects.
Ensure during import of IL and ST sections that the settings for nested comments
( Options → Preferences → IEC extensions → Nested comments authorised ) are identical in the source and target projects.
33002204 12/2010
699
Import/Export
Checking the Sections to be Imported z z z z z z
Before the import actually takes place, a check of the following takes place: identical project environment (DFBs, EFBs, definition of Derived Data Types) existing sections existing SFC sections (not authorized in Concept DFB) existing step names
Declarations of inputs/outputs (not authorized in Concept projects)
Declarations of direct addresses (not authorized in Concept DFB)
If an error is identified, the import is canceled.
z z z
Errors that occur subsequently are "irreparable" and will cause the project to close
(i.e. all changes made since the last save are lost). Possible errors are:
Name collisions between variables with different data types
Name collisions between item names other errors
Name collisions between variables with different initial values or direct addresses
(located variable) cause a warning. The value of the target project is retained.
Automatic adjustment of standard preset names z z
An automatic adjustment of standard preset names occurs in the case of: z Standard generated names, such as SFC step names (S_x_y) and transition section names (TransSection_x_y)
Standard generated item names (FBI_x_y)
Position of new DFB inputs/outputs (only with import into Concept DFB)
Specific Changes
During import there are also the following possibilities for performing specific changes, in order to adjust the sections that are to be imported specifically to the target project / target DFB.
z Replacing names (variable names, section names, item names, names in text z languages, comments, etc)
Address offset for located variables and direct addresses in graphic languages
(e.g. %3:10 -> %3:20) and text languages (%QW10 -> %QW20) z z z z
The following points are excluded from the replace function:
DFB names
Index of ARRAYs (e.g. a[1])
Elements from multi-element variables (e.g. a.dummy)
In the case of EFBs, the replace function is only used for non-automatically generated names (i.e. Instance names)
700
33002204 12/2010
Import/Export
Syntax for replacing names and address offset (address shift) z z z
The following syntax applies when replacing names: z Only entire names will be searched. If parts of names are to be replaced, z wildcards must be used.
The "?" character is permitted as a wildcard. It is used to represent one character exactly. If more than one character is to be ignored, a corresponding number of
"?" must be used. The "?" character is only permitted at the start of the name.
z The "*" character is permitted as a wildcard. It is used to represent any number of characters. The "*"character is only permitted in the character string that is to be searched for.
Wildcards are only permitted in the search character string.
z
There are no case distinctions.
The section name, which is to be used as a replacement, must conform to IEC name conventions, otherwise an error message occurs.
In accordance with IEC1131-3, only letters are permitted as the first character of z item names. Should figures be required as the first character, however, the menu command Options → Preferences → IEC extensions... → in identifiers .
The specified value for the address offset is added to the corresponding address z zone for located variables and direct addresses.
The offset value is given in decimal format by default. If it is given in hexadecimal format, this can be marked as such with the prefix "16#" in front of the actual offset value (e.g. 16#100).
NOTE: Replacing names has an effect on all variables, instance names and comments. Using wildcards runs the risk of replacing names that also happen incidentally to contain the same character string that is being searched. This would normally lead to a cancellation.
Examples of search and replace:
Replaces:
Name1
???123
Name1*
By:
Name2
456
Name2 available names
Name1
Name1A
NameA
NameB abc123 cde123 abcd123 abc1234
Name1A
XName1B
NameAB
Result
Name2
Name1A
NameA
NameB abc456 cde456 abcd123 abc1234
Name2A
XName1B
NameAB
33002204 12/2010
701
Import/Export
Replaces:
*123
*123*
???123*
By:
456
456
456 available names abc123 cde123 abcde123 abd123a abc123abc cde123defghi abcde123def abc123abc cde123defghi abcde123def
Result abc456 cde456 abcde456 abd123a abc456abc cde456defghi abcde456def abc456abc cde456defghi abcde123def
Syntax for Creating the Replace List with an External Editor
When creating the replace list using an external editor, the following syntax should also be noted: z The replace-by string (previous name-new name) must be separated by a z comma (e.g. name1,name2).
The replace list is processed line by line. Individual replace instructions must be z separated by a line break.
The instructions for the address offset have the following structure: z z z to add an address offset:
<reg0>,www
<reg1>,xxx
<reg3>,yyy
<reg4>,zzz to subtract an address offset:
<reg0>,-www
<reg1>,-xxx
<reg3>,-yyy
<reg4>,-zzz
Likewise, the value can be given in hexadecimal form, e.g.:
<reg1>,16#xxx
702
33002204 12/2010
Import/Export
Procedure for importing sections
At a Glance
In principle, sections must firstly be exported from the source project /DFB into an export file (*.sec) and then be imported by the target project/DFB. Exporting and importing from project to project or from DFB to DFB can take place in shared or in separate sessions. Exporting and importing from projects into DFBs or from DFBs into projects must take place in separate sessions.
Section export and section import
To section export a source project and then section import into a target project, the following procedure should be performed:
Step
1
2
3
4
5
6
7
8
Action
Open the target project in Concept.
Call File → Program: section(s) .
In the window Open file select the source project, e.g.
C:\SOURCE_DIR\SOURCE.PRJ
Select the sections to be exported from the source project.
In Save section export under , specify the name of the export file (*.SEC), e.g.
C:\TARGET_DIR\TARGET.SEC
Reaction: The sections are exported and saved in the *.SEC file, e.g. in
TARGET.SEC.
The question Import section into project now ?
follows
If the question as to whether the sections should be imported is answered with
OK , the import will be performed now.
Answer Cancel , if you want to start the mport later, see also procedure
Resuming following canceled import
.
Answer the question as to whether the project should be saved first with OK .
Note: The query Save project first ?
should be answered with OK , because, in the event of an import error, the current project is closed and all changes since the last save are rejected.
If it is required or necessary, it is possible in the table Replace , to make replacements for item names of variables, sections etc., as well as to define address offsets for located variables and direct addresses (refer to
).
33002204 12/2010
703
Import/Export
Step
9
10
Action
Select OK to continue (the whole import process is canceled if Cancel is selected).
Reaction: Sections, used DFBs, used derived data types and the declarations for used variables, including comments, are imported into the target project.
The import is canceled and the current project closed, if z the sections to be imported contain DFBs that are not available in the target z z project.
the sections to be imported contain DFBs whose versions differ from already available DFBs. (The imported DFB version can be accepted or rejected.) other errors arise during import.
Errors are displayed in the messages window and have to be acknowledged.
If the import had been canceled, eliminate the cause of the cancelation and carry out the Resuming after import cancelation
procedure.
DFB export and DFB import
To section export a source DFB and to then section import into a target DFB, carry out the following procedure:
Step
1
2
3
4
5
6
7
8
Action
Open the target DFB in Concept DFB.
Call File Export Program: section(s) .
In the window Open file select the source DFB, e.g.
C:\SOURCE_DIR\SOURCE.DFB
Select the sections to export from the source DFB.
In Save section export under specify the name of the export file (*.SEC), e.g.
C:\TARGET_DIR\DFB\TARGET.SEC
Reaction: The sections are exported and saved in the *.SEC file, e.g. in
TARGET.SEC.
The question Import section into project now?
is now displayed.
If this question is answered with OK , the import is performed now.
If the answer given is Cancel , the import is started later, refer to Resuming after import break
procedure.
Respond to the question as to whether the project should first be saved with OK .
Note: The query Save project first ?
should be answered with OK , because, in the event of an import error, the current project is closed and all changes since the last save are rejected.
If required or necessary, it is possible in the table Replace , to replace item names of variables, sections etc., as well as to define address offsets for located variables and direct addresses (refer to
704
33002204 12/2010
Import/Export
Step
9
10
Action
Select OK to continue (the whole import process is canceled if Cancel is selected).
Reaction: Sections, used DFBs, used derived data types and the declarations for used variables, outputs and inputs are imported into the target project.
The import is canceled and the current DFB closed, if z the sections to be imported contain DFBs that are not available in the target z z
DFB.
the sections to be imported contain DFBs whose versions differ from already available DFBs. (The imported DFB version can be transferred or rejected.) other errors arise during import.
Errors are displayed in the messages window and have to be acknowledged.
If the import had been canceled, eliminate the cause of the cancel and carry out the Resuming after import cancelation
procedure.
Section export and DFB import
To section export a source project and to then section import into a target DFB, carry out the following procedure:
Step
1
10
11
12
7
8
9
5
6
2
3
4
Action
In Concept, delete all declarations of direct addresses and located variables in the sections to be exported. (They are not authorized in a DFB.)
Open the source project in Concept.
Call File → Program: section(s) .
In the window Open file select the source project, e.g.
C:\SOURCE_DIR\SOURCE.DFB
Select the sections to be exported from the source project.
In Save section export under specify the name of the export file (*.SEC), e.g.
C:\TARGET_DIR\TARGET.SEC
Reaction: The sections are exported and saved in the file *.SEC, e.g. in
TARGET.SEC.
The question Import section into project now?
is now displayed.
Answer the question as to whether the sections should be imported with Cancel .
Close Concept.
Open Concept DFB and the target DFB.
Execute the menu command File
→
Program: section(s) .
Select the export file (e.g. TARGET.SEC)
Respond to the question as to whether the project should firstly be saved with
OK .
Note: The question Save project first ?
should be answered with OK , because in the event of an import error, the current project is closed and all changes made since the last save are rejected.
33002204 12/2010
705
Import/Export
Step
13
14
15
Action
If required or necessary, in the table Replace , it is possible to replace item names of variables, sections etc., as well as to define address offsets for located variables and direct addresses (refer to
Select OK to continue (the whole import process is canceled if Cancel is selected).
Reaction: Sections, DFBs used, derived data types used and the declarations of used variables, inputs and outputs are imported into the target DFB.
The import is canceled and the current DFB closed, if z the sections to be imported contain DFBs that are not available in the target z z
DFB.
the sections to be imported contain DFBs whose versions differ from those of
DFBs already available. (The imported DFB version can be transferred or rejected).
other errors arise during import.
Errors are displayed in the messages window and have to be acknowledged.
If the import had been canceled, eliminate the cause of the cancel and carry out the Resuming after import cancelation
procedure.
DFB export and section import
To section export a source DFB and to then section import into a target project, carry out the following procedure:
Step
1
10
11
8
9
2
3
4
5
6
7
Action
Delete the input/output declarations in the DFB to be exported before exporting into Concept DFB, as these are not authorized in Concept projects.)
Open the source DFB in Concept DFB.
Call File Export Program: section(s) .
In the window Open file select the source DFB, e.g.
C:\SOURCE_DIR\DFB\SOURCE.DFB
Select the sections to export from the source DFB.
In Save section export under specify the name of the export file (*.SEC), e.g.
C:\TARGET_DIR\TARGET.SEC
Reaction: The sections are exported and saved in the file *.SEC, e.g. in
TARGET.SEC.
The question Import section into project now?
is now displayed.
Respond to the question as to whether the sections should be imported with
Cancel .
Close Concept DFB.
Open Concept and the target project.
Execute the menu command File Import Program: section(s) .
Select the export file (e.g. TARGET.SEC).
706
33002204 12/2010
33002204 12/2010
Step
12
13
14
15
Import/Export
Action
Respond to the question as to whether the project should firstly be saved with
OK .
Note: The question Save project first ?
should be answered with OK , because in the event of an import error, the current project is closed and all changes made since the last save are rejected.
If required or necessary, it is possible in the table Replace , to replace item names of variables, sections etc., as well as to define address offsets for located variables and direct addresses (refer to
Select OK to continue (the entire import process is canceled if Cancel is selected).
Reaction: Sections, DFBs used, derived data types used and the declarations of variables used, incl. comments, are imported into the target project.
The import is canceled and the current project closed, if z the sections to be imported contain DFBs that are not available in the target z z project.
the sections to be imported contain DFBs whose versions differ from those of
DFBs already available. (The imported DFB version can be transferred or rejected.) other errors arise during import.
Errors are displayed in the messages window and have to be acknowledged.
If the import had been canceled, eliminate the cause of the cancel and carry out the Resuming after import cancelation
procedure.
707
Import/Export
Resuming after import cancelation
To resume after an import cancelation, carry out the following procedure:
Step
1
2
3
4
5
6
Action
Open the target project/target DFB again.
Execute the menu command File Import Program: section(s) .
Select the export file (e.g. TARGET.SEC).
Answer the question Back up project?: with Yes .
Note: The question Back up project?
should be answered with Yes , because in the event of an import error, the current project is closed and all changes made since the last save are rejected.
If required or necessary, it is possible in the table Replace , to replace item names of variables, sections etc., as well as to define address offsets for located variables and direct addresses (refer to
Select OK to continue (the whole import process is canceled if Cancel is selected).
Reaction: Sections, DFBs used, derived data types used and the declarations of variables used, incl. comments, are imported into the target project.
The import is canceled and the current project closed, if z the sections to be imported contain DFBs that are not available in the target project/target DFB.
z the sections to be imported contain DFBs whose versions differ from those of
DFBs already available. (The imported DFB version can be transferred or rejected.) z other errors arise during import.
Errors are displayed in the messages window and have to be acknowledged.
708
33002204 12/2010
Import/Export
Importing IL and ST Programs to FBD, SFC, IL or ST Sections (with Conversion)
Introduction
Using File Import Program: IEC text ASCII files with IL or ST programs can be imported to FBD, SFC, IL or ST sections. ST and IL are able to have SFC elements (when imported into SFC section). Both text languages must adhere to the grammar of IEC text languages, shown in IEC 1131-3 and in the process tables 52
56 of IEC 1131-3.
Import units
The minimum import unit is a program organization unit (POU) to IEC (PROGRAM
END_PROGRAM; FUNCTION_BLOCK ... END_FUNCTION_BLOCK).
The ASCII file can contain several POUs in Concept. From one POU, one or more sections bearing the same name as the POU arise, which is provided with a current number. A new section will be begun if too little graphic space is available to store the logic. FUNCTION_BLOCK ... END_FUNCTION_BLOCK-POUs are imported as
DFBs.
In Concept DFB, the ASCII file can only contain a single POU. From this POU
(FUNCTION_BLOCK END_FUNCTION_BLOCK) one section arises.
Inserting POUs:
Type of POU Import into open project Import into open DFB
PROGRAM ... END_PROGRAM as a section into the current project.
not possible
FUNCTION_BLOCK
...END_FUNCTION_BLOCK
as project DFB.
More than one POU can be imported at the same time.
FUNCTION ... END_FUNCTION is changed as DFB. The function name becomes the DFB output as a section into the current DFB. Only one
POU can be imported.
is changed as DFB. The function name becomes the DFB output.
Behavior in the Event of Error
In this case, sections are only stored if the ST/IL text is syntactically perfect. POUs that cannot be reproduced are ignored completely, and an error message is displayed in the message window.
NOTE: If the file to be imported contains more than 200 declarations (declarations of variables and FFBs, a program error is caused. If this is the case, the declarations should be divided amongst several VAR...END_VAR blocks.
33002204 12/2010
709
Import/Export
Variables
The variables declared in POUs appear after the import in the Variable Editor
(exceptions: SFCSTEP_STATE and SECT_CTRL type variables).
EFBs with extended parameter set
EFBs with extended parameter set (PRE_DIA, GRP_DIA, LOOKUP_TABLE, ..) are only supported up to the predefined number of inputs/outputs.
"Bracket function" with extended number of inputs
If calls from a "bracket function" with extended number of inputs, such as
MUX_INT() are imported then all instances of this function work with the maximum number of inputs that occur.
Changing from IL/ST to FBD z z
The following restrictions occur when changing to FBD:
The following restrictions occur when changing to FBD:
Block items can only be called once z only assignments and block calls z z z z z z but none:
RET (table 52, property 20)
ELSIF (table 56, property 4)
ELSIF (table 56, property 4)
CASE (table 56, property 5)
FOR (table 56, property 6) z
REPEAT (table 56, property 8)
EXIT (table 56, property 9) z IF not nesting (IEC 1131-3 table 56, property 4)
Changing from IL/ST to SFC z z z z
The following limitations should be noted when making a SFC import from a text file:
Only variables are permitted as actions. Direct addresses cannot be imported.
Only literals are allowed as time variables for identifiers.
Transition section names are changed to standard names.
Step monitoring times and step delay times are lost when importing.
The following additional restrictions occur when changing to SFC (table = IEC 1131z z
3-table): z Transitions conditions are stored in special FBD sections (TC_secname) (table
41, property 7a ,7c, 7d). The textual import of transition conditions is not possible.
Actions are converted into FBD sections and not linked to steps.
no identifier SD and SL (table 45, property 8, 10), they are imported as MOVE.
710
33002204 12/2010
Import/Export z z
Structure components and directly addressed variables are allowed as SFC actions. This can be seen as an extension of the IEC 1131-3 standard. ST and IL exports support neither.
Using step variables ’step.X’ , ’step.T’ cannot be imported or exported and must be generated again.
Changing from IL/ST to ST or IL
The following restrictions apply when changing to ST or IL, that were not created in
Concept.
z FB, DFB and direct address declarations occur at the start of the section
(VAREND_VAR) z z the source formatting (indents, comments etc) applied only to the "logic part" of the sections, i.e. no comments for declarations (VAREND_VAR), for example
Function Block counters must be made consistent, e.g. CTU must be changed to
CTU_INT z z z z z z z z z z z no Keywords
TYPE_...END_TYP
VAR_INPUT...END_VAR
VAR_OUTPUT...END_VAR
VAR_IN_OUT...END_VAR
VAR_EXTERNAL...END_VAR
FUNCTION...END_FUNCTION
FUNCTION_BLOCK...END_FUNCTIONBLOCK
PROGRAM...END_PROGRAM
STEP...END_STEP
z
TRANSITION...END_TRANSITION
ACTION...END_ACTION
z z no RETURN instruction (ST Editor) no RET instruction (IL Editor)
Changing to Variable Declarations z z
When importing variable declarations the following restrictions occur:
No comments are imported.
VAR_CONSTANT is imported as located variable.
(VAR_CONSTANT i : INT := 10;
END_VAR becomes located variable "I" with the initial value of "10") z z
VAR_INPUT and VAR_OUTPUT definitions are imported into the programs as located variables (VAR).
VAR_INPUT and VAR_OUTPUT definitions are imported into DFBs as input/output variables (VAR_INPUT, VAR_OUTPUT).
33002204 12/2010
711
Import/Export
Importing (insert file) IL and ST programs into IL or ST sections
At a Glance
Using Edit → Insert text file...
it is possible to import ASCII files with IL or ST programs to IL or ST sections.
This import function is a pure text import function, which can also be performed via the clipboard (cut/copy/paste). Data conversion does not take place. For this reason, the necessary variable declarations for example (also if these are contained in the ASCII file) are not automatically integrated into the Variable Editor. The necessary variable declarations must be imported explicitly via File → from a "variables file", or be newly created. If variable declarations are contained in the section, they must be deleted, since they generate errors in the code generation of the section. Apart from this, all information for the POU must be deleted from the program (e.g. from the export of a graphic section using File Export Program:
IEC text ).
Restrictions
When importing IL and ST programs the following restrictions occur: z no keywords z z z z z z z z z z z
TYPE_...END_TYP
VAR_INPUT...END_VAR
VAR_OUTPUT...END_VAR
VAR_IN_OUT...END_VAR
VAR_EXTERNAL...END_VAR
FUNCTION...END_FUNCTION
FUNCTION_BLOCK...END_FUNCTIONBLOCK
PROGRAM...END_PROGRAM
STEP...END_STEP
TRANSITION...END_TRANSITION
ACTION...END_ACTION
z z z z z
VAR...END_VAR only for Function Block declarations and DFBs only at the start of the section for all Function Blocks and DFBs in the section not for variable declarations apart from this, for making direct addresses consistent: VAR %Q10:INT;
END_VAR z z no RETURN instruction (ST Editor) no RET instruction (IL Editor)
712
33002204 12/2010
Import/Export
Procedure for "Copying" an IL section from an existing project into a new project.
Procedure
To "copy" an IL section from an existing project into an IL section of a new project, perform the following steps:
Step
1
2
3
9
10
7
8
11
12
4
5
6
13
Action
Open the IL section to be exported.
Using Edit
→
from the menu.
Select a directory for the export file and give it a name. Confirm with OK .
Reaction: The IL section contents are copied into a new ASCII file.
Execute the menu command File
→
Variables: Text delimited .
Select the filter settings Export variables and Export constants . Select comma as the text delimiter. Confirm with OK .
Select a directory for the export file and give it a name. Confirm with OK .
Reaction: The variable declarations of your project are exported to an ASCII file.
Using File
→
generate a new project.
Using Project
→
open the configurator.
Using Configure
→
select a PLC. Confirm with OK .
Using File
→
generate an IL section.
Using Edit
→
import the IL file.
Using File
→
Variables: Text delimited ( Warning: Text delimiter must again be comma), import the variables file into the project’s Variable Editor.
Check the import process using Project
→
.
Reaction: The import process is now completed and the new project can be edited in the normal way (Create further sections, complete the configuration etc.)
33002204 12/2010
713
Import/Export
Procedure for converting FBD sections from an existing project into IL sections of a new project.
Procedure
The process of converting FBD sections from an existing project into IL sections in a new project consists of three main steps:
Step
1
2
3
Action
Exporting FBD section
.
Importing FBD section into an IL section
.
Correcting the syntax
.
Exporting FBD section.
The procedure for exporting the FBD section is as follows:
Step
1
2
3
4
5
6
Action
Open the existing project.
Export the desired FBD section using File
→
Program: IEC text .
Select a directory for the export file and give it a name. Confirm with OK .
Reaction: The FBD section is exported into an ASCII file.
Execute the menu command File Export Variables: Text delimited .
Select the filter settings Export variables and Export constants . Select comma as the text delimiter. Confirm with OK .
Select a directory for the export file and give it a name. Confirm with OK .
Reaction: The variable declarations are exported to an ASCII file.
Importing FBD section into an IL section
The procedure for importing the FBD section into an IL section is as follows:
Step
1
2
3
4
5
6
Action
Using File
→
generate a new project.
Using Project
→
open the configurator.
Using Configure
→
select a PLC. Confirm with OK .
Using File
→
generate an IL section.
Using Edit
→
import the IL file.
Using File Import Variables: Text delimited ( Warning: Text delimiter must again be comma), import the variables file into the project’s Variable Editor.
Reaction: The FBD section (in IL format) and the variable declarations were imported.
714
33002204 12/2010
Import/Export
Correcting the syntax
The procedure for correcting the syntax is as follows:
Step
1
2
3
4
5
6
7
Action
Delete the line PROGRAM . (It contains the name of the old project.)
Delete any lines between VAR and END_VAR which do not contain Function
Block or DFB declarations (e.g. variable declarations).
Delete all lines from INITIAL_STEP to END_STEP . (They contain the sections processing sequence of the old project.)
Change the ACTION lines to comment lines, e.g. (* ACTION xxx *) . (They contain the names of the FBD sections.)
Delete the END_ACTION line.
Delete the END_PROGRAM line.
Verify the import process using Project → and correct any errors.
Reaction: The import process is now completed and the new project can be edited in the normal way (Create further sections, complete the configuration etc.)
33002204 12/2010
715
Import/Export
21.5
Variables import
Overview
This section describes the importing of variables.
What's in this Section?
This section contains the following topics:
Topic
Importing Variables in "Text Delimited" Format
Importing structured variables
Importing variables in Factory Link format
Multiple Address Assignment after Variable Import
Page
716
33002204 12/2010
Import/Export
Importing Variables in "Text Delimited" Format
Introduction
Using File Import Variables: Text Delimited , the variable declarations can be imported from an ASCII file into the variable editor in text delimited format.
Importing Initial Values
Initial values of variables in derived data types cannot be imported with this import format. If you wish to import initial values of variables in derived data types, select the IEC text import export/import format.
General Format Description z z z z
An ASCII file in "text delimited" format must conform to the following conditions:
The character set used conforms to ANSI (Windows).
The parameters of a variable are executed within one line.
z The individual parameters are separated from one another by a user-defined z character.
Leading and following spaces are allowed in any field (Exception: if a space has been used as a separator), the import function deletes the latter (with the exception of the comment field).
z
The selected separator must not be contained in the individual parameters.
Concept is not case-sensitive, in accordance with IEC name conventions. This should be adhered to for variable names.
Overlapping between pre-existing addresses and addresses to be imported can be prevented in the following way: in the Options → Preferences →
→ dialog, activate the Treat Overlap of Addresses as an Error option.
Order of Parameters within a Line z z z z z z
Order of Parameters within a Line:
Variable flag
Variable name (symbolic name)
Data type
Hardware address
Initial value
Comment
33002204 12/2010
717
Import/Export
Meaning of Variable Flags z z z z
Possible values for the variable flags are:
0 or N= the symbolic name refers to a non-exportable variable
1 or E= the symbolic name refers to an exportable variable
2 or C= the symbolic name refers to a constant z
3 or I = the symbolic name refers to an Input
(Concept DFB only)
4 or O = the symbolic name refers to an Output
(Concept DFB z only)
5 or M = the symbolic name refers to a VARINOUT variable
z
(Concept DFB only)
S = Structured variable, see Importing structured variables, page 720 .
Only variables with the 0/N or 1/E variable flag value are imported as located variables. All others are imported as unlocated variables.
If the variable flag is set at 2/C, the hardware address is ignored.
The values 3/I and 4/O are only permitted in Concept DFB. In this case, the values of the address fields are used for the position of the corresponding inputs and outputs. The variable flag value 1/E is imported into Concept DFB as variable flag value 0/N.
Structure of the Hardware Address Field z z
Structure of the Hardware Address Field (Example: %4:100):
Characters for direct addresses "%" (may be missing)
Address type z z z z
0 = output, discrete
1 = input
3 = input word
4 = output word, discrete word z z
Separator ":" or ".".
If no separator is used, the address must be 6 characters long.
Address
Examples of an Address Description z z z z z z
Output register 123 :
%400123 or
%4.123 or
%4:123 or
400123 or
4.123 or
4:123
718
33002204 12/2010
Import/Export
IEC Address Conventions
The IEC address conventions can also be used (e.g. %QX100 corresponds to
000100):
Address Type
Output, discrete
Input
Input register
Output register, discrete register
Concept Designation
0x
1x
2x
3x
IEC Designation
%QX,%Q
%IX,%I
%IW
%QW
Empty Fields
Empty fields are represented by two consecutive separators.
z z
The following fields are allowed to be empty:
Hardware address
Initial value z Comment
Missing Fields z z z
The following fields are allowed to be missing:
Comment
Comment and initial value
Comment and initial value and hardware address
33002204 12/2010
719
Import/Export
Importing structured variables
At a Glance
The basic structure of the file corresponds to that of the variables in text delimited
format.
Additional usage designations z z
In addition, the following points should be taken into account:
Multiple rows are necessary to describe a variable.
Each of these rows must correspond to the format of variables in delimited text format.
z A structured variable with initial values is described by an introducing row with the following structure: a.
Variable flag b.
Variable name (symbolic name) c.
Name of derived data type d.
Hardware address e.
Empty field f.
Comment z This introductory line is followed by at least one component description. This component description results from the description of the element components ( element data type) in the form of a row with the following structure (a component does not have to be described if its initial value is the same as the standard value). The sequence in which the individual components are executed is insignificant.
a.
Character "S" (S stands for structured) b.
Path of components (the variable name does not have to be included) c.
Field for IEC data type (this field can remain empty) d.
Empty field e.
Initial value f.
Empty field
Component description error trapping z z
Component description error trapping
If a variable component is described more than once, the last description is used.
If the specified component is not contained in the currently described variable, the z component description is ignored and a warning is given.
If the field for the components path is empty, the component description is z ignored and a warning is given.
If the field for the IEC data type is not empty, the specified data type is checked.
If the specified data type and the data type of the component are not the same, the component description is ignored and a warning is given.
720
33002204 12/2010
Import/Export z z
Entries in the address field are ignored.
Entries in the address field are ignored.
Example: Structured variables in "Text delimited" format
Structured data type definition ESI_IN:
ESI_In: (* ESI - input data *)
STRUCT
in: ESI_InOut; (* ESI input data *)
esi: ESI_Status;
dummy: BYTE; (* supplement to modulo 16 *)
slot: Exp_Status;
END_STRUCT;
ESI_InOut: (* ESI input / output data structure *)
STRUCT
tstat: BYTE; (* transfer status, handshake *)
blocks: BYTE; (* number of used blocks *)
res: BYTE; (* reserved *)
block: ESI_BlockArr14; (* data block *)
END_STRUCT;
ESI_BlockArr14: ARRAY[1..14] OF ESI_Block;
ESI_Block: (* datas of ESI *)
STRUCT
func: BYTE; (* function *)
mux: WORD; (* distribution *)
attr: BYTE; (* attribute *)
cause: BYTE; (* reason *)
station: WORD; (* station number *)
object: WORD; (* objekt number *)
data: ByteArr9; (* data bytes *)
END_STRUCT;
ByteArr9: ARRAY [1..9] OF BYTE; (* 9 bytes *)
33002204 12/2010
721
Import/Export
ESI_Status: (* Status of ESI *)
STRUCT
wdog: BYTE; (* expert watchdog-counter *)
stat1: BYTE; (* error status 1 *)
stat2: BYTE; (* error status 2 *)
stat3: BYTE; (* error status 3 *)
slot: WORD; (* slot number *)
user: WORD; (* virtual slot number *)
esitime: DPM_Time; (* time stamp *)
END_STRUCT;
DPM_Time: (* time stamp *)
STRUCT
sync: BOOL; (* sync clock *)
ms: WORD; (* milli-seconds *)
min: BYTE; (* minutes *)
hour: BYTE; (* hours; (hour AND 16#80) *)
(* = day light saving time *)
day: BYTE; (* days of week *)
mon: BYTE; (* month *)
year: BYTE; (* year *)
END_STRUCT;
STRUCT
Exp_Status: (* error status of transfer *)
ErrFlag1: BOOL; (* TRUE: epxert not pluged *)
ErrFlag2: BOOL; (* TRUE: Bit 7 of DPM *)
(* Identcode is set; *)
(* logical DMP-access-error *)
UserStatus: WORD; (* status of expert *)
ErrNo: WORD; (* errornumber *)
END_STRUCT;
722
33002204 12/2010
33002204 12/2010
Import/Export
Representation of variables "demo" of ESP_IN data type in delimited text format:
1;demo;ESI_In;400002;;structured data type
S;in.tstat;BYTE;;16#0F;
S;in.blocks;BYTE;;16#0F;
S;in.res;BYTE;;16#0F;
S;in.block[1].func;BYTE;;16#0F;
S;in.block[1].mux;WORD;;16#000F;
S;in.block[1].attr;BYTE;;16#0F;
S;in.block[1].cause;BYTE;;16#0F;
S;in.block[1].station;WORD;;16#000F;
S;in.block[1].object;WORD;;16#000F;
S;in.block[1].data[1];BYTE;;16#0F;
S;in.block[1].data[5];BYTE;;16#0F;
S;in.block[3].func;BYTE;;16#0F;
S;in.block[3].mux;WORD;;16#000F;
S;in.block[3].func;BYTE;;16#0F;
S;in.block[3].cause;BYTE;;16#0F
S;in.block[3].station;WORD;;16#000F
S;in.block[3].object;WORD;;16#000F
S;in.block[3].data[1];BYTE;;16#0F
S;in.block[3].data[2];BYTE;;16#0F
S;esi.wdog;BYTE;;16#0F
S;esi.stat1;BYTE;;16#0F
S;esi.stat2;BYTE;;16#0F
S;esi.stat3;BYTE;;16#0F
S;esi.slot;WORD;;16#000F
S;esi.user;WORD;;16#000F
S;esi.esitime.sync;BOOL;;TRUE
S;esi.esitime.ms;WORD;;16#000F
S;esi.esitime.min;BYTE;;16#0F
S;esi.esitime.hour;BYTE;;16#0F
S;esi.esitime.day;BYTE;;16#0F
S;esi.esitime.mon;BYTE;;16#0F;
S;esi.esitime.year;BYTE;;16#0F;
S;dummy;BYTE;;16#0F;
S;slot.ErrFlag1;BOOL;;FALSE;
S;slot.ErrFlag2;BOOL;;FALSE;
S;slot.UserStatus;WORD;;16#000F;
S;slot.ErrNo;WORD;;16#000F;
723
Import/Export
Importing variables in Factory Link format
Description
Using File Import Variables: Factory Link variable declarations in Factory Link format can be imported. In addition, carry out a Factory Link export and specify the
Factory Link version when importing into Concept.
If your Factory Link version of Concept is not supported, please call our hotline.
NOTE: Factory Link is case-sensitive with variable names. Concept does not differentiate in accordance with IEC naming conventions. This should be adhered to during import
724
33002204 12/2010
Import/Export
Multiple Address Assignment after Variable Import
Description
Via a Variables Import the multiple assignment of a single address by different variable names is possible. This situation occurs if prior to the import, a variable that has already been used in Concept is renamed in the list to be imported. In order to not have to also manually perform this renaming in Concept, after the import you can open the dialog box Multiple Address Assignment and perform the renaming or replacement of the variable names automatically in the entire project (e.g. in
Variable Editor, Sections).
NOTE: In large projects and a corresponding number of multiple assignments, the updating of the variable names can take some time.
33002204 12/2010
725
Import/Export
21.6
Import/Export of PLC Configuration
Overview
This Section describes the import and export of the PLC configuration with Concept or Concept Converter.
What's in this Section?
This section contains the following topics:
Topic
Import/Export of PLC Configuration using Concept
Import/Export of PLC Configuration using Concept Converter
Page
726
33002204 12/2010
Import/Export
Import/Export of PLC Configuration using Concept
Introduction
Using the Import/Export function a PLC configuration can be exported out of a current (open) project and subsequently re-imported.
Config. Export and Config. Import
To export and subsequently import SPS configurations, proceed as follows:
Step
1
2
3
4
5
6
7
8
9
Action
To export the PLC configuration from the current project, start Concept, open the desired project and select File → Configuration .
In the Folder field, select the target directory for the PLC configuration to be exported.
In the File name field, enter a name for the Export file (NAME.CCF) and press
OK .
Response: The PLC configuration is stored in the selected directory as an ASCII file.
To import a PLC configuration into a project, open the desired project.
In Concept select the File → Configuration menu command.
From the File type list select the Concept Configuration entry. (*.CCF) .
In the Folder field, select the desired directory.
From the File name list select the PLC configuration to be imported
(NAME.CCF) and click on OK .
Warning: The current PLC configuration of the chosen project will be overwritten.
Answer the question with OK .
Response: The PLC configuration is imported.
33002204 12/2010
727
Import/Export
Import/Export of PLC Configuration using Concept Converter
Introduction
The Concept Converter’s import/export function enables you to export the configuration from one project (Project A) and import it into another project (Project
B).
Config Export and Config Import
In order to export and then import a PLC configuration, carry out the following steps:
Step
1
7
8
5
6
2
3
4
9
Action
To export the PLC Configuration from project A, start the Concept Converter and select File
→
Configuration .
From the Folder field, select the Project A system directory.
Select the PLC configuration to be exported (PROJECTNAME.C1) and click on
OK .
Response: The PLC configuration is filed in the system directory in the form of an ASCII file (PROJECTNAME.CON).
To import the PLC configuration into Project B, copy the exported file into the system directory of Project B.
In Concept Converter select the File
→
menu command.
From the File Type list box select the Configuration (*.CON) entry.
From the Folder field, select the Project B system directory.
From the File Name list box, select the PLC configuration
(PROJEKTNAME.CON) to be imported and click on OK .
Caution: The current PLC configuration of the selected project will be overwritten.
Answer the question with OK .
Response: The PLC configuration will be imported.
728
33002204 12/2010
Documentation and Archiving
33002204 12/2010
Documentation and Archiving
22
Overview
This chapter describes the documentation, the archiving and deleting of projects,
DFBs and macros.
What's in this Chapter?
This chapter contains the following sections:
Section
22.1
22.2
Topic
Documentation of projects, DFBs and macros
Managing projects, DFBs and macros
Page
729
33002204 12/2010
Documentation and Archiving
22.1
Documentation of projects, DFBs and macros
Overview
This section describes the documentation of projects, DFBs and macros.
What's in this Section?
This section contains the following topics:
Topic
Documentation contents
Documentation Layout
Defining Page Breaks for Sections
Use of keywords
Page
730
33002204 12/2010
Documentation and Archiving
Documentation contents
At a Glance
The contents of the documentation can range in length from one on-screen page to the entire documentation of a project. The order in the first chapter is given as in the dialog box File Print Documentation contents and cannot be changed.
Project documentation z z z z z z z z z z z z z z
The following chapter can be printed for project documentation using the menu command File → : z Project description z Derived data types
Using state RAM
State RAM values
Using the DFBs
Using the EFBs
PLC configuration
I/O Map
Execution sequence of the sections
Project structure
Messages
ASCII messages only with Concept for Quantum
Variable lists
Use of variables
Contents of sections
Contents directory for the printed documentation
DFB/macro documentation z z z z z z z z
The following chapter can be printed for DFB/macro documentation using the menu command File → : z DFB/macro description
Derived data types
Using the DFBs
Using the EFBs
Execution sequence of the sections
Messages
Variable lists
Use of variables z
Contents of the sections
Contents directory for the printed documentation
33002204 12/2010
731
Documentation and Archiving
Documentation Layout
Print Format
The printout can be in either portrait or landscape mode. This is set up in the dialog box File → Printer Setup → Select Printer .
Page Numbering
The pages are numbered linearly. The starting page number can be selected by the user.
Page Size
The left margin is 12 characters wide. The area for text and graphics is approximately 132 characters wide, the height depends on the header and footer files. If the header and footer files are not activated or the keyword "%PAGENO" is not contained in them, the page number will be printed automatically in the bottom right corner of the page.
Page Breaks
If a graphics section does not fit on a printed page, the section will be divided - like a map - in the printout. In this case page references are printed in all four corners of the graphics area to show which page the graphics are continued on. The View →
Page Break menu option displays the page break corresponding to the printer set in File → and to the enlargement factor in the editor window.
Also see the
Defining Page Breaks for Sections, page 735 description.
Size and Fonts
In text sections the font size in the printout cannot be altered. Emphasis of keywords is represented in the printout using bold and italic typefaces.
732
33002204 12/2010