You are on page 1of 17

Unity Pro

35006144 07/2012

Unity Pro
Program Languages and Structure
Reference Manual
07/2012
35006144.12

www.schneider-electric.com
The information provided in this documentation contains general descriptions and/or
technical characteristics of the performance of the products contained herein. This
documentation is not intended as a substitute for and is not to be used for
determining suitability or reliability of these products for specific user applications. It
is the duty of any such user or integrator to perform the appropriate and complete
risk analysis, evaluation and testing of the products with respect to the relevant
specific application or use thereof. Neither Schneider Electric nor any of its affiliates
or subsidiaries shall be responsible or liable for misuse of the information that is
contained herein. If you have any suggestions for improvements or amendments or
have found errors in this publication, please notify us.
No part of this document may be reproduced in any form or by any means, electronic
or mechanical, including photocopying, without express written permission of
Schneider Electric.
All pertinent state, regional, and local safety regulations must be observed when
installing and using this product. For reasons of safety and to help ensure
compliance with documented system data, only the manufacturer should perform
repairs to components.
When devices are used for applications with technical safety requirements, the
relevant instructions must be followed.
Failure to use Schneider Electric software or approved software with our hardware
products may result in injury, harm, or improper operating results.
Failure to observe this information can result in injury or equipment damage.
© 2012 Schneider Electric. All rights reserved.

2 35006144 07/2012
Table of Contents

Safety Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Part I General Presentation of Unity Pro . . . . . . . . . . . . . . 15
Chapter 1 Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Capabilities of Unity Pro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Project Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
User Application and Project File Formats . . . . . . . . . . . . . . . . . . . . . . . . 27
Configurator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Data Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Program Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Function Block Diagram FBD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Ladder Diagram (LD) Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
General Information about SFC Sequence Language . . . . . . . . . . . . . . . 53
Instruction List IL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Structured Text ST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
PLC Simulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Export/Import. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
User Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Debug Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Diagnostic Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Operator Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Part II Application Structure. . . . . . . . . . . . . . . . . . . . . . . . . 73
Chapter 2 Description of the Available Functions for Each Type of
PLC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Functions Available for the Different Types of PLC. . . . . . . . . . . . . . . . . . 75
Chapter 3 Application Program Structure . . . . . . . . . . . . . . . . . . . . 77
3.1 Description of Tasks and Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Presentation of the Master Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Presentation of the Fast Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Presentation of Auxiliary Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Overview of Event Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83

35006144 07/2012 3
3.2 Description of Sections and Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . 84
Description of Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Description of SFC sections. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Description of Subroutines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.3 Mono Task Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Description of the Master Task Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Mono Task: Cyclic Execution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Periodic Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Control of Cycle Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Execution of Quantum Sections with Remote Inputs/Outputs . . . . . . . . . 95
3.4 Multitasking Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Multitasking Software Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Sequencing of Tasks in a Multitasking Structure . . . . . . . . . . . . . . . . . . . 100
Task Control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Assignment of Input/Output Channels to Master, Fast and Auxiliary Tasks 105
Management of Event Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Execution of TIMER-type Event Processing . . . . . . . . . . . . . . . . . . . . . . 108
Input/Output Exchanges in Event Processing . . . . . . . . . . . . . . . . . . . . . 112
How to Program Event Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Chapter 4 Application Memory Structure . . . . . . . . . . . . . . . . . . . . . 115
4.1 Memory Structure of the Premium, Atrium and Modicon M340 PLCs . . . 116
Memory Structure of Modicon M340 PLCs . . . . . . . . . . . . . . . . . . . . . . . 117
Memory Structure of Premium and Atrium PLCs. . . . . . . . . . . . . . . . . . . 121
Detailed Description of the Memory Zones . . . . . . . . . . . . . . . . . . . . . . . 123
4.2 Memory Structure of Quantum PLCs. . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
Memory Structure of Quantum PLCs . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Detailed Description of the Memory Zones . . . . . . . . . . . . . . . . . . . . . . . 128
Chapter 5 Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
5.1 Modicon M340 PLCs Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Processing of Power Outage and Restoral of Modicon M340 PLCs . . . . 133
Processing on Cold Start for Modicon M340 PLCs . . . . . . . . . . . . . . . . . 135
Processing on Warm Restart for Modicon M340 PLCs . . . . . . . . . . . . . . 139
Automatic Start in RUN for Modicon M340 PLCs . . . . . . . . . . . . . . . . . . 142
Processing of State RAM on STOP Mode for Modicon M340 PLCs . . . . 143
5.2 Premium, Quantum PLCs Operating Modes . . . . . . . . . . . . . . . . . . . . . . 144
Processing of Power Outage and Restoral for Premium/Quantum PLCs 145
Processing on Cold Start for Premium/Quantum PLCs . . . . . . . . . . . . . . 147
Processing on Warm Restart for Premium/Quantum PLCs. . . . . . . . . . . 152
Automatic Start in RUN for Premium/Quantum . . . . . . . . . . . . . . . . . . . . 155
5.3 PLC HALT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
PLC HALT Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

4 35006144 07/2012
Chapter 6 System Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
6.1 System Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
System Bit Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Description of System Bits %S0 to %S7 . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Description of System Bits %S9 to %S13 . . . . . . . . . . . . . . . . . . . . . . . . . 162
Description of System Bits %S15 to %S21 . . . . . . . . . . . . . . . . . . . . . . . . 164
Description of System Bits %S30 to %S59 . . . . . . . . . . . . . . . . . . . . . . . . 167
Description of System Bits %S65 to %S79 . . . . . . . . . . . . . . . . . . . . . . . . 170
Description of System Bits %S80 to %S96 . . . . . . . . . . . . . . . . . . . . . . . . 174
Description of System Bits %S100 to %S123 . . . . . . . . . . . . . . . . . . . . . . 177
6.2 System Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Description of System Words %SW0 to %SW11 . . . . . . . . . . . . . . . . . . . 180
Description of System Words %SW12 to %SW29 . . . . . . . . . . . . . . . . . . 184
Description of System Words %SW30 to %SW47 . . . . . . . . . . . . . . . . . . 189
Description of System Words %SW48 to %SW59 . . . . . . . . . . . . . . . . . . 191
Description of System Words %SW70 to %SW100 . . . . . . . . . . . . . . . . . 193
Description of System Words %SW108 to %SW116 . . . . . . . . . . . . . . . . 205
Description of System Words %SW123 to %SW127 . . . . . . . . . . . . . . . . 206
6.3 Atrium/Premium-specific System Words . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Description of System Words %SW60 to %SW65 . . . . . . . . . . . . . . . . . . 209
Description of System Words %SW128 to %SW143 . . . . . . . . . . . . . . . . 213
Description of System Words %SW144 to %SW146 . . . . . . . . . . . . . . . . 214
Description of System Words %SW147 to %SW152 . . . . . . . . . . . . . . . . 216
Description of System Word %SW153 . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Description of System Word %SW154 . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Description of Premium/Atrium System Words %SW155 to %SW167 . . . 220
6.4 Quantum-specific System Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Description of Quantum System Words %SW60 to %SW66 . . . . . . . . . . 222
Description of Quantum System Words %SW98 to %SW109 . . . . . . . . . 227
Description of Quantum System Words %SW110 to %SW177 . . . . . . . . 228
Description of Quantum System Words %SW180 to %SW702 . . . . . . . . 231
6.5 Modicon M340-Specific System Words. . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Description of System Words: %SW138 to %SW141, %SW142 to
%SW145, %SW146 and %SW147, %SW150 to %SW154, %SW160 to
%SW167 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
Part III Data Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Chapter 7 General Overview of Data . . . . . . . . . . . . . . . . . . . . . . . . 243
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
General Overview of the Data Type Families . . . . . . . . . . . . . . . . . . . . . . 245
Overview of Data Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Overview of the Data References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Syntax Rules for Type\Instance Names . . . . . . . . . . . . . . . . . . . . . . . . . . 250

35006144 07/2012 5
Chapter 8 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
8.1 Elementary Data Types (EDT) in Binary Format . . . . . . . . . . . . . . . . . . . 252
Overview of Data Types in Binary Format . . . . . . . . . . . . . . . . . . . . . . . . 253
Boolean Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Integer Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
The Time Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
8.2 Elementary Data Types (EDT) in BCD Format . . . . . . . . . . . . . . . . . . . . 263
Overview of Data Types in BCD Format . . . . . . . . . . . . . . . . . . . . . . . . . 264
The Date Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
The Time of Day (TOD) Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
The Date and Time (DT) Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
8.3 Elementary Data Types (EDT) in Real Format . . . . . . . . . . . . . . . . . . . . 269
Presentation of the Real Data Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
8.4 Elementary Data Types (EDT) in Character String Format . . . . . . . . . . . 274
Overview of Data Types in Character String Format . . . . . . . . . . . . . . . . 274
8.5 Elementary Data Types (EDT) in Bit String Format . . . . . . . . . . . . . . . . . 277
Overview of Data Types in Bit String Format. . . . . . . . . . . . . . . . . . . . . . 278
Bit String Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
8.6 Derived Data Types (DDT/IODDT/Device DDT) . . . . . . . . . . . . . . . . . . . 281
Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Overview of the Derived Data Type family (DDT) . . . . . . . . . . . . . . . . . . 286
DDT: Mapping Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Overview of Input/Output Derived Data Types (IODDT) . . . . . . . . . . . . . 291
Overview of Device Derived Data Types (Device DDT) . . . . . . . . . . . . . 293
8.7 Function Block Data Types (DFB\EFB) . . . . . . . . . . . . . . . . . . . . . . . . . . 294
Overview of Function Block Data Type Families . . . . . . . . . . . . . . . . . . . 295
Characteristics of Function Block Data Types (EFB\DFB). . . . . . . . . . . . 297
Characteristics of Elements Belonging to Function Blocks . . . . . . . . . . . 299
8.8 Generic Data Types (GDT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Overview of Generic Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
8.9 Data Types Belonging to Sequential Function Charts (SFC). . . . . . . . . . 304
Overview of the Data Types of the Sequential Function Chart Family . . 304
8.10 Compatibility Between Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Compatibility Between Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
Chapter 9 Data Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Data Type Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Data Instance Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Direct Addressing Data Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Chapter 10 Data References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
References to Data Instances by Value. . . . . . . . . . . . . . . . . . . . . . . . . . 328
References to Data Instances by Name . . . . . . . . . . . . . . . . . . . . . . . . . 330
References to Data Instances by Address. . . . . . . . . . . . . . . . . . . . . . . . 333
Data Naming Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337

6 35006144 07/2012
Part IV Programming Language . . . . . . . . . . . . . . . . . . . . . . 339
Chapter 11 Function Block Language FBD . . . . . . . . . . . . . . . . . . . . 341
General Information about the FBD Function Block Language. . . . . . . . . 342
Elementary Functions, Elementary Function Blocks, Derived Function
Blocks and Procedures (FFBs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
Subroutine Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
Control Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Text Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
Execution Sequence of the FFBs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Change Execution Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
Loop Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Chapter 12 Ladder Diagram (LD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
General Information about the LD Ladder Diagram Language . . . . . . . . . 370
Contacts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373
Coils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
Elementary Functions, Elementary Function Blocks, Derived Function
Blocks and Procedures (FFBs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Control Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Operate Blocks and Compare Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
Links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Text Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Edge Recognition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Execution Sequence and Signal Flow. . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Loop Planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Change Execution Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Chapter 13 SFC Sequence Language . . . . . . . . . . . . . . . . . . . . . . . . 413
13.1 General Information about SFC Sequence Language . . . . . . . . . . . . . . . 414
General Information about SFC Sequence Language . . . . . . . . . . . . . . . 415
Link Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
13.2 Steps and Macro Steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Macro Steps and Macro Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
13.3 Actions and Action Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
Action . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Action Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
Qualifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
13.4 Transitions and Transition Sections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
Transition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Transition Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
13.5 Jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Jump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
13.6 Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
Link . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441

35006144 07/2012 7
13.7 Branches and Merges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
Alternative Branches and Alternative Joints . . . . . . . . . . . . . . . . . . . . . . 443
Parallel Branch and Parallel Joint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
13.8 Text Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Text Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
13.9 Single-Token . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
Execution Sequence Single-Token . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
Alternative String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
Sequence Jumps and Sequence Loops . . . . . . . . . . . . . . . . . . . . . . . . . 451
Parallel Strings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
Asymmetric Parallel String Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
13.10 Multi-Token . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Multi-Token Execution Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
Alternative String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
Parallel Strings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
Jump into a Parallel String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
Jump out of a Parallel String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
Chapter 14 Instruction List (IL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
14.1 General Information about the IL Instruction List . . . . . . . . . . . . . . . . . . . 476
General Information about the IL Instruction List . . . . . . . . . . . . . . . . . . . 477
Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Modifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
Subroutine Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
Labels and Jumps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Comment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
14.2 Calling Elementary Functions, Elementary Function Blocks, Derived
Function Blocks and Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
Calling Elementary Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
Calling Elementary Function Blocks and Derived Function Blocks . . . . . 506
Calling Procedures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
Chapter 15 Structured Text (ST) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
15.1 General Information about the Structured Text ST . . . . . . . . . . . . . . . . . 528
General Information about Structured Text (ST) . . . . . . . . . . . . . . . . . . . 529
Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534
15.2 Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541
Select Instruction IF...THEN...END_IF. . . . . . . . . . . . . . . . . . . . . . . . . . . 544
Select Instruction ELSE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545
Select Instruction ELSIF...THEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
Select Instruction CASE...OF...END_CASE . . . . . . . . . . . . . . . . . . . . . . 547
Repeat Instruction FOR...TO...BY...DO...END_FOR. . . . . . . . . . . . . . . . 548
Repeat Instruction WHILE...DO...END_WHILE . . . . . . . . . . . . . . . . . . . . 551

8 35006144 07/2012
Repeat Instruction REPEAT...UNTIL...END_REPEAT . . . . . . . . . . . . . . . 552
Repeat Instruction EXIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Subroutine Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554
RETURN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Empty Instruction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556
Labels and Jumps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Comment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
15.3 Calling Elementary Functions, Elementary Function Blocks, Derived
Function Blocks and Procedures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559
Calling Elementary Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
Call Elementary Function Block and Derived Function Block . . . . . . . . . . 566
Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574
Part V User Function Blocks (DFB) . . . . . . . . . . . . . . . . . . . 581
Chapter 16 Overview of User Function Blocks (DFB). . . . . . . . . . . . 583
Introduction to User Function Blocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
Implementing a DFB Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
Chapter 17 Description of User Function Blocks (DFB). . . . . . . . . . 589
Definition of DFB Function Block Internal Data . . . . . . . . . . . . . . . . . . . . . 590
DFB Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
DFB Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596
DFB Code Section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
Chapter 18 User Function Blocks (DFB) Instance . . . . . . . . . . . . . . 601
Creation of a DFB Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
Execution of a DFB Instance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
Programming Example for a Derived Function Block (DFB) . . . . . . . . . . . 604
Chapter 19 Use of the DFBs from the Different Programming
Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607
Rules for Using DFBs in a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
Use of IODDTs in a DFB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Use of a DFB in a Ladder Language Program . . . . . . . . . . . . . . . . . . . . . 614
Use of a DFB in a Structured Text Language Program. . . . . . . . . . . . . . . 616
Use of a DFB in an Instruction List Program . . . . . . . . . . . . . . . . . . . . . . . 619
Use of a DFB in a Program in Function Block Diagram Language . . . . . . 623
Chapter 20 User Diagnostics DFB . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
Presentation of User Diagnostic DFBs . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
Appendices ........................................... 627
Appendix A EFB Error Codes and Values . . . . . . . . . . . . . . . . . . . . . . 629
Tables of Error Codes for the Base Library. . . . . . . . . . . . . . . . . . . . . . . . 630
Tables of Error Codes for the Diagnostics Library . . . . . . . . . . . . . . . . . . 632
Tables of Error Codes for the Communication Library . . . . . . . . . . . . . . . 633
Tables of Error Codes for the IO Management Library . . . . . . . . . . . . . . . 637

35006144 07/2012 9
Tables of Error Codes for the CONT_CTL Library. . . . . . . . . . . . . . . . . . 644
Tables of Error Codes for the Motion Library. . . . . . . . . . . . . . . . . . . . . . 651
Tables of Error Codes for the Obsolete Library . . . . . . . . . . . . . . . . . . . . 653
Common Floating Point Errors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
Appendix B IEC Compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
B.1 General Information regarding IEC 61131-3 . . . . . . . . . . . . . . . . . . . . . . 662
General information about IEC 61131-3 Compliance . . . . . . . . . . . . . . . 662
B.2 IEC Compliance Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 664
Common elements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665
IL language elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
ST language elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679
Common graphical elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
LD language elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
Implementation-dependent parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 682
Error Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685
B.3 Extensions of IEC 61131-3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
Extensions of IEC 61131-3, 2nd Edition . . . . . . . . . . . . . . . . . . . . . . . . . 687
B.4 Textual language syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
Textual Language Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719

10 35006144 07/2012
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.

35006144 07/2012 11
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 its installation, and has received safety
training to recognize and avoid the hazards involved.

12 35006144 07/2012
About the Book

At a Glance

Document Scope
This manual describes the elements necessary for the programming of Premium,
Atrium and Quantum PLCs using the Unity Pro programming workshop.

Validity Note
This documentation is valid from Unity Pro V7.0.

Product Related Information

WARNING
UNINTENDED EQUIPMENT OPERATION
The application of this product requires expertise in the design and programming
of control systems. Only persons with such expertise should be allowed to
program, install, alter, and apply this product.
Follow all local and national safety codes and standards.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.

User Comments
We welcome your comments about this document. You can reach us by e-mail at
techcomm@schneider-electric.com.

35006144 07/2012 13
14 35006144 07/2012
Unity Pro
General Presentation
35006144 07/2012

General Presentation of Unity Pro

35006144 07/2012 15
General Presentation

16 35006144 07/2012
Unity Pro
Presentation
35006144 07/2012

Presentation

1
Overview
This chapter describes the general design and behavior of a project created with
Unity Pro.

What Is in This Chapter?


This chapter contains the following topics:
Topic Page
Capabilities of Unity Pro 18
User Interface 23
Project Browser 25
User Application and Project File Formats 27
Configurator 33
Data Editor 38
Program Editor 46
Function Block Diagram FBD 49
Ladder Diagram (LD) Language 51
General Information about SFC Sequence Language 53
Instruction List IL 57
Structured Text ST 58
PLC Simulator 59
Export/Import 60
User Documentation 61
Debug Services 62
Diagnostic Viewer 69
Operator Screen 70

35006144 07/2012 17

You might also like