458
IEC 61131-3 Programming Tool WAGO-I/O-PRO 32 User Manual Installation, Programm Development, Test and Start-up Functions 759-122/000-002 Version 1.1.0

Wago Pro Manual

Embed Size (px)

Citation preview

Page 1: Wago Pro Manual

IEC 61131-3 Programming Tool

WAGO-I/O-PRO 32

User Manual

Installation, Programm Development,Test and Start-up Functions

759-122/000-002Version 1.1.0

Page 2: Wago Pro Manual

Copyright � 2000, by WAGO Kontakttechnik GmbHAll rights reserved.

WAGO Kontakttechnik GmbHHansastraße 27D-32423 MindenGermany

Information: Support:Tel.: +49 (0) 571/8 87 � 0 Tel.: +49 (0) 571/8 87 � 5 55Fax: +49 (0) 571/8 87 - 1 69 Fax: +49 (0) 571/8 87 - 4 30

E-mail: [email protected] E-mail: [email protected]

Web: http://www.wago.com

Every conceivable measure has been taken to ensure the correctness andcompleteness of this documentation. However, as errors can never be fullyexcluded we would appreciate any information or ideas at any time.

We wish to point out that the software and hardware terms as well as thetrademarks of companies used and/or mentioned in the present manual aregenerally trademark or patent protected.

Page 3: Wago Pro Manual

Contents

WAGO-I/O-PRO 32 iii

Contents

1 General 1-1

Component Parts of the IEC 61131-3 Programming Tool .................................................1-1Legal Stipulation.................................................................................................................1-1Symbols ..............................................................................................................................1-2Start.....................................................................................................................................1-3

System Requirements ................................................................................................1-3Set-up ........................................................................................................................1-4Uninstall ....................................................................................................................1-4Start ...........................................................................................................................1-5Latest Information on WAGO-I/O-PRO 32 V2.1 .....................................................1-6

Important Information.........................................................................................................1-7

2 WAGO-I/O-PRO 32 2-1

A Brief Introduction to WAGO-I/O-PRO 32 .....................................................................2-1What is WAGO-I/O-PRO 32 ....................................................................................2-1Overview of WAGO-I/O-PRO 32 Functions ............................................................2-1

Project Components............................................................................................................2-2Languages .........................................................................................................................2-12

Instruction List (IL) .................................................................................................2-12Structured Text (ST.................................................................................................2-13Sequential Function Chart (SFC) ............................................................................2-20Function Block Diagram (FBD)..............................................................................2-26Ladder Diagram (LD)..............................................................................................2-26

Debugging, Online Functions ...........................................................................................2-28The Standard .....................................................................................................................2-30

3 We Write a Little Program 3-1

Controlling a Traffic Signal Unit........................................................................................3-1Visualizing a Traffic Signal Unit......................................................................................3-14

4 The Individual Components 4-1

The Main Window..............................................................................................................4-1Options................................................................................................................................4-4Managing Projects ............................................................................................................4-16

Page 4: Wago Pro Manual

Contents

iv WAGO-I/O-PRO 32

Creating and Deleting Objects, etc. ..................................................................................4-28General Editing Functions ................................................................................................4-36General Online Functions .................................................................................................4-42Window set up ..................................................................................................................4-51Help when you need it ......................................................................................................4-52

5 Editors in WAGO-I/O-PRO 32 5-1

The Declaration Editor........................................................................................................5-1The Text Editors .................................................................................................................5-8

The Instruction List Editor ......................................................................................5-12The Editor for Structured Text ................................................................................5-13

The Graphic Editors..........................................................................................................5-14The Function Block Diagram Editor .......................................................................5-16The Ladder Editor....................................................................................................5-22The Sequential Function Chart Editor.....................................................................5-28The Continuous Function Chart Editor (CFC)........................................................5-36

6 The Resources 6-1

Overview of the Resources .................................................................................................6-1Global Variables .................................................................................................................6-1

Global Variables........................................................................................................6-2Variable Configuration..............................................................................................6-3Document Frame .......................................................................................................6-4

PLC Configuration..............................................................................................................6-6Task Configuration .............................................................................................................6-6Sampling Trace ...................................................................................................................6-9Watch and Receipt Manager.............................................................................................6-16

7 Library Manager 7-1

Library Manager..................................................................................................................7-1

8 Visualization 8-1

Create Visualization............................................................................................................8-1Visualization Elements, Insert ............................................................................................8-2Working with Visualization Elements................................................................................8-4Visualization Elements, Configure .....................................................................................8-5Additional Visualization Element Functions....................................................................8-12

9 DDE Interface 9-1

DDE Interface .....................................................................................................................9-1

Page 5: Wago Pro Manual

Contents

WAGO-I/O-PRO 32 v

10 Using the Keyboard 10-1

Use of Keyboard ...............................................................................................................10-1Key Combinations ............................................................................................................10-1

11 Data types 11-1

Standard Data types ..........................................................................................................11-1Defined Data Types ..........................................................................................................11-4

12 IEC Operators 12-1

IEC Operators ...................................................................................................................12-1Bitstring Operators............................................................................................................12-3Bit-Shift Operators............................................................................................................12-5Selection Operators...........................................................................................................12-8Comparison Operators ....................................................................................................12-10Address Operators...........................................................................................................12-12Calling Operator .............................................................................................................12-13Type Conversion Functions ............................................................................................12-13Numeric Functions..........................................................................................................12-18

13 Standard Library Elements 13-1

String Functions................................................................................................................13-1Bistable Function Blocks ..................................................................................................13-5Trigger...............................................................................................................................13-6Counter..............................................................................................................................13-8Timer...............................................................................................................................13-10

14 The UTIL.LIB Library 14-1

BCD conversion................................................................................................................14-1Bit/byte functions..............................................................................................................14-2Mathematical help functions.............................................................................................14-3Controllers ........................................................................................................................14-4Signal generators...............................................................................................................14-6Function manipulators ......................................................................................................14-7Analogue value processing ...............................................................................................14-9

15 Operands in WAGO-I/O-PRO 32 15-1

Constants...........................................................................................................................15-1Variables ...........................................................................................................................15-3Addresses ..........................................................................................................................15-4Functions...........................................................................................................................15-5

Page 6: Wago Pro Manual

Contents

vi WAGO-I/O-PRO 32

16 Command Line/Command File Commands 16-1

Command Line Commands ..............................................................................................16-1Command File (cmdfile) Commands ..............................................................................16-1

17 Error messages 17-1

Error messages ..................................................................................................................17-1A 17-1C 17-1D 17-2E 17-2F 17-3I 17-4J 17-5K 17-6L 17-6M 17-6N 17-6O 17-8P 17-9S 17-9T 17-10U 17-11V 17-12W 17-12

18 Quick Start 18-1

19 Compliance List 19-1

Appendix A: Additional Libraries 1

Installation ............................................................................................................................. 1Contents ................................................................................................................................. 3Additional Libraries ............................................................................................................... 5

Appendix B: Communication Drivers 1

Installation ............................................................................................................................. 1Contents ................................................................................................................................. 3Communication Drivers......................................................................................................... 5

20 Bibliography 20-1

Page 7: Wago Pro Manual

Contents

WAGO-I/O-PRO 32 vii

21 Glossary 21-1

22 Index 22-1

Page 8: Wago Pro Manual
Page 9: Wago Pro Manual

Chapter 1 - General

WAGO-I/O-PRO 32 1-1

1 General

Component Parts of the IEC 61131-3 Programming Tool

The IEC 61131-3 Programming Tool comprises of the following components:

• 1 pc user manual, WAGO-I/O-PRO 32, Item number: 759-122/000-002English

• 1 pc communication cable Item number: 750-920• 1 pc CD rom• 1 pc Software Licence Agreement

= IEC 61131-3 Programming Tool Item number: 759-330/000-002

Legal Stipulation

This manual including all of its illustrations is copyrighted, deviations from thecopyright stipulations are strictly prohibited. Reproduction, translation as wellas electronic and photographic archiving or changes require the writtenapproval of WAGO Kontakttechnik GmbH. Non observance will result inclaims for damage.

WAGO Kontakttechnik GmbH reserves all rights for changes or amendmentswhich serve technical progress. All rights for the issuing of patents or theprotection of registered designs are reserved by WAGO Kontakttechnik GmbH.Products of other suppliers are always referred to without reference to patentrights. For this reason the existence of such rights cannot be excluded.

The use of the product described in this manual is solely intended for qualifiedpersons trained in PLC programming, qualified electricians or personsinstructed by qualified electricians who are also familiar with the applicablestandards and directives. WAGO Kontakttechnik GmbH declines all liabilityfor faulty operation and damages to WAGO products and products from othersuppliers resulting from non-observance of the information contained in thismanual.

The components are delivered ex works with a defined hardware and softwareconfiguration for each case of application. Changes are only permitted withinthe framework of the possibilities outlined in the manuals. All other changes ormodifications to the hardware or software as well as the use of the componentsnot conforming with that intended will result in the exclusion from any liabilityon the part of WAGO Kontakttechnik GmbH.

Page 10: Wago Pro Manual

Symbols

1-2 WAGO-I/O-PRO 32

Symbols

Ensure that the following explanations are observed!To assure a quick installation and start up of the units described in this manualensure that the following information and explanations are carefully read andadhered to.

Description of the symbols used

The ATTENTION symbol refers to

a) incorrect handling which can result in damage or destruction tothe hardware or software

b) possible injuries to persons when operating with dangerousperipheral process units.

The FINGER symbol describes routines or gives suggestions forthe efficient use of the unit and optimisation of the software.

The MOUSE symbol indicates instructions for use.

Page 11: Wago Pro Manual

Chapter 1 - General

WAGO-I/O-PRO 32 1-3

Start

System Requirements

PC: Pentium processor

Operating system: Microsoft Windows 95 or better

Main memory: Windows 95: 16 MB orWindows NT 4.0: 64 MB

Hard disk storage: recommanded: 10 MB

Monitor: VGA or comparable

Mouse: required

CD rom drive: required

Others: free serial interface, COM 1...4

Page 12: Wago Pro Manual

Start

1-4 WAGO-I/O-PRO 32

Set-up

WAGO-I/O-PRO 32 is delivered on a installation CD which includes allprogram files of the application. The set-up program is not different to the set-up method of most other Windows applications.

The set-up program is started from the D drive in the following instructions. Incase you would like to use another drive, please enter the corresponding letter.

To install WAGO-I/O-PRO 32:

1. Put the WAGO-I/O-PRO 32-CD in the D drive.

2. In case "Autoplay" is selected in your system the set-up will be startedautomatically. Proceed with step 6.

If the set-up is not starting automatically please proceed with step 3.

3. Select "Execute" in the Windows "Start" menu

4. Start the WAGO-I/O-PRO 32 set-up.

5. Enter "D:\setup.exe" (D is the drive with the WAGO-I/O-PRO-32-CD) and start the set-up by clicking on "OK".

6. Select the set-up language.

The rest of the set-up is taking place via menus. Please follow the instructionsto complete the set-up. If possible the proposed settings should be adopted.

The set-up type will be requested during the set-up.

���� Click on "Complete new installation" and confirm with "Next".

Uninstall

To uninstall WAGO-I/O-PRO 32:

1. Select "Settings" in the Windows "Start" menu and open "Systemcontrol".

2. Click on "Software".

3. Select WAGO-I/O-PRO 32 in the list and click on "Remove".

4. Click on "Yes" to confirm the removal.

Note: After having uninstalled WAGO-I/O-PRO 32 you might be askedto restart the computer. Please follow this instruction.

Page 13: Wago Pro Manual

Chapter 1 - General

WAGO-I/O-PRO 32 1-5

Start

Menu "Start"

To start WAGO-I/O-PRO 32 :

1. Click on the "Start" symbol in the Windows system tray to open the"Start" menu.

2. Select the "Programs" option in the "Start" menu to open the"Programs" folder.

3. Select "WAGO-I/O-PRO 32*" to open the "WAGO-I/O-PRO 32*"folder.

4. Click on the "WAGO-I/O-PRO 32 English" link to start theprogramming system.

* or the name you selected.

"My Computer" orWindows Explorer

You can start "WAGO-I/O-PRO 32" using the icon "My Computer" or theWindows-Explorer. You can find the "WAGO-IO-PRO 32.exe" file on the driveand in the folder you indicated during the set-up. If you did not change the pre-settings during the set-up you can find the "WAGO-IO-PRO 32.exe" in thefolder:

C:\Programs\WAGO-IO-PRO 32\English���� Doubleclick on the "WAGO-IO-PRO 32.exe" file or highlight the file

and press the <ENTER**> key.

** or CR, ↵

Page 14: Wago Pro Manual

Start

1-6 WAGO-I/O-PRO 32

Latest Information on WAGO-I/O-PRO 32 V2.1

Menu "Start"

This will provide you with updated information concerning WAGO-I/O-PRO32. This information resulting from the realisation of projects in practice usingWAGO-I/O-PRO 32 could not be included in the manual at the time of itspreparation.

README can be started in one of the following manners:

1. Click on the "Start" symbol in the Windows task bar in order to openthe "Start" menu.

2. Select the "Programs" option in the "Start" menu to be able to openthe "Programs" folder.

3. Select "WAGO-I/O-PRO 32*" to open the "WAGO-I/O-PRO 32*"folder.

4. Click on the "Latest Informaten on WAGO-I/O-PRO 32 V2.1" link toopen the "Readme_E" file.

* or the name you have selected

"My Computer" orWindows Explorer

You can start "Readme_E" by means of the symbol "My Computer" or fromthe Windows-Explorers. You will find the file "Readme_E.exe" on the driveand in the folder you have selected during the installation. If you did not changethe preset settings during installation, "Readme_E.exe"will be in:

C:\Programs\WAGO-IO-PRO 32\English���� Double-click on the "Readme_E.exe" file or select the file and press

<ENTER**>.

** or CR, ↵

Page 15: Wago Pro Manual

Chapter 1 - General

WAGO-I/O-PRO 32 1-7

Important Information

When working with WAGO-I/O-PRO 32 please observe the followinginformation:

Warning!If during a status change from "Run" to "Stop" outputs are still active(e.g. for motor contactors or valves), they will remain active! Software cut-outs (e.g. by initiators) are then ineffective as the programme is notprocessed any more! The change of operation mode takes place internallyat the end of a programme cycle!

Endless loopIn the event of a endless loop the outputs deactivate via the Watchdog of theoutput terminal blocks. In this case, a communication with the controller isimpossible. (To restore communication, switch the supply voltage of thecontroller off and on again. You can re-establish the communication bypressing the function selector. This selector must then be either in the top orcentral position.)

The Programmer has to ensure that no endless loop can occur!

Page 16: Wago Pro Manual

Important Information

1-8 WAGO-I/O-PRO 32

Page 17: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-1

2 WAGO-I/O-PRO 32

A Brief Introduction to WAGO-I/O-PRO 32

What is WAGO-I/O-PRO 32

WAGO-I/O-PRO 32is a complete development environment for your PLC.(WAGO-I/O-PRO 32 stands for WAGO-I/O-System-Programming, 32 Bit)

WAGO-I/O-PRO 32 puts a simple approach to the powerful IEC language atthe disposal of the PLC programmer. Use of the editors and debuggingfunctions is based upon the proven development program environments ofadvanced programming languages (such as Visual C++).

Overview of WAGO-I/O-PRO 32 Functions

How is a projectstructured?

A project is put into a file named after the project. The first POU (ProgramOrganization Unit) created in a new project will automatically be namedPLC_PRG. The process begins here (in compliance with the main function in aC program), and other POUs can be accessed from the same point (programs,function blocks and functions).

Once you have defined a Task Configuration, it is no longer necessary to createa program named PLC_PRG. You will find more about this in the TaskConfiguration chapter.

There are different kinds of objects in a project: POUs, data types, displayelements (visualizations) and resources.

The Object Organizer contains a list of all the objects in your project.

How do I set up myproject?

First you should configure your PLC in order to check the accuracy of theaddresses used in the project.

Then you can create the POUs needed to solve your problem.

Now you can program the POUs you need in the desired languages.

Once the programming is complete, you can compile the project and removeerrors should there be any.

How can I test myproject?

Once all errors have been removed, activate the simulation, log in to thesimulated PLC and start the program processing.

Page 18: Wago Pro Manual

Project Components

2-2 WAGO-I/O-PRO 32

Now open the window with your PLC Configuration and test your project forcorrect sequence. To do this, enter input variables manually and observewhether outputs are as expected. You can also observe the value sequence ofthe local variables in the POUs. In the Watch and Receipt Manager you canconfigure data records whose values you wish to examine.

Debugging

In case of a programming error you can set breakpoints. If the process stops atsuch a breakpoint, you can examine the values of all project variables at thispoint in time. By working through sequentially (single step) you can check thelogical correctness of your program.

Additional OnlineFunctions

An additional debugging function: You can set program variables and inputsand outputs at certain values. You can use the flow control to check whichprogram lines have been run. The Sampling Trace allows you to trace anddisplay the actual course of variables over an extended period of time.

Once the project has been set up and tested, the hardware can be loaded in thehardware and tested as well. The same online functions you used with thesimulation are available.

Additional WAGO-I/O-PRO 32 Features

The entire project can be documented or exported to a text file at any time.

Summary

WAGO-I/O-PRO 32 is a complete development tool used to program yourPLC which will save you a measurable amount of time setting up yourapplications.

Project Components

Project

A project contains all of the objects in a PLC program. A project is saved in afile named after the project. The following objects are included in a project:

POUs (Program Organization Units), data types, visualizations, resources, andlibraries.

POU (ProgramOrganization Unit)

Functions, function blocks, and programs are POUs.

Each POU consists of a declaration part and a body. The body is written in oneof the IEC programming languages which include IL, ST, SFC, FBD and LD.

Page 19: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-3

WAGO-I/O-PRO 32 supports all IEC standard POUs. If you want to use thesePOUs in your project, you must include the library standard.lib in your project.

POUs can call up other POUs. However, recursions are not allowed.

Function

A function is a POU, which yields exactly one data element (which can consistof several elements, such as fields or structures) when it is processed, andwhose call in textual languages can occur as an operator in expressions.

When declaring a function do not forget that the function must receive a type.This means, after the function name, you must enter a colon followed by a type.

A correct function declaration can look like this example:FUNCTION Fct: INT

In addition, a result must be assigned to the function. That means that functionname is used as an output variable.

A function declaration begins with the keyword FUNCTION and ends withEND_FUNCTION.

Example in IL of a function that takes three input variables and returns theproduct of the first two divided by the third:

Image 2.1: Function

The call of a function in ST can appear as an operand in expressions.

Functions do not have any internal conditions. That means that calling up afunction with the same argument (input parameters) always produces the samevalue (output).

Examples for calling up the function described above:

in IL:LD 7Fct 2,4ST Result

in ST:Result := Fct(7, 2, 4);

Page 20: Wago Pro Manual

Project Components

2-4 WAGO-I/O-PRO 32

in FBD:

In SFC a function call can only take place within a step or a transition.

Note: If you define a function in your project with the nameCheckBounds, you can use it to check for range overflows in your project! Thename of the function is defined and may have only this identifier. An exampleof how this function is implemented is shown below:

Image 2.2: Example of the Implementation of the Function CheckBounds

The following typical program for testing the CheckBounds function goesbeyond the boundaries of a defined array. The CheckBounds functions makessure that the value TRUE is not assigned to the position A[10], but rather to theupper area boundary A[7] which is still valid. Therefore, the CheckBoundsfunction can be used to correct extensions beyond array boundaries.

Image 2.3: Test Program for the CheckBounds Function

Page 21: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-5

Note: If you define functions in your project with the nameCheckDivByte, CheckDivWord, CheckDivDWord and CheckDivReal, youcan use them See the following example for the implementation of the functionCheckDivReal:

Bild 2.4: Example for the implementation of the funciton CheckDivReal

Operator DIV uses the output of function CheckDivReal as Divisor. In aprogram like shown in the following example this avoids an division by 0, thedivisor (d) is set from 0 to 1. So the result of the division is 799.

Bild 2.5: Example program of the function CheckDivReal

Functionblock

A function block is a POU which provides one or more values during theprocedure. As opposed to a function, a function block provides no return value.

A function block declaration begins with the keyword FUNCTION_BLOCKand ends with END_FUNCTION_BLOCK.

Page 22: Wago Pro Manual

Project Components

2-6 WAGO-I/O-PRO 32

Example in IL of a function block with two input variables and two outputvariables. One output is the product of the two inputs, the other a comparisonfor equality:

Image 2.6: Function Block

Function Block Instances

Reproductions or instances (copies) of a function block can be created.

Each instance possesses its own identifier (the Instance name), and a datastructure which contains its inputs, outputs, and internal variables. Instances aredeclared locally or globally as variables, whereas the name of the functionblock is indicated as the type of an identifier.

Example of an instance with the name INSTANCE of the FUB function block:INSTANCE: FUB;

Function blocks are always called through the instances described above.

Only the input and output parameters can be accessed from outside of anfunction block instance. This means the internal variables of the function blocksremain invisible to the user of the function block.

Example for accessing an input variable:

The function block FB has an input variable in1 of the type INT.PROGRAM progVAR

inst1:fb;END_VARLD 17ST inst1.in1CAL inst1END_PROGRAM

Page 23: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-7

The declaration parts of function blocks and programs can contain instancedeclarations. Instance declarations are not permitted in functions.Access to a function block instance is limited to the POU in which it wasdeclared unless it was declared globally.The instance name of a function block instance can be used as the input for afunction or a function block.

Note: All values are retained after processing a function block until thenext it is processed. Therefore, function block calls with the same arguments donot always return the same output values!

Calling a function block

You can use the variables of the function block by entering the instance name, apoint, and then the variable name.

If you would like to set the input parameters when you open the function block,you can do this in the text languages IL and ST by assigning values to theparameters after the instance name of the function block in parentheses (thisassignment takes place using ":=" just as with the initialization of variables atthe declaration position).

Examples for calling function block FUB described above: The multiplicationresult is saved in the variable ERG, and the result of the comparison is saved inQUAD. An instance of FUB with the name INSTANCE is declared.

In IL the function block is called as shown in the following image:

Image 2.7: Function Block Call in IL

In the example below the call is shown in ST. The declaration part is the sameas with IL:

Page 24: Wago Pro Manual

Project Components

2-8 WAGO-I/O-PRO 32

Image 2.8: Function Block Call in ST

In FBD the instance of a function block is called as shown in the followingimage (declaration part the same as with IL):

Image 2.9: Function Block Call in FBD

In SFC function block calls can only take place in steps.

Program

A program is a POU which returns several values during operation. Programsare recognized globally throughout the project. All values are retained from thelast time the program was run until the next.

Image 2.10: Example of a program

Programs can be called. A program call in a function is not allowed. There arealso no instances of programs.

Page 25: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-9

If a POU calls a program, and if thereby values of the program are changed,then these changes are retained the next time the program is called, even if theprogram has been called from within another POU.

This is different from calling a function block. There only the values in thegiven instance of a function block are changed.

These changes therefore play a role only when the same instance is called.

A program declaration begins with the keyword PROGRAM and ends withEND_PROGRAM.

Examples of calls of the program described above:

In IL:CAL PRGExampleLD PRGexample.PARST ERGin ST:PRGExample;Erg := PRGexample.PAR;

In FBD:

Example for a possible call sequence for PLC_PRG:LD 0ST PRGexample.PAR (*Default setting for PAR is 0*)CAL IL call (*ERG in IL call results in 1*)CAL ST call (*ERG in ST call results in 2*)CAL FBD call (*ERG in FBD call results in 3*)

If the variable PAR from the program PRGexample is initialized by a mainprogram with 0, and then one after the other programs are called with abovenamed program calls, then the ERG result in the programs will have the values1, 2, and 3. If one exchanges the sequence of the calls, then the values of thegiven result parameters also change in a corresponding fashion.

PLC_PRG

The PLC_PRG is a special predefined POU. Each project must contain thisspecial program. This POU is called exactly once per control cycle.

The first time the "Project" "Object Add" command is used after a newproject has been created, the default entry in the POU dialog box will be a POUnamed PLC_PRG of the program type. You should not change this defaultsetting!

If tasks have been defined, then the project may not contain any PLC_PRG,since in this case the procedure sequence depends upon the task assignment.

Page 26: Wago Pro Manual

Project Components

2-10 WAGO-I/O-PRO 32

Attention: Do not delete or rename the POU PLC_PRG(assuming you are not using a Task Configuration, see chapter TaskConfiguration!) PLC_PRG is generally the main program in a single taskprogram.

Action

Actions can be defined to function blocks and programmes. The actionrepresents a further implementation which can be entirely created in anotherlanguage as the �normal� implementation. Each action is given a name.

An action works with the data from the function block or programme which itbelongs to. The action uses the same input/output variables and local variablesas the �normal� implementation uses.

Image 2.11:Example for an action of a function block

In the example given, calling up the function block Counter increases ordecreases the output variable �out�, depending on the value of the inputvariable �in�. Calling up the action Reset of the function block sets the outputvariable to zero. The same variable �out� is written in both cases.

An action is called up with <Program_name>.<Action_name> or<Instance_name>.<Action_name>. If it is required to call up the action withinits own block, one just uses the name of the action in the text editors and in thegraphic form the function block call up without instance information.

Examples for the calling-up of the above action:

Declaration for all Examples:PROGRAM PLC_PRGVAR

Inst : Counter;END_VAR

In AWL:CAL Inst.Reset(In := FALSE)LD Inst.out

Page 27: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-11

ST ERG

In ST:Inst.Reset(In := FALSE);Erg := Inst.out;

In FUP:

Note: Actions play an important role in blocks in sequential functioncharts, see the chapter Sequential Function Chart - SFC.

The IEC standard does not recognise actions other than actions of the sequentialfunction chart.

Resources

You need the resources for configuring and organizing your project and fortracing variable values:

• Global Variables which can be used throughout the project• PLC Configuration for configuring your hardware• Task Configuration for guiding your program through tasks• Sampling Trace for graphic display of variable values• Watch and Receipt Manager for displaying variable values and setting

default variable values

See the chapter called "The Resources".

Libraries

You can include in your project a series of libraries whose POUs, data types,and global variables you can use just like user-defined variables. The library"standard.lib" is a standard part of the program and is always at your disposal.

See the chapter called "Library Manager".

Data types

Along with the standard data types the user can define his own data types.Structures, enumeration types and references can be created.

See "Standard" and "Defined data types" in the appendix.

Visualization

WAGO-I/O-PRO 32provides visualizations so that you can display yourproject variables. You can plot geometric elements off-line with the help of thevisualization. They can then change their form online, depending upon certainvariable values.

See the chapter called "Visualization".

Page 28: Wago Pro Manual

Languages

2-12 WAGO-I/O-PRO 32

Languages

Instruction List (IL)

An instruction list (IL) consists of a series of instructions. Each instructionbegins in a new line and contains an operator and, depending on the type ofoperation, one or more operands separated by commas.

In front of an instruction there can be an identification mark (label) followedby a colon (:).

A comment must be the last element in a line. Empty lines can be insertedbetween instructions.

Example:LD 17ST lint (* comment *)GE 5JMPC nextLD idwordEQ istruct.sdwordSTN testnext:

Modifiers and operatorsin IL

In the IL language the following operators and modifiers can be used.

Modifiers:• C with JMP, CAL, RET: The instruction is only then executed if the

result of the preceding expression is TRUE.• N with JMPC, CALC, RETC: The instruction is only then executed if the

result of the preceding expression is FALSE.• N otherwise: Negation of the operand (not of the accumulator)

Below you find a table of all operators in IL with their possible modifiers andthe relevant meaning:

Operator Modifiers MeaningLD N Make current result equal to the operandST N Save current result at the position of the operandS Then put the Boolean operand exactly at TRUE if

the current result is TRUER Then put the Boolean operand exactly at FALSE if

the current result is TRUEAND N,( Bitwise ANDOR N,( Bitwise ORXOR N,( Bitwise exclusive ORADD ( AdditionSUB ( SubtractionMUL ( MultiplicationDIV ( Division

Page 29: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-13

GT ( >GE ( >=EQ ( =NE ( <>LE ( <=LT ( <JMP CN Jump to the labelCAL CN Call programor function block orRET CN Leave POU and return to caller.) Evaluate deferred operation

You find a list of all IEC operators in the appendix.

Example of an IL program while using some modifiers:LD TRUE (*load TRUE in the accumulator*)ANDN BOOL1 (*execute AND with the negated value of the BOOL1

variable*)JMPC mark (*if the result was TRUE, then jump to the label "mark"*)

LDN BOOL2 (*save the negated value of *)ST ERG (*BOOL2 in ERG*)label:LD BOOL2 (*save the value of *)ST ERG *BOOL2 in ERG*)

It is also possible in IL to put parentheses after an operation. The value of theparenthesis is then considered as an operand.

For example:LD 2MUL 2ADD 3ST ERG

Here is the value of Erg 7. However, if one puts parentheses:LD 2MUL(

2

ADD 3)ST ERG

Here the resulting value for Erg is 10, the operation MUL is only then evaluatedif you come to ")"; as operand for MUL 5 is then calculated.

Structured Text (ST

The Structured Text consists of a series of instructions which, as determined inhigh level languages, ("IF..THEN..ELSE") or in loops (WHILE..DO) can beexecuted.

Page 30: Wago Pro Manual

Languages

2-14 WAGO-I/O-PRO 32

Example:IF value < 7 THEN

WHILE value < 8 DOvalue:=value+1;

END_WHILE;END_IF;

Expressions

An expression is a construction which returns a value after its evaluation.

Expressions are composed of operators and operands. An operand can be aconstant, a variable, a function call, or another expression.

Valuation of expressions

The evaluation of an expression takes place by means of processing theoperators according to certain binding rules. The operator with the strongestbinding is processed first, then the operator with the next strongest binding,etc., until all operators have been processed.

Operators with equal binding strength are processed from left to right.

Below you find a table of the ST operators in the order of their bindingstrength:

Operation Symbol Binding strengthPut in parentheses (expression) Strongest bindingFunction call Function name

(parameter list)Exponentiation EXPTNegateBuilding of complements

-NOT

MultiplyDivideModulo

*/MOD

AddSubtract

+-

Compare <,>,<=,>=Equal toNot equal to

=<>

Boolean AND ANDBoolean XOR XORBoolean OR OR Weakest binding

There are the following instructions in ST, arranged in a table together withexample:

Instruction type ExampleAssignment A:=B; CV := CV + 1; C:=SIN(X);Calling a function block anduse of the FB output

CMD_TMR(IN := %IX5, PT := 300);A:=CMD_TMR.Q

RETURN RETURN;

Page 31: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-15

IF D:=B*B;IF D<0.0 THEN C:=A;ELSIF D=0.0 THEN C:=B;ELSE C:=D;END_IF;

CASE CASE INT1 OF1: BOOL1 := TRUE;2: BOOL2 := TRUE;ELSE

BOOL1 := FALSE;BOOL2 := FALSE;

END_CASE;

FOR J:=101;FOR I:=1 TO 100 BY 2 DO IF ARR[I] = 70 THEN J:=I; EXIT; END_IF;END_FOR;

WHILE J:=1;WHILE J<= 100 AND ARR[J] <> 70DO J:=J+2;END_WHILE;

REPEAT J:=-1;REPEAT J:=J+2;UNTIL J= 101 OR ARR[J] = 70END_REPEAT;

EXIT EXIT;Empty instruction ;

Instruction in StructuredText

The name already indicates, the Structured Text is designed for structureprogramming, i.e. ST offers predetermined structures for certain often usedconstructs such as loops for programming.

This offers the advantages of low error probability and increased clarity of theprogram.

For example, let us compare two equally significant program sequences in ILand ST:

A loop for calculating powers of two in IL:Loop:

Page 32: Wago Pro Manual

Languages

2-16 WAGO-I/O-PRO 32

LD Counter

JMPC end

LD Var1MUL 2ST Var1

LD CounterSUB 1ST CounterJMP Loop

End:LD Var1ST ERG

The same loop programmed in ST would produce:WHILE counter<>0 DO

Var1:=Var1*2;Counter:=counter-1;

END_WHILE

Erg:=Var1;

You can see, the loop in ST is not only faster to program, but is alsosignificantly easier to read, especially in view of the convoluted loops in largerconstructs.

The different structures in ST have the following significance:

Assignment operator

On the left side of an assignment there is an operand (variable, address) towhich is assigned the value of the expression on the right side with theassignment operator :=

Example:Var1 := Var2 * 10;

After completion of this line Var1 has the tenfold value of Var2.

Calling function blocks inST

A function block is called in ST by writing the name of the instance of thefunction block and then assigning the values of the parameters in parentheses.In the following example a timer is called with assignments for the parametersIN and PT. Then the result variable Q is assigned to the variable A.

The result variable, as in IL, is addressed with the name of the function block, afollowing point, and the name of the variable:

CMD_TMR(IN := %IX5, PT := 300);A:=CMD_TMR.Q

Page 33: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-17

RETURN instruction

The RETURN instruction can be used to leave a POU, for example dependingon a condition.

IF instruction

With the IF instruction you can check a condition and, depending upon thiscondition, execute instructions.

Syntax:IF <Boolean_expression1> THEN <IF_instructions>{ELSIF <Boolean_expression2> THEN <ELSIF_instructions1>..ELSIF <Boolean_expression n> THEN <ELSIF_instructions n-1>ELSE <ELSE_instructions>}END_IF;

The part in braces {} is optional.

If the <Boolean_expression1> returns TRUE, then only the <IF_Instructions>are executed and none of the other instructions.

Otherwise the Boolean expressions, beginning with <Boolean_expression2>,are evaluated one after the other until one of the expressions returns TRUE.Then only those instructions after this Boolean expression and before the nextELSE or ELSIF are evaluated.

If none of the Boolean expressions produce TRUE, then only the<ELSE_instructions> are evaluated.

Example:IF temp<17THEN heating_on := TRUE;ELSE heating_on := FALSE;END_IF;

Here the heating is turned on when the temperature sinks below 17 degrees.Otherwise it remains off.

CASE instruction

With the CASE instructions one can combine several conditioned instructionswith the same condition variable in one construct.

Syntax:CASE <Var1> OF<Value1>: <Instruction 1><Value2>: <Instruction 2><Value3, Value4, Value5>: <Instruction 3><Value6 .. Value10>: <Instruction 4>

Page 34: Wago Pro Manual

Languages

2-18 WAGO-I/O-PRO 32

...<Value n>: <Instruction n>ELSE <ELSE instruction>END_CASE;

A CASE instruction is processed according to the following model:• If the variable in <Var1> has the value <Value i>, then the instruction

<Instruction i> is executed.• If <Var 1> has none of the indicated values, then the <ELSE Instruction>

is executed.• If the same instruction is to be executed for several values of the

variables, then one can write these values one after the other separated bycommas, and thus condition the common execution.

• If the same instruction is to be executed for a value range of a variable,one can write the initial value and the end value separated by two dotsone after the other. So you can condition the common condition.

Example:CASE INT1 OF1, 5: BOOL1 := TRUE;

BOOL3 := FALSE;2: BOOL2 := FALSE;

BOOL3 := TRUE;10..20: BOOL1 := TRUE;

BOOL3:= TRUE;ELSE

BOOL1 := NOT BOOL1;BOOL2 := BOOL1 OR BOOL2;

END_CASE;

FOR loop

With the FOR loop one can program repeated processes.

Syntax:INT_Var :INT;

FOR <INT_Var> := <INIT_VALUE> TO <END_VALUE> {BY <Stepsize>} DO

<Instructions>END_FOR;

The part in braces {} is optional.

The <Instructions> are executed as long as the counter <INT_Var> is notgreater than the <END_VALUE>. This is checked before executing the<Instructions> so that the <instructions> are never executed if <INIT_VALUE>is greater than <END_VALUE>.

When <Instructions> are executed, <INT_Var> is always increased by <Stepsize>. The step size can have any integer value. If it is missing, then it is set to1. The loop must also end since <INT_Var> only becomes greater.

Page 35: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-19

Example:FOR Counter:=1 TO 5 BY 1 DOVar1:=Var1*2;END_FOR;Erg:=Var1;

Let us assume that the default setting for Var1 is the value 1. Then it will havethe value 32 after the FOR loop.

Note: <END_VALUE> must not be equal to the limit value of the counter<INT_VAR>. For example: If the variable Counter is of type SINT and if<END_VALUE> is 127, you will get an endless loop.

WHILE loop

The WHILE loop can be used like the FOR loop with the difference that thebreak-off condition can be any Boolean expression. This means you indicate acondition which, when it is fulfilled, the loop will be executed.

Syntax:WHILE <Boolean expression> <Instructions>END_WHILE;

The <Instructions> are repeatedly executed as long as the<Boolean_expression> returns TRUE. If the <Boolean_expression> is alreadyFALSE at the first evaluation, then the <Instructions> are never executed. If<Boolean_expression> never assumes the value FALSE, then the<Instructions> are repeated endlessly which causes a relative time delay.

Note: The programmer must make sure that no endless loop is caused. Hedoes this by changing the condition in the instruction part of the loop, forexample, by counting up or down one counter.

Example:WHILE counter<>0 DO

Var1 := Var1*2;Counter := Counter-1;

END_WHILE

The WHILE and REPEAT loops are, in a certain sense, more powerful than theFOR loop since one doesn't need to know the number of cycles beforeexecuting the loop. In some cases one will, therefore, only be able to work withthese two loop types. If, however, the number of the loop cycles is clear, then aFOR loop is preferable since it allows no endless loops.

REPEAT loop

The REPEAT loop is different from the WHILE loop because the break-offcondition is checked only after the loop has been executed. This means that the

Page 36: Wago Pro Manual

Languages

2-20 WAGO-I/O-PRO 32

loop will run through at least once, regardless of the wording of the break-offcondition.

Syntax:REPEAT <Instructions>UNTIL <Boolean expression>END_REPEAT;

The <Instructions> are carried out until the <Boolean expression> returnsTRUE.

If <Boolean expression> is produced already at the first TRUE evaluation, then<Instructions> are executed only once. If <Boolean_expression> never assumesthe value TRUE, then the <Instructions> are repeated endlessly which causes arelative time delay.

Note: The programmer must make sure that no endless loop is caused. Hedoes this by changing the condition in the instruction part of the loop, forexample by counting up or down one counter.

Example:REPEAT

Var1 := Var1*2;Counter := Counter-1;

UNTILCounter=0

END_REPEAT;

EXIT instruction

If the EXIT instruction appears in a FOR, WHILE, or REPEAT loop, then theinnermost loop is ended, regardless of the break-off condition.

Sequential Function Chart (SFC)

The Sequential Function Chart is a graphically oriented language which makesit possible to describe the chronological order of different actions within aprogram.

Page 37: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-21

Image 2.12: Network in SFC

Step

A POU written in a Sequential Function Chart consists of a series of stepswhich are connected with each other through directed connections (transitions).

There are two types of steps.• The simplified type consists of an action and a flag which shows if the

step is active. If the action of a step is implemented, then a small triangleappears in upper right corner of the step.

• An IEC step consists of a flag and one or more assigned actions orboolean variables. The associated actions appear to the right of the step.More on this later.

Action

An action can contain a series of instructions in IL or in ST, a lot of networks inFBD or in LD, or again in Sequential Function Chart (SFC).

With the simplified steps an action is always connected to a step. In order toedit an action, click twice with the mouse on the step to which the actionbelongs. Or select the step and select the menu command "Extras" "ZoomAction/Transition".

Actions of IEC steps hang in the Object Organizer directly under their SFC-POU and are loaded with a doubleclick or by pressing <Enter> in their editor.New actions can be created with "Project" "Add Action".

Page 38: Wago Pro Manual

Languages

2-22 WAGO-I/O-PRO 32

Entry or exit action

You can add an entry action and an exit action to a step. An entry action isexecuted only once, right after the step has become active. An exit action isexecuted only once before the step is deactivated.

A step with entry action is indicated by an "E" in the lower left corner, the exitaction by an "X" in the lower right corner.

The entry and exit action can be implemented in any language. In order to editan entry or exit action, doubleclick in the corresponding corner in the step withthe mouse.

Example of a step with entry and exit action:

Transition / Transitioncondition

Between the steps there are so-called transitions.

A transition condition can be a Boolean variable, a boolean address, a booleanconstant, or a series of instructions with a Boolean result in ST syntax (i.e. (i <=100) AND b) or fully programmed in any language.

Active step

After calling the SFC POU, the action (surrounded by a double border)belonging to the initial step is executed first. A step, whose action is beingexecuted, is called active. If the step is active, then the appropriate action isexecuted once per cycle. In Online mode active steps are shown in blue.

In a control cycle all actions are executed which belong to active steps.Thereafter the respective following steps of the active steps become active if thetransition conditions of the following steps are TRUE. The currently activesteps will be executed in the next cycle.

IEC step

Along with the simplified steps the standard IEC steps in SFC are available.

Any number of actions can be assigned to an IEC step. The actions of IEC stepslie separated from the steps and can be used repeatedly within their POU. Forthis they must be associated to the single steps with the command "Extras""Associate action".Along with actions, Boolean variables can be assigned to steps. Through the so-called qualifiers the actions and Boolean variables are activated anddeactivated, partially with time delays. Since an action can still be active, evenif the next step has been processed, for example through the qualifier S (Set),one can achieve concurrent processes.

An associated boolean variable is set or reset with each call of the AS. Thatmeans, that with each call it gets the value TRUE or FALSE.

Page 39: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-23

The actions associated with an IEC step are shown at the right of the step in atwo-part box. The left field contains the qualifier, possibly with time constant,and the right field contains the action name respectively boolean variable name.

Note: If an action has been inactivated, it will be executed once more.That means, that each action is executed at least twice (also an action withqualifier P).

In case of a call first the deactivated actions, then the active actions areexecuted, in alphabetical order each time.

An example for an IEC step with two actions:

In order to make it easier to follow the processes, all active actions in onlinemode are shown in blue like the active steps. After each cycle a check is madeto see which actions are active.

Whether a newly inserted step is an IEC step depends upon whether the menucommand "Extras" "Use IEC-Steps" has been chosen.

In the Object Organizer the actions hang directly underneath their respectiveSFC POUs. New actions can be created with "Project" "Add Action".

In order to use IEC steps you must include in your project the special SFClibrary Iecsfc.lib .

Image 2.13: SFC POU with actions in the Object Organizer

Qualifier

In order to associate the actions with IEC steps the following qualifiers areavailable:

N Non-stored The action active as long as the stepR overriding Reset The action is deactivatedS Set (Stored) The action is activated and remains active until

a ResetL time Limited The action is activated for a certain time,

maximum as long as the step is activeD time Delayed The action becomes active after a certain time if

the step is still active and then it remains activeas long as the step is active.

Page 40: Wago Pro Manual

Languages

2-24 WAGO-I/O-PRO 32

P Pulse The action is executed just one time if the step isactive

SD Stored and timeDelayed

The action is activated after a certain time andremains active until a Reset

DS Delayed andStored

The action is activated after a certain time aslong as the step is still active and remains activeup to a Reset

SL Stored and timelimited

The action is activated for a certain time

The qualifiers L, D, SD, DS and SL need a time value in the TIME constantformat.

Implicit variables in SFC

There are implicitly declared variables in the SFC which can be used.

A flag belongs to each step which stores the state of the step. The step flag(active or inactive state of the step) is called <StepName>.x for IEC steps orjust <StepName> for the simplified steps. This Boolean variable has the valueTRUE when the associated step is active and FALSE when it is inactive. It canbe used in every action and transition of the SFC block.

One can make an enquiry with the variable <ActionName>.x. as to whether anIEC action is active or not.

Note: During the deactivation of the IEC action the variable already hasthe value FALSE.

For IEC steps the implicit variables <StepName>.t can be used to enquireabout the active time of the steps.

SFC Flags

If a step is active in SFC for longer than its attributes state, some special flagsare set. There are also variables which can be set in order to control the programflow in the sequential function chart. To use the flags it is necessary,somewhere, globally or locally, to declare them as output or input variables.

SFCEnableLimit: This variable is of the type BOOL. When it has the valueTRUE, the timeouts of the steps will be registered in SFCError. Other timeoutswill be ignored.

SFCInit: This variable is also of the type BOOL. When the variable has thevalue TRUE the sequential function chart is set back to the Init step and theother SFC flags are reset. The Init step remains active, but is not executed, foras long as the variable has the value TRUE. It is only when SFCInit is again setto FALSE that the block can be processed normally again.

SFCQuitError: A variable of the type BOOL. Execution of the SFC diagramis stopped for as long as the variable has the value TRUE whereby a possibletimeout in the variable SFCError is reset. All previous times in the active stepsare reset when the variable again assumes the value FALSE.

Page 41: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-25

SFCPause: A variable of the type BOOL. Execution of the SFC diagram isstopped for as long as the variable has the value TRUE.

SFCError: This Boolean variable is set when a timeout has occurred in a SFCdiagram.

SFCTrans: This variable is of the type BOOL. The variable takes on the valueTRUE when a transition is actuated.

SFCErrorStep: This variable is of the type STRING. In this variable the nameof the step is stored which has caused a timeout to occur.

SFCErrorPOU: This variable of the type STRING contains the name of theblock in which a timeout has occurred.

SFCCurrentStep: This variable is of the type STRING. The name of the stepis stored in this variable which is active, independently of the time monitoring.In the case of simultaneous sequences the step is stored in the branch on theouter right.

No further timeout will be registered if a timeout occurs and the variableSFCError is not reset again.

Alternative branch

Two or more branches in SFC can be defined as alternative branches. Eachalternative branch must begin and end with a transition. Alternative branchescan contain parallel branches and other alternative branches. An alternativebranch begins at a horizontal line (alternative beginning) and ends at ahorizontal line (alternative end) or with a jump.

If the step which precedes the alternative beginning line is active, then the firsttransition of each alternative branch is evaluated from left to right. The firsttransition from the left whose transition condition has the value TRUE isopened and the following steps are activated (see active step).

Parallel branch

Two or more branches in SFC can be defined as parallel branches. Each parallelbranch must begin and end with a step. Parallel branches can contain alternativebranches or other parallel branches. A parallel branch begins with a double line(parallel beginning) and ends with a double line (parallel end) or with a jump.

If the parallel beginning line of the previous step is active and the transitioncondition after this step has the value TRUE, then the first steps of all parallelbranches become active (see active step). These branches are now processedparallel to one another. The step after the parallel end line becomes active whenall previous steps are active and the transition condition before this stepproduces the value TRUE.

Jump

A jump is a connection to the step whose name is indicated under the jumpsymbol. Jumps are required because it is not allowed to create connectionswhich lead upward or cross each other.

Page 42: Wago Pro Manual

Languages

2-26 WAGO-I/O-PRO 32

Function Block Diagram (FBD)

The Function Block Diagram is a graphically oriented programming language.It works with a list of networks whereby each network contains a structurewhich represents either a logical or arithmetic expression, the call of a functionblock, a jump, or a return instruction.

An example of a typical network in the Function Block Diagram as it couldappear in WAGO-I/O-PRO 32:

Image 2.14: Network in Function Block Diagram

See also chapter 'The Continuous Function Chart Editor' at 'The Editors inWAGO-I/O-PRO 32'.

Ladder Diagram (LD)

The Ladder Diagram is also a graphics oriented programming language whichapproaches the structure of an electric circuit.

On the one hand, the Ladder Diagram is suitable for constructing logicalswitches, on the other hand one can also create networks as in FBD. Thereforethe LD is very useful for controlling the call of other POUs.

The Ladder Diagram consists of a series of networks. A network is limited onthe left and right sides by a left and right vertical current line. In the middle is acircuit diagram made up of contacts, coils, and connecting lines.

Each network consists on the left side of a series of contacts which pass onfrom left to right the condition "ON" or "OFF" which correspond to theBoolean values TRUE and FALSE. To each contact belongs a Booleanvariable. If this variable is TRUE, then the condition is passed from left to rightalong the connecting line. Otherwise the right connection receives the valueOFF.

Example of a typical network in the Ladder Diagram as it could appear inWAGO-I/O-PRO 32:

Page 43: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-27

Image 2.15: Network in a Ladder Diagram made up of Contacts and Coils

Contact

Each network in LD consists on the left side of a network of contacts (contactsare represented by two parallel lines: | |) which from left to right show thecondition "On" or "Off".

These conditions correspond to the Boolean values TRUE and FALSE. ABoolean variable belongs to each contact. If this variable is TRUE, then thecondition is passed on by the connecting line from left to right, otherwise theright connection receives the value "Out".

Contacts can be connected in parallel, then one of the parallel branches musttransmit the value "On" so that the parallel branch transmits the value "On"; orthe contacts are connected in series, then contacts must transmit the condition"On" so that the last contact transmits the "On" condition. This thereforecorresponds to an electric parallel or series circuit.

A contact can also be negated, recognizable by the slash in the contact symbol:|/|. Then the value of the line is transmitted if the variable is FALSE.

Coil

On the right side of a network in LD there can be any number of so-called coilswhich are represented by parentheses:( ). They can only be in parallel. A coiltransmits the value of the connections from left to right and copies it in anappropriate Boolean variable. At the entry line the value ON (corresponds tothe Boolean variable TRUE) or the value OFF (corresponding to FALSE) canbe present.

Contacts and coils can also be negated (in the example the contact SWITCH1and the coil %QX3.0 is negated). If a coil is negated (recognizable by the slashin the coil symbol: (/)), then it copies the negated value in the appropriateBoolean variable. If a contact is negated, then it connects through only if theappropriate Boolean value is FALSE.

Function blocks in theLadder Diagram

Along with contacts and coils you can also enter function blocks and programs.In the network they must have an input and an output with Boolean values and

Page 44: Wago Pro Manual

Debugging, Online Functions

2-28 WAGO-I/O-PRO 32

can be used at the same places as contacts, that is on the left side of the LDnetwork

Set/Reset coils

Coils can also be defined as set or reset coils. One can recognize a set coil bythe "S" in the coil symbol: (S)) It never writes over the value TRUE in theappropriate Boolean variable. That is, if the variable was once set at TRUE,then it remains so.

One can recognize a reset coil by the "R" in the coil symbol: (R)) It neverwrites over the value FALSE in the appropriate Boolean variable: If thevariable has been once set on FALSE, then it remains so.

LD as FBD

When working with LD it is very possible that you will want to use the result ofthe contact switch for controlling other POUs. On the one hand you can use thecoils to put the result in a global variable which can then be used in anotherplace. You can, however, also insert the possible call directly into your LDnetwork. For this you introduce a POU with EN input.

Such POUs are completely normal operands, functions, programs, or functionblocks which have an additional input which is labeled with EN. The EN inputis always of the BOOL type and its meaning is: The POU with EN input isevaluated when EN has the value TRUE.

An EN POU is wired parallel to the coils, whereby the EN input is connected tothe connecting line between the contacts and the coils. If the ON information istransmitted through this line, this POU will be evaluated completely normally.

Starting from such an EN POU, you can create networks similar to FBD.

Image 2.16: Part of a LD Network with an EN POU

Debugging, Online Functions

Sampling Trace

The Sampling Trace allows you to trace the value sequence of variables,depending upon the so-called trigger event. This is the rising edge or fallingedge of a previously defined Boolean variable (trigger variable). WAGO-I/O-PRO 32 permits the tracing of up to 20 variables. 500 values can be traced foreach variable.

Page 45: Wago Pro Manual

Chapter 2 - WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 2-29

Debugging

The debugging functions of WAGO-I/O-PRO 32 make it easier for you to finderrors.

In order to debug, run the command "Project" "Options" and in the dialogbox that pops up under Build options select the item Debugging.

Breakpoint

A breakpoint is a place in the program at which the processing is stopped. Thusit is possible to look at the values of variables at specific places within theprogram.

Breakpoints can be set in all editors. In the text editors breakpoints are set atline numbers, in FBD and LD at network numbers, and in SFC at steps.

Single step

Single step means:• In IL: Execute the program until the next CAL, LD or JMP command.• In ST: Execute the next instruction.• In FBD, LD: Execute the next network.• In SFC: Continue the action until the next step.

By proceeding step by step you can check the logical correctness of yourprogram.

Single Cycle

If Single cycle has been chosen, then the execution is stopped after each cycle.

Change values online

During operations variables can be set once at a certain value (write value) oralso described again with a certain value after each cycle (forcing). In onlinemode one also can change the variable value by double click on the value. Bythat boolean variables change from TRUE to FALSE or the other way round,for each other types of variables one gets the dialog Write Variable xy, wherethe actual value of the variable can be edited.

Monitoring

In addition to the variable declarations visible on the screen, the current valuesfrom the PLC are continuously read and displayed.

In Online mode WAGO-I/O-PRO 32 monitors all variables visible on thescreen. At the same time variables can be put together in the Watch and ReceiptManager whose data you would like to see all in one place.

Simulation

During the simulation the created PLC program is not processed in the PLC,but rather in the calculator on which WAGO-I/O-PRO 32 is running. Allonline functions are available. That allows you to test the logical correctness ofyour program without PLC hardware.

Page 46: Wago Pro Manual

The Standard

2-30 WAGO-I/O-PRO 32

The Standard

The IEC 61131-3 standard from 1993 is an international standard for modernsystems with PLC functionality. Based on a structured software model itdefines a series of high-capacity programming languages, which can beemployed for different automation tasks. Here the development environment ofPLC systems has not been taken into consideration.

The use of standardised controls which are in accordance with this standardprovides the user with the following advantages:

• The optimum programming language can be selected for each individualapplication.

• Software structure and command block of the standard are better suited tomeet the increasingly complex requirements than the functions of earliersystems

• When using systems from different manufacturers the programmertraining time is reduced

• Programs and program elements can be more simply transmitted fromother supplier systems

• PLC systems are comparable

The 5 programming languages realisable in WAGO-I/O-PRO 32 IL, LD, FBD,ST and SFC conform with the requirements of the standard.

According to this standard, a program consists of the following elements:• Structures• POUs• Global Variables

The processing of a WAGO-I/O-PRO 32 program begins with the special POUPLC_PRG. The POU PLC_PRG can call other POUs.

Page 47: Wago Pro Manual

Chapter 3 - We Write a Little Program

WAGO-I/O-PRO 32 3-1

3 We Write a Little Program

Controlling a Traffic Signal Unit

Let us now start to write a small example program. It is for a simple trafficsignal unit which is supposed to control two traffic signals at an intersection.The red/green phases of both traffic signals alternate and, in order to avoidaccidents, we will insert yellow or yellow/red transitional phases. The latter willbe longer than the former.

In this example you will see how time dependent programs can be shown withthe language resources of the IEC 61131-3 standard, how one can edit thedifferent languages of the standard with the help of WAGO-I/O-PRO 32, andhow one can easily connect them while becoming familiar with the simulationof WAGO-I/O-PRO 32.

Create POU

The beginning is always easy: Start WAGO-I/O-PRO 32 and choose "File""New".

In the dialog box which appears, the first POU has already been given thedefault name PLC_PRG. Keep this name, and the type of POU shoulddefinitely be a program. Each project needs a program with this name. In thiscase we choose as the language of this POU the Continuous Function ChartEditor (CFC).

Now create three more objects with the command "Project" "Object Add"with the menu bar or with the context menu (press right mouse button in theObject Organizer): a program in the language Sequential Function Chart (SFC)named SEQUENCE, a function block in the language Function Block Diagram(FBD) named TRAFFICSIGNAL, along with a POU WAIT, also of the typefunction block, which we want to program as an Instruction List (IL).

What doesTRAFFICSIGNAL do?

In the POU TRAFFICSIGNAL we will assign the individual trafficsignalphases to the lights, i.e. we will make sure that the red light is lit red in the redphase and in the yellow/red phase, the yellow light in the yellow and yellow/redphases, etc.

What does WAIT do?

In WAIT we will program a simple timer which as input will receive the lengthof the phase in milliseconds, and as output will produce TRUE as soon as thetime period is finished.

Page 48: Wago Pro Manual

Controlling a Traffic Signal Unit

3-2 WAGO-I/O-PRO 32

What does SEQUENCEdo?

In SEQUENCE all is combined so that the right light lights up at the right timefor the desired time period.

What does PLC_PRG do?

In PLC_PRG the input start signal is connected to the traffic lights' sequenceand the 'color instructions' for each lamp are provided as outputs.

"TRAFFICSIGNAL"declaration

Let us now turn to the POU TRAFFICSIGNAL. In the declaration editor youdeclare as input variable (between the keywords VAR_INPUT and END_VAR)a variable named STATUS of the type INT. STATUS will have four possibleconditions, that is one for the TRAFFICSIGNAL phases green, yellow,yellow/red andred.

Therefore our TRAFFICSIGNAL has three outputs, that is RED, YELLOW andGREEN. You should declare these three variables. Then the declaration part ofour function block TRAFFICSIGNAL will look like this:

Image 3.1: Function block TRAFFICSIGNAL, declaration part

"TRAFFICSIGNAL" body

Now it is time to determine from the input STATUS of the POU the values ofthe output variables. For this go into the body of the POU. Click on the field tothe left beside the first network (the gray field with the number 1). You havenow selected the first network. Now choose the menu item "Insert""Operator".

In the first network a box is inserted with the operator AND and two inputs:

Page 49: Wago Pro Manual

Chapter 3 - We Write a Little Program

WAGO-I/O-PRO 32 3-3

Click on the text AND with the mouse pointer and change the text into EQ.Select the three question marks from the upper of the two inputs and enter thevariable STATUS. Then select the lower of the three question marks and put a1 underneath it. You get the following network:

Click now on a place behind the EQ Box. Now the output of the EQ operationis selected. Choose "Insert" "Assignment". Change the three question marks??? to GREEN. You now have created a network with the following structure:

STATUS is compared with 1, the result is assigned to GREEN. This networkthus switches to GREEN if the preset state value is 1.

For the other TRAFFICSIGNAL colors we need two more networks. Youcreate them with the command "Insert" "Network (after)". These networksshould be set up as in the example. The finished POU now is as follows:

Page 50: Wago Pro Manual

Controlling a Traffic Signal Unit

3-4 WAGO-I/O-PRO 32

Image 3.2: Function block TRAFFICSIGNAL, instruction part

In order to insert an operator in front of another operator, you must select theplace where the input to which you want to attach the operator feeds into thebox.

Then use the command "Insert" "Operator". Otherwise you can setup thesenetworks in the same way as the first network.

Now our first POU has been finished. TRAFFICSIGNAL, according to theinput of the value STATUS, controls whichever light color we wish.

Connecting thestandard.lib

For the timer in the POU WAIT we need a POU from the standard library.Therefore, open the library manager with "Window" "Library Manager".Choose "Insert" "Additional library" . The dialog box appears for openingfiles. From the list of the libraries choose standard.lib.

Page 51: Wago Pro Manual

Chapter 3 - We Write a Little Program

WAGO-I/O-PRO 32 3-5

"WAIT" declaration

Now let us turn to the POU WAIT. This POU is supposed to become a timerwith which we can determine the length of the time period of eachTRAFFICSIGNAL phase. Our POU receives as input variable a variable TIMEof the type TIME, and as output it produces a Boolean value which we want tocall OK and which should be TRUE when the desired time period is finished.We set this value with FALSE by inserting at the end of the declaration (beforethe semicolon, however) " := FALSE ".

For our purposes we need the POU TP, a clock generator. This has two inputs(IN, PT) and two outputs (Q, ET). TP does the following:

As long as IN is FALSE, ET is 0 and Q is FALSE. As soon as IN provides thevalue TRUE, the time is calculated at the output ET in milliseconds. When ETreaches the value PT, then ET is no longer counted. Meanwhile Q producesTRUE as long as ET is smaller than PT. As soon as the value PT has beenreached, then Q produces FALSE again. In addition you will find a shortdescription of all POUs from the standard library in the appendix.

In order to use the POU TP in the POU WAIT we must create a local instancefrom TP. For this we declare a local variable ZAB (for elapsed time) of the typeTP (between the keywords VAR, END_VAR).

The declaration part of WAIT thus looks like this:

Image 3.3: Function Block WAIT, Declaration Part

"WAIT" body

In order to create the desired timer, the body of the POU must be programmedas follows:

Page 52: Wago Pro Manual

Controlling a Traffic Signal Unit

3-6 WAGO-I/O-PRO 32

Image 3.4: Function Block WAIT, Instruction Part

At first it is checked whether Q has already been set at TRUE (as though thecounting had already been executed), in this case we change nothing with theoccupation of ZAB, but rather we call the function block ZAB without input (inorder to check whether the time period is already over).

Otherwise we set the variable IN in ZAB at FALSE, and therefore at the sametime ET at 0 and Q at FALSE. In this way all variables are set at the desiredinitial condition. Now we assign the necessary time from the variable TIMEinto the variable PT, and call ZAB with IN:=TRUE. In the function block ZABthe variable ET is now calculated until it reaches the value TIME, then Q is setat FALSE.

The negated value of Q is saved in OK after each execution of WAIT. As soonas Q is FALSE, then OK produces TRUE.

The timer is finished at this point. Now it is time to combine our two functionblocks WAIT and TRAFFICSIGNAL in the main program PLC_PRG.

"SEQUENCE" firstexpansion level

First we declare the variables we need. They are: an input variable START ofthe type BOOL, two output variables TRAFFICSIGNAL1 andTRAFFICSIGNAL2 of the type INT and one of the type WAIT (DELAY asdelay). The program SEQUENCE now looks like shown here:

Page 53: Wago Pro Manual

Chapter 3 - We Write a Little Program

WAGO-I/O-PRO 32 3-7

Image 3.5: Program Sequence, First Expansion Level, Declaration Part

Create a SFC diagram

The beginning diagram of a POU in SFC always consists of an action "Init" of afollowing transition "Trans0" and a jump back to Init. We should expand thatsomewhat.

First let us determine the structure of the diagrams before we program theindividual action and transitions. First we need for each TRAFFICSIGNALphase a step.. Insert it by marking Trans0 and choosing "Insert" "Steptransition (after)". Repeat this procedure three more times.

If you click directly on the name of a transition or a step, then this is markedand you can change it. Name the first transition after Init "START", and allother transitions "DELAY.OK".

The first transition switches through, if START is TRUE and all others switchthrough when DELAY in OK produces TRUE, i.e. when the set time period isfinished.

The steps (from top to bottom) receive the names Switch1, Green2, Switch2,Green1, whereby Init of course keeps its Name. "Switch" should include ayellow phase, at Green1 TRAFFICSIGNAL1 will be green, at Green2TRAFFICSIGNAL2 will be green. Finally change the return address of Initafter Switch1. If you have done everything right, then the diagram should be asfollows:

Page 54: Wago Pro Manual

Controlling a Traffic Signal Unit

3-8 WAGO-I/O-PRO 32

Image 3.6: Program SEQUENCE, First Expansion Level, Instruction Part

Now we have to finish programming the individual steps. If you doubleclick onthe field of a step, then you open a dialog to open a new action. In our case wewill use IL (Instruction List).

Actions and transitionconditions

In the action of the step Init the variables are initialized, the STATUS ofTRAFFICSIGNAL1 should be 1 (green). The state of TRAFFICSIGNAL2should be 3 (red). The action Init then is as follows:

Page 55: Wago Pro Manual

Chapter 3 - We Write a Little Program

WAGO-I/O-PRO 32 3-9

Image 3.7: Action Init

Switch1 changes the State of TRAFFICSIGNAL1 to 2 (yellow), and that ofTRAFFICSIGNAL2 to 4 (yellow-red). In addition, a time delay of 2000milliseconds is now set. The action is now as follows:

Image 3.8: Action Switch1

With Green2 TRAFFICSIGNAL1 is red (STATUS:=3), TRAFFICSIGNAL2green (STATUS:=1), and the delay time is at 5000 milliseconds.

Image 3.9: Action Green2

At Switch2 the STATUS of TRAFFICSIGNAL1 changes to 4 (yellow-red),that of TRAFFICSIGNAL2 to 2 (yellow). A time delay of 2000 milliseconds isnow set.

Image 3.10: Action Switch2

With Green1 TRAFFICSIGNAL1 is green (STATUS:=1), TRAFFICSIGNAL2is red (STATUS:=3), and the time delay is set at 5000.

Image 3.11: Action Green1

Page 56: Wago Pro Manual

Controlling a Traffic Signal Unit

3-10 WAGO-I/O-PRO 32

The first expansion phase of our program is completed. Now you can compile itand also test the simulation.

"SEQUENCE" secondexpansion level

In order to ensure that our diagram has at least one alternative branch, and sothat we can turn off our traffic light unit at night, we now include in ourprogram a counter which, after a certain number of TRAFFICSIGNAL cycles,turns the unit off.

At first we need a new variable COUNTER of the type INT. Declare this asusual in the declaration part of PLC_PRG, and initialize it in Init with 0.

Image 3.12: Action Init, Second Version

Now select the transition after Switch1 and insert a step and then a transition.Select the resulting transition and insert an alternative branch to its left. Afterthe left transition insert a step and a transition. After the resulting new transitioninsert a jump after Switch1.

Name the new parts as follows: the upper of the two new steps should be called"Count" and the lower "Off". The transitions are called (from top to bottom andfrom left to right) EXIT, TRUE and DELAY.OK. The new part shouldtherefore look like the part with the black border:

Page 57: Wago Pro Manual

Chapter 3 - We Write a Little Program

WAGO-I/O-PRO 32 3-11

Image 3.13: Program SEQUENCE, Second Expansion Level, Instruction Part

Now two new actions and a new transition condition are to be implemented. Atthe step Count, the only thing that happens is that COUNTER is increased byone:

Image 3.14: Action Count

The EXIT transition checks whether the counter is greater than a certainnumber, for example 7:

Image 3.15: Transition EXIT

Page 58: Wago Pro Manual

Controlling a Traffic Signal Unit

3-12 WAGO-I/O-PRO 32

At Off the state of both lights is set at 5(OFF), (or each other number not equal1,2,3 or 4) the COUNTER is reset to 0, and a time delay of 10 seconds is set:

Image 3.16: Action Off

The result

In our hypothetical situation, night falls after seven TRAFFICSIGNAL cycles,for ten seconds the TRAFFICSIGNAL turns itself off, then we have daylightagain, the traffic light unit turns itself on again, and the whole process startsagain from the beginning.

PLC_PRG

We want to start-up the traffic lights system over an ON switch and we want tosend each of the six lamps (each traffic light red, green, yellow) thecorresponding �signal command� for each step of the SEQUENCE. We arenow declaring appropriate Boolean variables for these six outputs and oneinput, before we create the programme in the editor, and are allocating them, atthe same time, to the corresponding IEC addresses.

The next step is to declare the variables LIGHT1 and LIGHT2 of the typeTRAFFICSIGNAL in the declaration editor.

Figure 3.17: Declaration LIGHT1 and LIGHT2

These deliver the Boolean value of each of the six lights to the abovementioned six outputs for each step of the block SEQUENCE. We are not,however, declaring the output variables which are foreseen within thePLC_PRG block but under Resources for Global Variables instead. TheBoolean input variable IN, which is used to set the variable START in the blockSEQUENCE to TRUE, can be set in the same way. ON is also allocated to anIEC address.

Select the tab Resources and open the list Global Variables.

Make the declaration as follows:

Page 59: Wago Pro Manual

Chapter 3 - We Write a Little Program

WAGO-I/O-PRO 32 3-13

Figure 3.18: Declaration of the Input-/Output Variables

The name of the variable (e.g. IN) is followed, after AT, by a percent signwhich begins the IEC address. I stands for input, Q for output, X (used in thisexample) stands for bit and the individual bits of the module are addressedusing 0.0 (0.1, 0.2, etc.). We will be handling the controller configurationafterwards but we want, first of all, to finish off the block PLC_PRG.

For this we go into the editor window. We have selected the ContinuousFunction Chart editor and we consequently obtain, under the menu bar, a CFCsymbol bar with all of the available elements (see Chapter The ContinuousFunction Chart Editor).

Click on the right mouse key in the editor window and select the element Box.Click on the text AND and write �SEQUENCE� instead. This brings up theblock SEQUENCE with all of the already defined input and output variables.Insert two further block elements which you name PHASES. Phases is afunction block and this causes you to obtain three red question marks over theblock which you replace with the already locally declared variables LIGHT1and LIGHT2. Now set an element of the type Input, which award the title ONand six elements of the type Output which you award variable names to, asdescribed, namely L1_green, L1_yellow, L1_red, L2_green, L2_yellow,L2_red.

All of the elements of the programme are now in place and you can connect theinputs and outputs, by clicking on the short line at the input/output of anelement and dragging this with a constantly depressed mouse key to theinput/output of the desired element.

Your program should finally look like the example shown here.

Page 60: Wago Pro Manual

Visualizing a Traffic Signal Unit

3-14 WAGO-I/O-PRO 32

Figure 3.19: PLC_PRG, Declaration and presentation with the Continuous Function Chart Editor

TRAFFICSIGNALsimulation

Now test your program. For this you must compile it ("Project" "Rebuildall") login ("Online" "Login" and then load it "Online" "Download"). Ifyou now select "Online" "Run", the chronological order of the individualsteps of your main program can be followed. The window of the POUPLC_PRG has now changed to the monitor window. Click twice on the plussign in the declaration editor, the variable display drops down, and you can seethe values of the individual variables.

Visualizing a Traffic Signal Unit

With the visualization of WAGO-I/O-PRO 32 you can quickly and easily bringproject variables to life. You find an complete description of the visualizationin chapter 8. We will now plot two traffic signals and an ON-Switch for ourtraffic light unit which will illustrate the switching process.

Creating a newvisualization

In order to create a visualization you must first select the range ofVisualization in the Object Organizer. First click on the lower edge of thewindow on the left side with the POU on the register card with this symbol and the name Visualization. If you now choose the command "Project""Object Add", then a dialog box opens.

Page 61: Wago Pro Manual

Chapter 3 - We Write a Little Program

WAGO-I/O-PRO 32 3-15

Image 3.20: Dialog Box for Opening a New Visualization

Enter here any name. When you confirm the dialog with OK, then a windowopens in which you can set up your new visualization.

Insert element inVisualization

For our TRAFFICSIGNAL visualization you should proceed as follows:

• Give the command "Insert" "Ellipse" and draw a medium sized circle(∅ 2cm). For this click in the editor field and draw with pressed left mousebutton the circle in its length.

• Now doubleclick the circle. The dialog box for editing visualizationelements opens

• Choose the category Variables and enter in the field Change color thevariable name .L1_red or choose this variable using the input assistance (button<F2>). This addresses the variable RED of the function block instanceTRAFFICSIGNAL1 of the POU PLC_PRG.

Image 3.21: Visualization Dialog Box Variables

• Then choose the category Color and click on the button Inside in the areaColor. Choose as neutral a color as possible, such as black.

• Now click on the button within in the area Alarm color and choose thered which comes closest to that of a red light.

Page 62: Wago Pro Manual

Visualizing a Traffic Signal Unit

3-16 WAGO-I/O-PRO 32

Image 3.22: Visualization Configuration Dialog Box (Color category)

The resulting circle will normally be black, and when the variable RED fromTRAFFICSIGNAL1 is TRUE, then its color will change to red. We havetherefore created the first light of the first traffic signal !

The other traffic lights

Now enter the commands "Edit" "Copy" (<Ctrl>+<C>) and then twice"Edit" "Paste" (<Ctrl>+<V>). That gives you two more circles of the exactsame size lying on top of the first one. You can move the circles by clicking onthe circle and dragging it with pressed left mouse button. The desired positionshould, in our case, be in a vertical row in the left half of the editor window.Doubleclick on one of the other two circles in order to open the configurationdialog box again. Enter in the field Change Color of the corresponding circlethe following variables:

for the middle circle: L1_yellow

for the lowest circle: L1_green

Now choose for the circles in the category Color and in the area Alarm colorthe corresponding color (yellow or green).

The TRAFFICSIGNALcase

Now enter the command "Insert" "Rectangle", and insert in the same way asthe circle a rectangle which encloses the three circles. Once again choose asneutral a color as possible for the rectangle and give the command "Extras""Send to back" so that the circles are visible again.

If simulation mode1 is not yet turned on, you can activate it with the command"Online" "Simulation".

1 The simulation mode is active if a check mark (�) appears in front of themenu item "Simulation" in the "Online" menu..

Page 63: Wago Pro Manual

Chapter 3 - We Write a Little Program

WAGO-I/O-PRO 32 3-17

If you now start the simulation with the commands "Online" "Login" and"Online" "Run", then you can observe the color change of the first trafficsignal.

The second traffic signal

The simplest way to create the second traffic signal is to copy all of theelements of the first traffic signal. For this you select all elements of the firsttraffic signal and copy them (as before with the lights of the first traffic signal)with the commands "Edit" "Copy" and "Edit" "Paste". You then only haveto change the text "TRAFFICSIGNAL1" in the respective dialog boxes into"TRAFFICSIGNAL2", and the visualization of the second traffic signal iscompleted.

The ON switch

Insert a rectangle and award it, as described above, a colour for a traffic light ofyour choice and enter .ON at Variables for the Change color. Enter �ON� inthe input field for Content in the category Text.

Image 3.23: Dialog to configure the visualization elements (Category Text)

In order to set the variable ON to TRUE with a mouse click on the switch, thevariable .ON must be entered into the category Variables. Also select theOption Variable keying and enter the variable .ON at this point. Variablekeying means that when a mouse click is made on the visualization element thevariable .ON is set to the value TRUE but is reset to the value FALSE when themousekey is released again (we have created hereby a simple switch-on devicefor our traffic lights program).

Page 64: Wago Pro Manual

Visualizing a Traffic Signal Unit

3-18 WAGO-I/O-PRO 32

Image 3.24: Dialog to configure the visualization elements (Category Input)

Font in the visualization

In order to complete the visualization you should first insert two morerectangles which you place underneath the traffic signals.

In the visualizations dialog box set white in the category Color for Frame andwrite in the category Text in the field Contents "Light1" or "Light2". Now yourvisualization looks like this:

Image 3.25: Visualization for the Sample Project Trafficsignal

Page 65: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-1

4 The Individual Components

The Main Window

Image 4.1: The Main Window

The following elements are found in the main window of WAGO-I/O-PRO 32(from top to bottom):

• The menu bar• The Tool bar (optional); with buttons for faster selection of menu

commands.• The Object Organizer with register cards for POUs, Data types,

Visualizations, and Resources• A vertical screen divider between the Object Organizer and the Work

space of WAGO-I/O-PRO 32• The Work space in which the editor windows are located• The message window (optional)• The Status bar (optional); with information about the current status of

the project

Menu bar

The menu bar is located at the upper edge of the main window. It contains allmenu commands.

Image 4.2: Menu Bar

Page 66: Wago Pro Manual

The Main Window

4-2 WAGO-I/O-PRO 32

Tool bar

By clicking with the mouse on a symbol you can select a menu command morequickly. The choice of the available symbols automatically adapts itself to theactive window.

The command is only carried out when the mouse button is pressed on thesymbol and then released.

If you hold the mouse pointer for a short time on a symbol in the tool bar, thenthe name of the symbol is shown in a Tooltip.

In order to see a description of each symbol on the tool bar, select in Help theeditor about which you want information and click on the tool bar symbol inwhich you are interested.

The display of the tool bar is optional (see "Project" "Options" categoryDesktop).

Image 4.3: Tool bar with symbols

Object Organizer

The Object Organizer is always located on the left side of WAGO-I/O-PRO.32At the bottom there are four register cards with symbols for the four types ofobjects POUs, Data types, Visualizations and Resources. Inorder to change between the respective object types click with the mouse on thecorresponding register card or use the left or right arrow key.

You will learn in chapter Creating and Deleting Objects, etc.how to work withthe objects in the Object Organizer.

Image 4.4: Object Organizer

Screen divider

The screen divider is the border between two non-overlapping windows. InWAGO-I/O-PRO 32 there are screen dividers between the Object Organizerand the Work space of the main window, between the interface (declarationpart) and the implementation (instruction part) of POUs and between the Workspace and the message window.

Page 67: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-3

You can move the screen divider with the mouse pointer. You do this bymoving the mouse with the left mouse button pressed.

Make sure the screen divider always remains at its absolute position, even whenthe window size has been changed. If it seems that the screen divider is nolonger present, then simply enlarge your window.

Work space

The Work space is located on the right side of the main window in WAGO-I/O-PRO 32. All editors for objects and the library manager are opened in thisarea.

You find the description of the editors in the chapter Editors in WAGO-I/O-PRO 32

Under the menu item "Window" you find all commands for windowmanagement.

Message window

The message window is separated by a screen divider underneath the workspace in the main window.

It contains all messages from the previous compilations, checks , orcomparisons.

If you doubleclick with the mouse in the message window on a message orpress <Enter>, the editor opens with the object. The relevant line of the objectis selected. With the commands "Edit" "Next error" and "Edit" "Previouserror" you can can quickly jump between the error messages.

The display of the message window is optional (see "Window" "Messages").

Status bar

The status bar at the bottom of the window frame of the main window inWAGO-I/O-PRO 32 gives you information about the current project and aboutmenu commands.If an item is relevant, then the concept appears on the right side of the status barin black script, otherwise in gray script.When you are working in online mode, the concept Online appears in blackscript. If you are working in the offline mode it appears in gray script.In Online mode you can see from the status bar whether you are in thesimulation (SIM), the program is being processed (RUNS), a breakpoint is set(BP), or variables are being forced (FORCE).With text editor the line and column number of the current cursor position isindicated (e.g. Line:5, Col.:11). In online mode 'OV' is indicated black in thestatus bar. Pressing the <Ins> key switches between Overwrite and Insert mode.If the mouse point is in a visualization, the current X and Y position of thecursor in pixels relative to the upper left corner of the screen is given. If themouse pointer is on an Element, or if an element is being processed, then its

Page 68: Wago Pro Manual

Options

4-4 WAGO-I/O-PRO 32

number is indicated. If you have an element to insert, then it also appears (e.g.Rectangle).If you have chosen a menu command but haven't yet confirmed it, then a shortdescription appears in the status bar.The display of the statusbar is optional (see "Project" "Options" categoryDesktop).

Context Menu

Shortcut: <Shift>+<F10>Instead of using the menu bar for executing a command, you can use the rightmouse button. The menu which then appears contains the most frequently usedcommands for a selected object or for the active editor. The choice of theavailable commands adapts itself automatically to the active window. Thechoice of the available commands adapts itself automatically to the activewindow.

Options

About WAGO-I/O-PRO 32 there can be of course only one viewpoint. InWAGO-I/O-PRO 32, however, you can configure the view of the mainwindow (and have more than one viewpoint). In addition you can make othersettings. For this you have the command "Project" Options" at your disposal.The settings you make thereby are, unless determined otherwise, saved in thefile "WAGO-IO-PRO.ini" and restored at the next WAGO-I/O-PRO 32startup.

"Project" "Options"

With this command the dialog box for setting options is opened. The optionsare divided into different categories. Choose the desired category on the leftside of the dialog box by means of a mouse click or using the arrow keys andchange the options on the right side.

You have at your disposal the following categories:• Load & Save• User information• Editor• Desktop• Color• Directories• Build• Passwords

Load & Save

If you choose this category , then you get the following dialog box:

Page 69: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-5

Image 4.5: Option dialog box of the category Load & Save

When activating an option, a check (�) appears before the option.

If you choose the option Create Backup, then WAGO-I/O-PRO 32 creates abackup file at every save with the extension ".bak". In this way you can alwaysrestore the versions before the last save.

If you choose the option Auto Save , then while you work your project isconstantly saved to a temporary file with the extension ".asd" according to a settime interval (Auto Save Interval). This file is erased at a normal exit from theprogram. If for any reason WAGO-I/O-PRO 32 is not shut down "normally"(e.g. due to a power failure), then the file is not erased. When you open the fileagain the following message appears:

Image 4.6: There is an auto save backup.

You can now decide whether you want to open the original file or the auto savefile.

If you request the option Ask for project info, then when saving a new project,or saving a project under a new name, the project info is automatically called.You can visualize the project info with the command "Project" "Projectinfo" and also process it.

If you choose the option Auto Load, then at the next start of WAGO-I/O-PRO32 the last open project is automatically loaded. The loading of a project at the

Page 70: Wago Pro Manual

Options

4-6 WAGO-I/O-PRO 32

start of WAGO-I/O-PRO 32 can also take place by entering the project in thecommand line.

User information

If you choose this category , then you get the following dialog box:

Image 4.7: Options dialog box of the category User information

To User information belong the Name of the user, his Initials and theCompany for which he works. Each of the entries can be modified.

Editor

If you choose this category , then you get the following dialog box:

Image 4.8: Options dialog box of the category Editor

When activating an option, a check (�) appears before the option.

You can make the following settings for the Editors:• Autodeclaration• Autoformat• Declaration as table

Page 71: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-7

• Tab width• Font• Display of the text selection• Display of the Bitvalues

Autodeclaration

If you have chosen the Autodeclaration, then (following the input of a not-yet-declared variable) a dialog box will appear in all editors with which thisvariable can be declared.

Autoformat

If the option Autoformat in the category Editor of the options dialog box hasbeen chosen, then WAGO-I/O-PRO 32 executes automatic formatting in the ILeditor and in the declaration editor. When you finish with a line, the followingformatting is made:

• Operators written in small letters are shown in capitals;• Tabs are inserted to that the columns are uniformly divided.

Declarations as tables

If the option Declarations as tables in the Editor category in the Optionsdialog box is selected, then you can edit variables in a table instead of using theusual declaration editor (see chapter The Declaration Editor). This table isarranged as a card-index box in which there are register cards for input, output,local, and input/output variables. For each variable you have available the fieldsName, Address, Type, Initial, and Comment.

Tab-Width

In the field Tab-Width in the category Editor of the Options dialog box youcan determine the width of a tab as shown in the editors. The default setting isfour characters, whereby the character width depends upon the font which ischosen.

Font

By clicking on the button Font in the category Editor of the Options dialog boxyou can choose the font in all WAGO-I/O-PRO 32 editors. The font size is thebasic unit for all drawing operations. The choice of a larger font size thusenlarges the printout, even with each editor of WAGO-I/O-PRO 32.

After you have entered the command, the font dialog box opens for choosingthe font, style and font size.

Page 72: Wago Pro Manual

Options

4-8 WAGO-I/O-PRO 32

Image 4.9: Dialog box for setting the font

Mark

When choosing Mark in the Editor category in the Options dialog box you canchoose whether the current selection in your graphic editors should berepresented by a dotted rectangle (Dotted), a rectangle with continuous lines(Line) or by a filled-in rectangle (Filled). In the last case the selection is showninverted.

The selection is activated in front of which a (• ) point appears.

Bitvalues

When choosing Bitvalues in the category Editor of the Options dialog box youcan choose whether binary data (type BYTE, WORD, DWORD) duringmonitoring should be shown Decimal, Hexadecimal, or Binary.

The selection is activated in front of which a (• ) point appears.

Desktop

If you choose this category , then you get the following dialog box:

Page 73: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-9

Image 4.10: Options dialog box of the category Desktop

If the option Tool bar has been chosen, then the tool bar with the buttons forfaster selection of menu commands becomes visible underneath the menu bar.

If the option Status bar has been chosen, then the status bar at the lower edgeof the WAGO-I/O-PRO 32 main window becomes visible.

If the option Online in Security mode has been chosen, then in Online modewith the commands "Run", "Stop", "Reset", "Toggle Breakpoint", "Singlecycle", "Write values", "Force values" and "Release force", a dialog boxappears with the confirmation request whether the command should really beexecuted. This option is saved with the project.

In language you can define, in which language the menu and dialog texts aredisplayed.

Note: Please note, that the language choice is only possible underWindows NT !

Colors

If you choose this category , then you get the following dialog box:

Page 74: Wago Pro Manual

Options

4-10 WAGO-I/O-PRO 32

Image 4.11: Options dialog box of the category Color

You can edit the default color setting of WAGO-I/O-PRO 32. You can choosewhether you want to change the color settings for Line numbers (defaultsetting: light gray), for Breakpoint positions (dark gray), for a Set breakpoint(light blue), for the Current position (red), for the Reached Positions (green)or for the Monitoring of Boolean values (blue).

If you have chosen one of the indicated buttons, the dialog box for the input ofcolors opens.

Image 4.12: Dialog box for setting colors

Directories

If you choose this category , then you get the following dialog box:

Page 75: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-11

Image 4.13: Options dialog box of the category Directories

In the input fields Libraries and Compilation Files you can indicatedirectories from which WAGO-I/O-PRO 32 should extract the libraries orcompilation files. If you activate the button (...) behind a field, then the dialogbox for selecting a directory opens.

Build

If you choose this category , then you get the following dialog box:

Image 4.14: Options dialog box of the category Build

If the option Debugging has been chosen, then the code can significantlyincrease in size. Choosing this option makes it possible to generate additionaldebugging codes. This is necessary in order to use the WAGO-I/O-PRO 32debugging functions. If you deactivate this option, then you make possiblefaster processing and a smaller code. This option is saved with the project.

If the option Save before compile, then your project will be saved every timebefore compilation.

Page 76: Wago Pro Manual

Options

4-12 WAGO-I/O-PRO 32

With the indication of the Number of data segments you can determine howmuch space is reserved in the PLC for the data of your project. If during Buildyou get the message: "The global variables need too much memory", thenincrease the number of segments in "Project" "Build" ", which increases thenumber of the data segments.

These options are saved with the project.

Passwords

If you choose this category , then you get the following dialog box:

Image 4.15: Options dialog box of the category Passwords

To protect your files from unauthorized access WAGO-I/O-PRO 32 offers theoption of using a password to protect against your files being opened orchanged.

Enter the desired password in the field Password. For each typed character anasterisk (*) appears in the field. You must repeat the same word in the fieldConfirm Password. Close the dialog box with OK. If you get the message:

"The password does not agree with the confirmation",

then you made a typing error during one of the two entries. In this case repeatboth entries until the dialog box closes without a message.

If you now save the file and then reopen it, then you get a dialog box in whichyou are requested to enter the password. The project can then only be opened ifyou enter the correct password. Otherwise WAGO-I/O-PRO 32 reports:

"The password is not correct."

Along with the opening of the file, you can also use a password to protectagainst the file being changed. For this you must enter a password in the fieldWrite Protection Password and confirm this entry in the field underneath.

A write-protected project can be opened without a password. For this simplypress the button Cancel, if WAGO-I/O-PRO 32 tells you to enter the write-protection password when opening a file. Now you can compile the project,load it into the PLC, simulate, etc., but you cannot change it.

Page 77: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-13

Of course it is important that you memorize both passwords. However, if youshould ever forget a password, then contact the manufacturer of your PLC.

The passwords are saved with the project.

In order to create differentiated access rights you can define user groups("Project" "Object access rights" and "Passwords for user groups" ).

Sourcedownload

The following dialog will be opened when you select this category:

Image 4.16: Option dialog for the category Sourcedownload

You can choose to which Timing and what Extent the project is loaded into thecontroller system. The option Sourcecode only exclusively involves just theWAGO-I/O-PRO 32 file (file extension .pro). The option All files alsoincludes files such as the associated library files, visualization bitmaps,configuration files, etc.

Using the option Implicit at load allows the selected file range to beautomatically loaded into the controller system on the command "Online""Load" .

Using the option Notice at load offers a dialog, when the command "Online""Load" is given, with the question �Do you want to write the source code intothe controller system?�. Pressing Yes will automatically load the selected rangeof files into the controller system, or you can alternatively finish with No.

When using the option On demand the selected range of files must beexpressly loaded into the controller system by giving the command "Online""Sourcecode download".

The project which is stored in the controller system can be retrieved by using"File" "Open" with Open project from PLC. The files will be unpacked inthe process.

See Chapter "Managing Projects" for details !

Symbol configuration

If you choose this category , then you get the following dialog box:

Page 78: Wago Pro Manual

Options

4-14 WAGO-I/O-PRO 32

Image 4.17: Option dialog for the category Symbol configuration

If the Dump symbol entries option has been selected you get a text file inwhich you can find symbols for the I/O variables and the memory address.

When selecting Create binary file of the application a binary file of theapplication is created. This function is not necessary in WAGO-I/O-PRO 32for the time being.

Page 79: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-15

Memory layout

If you choose this category , then you get the following dialog box:

Image 4.18: Option dialog for the category Memory layout

If the menu item Memory Layout is selected the start addresses of variousmemory areas of the controller are displayed. The addresses should not bechanged.

C16x Compiler Output

If you choose this category , then you get the following dialog box:

Image 4.19: Option dialog for the category C16x Compiler output

When selecting Hex-File the application is written in a Intel Hex file which canbe loaded into the selected controller.

Bin-File is not supported for the time being.

Both functions are not needed in WAGO-I/O-PRO 32 for the time being.

Page 80: Wago Pro Manual

Managing Projects

4-16 WAGO-I/O-PRO 32

Managing Projects

The commands which refer to entire project are found under the menu items"File" and "Project". Some of the commands under "Project" deal with objectsand are therefore described in the chapter Creating and Deleting Objects, etc..

"File" "New"

Symbol: With this command you create an empty project with the name "Untitled". Thisname must be changed when saving.

"File" "Open"

Symbol: With this command you open an already existing project. If a project hasalready been opened and changed, then WAGO-I/O-PRO 32 asks whether thisproject should be saved or not.

The dialog box for opening a file appears, and a project file with the extension"*.pro" or a library file with the extension "*.lib" must be chosen. This filemust already exist. It is not possible to create a project with the command"Open".

To upload a project from the PLC, press PLC at Open project from PLC. Ifthere is no current connection to the PLC, the dialog Communicationparameters appears to define the transmission parameters. If an onlineconnection is made, there will be checked whether there are already project fileswith equal names in the local PC directories. In this case the dialog Loadproject from PLC is opened where you can decide to replace or not to replacethe local files by that used in the PLC.

Note: Please note, that you in any case have to give a new name to aproject, when you load it from the PLC to your local directory, otherwise it isunnamed.

If there has not yet been loaded a project to the PLC, you get an error message.

(See also "Project" "Options" category "Sourcedownload").

Page 81: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-17

Image 4.20: Standard dialog box for opening a file in WAGO-I/O-PRO 32

The most recently opened files are listed under the command "File" "Exit". Ifyou choose one of them, then this project is opened.

If Passwords or User groups have been defined for the project, then a dialogbox appears for entering the password.

"File" "Close"

With this command you close the currently-open project. If the project has beenchanged, then WAGO-I/O-PRO 32 asks if these changes are to be saved ornot.

If the project to be saved carries the name "Untitled", then a name must begiven to it (see "File" "Save as").

"File" "Save"

Symbol: Shortcut: <Ctrl>+<S>With this command you save any changes in the project.

If the project to be saved is called "Untitled", then you must give it a name (see"File" "Save as").

"File" "Save as"

With this command the current project can be saved in another file or as alibrary. This does not change the original project file.

After the command has been chosen the Save dialog box appears. Choose eitheran existing File name or enter a new file name and choose the desired file type.

Page 82: Wago Pro Manual

Managing Projects

4-18 WAGO-I/O-PRO 32

Image 4.21: Dialog box for Save as

If the project is to be saved under a new name, then choose the file typeWAGO-I/O-PRO 32 Project (*.pro).

If you choose the file type Project Version 1.5 (*.pro), respectively ProjectVersion 2.0 (*.pro) then the current project is saved as if it were created withthe version 1.5 respectively 2.0. Specific data of the version 2.0 can thereby belost! However, the project can be executed with the version 1.5 or 2.0.

You can also save the current project as a library in order to use it in otherprojects. Choose the file type Internal library (*.lib) if you have programmedyour POUs in WAGO-I/O-PRO 32.

Choose the file type External library (*.lib) if you want to implement andintegrate POUs in other languages (e.g. C). This means that another file is alsosaved which receives the file name of the library, but with the extension "*.h".This file is constructed as a C header file with the declarations of all POUs, datatypes, and global variables. Is external libraries are used, in the simulationmode the implementation, written for the POUs in WAGO-I/O-PRO 32, willbe executed. Working with the real hardware the implementation written in Cwill be executed.

Then click OK. The current project is saved in the indicated file. If the new filename already exists, then you are asked if you want to overwrite this file.

When saving as a library, the entire project is compiled. If an error occursthereby, then you are told that a correct project is necessary in order to create alibrary. The project is then not saved as a library.

"File" "Print"

Shortcut: <Ctrl>+<P>With this command the content of the active window is printed.

After the command has been chosen, then the Print dialog box appears. Choosethe desired option or configure the printer and then click OK. The activewindow is printed.

Page 83: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-19

Image 4.22: Print dialog box

You can determine the number of the copies and print the version to a file.

With the button Properties you open the dialog box to set up the printer.

You can determine the layout of your printout with the command "File""Printer Setup".

During printing the dialog box shows you the number of pages already printed.When you close this dialog box, then the printing stops after the next page.

In order to document your entire project, use the command "Project""Document".

If you want to create a document frame for your project, then open a globalvariables list and use the command "Extras" "Make Docuframe file".

"File" "Printer setup"

With this command you can determine the layout of the printed pages. Thefollowing dialog box is now opened:

Page 84: Wago Pro Manual

Managing Projects

4-20 WAGO-I/O-PRO 32

Image 4.23: Page Layout Dialog Box

In the field File you can enter the name of the file with the extension ".dfr" inwhich the page layout should be saved. The default destination for the settingsis the file DEFAULT.DFR.

If you would like to change an existing layout, then browse through thedirectory tree to find the desired file with the button Browse

You can also choose whether to begin a new page for each object and foreach subobject. Use the Printer Setup button to open the printerconfiguration.

If you click on the Edit button, then the frame for setting up the page layoutappears. Here you can determine the page numbers, date, filename and POUname, and also place graphics on the page and the text area in which thedocumentation should be printed.

Image 4.24: Window for pasting the placeholders on the page layout

With the menu item "Insert" "Placeholder" and subsequent selection amongthe five placeholders (Page, POU name, File name, Date, and Content),insert into the layout a so-called placeholder by dragging a rectangle2 on thelayout while pressing the left mouse button. In the printout they are replaced asfollows:

Command Placeholder EffectPage {Page} Here the current page number appears in

the printout.POU name {POU Name} Here the current name of the POU

appears.

2 Drawing a rectangle on the layout by dragging the mouse diagonally whilepressing the left mouse button.

Page 85: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-21

File name {File Name} Here the name of the project appears.Date {Date} Here the current date appears.Contents {Contents} Here the contents of the POU appear.

In addition, with "Insert" "Bitmap" you can insert a bitmap graphic (e.g. acompany logo) in the page. After selecting the graphic, a rectangle should alsobe drawn here on the layout using the mouse. Other visualization elements canbe inserted (see chapter Visualizations).

If the template was changed, then WAGO-I/O-PRO 32 asks when the windowis closed if these changes should be saved or not.

"File" "Exit"

Shortcut: <Alt>+<F4>With this command you exit from WAGO-I/O-PRO 32.

If a project is opened, then it is closed as described in "File" "Save".

"Project" "Check all"

With this command you can check the static correctness of your program. If anerror crops up, then it is announced in the message window, as with thebuilding of the program.

In contrast to the command "Rebuild all", no code is created

"Project" "Build"

With this command all changed POUs are built. When loading the program,only the modified POUs are sent to the PLC. The rest of the program remainsunchanged in the PLC.

Note: The command "Build" is only supported if WAGO-I/O-PRO 32 isequipped with the Online Change function. Otherwise the command "Build"acts like "Rebuild all".

With larger changes use the function "Project" "Register changes".Online Change function means that parts of a program can be exchanged (sentto the PLC) without interrupting the PLC. All data is retained as far as possible.

Warning: If you select "Build" two times in a row withoutsending the program to the PLC in the interim, then the error message appears:"Modifications not compatible with each other".

Follwing this the program must be rebuilt ("Rebuild all") and sent in full tothe PLC!

"Project" "Rebuild all"

Shortcut: <Alt>+<F11>

Page 86: Wago Pro Manual

Managing Projects

4-22 WAGO-I/O-PRO 32

With this command you rebuild all POUs. The message window is openedwhich shows the progress of the building process and any errors which may bebe discovered.

A list of all error messages is to be found in the appendix.

Image 4.25: Message window of a project with three POUs and two error messages

With the command "Online" "Login" the command "Rebuild all" isautomatically executed if the project has been modified since the lastcompilation.

If the option Save before compile in the Options dialog box in the categoryBuild has been chosen, then the project is backed up before compilation.

Note: The cross references are created during compilation and are notsaved in the project! In order to use the commands "Show call tree�, "Showcross reference list, and "Show unused variables the project must be rebuiltafter loading and after a modification.

"Project" "Document"

This command lets you print the documentation of your entire project. Theelements of a complete documentation are:

• The POUs,• the contents of the documentation,• the data types,• the visualizations• the resources (Global variables, variables configuration, the Sampling

Trace, the PLC Configuration, the Task Configuration, the Watch andReceipt Manager)

• the call trees of POUs and data types, as well as• the cross reference list.

For the last two items the project must have been built without errors.

Page 87: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-23

Image 4.26: Dialog box for project documentation

Only those areas in the dialog box are printed which are highlighted in blue.

If you want to select the entire project, then select the name of your project inthe first line.

If, on the other hand, you only want to select a single object, then click on thecorresponding object or move the dotted rectangle onto the desired object withthe arrow key. Objects which have a plus sign in front of their symbols areorganization objects which contain other objects. With a click on a plus signorganization object is expanded, and with a click on the resulting minus sign itcan be closed up again. When you select an organization object, then allrelevant objets are also selected. By pressing the <Shift> key you can select agroup of objects, and by pressing the <Ctrl> key you can select severalindividual objects.

Once you have made your selection, then click on OK. The Print dialog boxappears. You can determine the layout of the pages to be printed with "File""Printer setup".

"Project" "Export"

With WAGO-I/O-PRO 32 projects can be exported or imported. That allowsyou to exchange programs between different IEC programming systems.

Page 88: Wago Pro Manual

Managing Projects

4-24 WAGO-I/O-PRO 32

There is a standardized exchange format for POUs in IL, ST, and SFC (theCommon Elements format of IEC 61131-3). For the POUs in LD and FBD andthe other objects WAGO-I/O-PRO 32 has its own filing format since there isno text format for this in IEC 61131-3. The selected objects are written to anASCII file.

POUs, data types, visualizations, and the resources can be exported.

Once you have made your selection in the dialog box window (the same way aswith "Project" "Document" ), you can decide, whether you want to export theselected parts to one file or to export in separate files, one for each object.Switch on or off the option One file for each object then click on OK. Thedialog box for saving files appears. Enter a file name with the expansion ".exp"respectively a directory for the object export files, which then will be savedthere with the file name <objectname.exp>.

"Project" "Import"

In the resulting dialog box for opening files select the desired export file.

The data is imported into the current project. If an object with the same namealready exists in the same project, then a dialog box appears with the question"Do you want to replace it?": If you answer Yes, then the object in the project isreplaced by the object from the import file. If you answer No, then the name ofthe new objects receives as a supplement an underline and a digit ("_0", "_1",..). With Yes, all or No, all this is carried out for all objects.

In the message window the import is registered.

"Project" "Compare"

With this command you can compare the open project with another. Forexample, if you prepare to save and want to know where you have madechanges in the current project, then you can compare the open project with thelast saved version of it.

After you have given this command, then the dialog box for opening filesappears. Choose the project with which you want to compare the currentproject. If you press OK, then you will see the result of the comparison in themessage window. All of the objects of the chosen project are listed and thechanges in the object are shown afterward in parentheses. There are fivepossible messages:

• "Unchanged": The object was not changed.• "Deleted": The object is no longer present in the current project.• "Implementation changed": The instruction part of the POU has been

changed.• "Interface changed": The declaration part of the object has been changed.• "Interface and implementation changed": Both the instruction part and the

declaration part of the POU have been changed.

A doubleclick on a message selects the first change in this object.

Page 89: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-25

"Project" "Merge"

With this command you can merge objects (POUs, data types, visualizations,and resources) from other projects into your project.

When the command has been given, first the standard dialog box for openingfiles appears. When you have chosen a file there, a dialog box appears in whichyou can choose the desired object. The selection takes place as described with"Project" "Document" .If an object with the same name already exists in the project, then the name ofthe new object receives the addition of an underline and a digit ("_1", "_2" ...).

"Project" "Project info"

Under this menu item the information about your project can be saved. Whenthe command has been given, then the following dialog box opens:

Image 4.27: Dialog box for entering project information

The following project information is displayed:• File name• Directory path• The time of the most recent change (Change date)

This information can not be changed.

In addition, you can can add the following information:• A Title of the project,• the name of the Author,• the Version number, and• a Description of the project.

Page 90: Wago Pro Manual

Managing Projects

4-26 WAGO-I/O-PRO 32

This information is optional. When you press the button Statistics you receivestatistical information about the project.

It contains information such as the number of the POUs, data types, and thelocal and global variables as they were traced at the last compilation.

Image 4.28: Example of project statistics

If you choose the option Ask for project info in the category Load & Save inthe Options dialog box, then while saving a new project, or while saving aproject under a new name, the project info is called automatically.

"Project" "GlobalSearch"

With this command you can search for the location of a text in POUs, datatypes, or in the objects of the global variables.

When the command is entered, a dialog box opens in which you can choose thedesired object. The selection is made as in the "Project" "Document"description.

When you have confirmed the selection with OK, then the search dialog boxappears. If a text in an object has been found, then the object is loaded into theappropriate editor, and its location is shown.

"Project" "Globalreplace"

With this command you can search for the location of a text in POUs, datatypes, or the objects of the global variables and replace this text by another.This is executed in the same way as with "Project" "Global Search" or"Edit" "Replace".

Page 91: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-27

"Project" "Registerchanges"

This command is necessary when significant changes have to be made to aproject without interrupting the PLC. (Online Change).

Copy your project, make your changes, and test your changes. Select thecommand "Project" "Compare" in order to compare the two projects. Withthe command "Register changes" all differences between the current projectand the comparison are traced. Then, with the command "Build" the modifiedPOUs can be compiled. When downloading the program only the modifiedPOUs are sent to the PLC. The rest of the program remains unchanged in thePLC.

User groups

In WAGO-I/O-PRO 32 up to eight user groups with different access rights tothe POUs, data types, visualizations, and resources can be set up. Access rightsfor single objects or all of them can be established. Only a member of a certainuser group can open a project. A member of such a user group must identifyhimself by means of a password.

The user groups are numbered from 0 to 7, whereby the Group 0 has theadministrator rights, i.e. only members of group 0 may determine passwordsand access rights for all groups and/or objects.

When a new project is launched, then all passwords are initially empty. Until apassword has been set for the 0 group, one enters the project automatically as amember of the 0 group.

If a password for the user group 0 is existing while the project is loaded, then apassword will be demanded for all groups when the project is opened. For thisthe following dialog box appears:

Image 4.29: Dialog box for password entry

In the combobox User group on the left side of the dialog box, enter the groupto which you belong and enter on the right side the relevant password. PressOK. If the password does not agree with the saved password, then the messageappears:

"The password is not correct."

Only when you have entered the correct password can the project be opened.

Page 92: Wago Pro Manual

Creating and Deleting Objects, etc.

4-28 WAGO-I/O-PRO 32

With the command "Passwords for user group" you can assign thepasswords, and with "Object" "Access rights" you can define the rights forsingle objects or for all of them.

"Project""Passwords foruser groups"

With this command you open the dialog box for password assignment for usergroups. This command can only be executed by members of group 0. When thecommand has been given, then the following dialog box appears:

Image 4.30: Dialog box for password assignment

In the left combobox User group you can select the group. Enter the desiredpassword for the group in the field Password. For each typed character anasterisk (*) appears in the field. You must repeat the same password in the fieldConfirm password. Close the dialog box after each password entry with OK.If you get the message:

"The password does not agree with the confirmation",

then you made a typing error during one of the two entries. In this case repeatboth entries until the dialog box closes without a message.

Then, if necessary, assign a password for the next group by calling thecommand again.

With the command "Object" "Access rights" you can assign the rights forsingle objects or all of them.

Creating and Deleting Objects, etc.

Now we shall explain how to work with objects and what help is available tokeep track of a project (Folders, Call tree, Cross reference list,..).

Object

POUs, data types, visualizations and the resources (Global variables, thevariable configuration, the Sampling Trace, the PLC Configuration, the TaskConfiguration, and the Watch and Receipt Manager are all defined as "objects".The folders inserted for structuring the project are partially involved. Allobjects of a project are in the Object Organizer.

If you hold the mouse pointer for a short time on a POU in the ObjectOrganizer, then the type of the POU (Program, Function or Function block) is

Page 93: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-29

shown in a Tooltip. For the global variables the tooltip shows the keyword(VAR_ACCESS, VAR_GLOBAL, VAR_CONFIG).

Folder

In order to keep track of larger projects you should group your POUs, datatypes, visualizations, and global variables systematically in folders.

You can set up as many levels of folders as you want. If a plus sign is in frontof a closed folder symbol, then this folder contains objects and/oradditional folders. With a click on the plus sign the folder is opened and thesubordinated objects appear. With a click on the minus (which has replaced theplus sign) the folder can be closed again. In the context menu you find thecommands "Expand nodes" and "Collapse nodes" with the same functions.

With Drag&Drop you can move the objects as well as the folders within theirobject type. For this select the object and drag it with pressed left mouse buttonto the desired position.

Note: Folders have no influence on the program, but rather serve only tostructure your project clearly.

Image 4.31: Example of folders in the Object Organizer

"New Folder"

With this command a new folder is inserted as a structural object. If a folder hasbeen selected, then the new one is created underneath it. Otherwise it is createdon the same level.

The context menu of the Object Organizer which contains this commandappears when an object or the object type has been selected and you havepressed the right mouse button or <Shift>+<F10>.

"Expand nodes" "Collapsenodes"

With the command expand the objects are visibly unfolded which are located inthe selected object. With Collapse the subordinated objects are no longershown.

With folders you can open or close them with a double mouse click or bypressing <Enter>.

Page 94: Wago Pro Manual

Creating and Deleting Objects, etc.

4-30 WAGO-I/O-PRO 32

The context menu of the Object Organizer which contains this commandappears when an object or the object type has been selected and you havepressed the right mouse button or <Shift>+<F10>.

"Project" "Object Delete"

Shortcut: <Delete>

With this command the currently selected object (a POU, a data type, avisualization, or global variables), or a folder with the subordinated objects isremoved from the Object Organizer and is thus deleted from the project.

For safety you are asked once more for confirmation.

If the editor window of the object was open, then it is automatically closed.

If you delete with the command "Edit" "Cut", then the object is parked on theclipboard.

"Project" "Object Add"

Shortcut: <Insert>With this command you create a new object. The type of the object (POU, datatype, visualization, or global variables) depends upon the selected register cardin the Object Organizer. Enter the name of the new object in the dialog boxwhich appears. Remember that the name of the object may not have alreadybeen used.

If you are dealing with a POU, then you must also choose the type of the POU(Program, Function, or Function block) and the language in which it is to beprogrammed.

After confirmation of the entry, then the suitable entry window for the objectappears.

Image 4.32: Dialog box for creating a new POU

If, on the other hand, you use the command "Edit" "Paste", then the object ispasted from the clipboard, and no dialog box appears.

Page 95: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-31

"Project" "ObjectRename"

Shortcut: <Spacebar>

With this command you give a new name to the currently-selected object orfolder. Remember that the name of the object may not have already been used.

If the editing window of the object is open, then its title is changedautomatically when the name is changed.

Image 4.33: Dialog box for renaming a POU

"Project" "ObjectConvert"

This command can only be used with POUs. You can convert POUs from thelanguages SFC, ST, FBD, LD, and IL into one of the three languages IL, FBD,and LD.

For this the project must be compiled. Choose the language into which youwant to convert and give the POU a new name. Remember that the name of thePOU may not have already been used. Then press OK, and the new POU isadded to your POU list.

Image 4.34: Dialog box for converting a POU

"Project" "Object Copy"

With this command a selected object is copied and saved under a new name.Enter the name of the new object in the resulting dialog box. Remember thatthe name of the object may not have already been used.

If, on the other hand, you used the command "Edit" "Copy", then the object isparked on the clipboard, and no dialog box appears.

Page 96: Wago Pro Manual

Creating and Deleting Objects, etc.

4-32 WAGO-I/O-PRO 32

Image 4.35: Dialog box for copying a POU

"Project" "Object Open"

Shortcut: <Enter>

With the command you load a selected object within the Object Organizer intothe respective editor. If a window with this object is already open, then it gets afocus, is moved into the foreground and can now be edited.

There are two other ways of opening an object:• Doubleclick with the mouse on the desired object• type in the Object Organizer the first letter of the object name. Then a

dialog box opens in which all objects of the available object types withthis initial letter are shown. Select the desired object and click on thebutton Open in order to load the object in its edit window. This option issupported with the object type Resources only for global variables.

This last possibility is especially useful in projects with many objects.

Image 4.36: Dialog box for choosing the object to be opened

"Project" "Object Accessrights"

With this command you open the dialog box for assigning access rights to thedifferent user groups. The following dialog box appears:

Page 97: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-33

Image 4.37: Dialog box for assigning access rights

Members of the user group 0 can now assign individual access rights for eachuser group. There are three possible settings:

• No Access: the object may not be opened by a member of the user group.• Read Access: the object can be opened for reading by a member of the

user group but not changed.• Full Access: the object may be opened and changed by a member of the

user group.

The settings refer either to the currently-selected object in the Object Organizeror, if the option Apply to all is chosen, to all POUs, data types, visualizations,and resources of the project.

The assignment to a user group takes place when opening the project through apassword request if a password was assigned to the user group 0.

"Project" "Add Action"

This command is used to generate an action allocated to a selected block in theObject Organiser. One selects the name of the action in the dialog whichappears and also the language in which the action should be implemented.

The new action is placed under your block in the Object Organiser. A plus signappears in front of the block. A simple mouse click on the plus sign causes theaction objects to appear and a minus sign appears in front of the block.Renewed clicking on the minus sign causes the actions to disappear and theplus sign appears again. This can also be achieved over the context menucommands "Expand Node" and "Collapse Node" .

"Project" "View instance"

With this command you can open and show single instances of function blocks.The function block whose instance should be open must first be selected in theObject Organizer before you can execute this command. In the resulting dialogbox you can choose the desired instance of this function block.

Note: Instances can be opened only after logging in! (Project was correctlycompiled and sent with "Online" "Login" to the PLC).

Page 98: Wago Pro Manual

Creating and Deleting Objects, etc.

4-34 WAGO-I/O-PRO 32

Image 4.38: Dialog box for opening an instance

"Project" "Show call tree"

With this command you open a window which shows the call tree of the objectchosen in the Object Organizer. For this the project must be compiled (see"Rebuild all"). The call tree contains both calls for POUs and references todata types.

Image 4.39: Example of a call tree

"Project" "Show crossreference list"

With this command you open a dialog box which makes possible the output ofall application points for a variable, address, or a POU. For this the project mustbe compiled (see "Rebuild all").

Choose first the category Variable, Address, or POU and then enter the nameof the desired element. By clicking on the button Get References you get thelist of all application points. Along with the POU and the line or network

Page 99: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-35

number, it is shown whether this point has read only access or full access,whether it is a local or global variable and whether the variable is connected toan address.

When you select a line of the cross reference list and press the button Go To ordoubleclick on the line, then the POU is shown in its editor at thecorresponding point. In this way you can jump to all application points withouta time-consuming search.

In order to make processing easier, you can use the Send to message windowbutton to bring the current cross reference list into the message window andfrom there change to the respective POU.

Image 4.40: Dialog box and example of a cross reference list

"Project" "Show unusedvariables"

With this command a list of variables is shown which, to be sure, have beendeclared in the project but are not being used anywhere. For this the projectmust be compiled (see "Rebuild all").

If there are no unused variables in your project, then that is announced.Otherwise the following window appears:

Page 100: Wago Pro Manual

General Editing Functions

4-36 WAGO-I/O-PRO 32

Image 4.41: Unused variables of a project

If you select a variable and press the button Go To or doubleclick on thevariable, then you change to the respective object in which the variable hasbeen declared.

"Extras"Previous version

With this command you can restore the current object to the last saved state.The restored state is either that of the most recent manual save ("File" "Save")or that which was kept after the automatic save, depending upon which versionis most recent.

General Editing Functions

You can use the following commands in all editors and some of them in theObject Organizer. All of the commands are locted under the menu item "Edit".

"Edit" "Undo"

Shortcut: <Ctrl>+<Z>

This command undoes the action which was most recently executed in thecurrently-open editor window or in the Object Organizer.

By repeatedly selecting this command, all actions can be undone back to thepoint at which the window was opened. This applies to all actions in the editorsfor POUs, data types, visualizations, and global variables and in the ObjectOrganizer.

With "Edit" "Redo" you can restore an action which you have undone.

Note: The commands "Undo" and "Redo" apply to the current window.Each window carries its own action list. If you want to undo actions in severalwindows, then you must activate the corresponding window. When undoing orredoing in the Object Organizer the focus must lie here.

Page 101: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-37

"Edit" "Redo"

Shortcut: <Ctrl>+<Y>

With the command in the currently-open editor window or in the ObjectOrganizer you can restore an action you have undone ("Edit" "Undo").

As often as you have previously executed the command "Undo" , you can alsocarry out the command "Redo".

Note: The commands "Undo" and "Redo" apply to the current window.Each window carries its own action list. If you want to undo actions in severalwindows, then you must activate the corresponding window. When undoing orredoing in the Object Manager must lie there.

"Edit" "Cut"

Symbol: Shortcut: <Ctrl>+<X> or <Shift>+<Delete>

This command transfers the current selection from the editor to the clipboard.The selection is removed from the editor.

In the Object Organizer this similarly applies to the selected object, wherebynot all objects can be deleted, e.g. the PLC Configuration.

Remember that not all editors support the cut command, and that its use can belimited in some editors.

The form of the selection depends upon the respective editor:

In the text editors (IL, ST, and declarations) the selection is a list of characters.

In the FBD and LD editors the choice is a number of networks which areindicated by a dotted rectangle in the network number field or a box with allpreceding lines, boxes, and operands.

In the SFC editor the selection is a part of a series of steps surrounded by adotted rectangle.

In order to paste the content of the clipboard you use the command "Edit""Paste". In the SFC editor you can also use the commands "Extras" "Insertparallel branch (right)" or "Extras" "Paste after".

In order to copy a selection onto the clipboard without deleting it, use thecommand "Edit" "Copy".

In order to remove a selected area without changing the clipboard, use thecommand "Edit" "Delete".

"Edit" "Copy"

Symbol: Shortcut: <Ctrl>+<C>

This command copies the current selection from the editor to the clipboard.This does not change the contents of the editor window.

Page 102: Wago Pro Manual

General Editing Functions

4-38 WAGO-I/O-PRO 32

With the Object Organizer this similarly applies to the selected object, wherebynot all objects can be copied, e.g. the PLC Configuration.

Remember that not all editors support copying and that it can be limited withsome editors.

For the type of selection the same rules apply as with "Edit" "Cut".

In the text editors (IL, ST, and declarations) the selection is a list of characters.

In the FBD and LD editors the choice is a number of networks which areindicated by a dotted rectangle in the network number field or a box with allpreceding lines, boxes, and operands.

In the SFC editor you can also use the commands "Extras" "Insert parallelbranch (right)" or "Extras" "Paste after".

"Edit" "Paste"

Symbol: Shortcut: <Ctrl>+<V>

Pastes the content of the clipboard onto the current position in the editorwindow. In the graphic editors the command can only be executed when acorrect structure results from the insertion.

With the Object Organizer the object is pasted from the clipboard.

Remember that pasting is not supported by all editors and that its use can belimited in some editors.

The current position can be defined differently according to the type of editor:

With the text editors (IL, ST, Declarations) the current position is that of theblinking cursor (a vertical line) which you place by clicking with the mouse).

In the FBD and LD editors the current position is the first network with a dottedrectangle in the network number area. The contents of the clipboard are insertedin front of this network. If a partial structure has been copied, then it is insertedin front of the selected element.

In the SFC editor the current position is determined the selection which issurrounded by a dotted rectangle. Depending upon the selection and thecontents of the clipboard, these contents are inserted either in front of theselection or into a new branch (parallel or alternative) to the left of theselection.

In SFC the commands "Extras" "Insert parallel branch (right)" or"Extras" "Paste after" can be used in order to insert the contents of theclipboard.

"Edit" "Delete"

Shortcut: <Delete>

Deletes the selected area from the editor window. This does not change thecontents of the clipboard.

In the Object Organizer this applies likewise to the selected object, whereby notall objects can be deleted, e.g. the PLC Configuration.

Page 103: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-39

For the type of selection the same rules apply as with "Edit" "Cut".

In the library manager the selection is the currently selected library name.

"Edit" "Find"

Symbol: With this command you search for a certain text passage in the current editorwindow. The Find dialog box opens. It remains opens until the button Cancel ispressed.

In the field Find what you can enter the series of characters you are lookingfor.

In addition, you can decide whether the text you are looking for Match wholeword only or not, or also whether Match case is to be considered, and whetherthe search should proceed Up or Down starting from the current cursorposition.

The button Find next starts the search which begins at the selected position andcontinues in the chosen search direction. If the text passages is found, then it ishighlighted. If the passage is not found, then a message announces this. Thesearch can be repeated several times in succession until the beginning or theend of the contents of the editor window has been reached.

Remember that the found text can be covered up by the Find dialog box.

Image 4.42: Find dialog box

"Edit" "Find next"

Symbol: Shortcut: <F3>

With this command you execute a search with the same parameters as with themost recent action "Edit" "Find".

"Edit" "Replace"

With this command you search for a certain passage just as with the command"Edit" "Find", and replace it with another. After you have chosen thecommand the dialog box for find and replace appears. This dialog box remainsopen until the button Cancel or Close is pressed.

The button Replace replaces the current selection with the text in the fieldReplace with.

Page 104: Wago Pro Manual

General Editing Functions

4-40 WAGO-I/O-PRO 32

The button Replace all replaces every occurrence of the text in the field Findnext after the current position with the text in the field Replace with. At theend of the procedure a message announces how many replacements were made.

Image 4.43: Dialog box for find and replace

"Edit" "Input Assistant"

Shortcut: <F2>

This command provides a dialog box for choosing possible inputs at the currentcursor position in the editor window. In the left column choose the desiredinput category, select the desired entry in the right column, and confirm yourchoice with OK. This inserts your choice at this position.

The categories offered depend upon the current cursor position in the editorwindow, i.e. upon that which can be entered at this point (e.g. variables,operators, POUs, conversions, ...).

Image 4.44: Input Assistant Dialog Box

In some positions (e.g. in the watch list) multilevel variable names arenecessary. At first the Input Assistant dialog box contains a list of all POUsalong with a single point for the global variables. After each POU name there isa point. Doubleclicking with the mouse or pressing <Enter> opens a list of thevariables for a selected POU. Instances and data types can, when appropriate,be opened again. By pressing OK you accept the selected variable.

Page 105: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-41

Image 4.45: Input Assistant dialog box with multilevel variable names

Note: Some entries (e.g. global variables) are only brought up to date inthe Input Assistant after a compilation run.

"Edit" "DeclareVariable"�

Shortcut: <Shift>+<F2>

This command opens the dialog for the declaration of a variable. This dialogalso opens automatically when the option 'Project' 'Options' 'Editor''Autodeclaration' is switched on and when a new undefined variable is used thedeclaration editor.

"Edit" "Next error"

Shortcut: <F4>

After the incorrect compilation of a project this command can show the nexterror. The corresponding editor window is activated and the incorrect place isselected. At the same time in the message window the corresponding errormessage is shown.

"Edit" "Previous error"

Shortcut: <Shift>+<F4>

After the incorrect compilation of a project this command shows the previouserror. The corresponding editor window is activated and the incorrect place isselected. At the same time in the message window the corresponding errormessage is shown.

Page 106: Wago Pro Manual

General Online Functions

4-42 WAGO-I/O-PRO 32

General Online Functions

The available online commands are assembled under the menu item "Online".The execution of some of the commands depends upon the active editor.

The online commands become available only after logging in.

"Online" "Login"

Symbol: Shortcut: <Alt>+<F8>This command combines the programming system with the PLC (or starts thesimulation program) and changes into the online mode.

If the current project has not been compiled since opening or since the lastmodification, then it is compiled now (as with "Project" "Rebuild all"). Iferrors occur during compilation, then WAGO-I/O-PRO 32 does not changeinto Online mode.

After a successful login all online functions are available (if the correspondingsettings in "Options" category Build have been entered). The current values aremonitored for all visible variable declarations.

Use the "Online" "Logout" command to change from online back to offlinemode.

If the system reports

Error:"A connection to the PLC could not be established"

Verify whether the parameters selected in the "Online" "CommunicationParameters" agree with those of your PLC.

You should especially verify that the interface number is correct. (If you haveset it to COM1, the cable should also be physically plugged into COM1.)Furthermore, verify that the baud rates in the PLC and the Program Systemagree with each other. (Default setting in WAGO-I/O-PRO 32: 9600 Bd).

Error:"The program has been modified! Should the new program be loaded?"

The project which is open in the editor is incompatible with the programcurrently found in the PLC (or with the Simulation Mode program being run).Monitoring and debugging is therefore not possible. You can either choose"No," logout, and open the right project, or use "Yes" to load the current projectin the PLC.

"Online" "Logout"

Symbol: Shortcut: <Strg>+<F8>The connection to the PLC is broken, or, the Simulation Mode program isended and is shifted to the offline mode.

Use the "Online" "Login" command to change to the online mode.

Page 107: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-43

"Online" "Download"

This command loads the compiled project in the PLC.

"Online" "Run"

Symbol: Shortcut: <F5>This command starts the program in the PLC or in Simulation Mode.

This command can be executed immediately after the "Online" "Download"command, or after the user program in the PLC has been ended with the"Online" "Stop" command, or when the user program is at a break point, orwhen a Single Cycle has been performed.

"Online" "Stop"

Symbol: Kurzform <Umschalt>+<F8>Stops the execution of the program in the PLC or in Simulation Mode betweentwo cycles.

Use the "Online" "Run" command to restart the program.

"Online" "Reset"

If you have initialized the variables with a specific value, then this commandwill reset the variables to the initialized value. All other variables are set at astandard initialization (for example, integers at 0). As a precautionary measure,WAGO-I/O-PRO 32 asks you to confirm your decision before all of thevariables are overwritten.

Use the "Online" "Run" command to restart the program.

"Online" "ToggleBreakpoint"

Symbol: Shortcut: <F9>This command sets a breakpoint in the present position in the active window. Ifa breakpoint has already been set in the present position, that breakpoint will beremoved.

The position at which a breakpoint can be set depends on the language in whichthe POU in the active window is written.

In the Text Editors (IL, ST), the breakpoint is set at the line where the cursor islocated, if this line is a breakpoint position (recognizable by the dark-gray colorof the line number field). You can also click on the line number field to set orremove a breakpoint in the text editors.

In FBD and LD, the breakpoint is set at the currently selected network. In orderto set or remove a breakpoint in the FBD or LD Editor, you can also click onthe network number field.

In SFC, the breakpoint is set at the currently selected step. In SFC you can alsouse <Shift> with a doubleclick to set or remove a breakpoint.

Page 108: Wago Pro Manual

General Online Functions

4-44 WAGO-I/O-PRO 32

If a breakpoint has been set, then the line number field or the network numberfield or the step will be displayed with a light-blue background color.

If a breakpoint is reached while the program is running, the program will stop,and the corresponding field will be displayed in a red background color. Inorder to continue the program, use the "Online" "Run", "Online" "Step in",or "Online" "Step Over" commands.

Online "BreakpointDialog Box"

This command opens a dialog box to edit breakpoints throughout the entireproject. The dialog box also displays all breakpoints presently set.

In order to set a breakpoint, choose a POU in the POU combobox and the lineor the network in the Location combobox where you would like to set thebreakpoint; then press the Add button. The breakpoint will be added to the list.

In order to delete a breakpoint, highlight the breakpoint to be deleted from thelist of the set breakpoints and press the Delete button.

The Delete All button can be used to delete all the breakpoints.

In order to go to the location in the editor where a certain breakpoint was set,highlight the respective breakpoint from the list of set breakpoints and press theGo to button.

Image 4.46: Breakpoint Editing Dialog Box

"Online" "Step over"

Symbol: Shortcut: <F10>This command causes a single step to execute. If a POU is called, the programstops after its execution. In SFC a complete action is executed.

If the present instruction is the call-up of a function or of a function block, thenthe function or function block will be executed completely. Use the "Online""Step In" command, in order to move to the first instruction of a calledfunction or function block.

If the last instruction has been reached, then the program will go on to the nextinstruction in the POU.

Page 109: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-45

"Online" "Step in"

Shortcut: <F8>A single step is executed. The program is stopped before the first instruction ofa called POU.

If necessary, there will be a changeover to an open POU.

If the present position is a call-up of a function or of a function block, then thecommand will proceed on to the first instruction in the called POU.

In all other situations, the command will function exactly as "Online" "StepOver".

"Online" "Single Cycle"

Shortcut: <Ctrl>+<F5>This command executes a single PLC Cycle and stops after this cycle.

This command can be repeated continuously in order to proceed in singlecycles.

The Single Cycle ends when the "Online" "Run" command is executed.

"Online" "Write Values"or "Force Values"

Shortcut: <Ctrl>+<F7> (Write values)

Shortcut: <F7> (Force values)

In order to change the value of a variable containing a single element, you mustfirst use the mouse to doubleclick on the line in which the variable is declared,or alternatively you can use <Enter>. Next you can enter the new value of thevariable in the dialog box that pops up. In the case of Boolean variables, thevalue is toggled without the dialog box appearing. The new value is displayedin red.

Image 4.47: Dialog Box for Writing a New Variable Value.

The new value is not yet written in the PLC.

Several variables can be set to specific values and afterwards written all at once(cycle consistently) in the PLC.

With "Write Values", the values are written just once and can immediately bewritten over again.

With "Force Values", the values continue to be written after each cycle untilthis procedure is stopped with "Release Force".

Page 110: Wago Pro Manual

General Online Functions

4-46 WAGO-I/O-PRO 32

"Online" "Release Force"

Shortcut: <Shift>+<F7>This command ends the forcing of variables in the PLC. All forced variablesonce again change their values normally.

If no forced values are available, the command will have no effect.

"Online""Show CallStack"

You can run this command when the Simulation Mode stops at a breakpoint.You will be given a dialog box with a list of the POUs currently in the CallStack.

Image 4.48: Example of a Call Stack

The first POU is always PLC_PRG, because this is where the executing begins.

The last POU is always the POU being executed.

After you have selected a POU and have pressed the Go to button, the selectedPOU is loaded in its editor, and it will display the line or network beingprocessed.

"Online" "Flow Control"

If you have selected the flow control, then a check(�) will appear in front ofthe menu item. Following this, every line or every network will be markedwhich was executed in the last PLC Cycle.

The line number field or the network number field of the lines or networkswhich just run will be displayed in green. An additional field is added in the IL-Editor in which the present contents of the accumulator are displayed. In thegraphic editors for the Function Block Diagram and Ladder Diagram, anadditional field will be inserted in all connecting lines not transporting anyBoolean values. When these Out- and Inputs are verified, then the value that istransported over the connecting line will be shown in this field. Connecting

Page 111: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-47

lines that transport only Boolean values will be shaded blue when they transportTRUE. This enables constant monitoring of the information flow.

"Online" "Simulation"

If Simulation Mode is chosen, then a check(�) will appear in front of themenu item.

In the simulation mode, the user program runs on the same PC under Windows.This mode is used to test the project. The communication between the PC andSimulation Mode uses the Windows Message mechanism.

If the program is not in simulation mode, then the program will run on the PLC.The communication between the PC and the PLC typically runs over the serialinterface.

The status of this flag is stored with the project.

"Online""CommunicationsParameters" for the use ofWAGO-I/O-PRO 32Server

You are offered a special dialog for setting communications parameters whenthe communication between the local PC and the run-time system is runningover the WAGO-I/O-PRO 32 Server (Gateway) in your system.

Let us examine the principle of the gateway system before explaining theoperation of the dialog:

A gateway server can be used to allow your local PC to communicate with oneor more run-time systems. The setting concerning which run-time systems canbe addressed, which is specifically configured for each gateway server, and theconnection to the desired gateway server, is made on the local PC. Here it ispossible that both the gateway server and the run-time system(s) can runtogether on the local PC. If we are dealing with a gateway server which isrunning on another PC we must ensure that it has been started there. If you areselecting a locally installed gateway server, it automatically starts when you logonto the target run-time system. You can recognise this through the appearanceof a WAGO-I/O-PRO 32 symbol on the bottom right in the task bar. Thissymbol lights up as long as you are connected to the run-time system over thegateway. The menu points Info and Finish are obtained by clicking with theright mousekey on the symbol. Finish is used to switch off the gateway.

See the following scheme for presenting a gateway system:

Page 112: Wago Pro Manual

General Online Functions

4-48 WAGO-I/O-PRO 32

Image 4.49: Example of a Gateway server system

PC_local is your local PC, PC_x is another PC, which gateway addresses.PC_gateway is the PC on which the gateway server is installed, PC_PLC1through to PC_PLC4 are PCs on which the run-time systems are running. Thediagram shows the modules as separated but it is fully possible for the Gatewayserver and / or run-time systems to be installed together on the local PC.

Important: Please note that a connection to gateway is onlypossible over TCP/IP so make sure that your PC is configured appropriately!

The connections from gateway to the various run-time computers can, on theother hand, run over different protocols (TCP/IP, Pipe, etc.).

Let us now return to the communications parameters dialog on the local PC: Itshows the current situation on the selected gateway server, which can be calledup at any time using the button Update.

The dialog will appear as follows if the communications parameters havealready been configured according to the example shown above:

Image 4.50: Dialog for setting the gateway communications parameters, example

The heading Channels lists two categories of connections:

On the one hand all of the connections are shown which are installed on thecurrently connected gateway server called 'localhost'. Here the address or thename of this gateway is located on the upper position behind the minus sign,which in our example is running on the local computer. The appropriate address'localhost' corresponds in the normal case to the IP address 127.0.0.1 of thelocal computer (PC_local). Below, indented to the right, are three addresses of

Page 113: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-49

run-time computers to which the gateway channels are set-up to (PC_PLC1 to3). They could have been configured both from the local PC or from the otherPCs (PC_x) which are or were connected to the gateway server.

The second category of the channels includes all connections to the gatewaywhich can be set up from your local PC, over this configuration dialog forexample. They create the �branch� which leads from the minus sign directlybelow to PC_PLC1 and PC_PLC4. These channel addresses do not necessarilyhave to be known yet at the gateway. For PC_PLC4 in the example describedabove, the configuration parameters are stored locally in the project but theywill first be known to the gateway the next time log-in to the run-time systemoccurs. This has already occurred for PC_PLC1 since the associated gatewayaddress has appeared as an additional �sub-branch� to the �channel tree�.

In the central part of the dialog one finds the designation, in each case, of theleft selected channel and the associated parameter under Name, Value andComment.Let us now turn to the way the communications parameters themselves can beset in dialog:

To define the connection to the desired gateway we open the dialogCommunication Parameters Gateway by pressing the button Gateway.

Image 4.51: Example dialog, definition of the local connection to the gateway

Here it is possible to enter or edit the name of the computer on which thegateway server is running as well as its Dataport and Serviceport. By firstactivation 'localhost' is offered by default as the name of the computer. You canalso enter an IP address instead of the computer name. The name 'localhost' isusually identical to the local IP address 127.0.0.1 in most cases but you mayhave to enter this directly into the field Address. Suitable values for theselected Gateway are usually already present in the fields Dataport andServiceport.

By ending the dialog with OK the appropriate input appears in the titleChannels of the dialog Communications Parameters, in the upper position. Asign in brackets showing �not connected� appears behind the address when it isnot possible to establish a connection to the selected gateway address, eitherbecause it is not running or because the address is incorrect.

Press the button New if you wish to install a new channel on the gatewayserver. You are offered the following dialog.

Page 114: Wago Pro Manual

General Online Functions

4-50 WAGO-I/O-PRO 32

Image 4.52: Example dialog, installing a new channel

The input field Name always contains the name used for the last inputtedchannel. The current gateway name e.g. �localhost_� appears if a connection hasnot been entered yet. You can edit the channel name at this point. The channelname is purely informative, it does not have to be a unique name but it isrecommended to use one. Select a driver which is offered in the column Namewith a mouse click (the offering depends on your individual installationconditions) and the commentary to it may possibly be shown in the columnInfo if one exists.

If you now close the dialog with OK, the newly defined channel appears in thecommunications parameter dialog as a further entry for Channels at the lowestposition under the minus sign. It is only stored locally in the project at first (seeabove). It is still possible to edit the column Value while it is in this condition(see tips below); confirm the parameters with OK thereby leaving the dialog.

To make the newly established connection known in the gateway, and thus tomake it generally available, it necessary for you to log-on into the run-timesystem. When you open the communications parameter dialog again the newchannel, apart from being in its former position, also appears indented under theaddress/name of the gateway computer. If a communications error occurs whenlogging in, the interface cannot be opened (e.g. COM1 for a serial connection)possibly because it is used by another device.

The parameters for a channel already known by the gateway server can nolonger be edited in the configuration dialog. The parameter fields appear grey.You can, however, delete the connection as long as it is not active.

Important: Please not that the deletion of a channel is notreversible. It occurs at the moment that you press on the button Remove!

Tips for editing the parameters in the communications parameters dialog:

You can only edit the text fields in the column Value.

Select a text field with the mouse, and get into the editing mode by doubleclicking or by pressing the space bar. The text input is finished by pressing the<Enter> key.

Page 115: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-51

You can use <Tabulator> or <Shift> + <Tabulator> to jump to the next or theprevious switching or editing possibility.

To edit numerical values it is possible with the arrow keys or the PageUp/Down keys to change the value by one or ten units respectively. A doubleclick with the mouse also changes the value by increasing by one unit. A typingcheck is installed for numerical values: <Ctrl> + <Home> or <Ctrl> + <End>deliver the lowest or the highest value respectively for the possible input valuesfor the type of parameter in question.

"Online" "Sourcecodedownload"

This command loads the source code for the project into the controller system.See also "Project" "Options" "Sourcecode download"

Window set up

Under the "Window" menu item you will find all commands for managing thewindows. There are commands both for the automatic set up of your window aswell as for opening the library manager and for changing between openwindows. At the end of the menu you will find a list of all open windows in thesequence they were opened. You can switch to the desired window by clickingthe mouse on the relevant entry. A check will appear in front of the activewindow.

"Window" "TileHorizontal"

With this command you can arrange all the windows horizontally in the workarea so that they do not overlap and will fill the entire work area.

"Window" "Tile Vertical"

With this command you can arrange all the windows vertically in the work areaso that they do not overlap and will fill the entire work area.

"Window" "Cascade"

With this command you can arrange all the windows in the work area in acascading fashion, one behind another.

"Window" "ArrangeSymbols"

With this command you can arrange all of the minimized windows in the workarea in a row at the lower end of the work area.

"Window" "Close All"

With this command you can close all open windows in the work area.

Page 116: Wago Pro Manual

Help when you need it

4-52 WAGO-I/O-PRO 32

"Window" "Messages"

Shortcut: <Shift>+<Esc>With this command you can open or close the message window with themessages from the last compiling, checking, or comparing procedure.

If the messages window is open, then a check (�) will appear in front of thecommand.

Help when you need it

Should you encounter any problems with WAGO-I/O-PRO 32 during yourwork, online help is available to help to solve them. There you will find all theinformation that is also contained in this handbook.

"Help" "Contents andIndex"

With this command you can open the help topics window.

Under the Contents register card you will find the contents. The books can beopened and closed using a doubleclick or the corresponding button.Doubleclicking or activating the Show button on a highlighted topic willdisplay the topic in the main window of help or in the index window.

Click on the Index register card to look for a specific word, and click on theSearch register card to select a full-text search. Follow the instructions in theregister cards.

Page 117: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-53

Image 4.53: Help Topics Window

Main Help Window

In the main help window topics are displayed with index entries listed belowthem.

The following buttons available:• Help topics opens the help topics window• Back shows the help entry that was previously displayed• Print opens the dialog box for printing• << shows the help entry that comes prior in sequence to the present entry• >> shows the help entry that is next in sequence

In addition you can use the following menu commands:• With "File" "'Print Topics" you can print out the present help entry.• If you use the "Edit" "Copy" command, the selected text will be copied

into the clipboard. From here you can insert the text into otherapplications and use it there.

• If you use the "Edit" "Annotate" command, a dialog box will be opened.There is an editing field on the left side of the dialog box in which youcan enter an annotation to the help page.On the right side there are buttons for storing the text, for canceling theprogram, for deleting the notation, for copying a highlighted text on theclipboard , and for pasting a text from the clipboard.If you have made an annotation to a help entry, a small green paper clipwill appear in the upper left-hand corner. By clicking the mouse on the

Page 118: Wago Pro Manual

Help when you need it

4-54 WAGO-I/O-PRO 32

paper clip, you can open the dialog box with the annotation that has beenmade.

• If you would like to mark a page from help, then you can set a bookmark.To do so, choose the "Define" "Bookmark" command. A dialog boxwill appear in which you can enter a new name (The name of the page canserve as a starter) or can delete an old bookmark. If bookmarks weredefined, then these will be displayed in the "Bookmark" menu. Bychoosing these menu items, you can access the desired page.

• Under "Options", you can define whether the help window alwaysappears in the foreground or in the background or in the standard setting.

• With "Display previous topics" under "Options", you are furnishedwith a selection window with the previously displayed help topics.Doubleclick the entry you wish to view.

• Under "Options", you can select the desired "Font" in small, normal,or large.

• If "Options" "Use System Color" has been chosen, help will not bedisplayed in the colors that were set, but in the system colors instead.

Image 4.54: Main Help Window

Index Window

The index window contains explanations about the menu commands, terms, orsequences.

The index window will always remain on the surface by default, unless the helpoption is placed in the background in the main window of help.

The following buttons are available:• Help topics opens the help topics window• Back shows the help entry that was previously displayed• Print opens the dialog box for printing

Page 119: Wago Pro Manual

Chapter 4 - The Individual Components

WAGO-I/O-PRO 32 4-55

• << shows the help entry directly prior to the present entry• >> shows the help entry that is next in sequence

Image 4.55: Index Window

Context Sensitive Help

Shortcut: <F1>You can use the <F1> key in an active window, in a dialog box, or above amenu command. When you perform a command from the menu, the help forthe command called up at that time is displayed.

You can also highlight a text (for example, a key word or a standard function)and have the help displayed for that item.

Page 120: Wago Pro Manual
Page 121: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-1

5 Editors in WAGO-I/O-PRO 32

The Declaration Editor

Declaration editors are used to declare variables of POUs (ProgramOrganization Units) and global variables, for data type declarations, and in theWatch and Receipt Manager.

The declaration of variables is supported by syntax coloring.

All editors for POUs (Program Organization Units) consist of a declaration partand a body. These are separated by a screen divider that can be dragged, asrequired, by clicking it with the mouse and moving it up or down.

The most important commands are found in the context menu (right mousebutton or <Ctrl>+<F10>).

Declaration Part

All variables to be used only in this POU are declared in the declaration part ofthe POU. These can include: input variables, output variables, input/outputvariables, local variables, retain variables, and constants. The declaration syntaxis based on the IEC 61131-3 standard. An example of a correct declaration ofvariables in WAGO-I/O-PRO 32 Editor:

Image 5.1: Declaration Editor

Input Variable

Between the key words VAR_INPUT and END_VAR, all variables aredeclared that serve as input variables for a POU. That means that at the callposition, the value of the variables can be given along with a call.

Page 122: Wago Pro Manual

The Declaration Editor

5-2 WAGO-I/O-PRO 32

Example:VAR_INPUT

in1:INT (* 1. Inputvariable*)END_VAR

Output Variable

Between the key words VAR_OUTPUT and END_VAR, all variables aredeclared that serve as output variables of a POU. That means that these valuesare carried back to the POU making the call. There they can be answered andused further.

Example:VAR_OUTPUT

out1:INT; (* 1. Outputvariable*)END_VAR

Input and OutputVariables

Between the key words VAR_IN_OUT and END_VAR, all variables aredeclared that serve as input and output variables for a POU.

Attention: With this variable, the value of the transferred variable is changed("transferred as a pointer"). That means that the input value for such variablescannot be a constant.

Example:VAR_IN_OUT

inout1:INT; (* 1. Inputoutputvariable *)END_VAR

Local Variables

Between the keywords VAR and END_VAR, all of the local variables of aPOU are declared. These have no external connection; in other words, they cannot be manipulated from the outside.

Example:VAR

loc1:INT; (* 1. Local Variable*)END_VAR

Retain Variables

Retain variables are identified by the key word RETAIN. These variablesmaintain their value, even after a power failure. When the program is run again,the stored values will be processed further. A practical example would be anoperations timer that recommences timing after a power failure.

All other variables are newly initialized, either with their initialized values orwith the standard initializations.

Page 123: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-3

Example:VAR RETAIN

rem1:INT; (* 1. Retain variable*)END_VAR

Constants

Constants are identified by the key word CONSTANT. They can be declaredlocally or globally.

Syntax:VAR CONSTANT

<Identifier>:<Type> := <initialization>;END_VAR

Example:VAR CONSTANT

con1:INT:=12; (* 1. Constant*)END_VAR

You will find a listing of possible constants here in the appendix.

Keywords

In all editors, all keywords are written in capital letters. Keywords may not beused as variables.

Variables declaration

A variables declaration has the following syntax:

<Identifier> {AT <Address>}:<Type> {:=<initialization>};

The parts in the braces {} are optional.

The variable identifier may not contain any blank spaces or special characters,may not be declared more than once and cannot be the same as any of thekeywords. Capitalization is not recognized which means that VAR1, Var1, andvar1 are all the same variable. The underscore character is recognized inidentifiers (e.g., "A_BCD" and "AB_CD" are considered two differentidentifiers). An identifier may not have more than one underscore character in arow. The first 32 characters are significant.

All declarations of variables and data type elements can include initialization.They are brought about by the ":=" operator. For variables of elementary types,these initializations are constants. The default-initialization is 0 for alldeclarations.

Example:var1:INT:=12; (* Integer variable with initial value of 12*)

If you wish to link a variable directly to a definite address, then you mustdeclare the variable with the keyword AT.

For faster input of the declarations, use the shortcut mode.

Page 124: Wago Pro Manual

The Declaration Editor

5-4 WAGO-I/O-PRO 32

In function blocks you can also specify variables with incomplete addressstatements. In order for such a variable to be used in a local instance, there mustbe an entry for it in the variable configuration.

Pay attention to the possibility of an automatic declaration

AT Declaration

If you wish to link a variable directly to a definite address, then you mustdeclare the variable with the keyword AT. The advantage of such a procedure isthat you can assign a meaningful name to an address, and that any necessarychanges of an incoming or outgoing signal will only have to be made in oneplace (e.g., in the declaration).

Notice that variables requiring an input cannot be accessed by writing. A furtherrestriction is that AT declarations can only be made for local and globalvariables, and not for input- and output variables from POUs.

Examples:counter_heat7 AT %QX0.0: BOOL;lightcabinetimpulse AT %IX7.2: BOOL;download AT %MX2.2: BOOL;

"Insert" "Declarationskeywords"

You can use this command to open a list of all the keywords that can be used inthe declaration part of a POU. After a keyword has been chosen and the choicehas been confirmed, the word will be inserted at the present cursor position.

You also receive the list, when you open the Input Assistant and choose theDeclarations category.

"Insert" "Type"

With this command you will receive a selection of the possible types for adeclaration of variables. You also receive the list when you access the InputAssistant.

The types are divided into these categories:• Standard types BOOL, BYTE, etc.• Defined types Structures, enumeration types, etc.• Standard function blocks for instance declarations• Defined function blocks for instance declarations

WAGO-I/O-PRO 32 supports all standard types of IEC 61131-3:

Examples for the use of the various types are found in the appendix.

Syntax Coloring

In all editors you receive visual support in the implementation and declarationof variables. Errors are avoided, or discovered more quickly, because the text isdisplayed in color.

A comment left unclosed, thus annotating instructions, will be noticedimmediately; keywords will not be accidentally misspelled, etc.

Page 125: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-5

The following color highlighting will be used:• Blue Keywords• Green Comments in the text editors• Pink Special constants (e.g. TRUE/FALSE, T#3s,

%IX0.0)• Red Input error (for example, invalid time constant,

keyword, written in lower case,...)• Black Variables, constants, assignment operators, ...

Shortcut Mode

The declaration editor for WAGO-I/O-PRO 32 allows you to use the shortcutmode. This mode is activated when you end a line with <Ctrl><Enter>

The following shortcuts are supported:• All identifiers up to the last identifier of a line will become declaration

variable identifiers• The type of declaration is determined by the last identifier of the line. In

this context, the following will apply:B or BOOL gives the result BOOLI or INT gives the result INTR or REAL gives the result REALS or string gives the result STRING

• If no type has been established through these rules, then the type is BOOLand the last identifier will not be used as a type (Example 1.).

• Every constant, depending on the type of declaration, will turn into aninitialization or a string (Examples 2. and 3.).

• An address (as in %MD12) is extended around the AT...attribute(Example 4.).

• A text after a semicolon (;) becomes a comment (Example 4.).• All other characters in the line are ignored (e.g., the exclamation point in

Example 5.).

Examples:Shortcut DeclarationA A: BOOL;A B I 2 A, B: INT := 2;ST S 2; A string ST:STRING(2); (* A string *)X %MD12 R 5 Real Number X AT %MD12: REAL := 5.0;(* Real

Number *)B ! B: BOOL;

Autodeclaration

If the Autodeclaration of the Options dialog box , then a dialog box willappear in all editors after the input of a variable that has not yet been declared.With the help of this dialog box, the variable can now be declared.

Page 126: Wago Pro Manual

The Declaration Editor

5-6 WAGO-I/O-PRO 32

Image 5.2: Dialog Box for Declaration of Variables

With the help of the Class combobox, select whether you are dealing with alocal variable (VAR), input variable( (VAR_INPUT), output variable(VAR_OUTPUT), input/output variable (VAR_INOUT), or a global variable(VAR_GLOBAL).

With the CONSTANT and RETAIN options, you can define whether you aredealing with a constant or a retain variable

The variable name you entered in the editor has been entered in the Name field,BOOL has been placed in the Type field. The ... button opens the InputAssistent dialog which allows you to select from all possible types.

In the Initial Value field you can assign a value to the variable; otherwise thestandard initial value will be used.

In the Address field you can link a variable to the address (AT declaration)

If necessary, insert a Comment.

By pressing OK you will enter the variable in the corresponding declarationeditor.

Note: The dialog box for variable declaration you also get by the command"Edit" "Declare Variable" (see Chapter 4.5 General Editing Functions).

Line Numbers in theDeclaration Editor

In offline mode, a simple click on a special line number will mark the entiretext line.

In the online mode, a single click on a specific line number will open up orclose the variable in this line, in case a structural variable is involved.

Declarations as tables

If the Declarations as tables option is set in the Options dialog box in theEditor category, the declaration editor looks like a table. As in a card-indexbox, you can select the register cards of the respective variable types and editthe variables.

For each variable you are given the following entry fields.Name: Input the identifier of the variable.Address: If necessary, input the address of the variable (AT

Page 127: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-7

declaration)Type: Input the type of the variable. (Input the function block

when instantiating a function block)Initial: Enter a possible initialization of the variable

(corresponding to the ":= " assignment operator).Comment: Enter a comment here.

Both of the display types of the declaration editor can be changed withoutcausing any problems. In the online mode, there are no differences for thedisplay.

Image 5.3: Declaration Editor as a Table

"Insert" "NewDeclaration"

With this command you bring a new variable into the declaration table of thedeclaration editor. If the present cursor position is located in an field of thetable, then the new variable will be pasted in the preceding line; otherwise, thenew variable is pasted at the end of the table. Moreover, you can paste a newdeclaration at the end of the table by using the right arrow key or the tab key inthe last field of the table.

You will receive a variable that has "Name" located in the Name field, and"Bool" located in the Type field, as its default setting. You should change thesevalues to the desired values. Name and type are all that is necessary for acomplete declaration of variables.

Declaration Editors inOnline Mode

In online mode , the declaration editor changes into a monitor window. In eachline there is a variable followed by the equal sign (=) and the value of thevariable. If the variable at this point is undefined, three question marks (???)will appear.

In front of every multi-element variable there is a plus sign. By pressing<Enter> or after doubleclicking on such a variable, the variable is opened up. Inthe example, the traffic signal structure would be opened up.

Page 128: Wago Pro Manual

The Text Editors

5-8 WAGO-I/O-PRO 32

When a variable is open, all of its components are listed after it. A minus signappears in front of the variable. If you doubleclick again or press <Enter>, thevariable will be closed, and the plus sign will reappear.

Pressing <Enter> or doubleclicking on a single-element variable will open thedialog box to write a variable. Here it is possible to change the present value ofthe variable. In the case of Boolean variables, no dialog box appears; thesevariables are toggled.

The new value will turn red and will remain unchanged. If the "Online""Write values" command is given, then all variables are placed in the selectedlist and are once again displayed in black.

If the "Online" "Force values" command is given, then all variables will beset to the selected values, until the "Release force" command is given.

Comment

User comments must be enclosed in the special character string "*" and "*".

Comments are allowed in all text editors at any preferred location. Theseinclude all declarations, the IL and ST languages, and user-defined data types.

In FBD and LD comments can be entered into every network. In order to do so,select the network that you wish to comment, and enable "Insert""Comment".

In SFC you can enter comments for the step in the dialog box for editing stepattributes.

Interlocking comments are not allowed.

In Online mode, if you place the mouse pointer briefly above a variable, thenthe type and, if necessary, address and comments about the variable will bedisplayed in a Tooltip.

The Text Editors

The text editors (the Instruction List editor and the editor for ) of WAGO-I/O-PRO 32 offer the usual capabilities of Windows text editors.

The implementation in the text editors is supported by syntax coloring.

In Overwrite mode the status bar shows a black OV. You can switch betweenOverwrite mode and Insert mode by key <Ins>

Page 129: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-9

Image 5.4: Text Editors for the Instruction List and Structured Text

The most important commands are found in the context menu (right mousebutton or <Ctrl>+<F10>).

The text editors use the following menu commands in special ways:

"Insert" "Operator"

With this command all of the operators available in the current language aredisplayed in a dialog box.

If one of the operators is selected and the list is closed with OK, then thehighlighted operator will be inserted at the present cursor position.

"Insert" "Operand"

With this command all variables in a dialog box are displayed. You can selectwhether you would like to display a list of the global, the local, or the systemvariables.

If one of the operands is chosen, and the dialog box is closed with OK, then thehighlighted operand will be inserted at the present cursor position.

"Insert" "Function"

With this command all functions will be displayed in a dialog box. You canchoose whether to have a list displaying user-defined or standard functions.

If one of the functions is selected and the dialog box is closed with OK, thenthe highlighted function will be inserted at the current cursor position.

If the With arguments option was selected in the dialog box, then thenecessary input and output variables will also be inserted.

Page 130: Wago Pro Manual

The Text Editors

5-10 WAGO-I/O-PRO 32

"Insert" "Function Block"

With this command all function blocks are displayed in a dialog box. You canchoose whether to have a list displaying user-defined or standard functionblocks.

If one of the function blocks is selected and the dialog box is closed with OK,then the highlighted function block will be inserted at the current cursorposition.

If the With arguments option was selected in the dialog box, then thenecessary input variables of the function block will also be inserted.

The text editors in Onlinemode

The online functions in the editors are set breakpoint and single step processing(steps). Together with the monitoring, the user thus has the debuggingcapability of a modern Windows standard language debugger.

In Online mode, the text editor window is vertically divided in halves. On theleft side of the window you will then find the normal program text; on the rightside you will see a display of the variables whose values were changed in therespective lines.

The display is the same as in the declaration part. That means that when thePLC is running, the present values of the respective variables will be displayed.

If you place the mouse pointer briefly above a variable, then the type, theaddress and the comment about the variable will be displayed in a Tooltip.

"Extras" "MonitoringOptions"

With this command you can configure your monitoring window. In the texteditors, the window is divided into two halves during monitoring. The programis located in the left half. In the right half, all variables that are located in thecorresponding program line are monitored.

You can specify the Monitor Window Width and which Distance two variablesshould have in a line. An distance declaration of 1 corresponds, in this case, to aline height in the selected font.

Image 5.5: Monitoring Options Dialog Box

Breakpoint PositionsSince in WAGO-I/O-PRO 32 several IL lines areinternally combined into a single C-code line, breakpoints can not be set inevery line. Breakpoint positions include all positions in a program at whichvalues of variables can change or where the program flow branches off.(Exception: function calls. If necessary, a breakpoint in the function must be set

Page 131: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-11

here.) At the positions lying inbetween, a breakpoint would not even makesense, since nothing has been able to change in the data since the precedingbreakpoint position.

This results in the following breakpoint positions in the IL:• At the start of the POU• At every LD, LDN (or, in case a LD is located at a label, then at the label)• At every JMP, JMPC, JMPCN• At every label• At every CAL, CALC, CALCN• At every RET, RETC, RETCN• At the end of the POU

Structured Text accommodates the following breakpoint positions:• At every assignment• At every RETURN and EXIT instruction• in lines where conditions are being evaluated (WHILE, IF, REPEAT)• At the end of the POU

Breakpoint positions are marked by the display of the line number field in adarker gray.

Image 5.6: IL Editor with Possible Breakpoint Positions (darker number fields)

How do you set abreakpoint?

In order to set a breakpoint, click the line number field of the line where youwant to set a breakpoint. If the selected field is a breakpoint position, then thecolor of the line numbers field will change from dark gray to light blue, and thebreakpoint will be activated in the PLC.

Deleting Breakpoints

Correspondingly, in order to delete a breakpoint, click on the line number fieldof the line with the breakpoint to be deleted.

Page 132: Wago Pro Manual

The Text Editors

5-12 WAGO-I/O-PRO 32

Setting and deleting of breakpoints can also be selected via the menu("Online" "Toggle Breakpoint"), via the function key <F9>, or via thesymbol in the tool bar.

What happens at abreakpoint?

If a breakpoint is reached in the PLC, then the screen will display the breakwith the corresponding line. The line number field of the line where the PLC ispositioned will appear in red. The user program is stopped in the PLC.

If the program is at a breakpoint, then the processing can be resumed with"Online" "Run".

In addition, with "Online" "Step over" or "Step in" you can cause the programto run to the next breakpoint position. If the instruction where you are located isa CAL command, or, if there is a function call in the lines up to the nextbreakpoint position, then you can use "Step over" to bypass the function call.With "Step in", you will branch to the open POU.

Line Number of the TextEditor

The line numbers of the text editor give the number of each text line of animplementation of a POU.

In Off-line mode, a simple click on a special line number will mark the entiretext line.

In Online mode, the background color of the line number indicates thebreakpoint status of every line:

• dark gray: This line is a possible position for a breakpoint.• light blue: a breakpoint has been set in this line.• red: The program has reached this point.

In Online mode, simply clicking the mouse will change the breakpoint status ofthis line.

The Instruction List Editor

This is how a POU written in the IL looks under the corresponding WAGO-I/O-PRO 32 editor:

Page 133: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-13

Image 5.7: IL Editor

All editors for POUs consist of a declaration part and a body. These areseparated by a screen divider.

The Instruction List editor is a text editor with the usual capabilities ofWindows text editors. The most important commands are found in the contextmenu (right mouse button or <Ctrl>+<F10>).

For information about the IL editor in Online mode, see Text Editors in OnlineMode.

For information about the language, see the Instruction Lists.

Flow Control

With the "Online" "Flow control" command, an additional field in which theaccumulator contents is displayed is inserted in the IL editor on the left side ofevery line.

The Editor for Structured Text

This is how a POU written in ST appears under the corresponding WAGO-I/O-PRO 32 editor:

Page 134: Wago Pro Manual

The Graphic Editors

5-14 WAGO-I/O-PRO 32

Image 5.8: Editor for Structured Text

All editors for POUs consist of a declaration part and a body. These areseparated by a screen divider.

The editor for Structured Text is a text editor with the usual capabilities ofWindows text editors. The most important commands are found in the contextmenu (right mouse button or <Ctrl>+<F10>).

For information about the ST editor in Online mode, read Text Editors inOnline Mode.

For information about the language, read the chapter Structured Text(ST).

The Graphic Editors

The editors of both of the graphically oriented languages, LD and FBD, havemany points in common. These points are summarized in the followingchapters. The editor of the Sequential Function Chart digresses from this pointand is, consequently, not described until Chapter The Sequential Function ChartEditor.

The implementation in the graphic editors is supported by syntax coloring.

Label

Each network has a label that can optionally be left empty. This label is editedby clicking the first line of the network, directly next to the network number.Now you can enter a label, followed by a colon.

Page 135: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-15

Network Comments

Every network can be supplied with a multi-lined comment. In "Extras""Options", you can enter the maximum number of lines to be made availablefor a network comment. This entry is made in the maximum comment sizefield. (The default value here is 4.) You can also enter the number of lines thatgenerally should be reserved for comments (minimum comment size). If, forexample, the number 2 is entered, then, at the start of each network there willbe two empty lines after the label line. The default value here is 0, which hasthe advantage of allowing more networks to fit in the screen area.

If the minimal comment size is greater than 0, then in order to enter a commentyou simply click in the comment line and then enter the comment. Otherwiseyou must next select the network to which a comment is to be entered, and use"Insert" "Comment" to insert a comment line. In contrast to the program text,comments are displayed in gray.

"Insert" "Network (after)"or "Insert" "Network(before)"

Shortcut: <Shift>+<T> (Network after)

In order to insert a new network in the FBD or the LD editor, select the"Insert" "Network (after)" or the �Insert" "Network (before)" command,depending on whether you want to insert the new network before or after thepresent network. The present network can be changed by clicking the networknumber. You will recognize it in the dotted rectangle under the number. Withthe <Shift key> and a mouse click you can select from the entire area ofnetworks, from the present one to the one clicked.

The network editors in theonline mode

In the FBD and the LD editors you can only set breakpoints for networks. Thenetwork number field of a network for which a breakpoint has been set, isdisplayed in blue. The processing then stops in front of the network, where thebreakpoint is located. In this case, the network number field is displayed in red.With single step processing (steps), you can jump from network to network.

All values are monitored upon entering and exiting network POUs (ProgramOrganization Units).

The flow control is run with the "Online" "Flow control" command. Usingthe flow control, you can view the present values that are being carried in thenetworks over the connecting lines. If the connecting lines do not carry Booleanvalues, then the value will be displayed in a specially inserted field. If the linescarry Boolean values, then they will be shaded blue, in the event that they carryTRUE. Therefore, you can accompany the flow of information while the PLC isrunning.

If you place the mouse pointer briefly above a variable, then the type, theaddress and the comment about the variable will be displayed in a Tooltip.

Page 136: Wago Pro Manual

The Graphic Editors

5-16 WAGO-I/O-PRO 32

The Function Block Diagram Editor

This is how a POU written in the FBD under the corresponding WAGO-I/O-PRO 32 editor looks:

Image 5.9: Editor for the Function Block Diagram

The Function Block Diagram editor is a graphic editor. It works with a list ofnetworks, in which every network contains a structure that displays,respectively, a logical or an arithmetical expression, the calling up of a functionblock, a jump, or a return instruction.

The most important commands are found in the context menu (right mousebutton or <Ctrl>+<F10>).

Cursor positions in FBD

Every text is a possible cursor position. The selected text is on a bluebackground and can now be changed.

You can also recognize the present cursor position by a dotted rectangle. Thefollowing is a list of all possible cursor positions with an example:

1) Every text field (possible cursor positions framed in black):

2) Every input:

Page 137: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-17

3) Every operator, function, or function block:

4) Outputs, if an assignment or a jump comes afterward:

5) The lined cross above an assignment, a jump, or a return instruction:

6) Behind the outermost object on the right of every network ("last cursorposition," the same cursor position that was used to select a network):

7) The lined cross directly in front of an assignment:

How to set the cursor

The cursor can be set at a certain position by clicking the mouse, or with thehelp of the keyboard.

Using the arrow keys, you can jump to the nearest cursor position in theselected direction at any time. All cursor positions, including the text fields, canbe accessed this way. If the last cursor position is selected, then the <up> or<down> arrow keys can be used to select the last cursor position of the previousor subsequent network.

An empty network contains only three question marks "???". By clickingbehind these, the last cursor position is selected.

"Insert" "Assignment"

Symbol: Shortcut: <Ctrl>+<A>

This command inserts an assignment.

Depending on the selected position, insertion takes place directly in front of theselected input (Cursor Position 2), directly after the selected output (CursorPosition 4), directly before the selected line cross (Cursor Position 5), or at theend of the network (Cursor Position 6). For an inserted assignment, a selectioncan be made accompanying the entered text "???", and the assignment can bereplaced by the variable that is to be assigned. For this you can also use theInput Assistant.

In order to insert an additional assignment to an existing assignment, use the"Insert" "Output" command.

Page 138: Wago Pro Manual

The Graphic Editors

5-18 WAGO-I/O-PRO 32

"Insert" "Jump"

Symbol: Shortcut: <Ctrl>+<L>

This command inserts a jump.

Depending on the selected position, insertion takes place directly in front of theselected input (Cursor Position 2), directly after the selected output (CursorPosition 4), directly before the selected line cross (Cursor Position 5), or at theend of the network (Cursor Position 6).

For an inserted jump, a selection can be made accompanying the entered text"???", and the jump can be replaced by the label to which it is to be assigned.

"Insert" "Return"

Symbol: Shortcut: <Ctrl>+<R>

This command inserts a RETURN instruction.

Depending on the selected position, insertion takes place directly in front of theselected input (Cursor Position 2),directly after the selected output (CursorPosition 4), directly before the selected line cross (Cursor Position 5), or at theend of the network (Cursor Position 6)

"Insert" "Operator"

Symbol: Shortcut: <Ctrl>+<O>

This command inserts an operator. Insertion takes place according to theselected position.

If an input is selected (Cursor Position 2), then the operator is inserted in frontof this input. The first input of this operator is linked to the branch on the left ofthe selected input. The output of the new operator is linked to the selectedinput.

If an output is selected (Cursor Position 4), then the operator is inserted afterthis output. The first input of the operator is connected with the selected output.The output of the new operator is linked to the branch with which the selectedoutput was linked.

If an operator, a function, or a function block is selected (Cursor Position 3),then the old element will be replaced by the new operator. As far as possible,the branches will be connected the same way as they were before thereplacement. If the old element had more inputs than the new one, then theunattachable branches will be deleted. The same holds true for the outputs.

If a jump or a return is selected, then the operator will be inserted before thisjump or return. The first input of the operator is connected with the branch tothe left of the selected element. The output of the operator is linked to thebranch to the right of the selected element.

If the last cursor position of a network is selected (Cursor Position 6), then theoperator will be inserted following the last element. The first input of theoperator is linked to the branch to the left of the selected position.

Page 139: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-19

The inserted operator is always an AND. By selecting and overwriting the text,you can convert this operator into any other operator. With the Input Assistant,you can choose the desired operator from the list of the supported operators. Ifthe new operator has a different lowest number of inputs, then these will beattached. If the new operator has a lesser highest number of inputs, then the lastinputs, including those on the branches situated in front of them will be deleted.

All operator inputs that could not be linked will receive the text "???". This textmust be clicked and changed into the desired constant or variable.

"Insert" "Function" or"Insert" "Function Block"

Symbol: Shortcut: <Ctrl>+<F (Function)

Symbol: Shortcut: <Ctrl>+<B> (Function block)

This command inserts a function or a function block. Insertion takes placeaccording to the selected position. First the Input Assistant dialog box, whichcontains all functions and function blocks, is opened.

The insertion then takes place analogous to the "Insert" "Operator"command. The assignment of inputs and outputs is also analogous. If there is abranch to the right of an inserted function block, then the branch will beassigned to the first output. Otherwise the outputs will remain unallocated.

"Insert" "Input"

Symbol: Shortcut: <Ctrl>+<U>

This command inserts an operator input. With many operators, the number ofinputs may vary. (For example, ADD can have 2 or more inputs.)

In order to extend such an operator by an input, you need to select the input infront of which you wish to insert an additional input (Cursor Position 1); or youmust select the operator itself (Cursor Position 3), if a lowest input is to beinserted.

The inserted input is allocated with the text "???". This text must be clicked andchanged into the desired constant or variable. For this you can also use the InputAssistant.

"Insert" "Output"

Symbol: This command inserts an additional assignment into an existing assignment.This capability serves the placement of so-called assignment combs; i.e., theassignment of the value presently located at the line to several variables.

If you select the lined cross above an assignment (Cursor Position 5) or theoutput directly in front of it (Cursor Position 4), then there will be anotherassignment inserted after the ones already there.

Page 140: Wago Pro Manual

The Graphic Editors

5-20 WAGO-I/O-PRO 32

If the line cross directly in front of an assignment is selected (Cursor Position4), then another assignment will be inserted in front of this one.

The inserted output is allocated with the text "???". This text must be clickedand changed into the desired variable. For this you can also use the InputAssistant.

"Extras" "Negation"

Symbol: Shortcut: <Ctrl>+<N>

With this command you can negate the inputs, outputs, jumps, or RETURNinstructions. The symbol for the negation is a small circle at a connection.

If an input is selected (Cursor Position 2), then this input will be negated.

If an output is selected (Cursor Position 4), then this output will be negated.

If a jump or a return is marked, then the input of this jump or return will benegated.

A negation can be canceled through renewed negation.

"Extras" "Set/Reset"

Symbol: With this command you can define outputs as Set or Reset Outputs. A grid withSet Output is displayed with [S], and a grid with Reset Output is displayed with[R].

Image 5.10: Set/Reset Outputs in FBD

An Output Set is set to TRUE, if the grid belonging to it returns TRUE. Theoutput now maintains this value, even if the grid jumps back to FALSE.

An Output Reset is set to FALSE, if the grid belonging to it returns FALSE.The output maintains its value, even if the grid jumps back to FALSE.

With multiple executions of the command, the output will alternate betweenset, reset, and normal output.

"Extras" "Zoom"

Shortcut: <Alt>+<Enter>

With this command a selected POU is loaded into its editor (Cursor Position 3).

If you are dealing with a POU from a library, then the library manager is calledup, and the corresponding POU is displayed.

Page 141: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-21

Cutting, Copying, Pasting,and Deleting in FBD

The commands used to "Cut", "Copy", "Paste", and "Delete" are found underthe "Edit" menu item.

If a line cross is selected (Cursor Position 5), then the assignments, jumps, orRETURNS located below the crossed line will be cut, deleted, or copied.

If an operator, a function, or a function block is selected (Cursor Position 3),then the selected object itself, will be cut, deleted, or copied, along with all ofthe branches dependent on the inputs, with the exception of the first branch.

Otherwise, the entire branch located in front of the cursor position will be cut,deleted, or copied.

After copying or cutting, the deleted or copied part is located on the clipboardand can now be pasted, as desired.

In order to do so, you must first select the pasting point. Valid pasting pointsinclude inputs and outputs.

If an operator, a function, or a function block has been loaded onto theclipboard (As a reminder: in this case all connected branches except the first arelocated together on the clipboard), the first input is connected with the branchbefore the pasting point.

Otherwise, the entire branch located in front of the pasting point will bereplaced by the contents of the clipboard.

In each case, the last element pasted is connected to the branch located in frontof the pasting point.

Note: The following problem is solved by cutting and pasting: A newoperator is pasted in the middle of a network. The branch located on the right ofthe operator is now connected with the first input, but must be connected withthe second input. You can now select the first input and perform the command"Edit" "Cut". Following this, you can select the second input and perform thecommand "Edit" "Paste". This way, the branch is dependent on the secondinput.

The Function BlockDiagram in the OnlineMode

In the Function Block Diagram, breakpoints can only be set to networks. If abreakpoint has been set to a network, then the network numbers field will bedisplayed in blue. The processing then stops in front of the network where thebreakpoint is located. In this case, the network numbers field will become red.Using stepping (single step), you can jump from network to network.

The current value is displayed for each variable. Doubleclicking on a variableopens the dialog box for writing a variable. Here it is possible to change thepresent value of the variable. In the case of Boolean variables, no dialog boxappears; these variables are toggled.

Page 142: Wago Pro Manual

The Graphic Editors

5-22 WAGO-I/O-PRO 32

The new value will turn red and will remain unchanged. If the "Online""Write values" command is given, then all variables are placed in the selectedlist and are once again displayed in black.

The flow control is run with the "Online" "Flow control" command. Usingthe flow control, you can view the present values that are being carried in thenetworks over the connecting lines. If the connecting lines do not carry Booleanvalues, then the value will be displayed in a specially inserted field. If the linescarry Boolean values, then they will be shaded blue in the event that they carryTRUE. By this means, you can accompany the flow of information while thePLC is running.

If you place the mouse pointer briefly above a variable, then the type, theaddress and the comment about the variable will be displayed in a Tooltip.

The Ladder Editor

This is how a POU written in the LD appears in the WAGO-I/O-PRO 32editor:

Image 5.11: POU in the Ladder Diagram

All editors for POUs consist of a declaration part and a body. These areseparated by a screen divider.

The LD editor is a graphic editor. The most important commands are found inthe context menu (right mouse button or <Ctrl>+<F10>).

For information about the elements, see Ladder Diagram (LD).

Page 143: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-23

Cursor Positions in theLD Editors

The following locations can be cursor positions, in which the function blockand program accessing can be handled as contacts. POUs with EN inputs andother POUs connected to them are treated the same way as in the FunctionBlock Diagram. Information about editing this network part can be found inChapteron the FBD Editor.

1. Every text field (possible cursor positions framed in black)

2. Every Contact or Function Block

3. Every Coil

4. The Connecting Line between the Contacts and the Coils.

The Ladder Diagram uses the following menu commands in a special way:

"Insert" "Contact"

Symbol: Shortcut: <Ctrl>+<O>

Use this command in the LD editor in order to insert a contact in front of themarked location in the network.If the marked position is a coil (Cursor Position 3) or the connecting linebetween the contacts and the coils (Cursor Position 4), then the new contactwill be connected serially to the previous contact connection.The contact is preset with the text "???". You can click on this text and changeit to the desired variable or the desired constant. For this you can also use theInput Assistant.

Page 144: Wago Pro Manual

The Graphic Editors

5-24 WAGO-I/O-PRO 32

"Insert" "ParallelContact"

Symbol: Shortcut: <Ctrl>+<R>

Use this command in the LD editor to insert a contact parallel to the markedposition in the network.If the marked position is a coil (Cursor Position 3) or the connection betweenthe contacts and the coils (Cursor Position 4), then the new contact will beconnected in parallel to the entire previous contact connection.The contact is preset with the text "???". You can click on this text and changeit to the desired variable or the desired constant. For this you can also use theInput Assistant.

"Insert" "Function Block"

Shortcut: <Ctrl>+<B>

You can use this command to open a dialog box for selecting a function blockor a program. You can select between user-defined or standard (default) POUs.The selected POU is inserted, according to the same rules used to insert acontact. In both cases, the first input of the POU is set on the input connection,and the first output is set on the output connection. For this reason both of thesevariables definitely must be of the BOOL type. All other POU inputs andoutputs are occupied with the text "???". These default settings can be changedto other constants, variables, or addresses. For this you can also use the InputAssistant.

"Insert" "Coil"

Symbol: Shortcut: <Ctrl>+<L>

You can use this command in the LD editor to insert a coil in parallel to theprevious coils.

If the marked position is a connection between the contacts and the coils(Cursor Position 4), then the new coil will be inserted as the last. If the markedposition is a coil (Cursor Position 3), then the new coil will be inserted directlyabove it.

The coil is given the text "???" as a default setting. You can click on this textand change it to the desired variable. For this you can also use the InputAssistant.

POUs with EN Inputs

If you want to use your LD network as a PLC for calling up other POUs , thenyou must merge a POU with an EN input. Such a POU is connected in parallelto the coils. Beyond such a POU you can develop the network further, as in theFunction Block Diagram. You can find the commands for insertion at an ENPOU under the menu item "Insert" "Insert at Blocks"

Page 145: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-25

An operator, a function block, or a function with EN input performs the sameway as the corresponding POU in the Function Block Diagram, except that itsexecution is controlled on the EN input. This input is annexed at the connectingline between coils and contacts. If this connection carries the information "On",then the POU will be evaluated.

If a POU has been created once already with EN input, then this POU can beused to create a network. This means that data from usual operators, functions,and function blocks can flow in an EN POU and an EN POU can carry data tosuch usual POUs.

If, therefore, you want to program a network in the LD editor, as in FBD, youonly need first to insert an EN operator in a new network. Subsequently, fromthis POU, you can continue to construct from your network, as in the FBDeditor. A network thus formed will perform like the corresponding network inFBD.

"Insert" "Operator withEN"

Use this command to insert an operator with EN input into a LD network.

The marked position must be the connection between the contacts and the coils(Cursor Position 4) or a coil (Cursor Position 3). The new operator is inserted inparallel to the coils and underneath them; it contains initially the designationAND. If you wish, you can change this designation to another one. For this youcan also use the Input Assistant.

"Insert" "Function Blockwith EN"

With this command you can insert a function block with EN input into a LDnetwork.

The marked position must be the connection between the contacts and the coils(Cursor Position 4) or a coil (Cursor Position 3). The new function block isinserted in parallel to the coils, below them. From the Input Assistant dialogbox that appears, you can select whether to insert a user-defined, or a standard(default) function block.

"Insert" "Function withEN"

With this command you can insert a function with EN input into an LDnetwork.

The marked position must be the connection between the contacts and the coils(Cursor Position 4) or a coil (Cursor Position 3). The new function is inserted inparallel to the coils, below them. From the Input Assistant dialog box thatappears, you can select whether to insert a user-defined, or a standard functionblock.

Page 146: Wago Pro Manual

The Graphic Editors

5-26 WAGO-I/O-PRO 32

"Insert" "Insert at Blocks"

With this command you can insert additional elements into a POU that hasalready been inserted (also a POU with EN input). The commands below thismenu item can be executed at the same cursor positions as the correspondingcommands in the Function Block Diagram (See Chapter 5.7).

With Input you can add a new input to the POU.

With Output you can add a new output to the POU.

With Operator you can add a new operator to the POU, whose output isdeposited onto the selected input.

With Assignment you can add an assignment to the selected input or output.

With Function you can add a function to the selected input.

With Function Block you can add a function block to the selected input.

"Insert" "Jump"

With this command you can insert a parallel jump in the selected LD editor, inparallel, at the end of the previous coils. If the incoming line delivers the value"On", then the jump will be executed to the indicated label.

The marked position must be the connection between the contacts and thecoils(Cursor Position 4) or a coil (Cursor Position 3).

The jump is present with the text "???". You can click on this text and make achange in the desired label.

"Insert" "Return"

In the LD editor, you can use this command to insert a Return instruction inparallel at the end of the previous coils. If the incoming line delivers the value"On," then the processing of the POU in this network is broken off.

The marked position must be the connection between the contacts and thecoils(Cursor Position 4) or a coil (Cursor Position 3).

"Extras" "Paste after"

Use this command in the LD editor to insert the contents of the clipboard as aserial contact after the marked position. This command is only possible if thecontents of the clipboard and the marked position are networks comprised ofcontacts.

"Extras" "Paste below"

Shortcut: <Ctrl>+<U>

Use this command in the LD editor to insert the contents of the clipboard asparallel contact below the marked position. This command is only possible ifthe contents of the clipboard and the marked position are networks comprisedof contacts.

Page 147: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-27

"Extras" "Paste above"

Use this command in the LD editor to insert the contents of the clipboard asparallel contact above the marked position. This command is only possible ifthe contents of the clipboard and the marked position are networks comprisedof contacts.

"Extras" "Negate"

Symbol: Shortcut: <Ctrl>+<N>

Use this command to negate a contact, a coil, a jump or return instruction, or aninput or output of EN POUs at the present cursor position (Cursor Position 2and 3).

Between the parentheses of the coil or between the straight lines of the contact,a slash will appear ((/) or |/|). If there are jumps, returns, or inputs or outputs ofEN POUs, a small circle will appear at the connection, just as in the FBDeditor.

The coil now writes the negated value of the input connection in the respectiveBoolean variable. Right at this moment, a negated contact switches the status ofthe input to the output, if the respective Boolean variable carries the valueFALSE.

If a jump or a return is marked, then the input of this jump or return will benegated.

A negation can be canceled through renewed negation.

"Extras" "Set/Reset"

If you execute this command on a coil, then you will receive a Set Coil. Such acoil never overwrites the value TRUE in the respective Boolean variable. Thismeans that once you have set the value of this variable to TRUE, it will alwaysremain at TRUE. A Set Coil is designated with an "S" in the coil symbol.

If you execute this command once again, then you will be given a Reset Coil.Such a coil never overwrites the value FALSE in the respective Booleanvariable. This means that once you have set the value of this variable toFALSE, it will always remain at FALSE. A Reset Coil is designated with an"R" in the coil symbol.

If you execute this command repeatedly, the coil will alternate between set,reset and normal coil.

The Ladder Diagram inthe Online Mode

In Online mode, the contacts and coils in the Ladder Diagram that are in the"On" state are colored blue. Likewise, all lines over which the "On" is carriedare also colored blue. At the inputs and outputs of function blocks, the values ofthe corresponding variables are indicated.

Breakpoints can only be set on networks; by using stepping, you can jump fromnetwork to network.

Page 148: Wago Pro Manual

The Graphic Editors

5-28 WAGO-I/O-PRO 32

If you place the mouse pointer briefly above a variable, then the type, theaddress and the comment about the variable will be displayed in a Tooltip.

The Sequential Function Chart Editor

This is how a POU written in the SFC appears in the WAGO-I/O-PRO 32editor:

Image 5.12: Sequential Function Chart Editor with an opened Action

All editors for POUs consist of a declaration part and a body. These areseparated by a screen divider.

The Sequential Function Chart editor is a graphic editor. The most importantcommands are found in the context menu (right mouse button or<Ctrl>+<F10>).

For information about the Sequential Function Chart, see Sequential FunctionChart.

The editor for the Sequential Function Chart must agree with the particulars ofthe SFC. In reference to these, the following menu items will be of service.

Marking Blocks in theSFC

A marked block is a bunch of SFC elements that are enclosed in a dottedrectangle. (In the example somewhat above, the step is marked Switch1.)

You can select an element (a step, a transition, or a jump) by pointing themouse on this element and pressing the left mouse button, or you can use the

Page 149: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-29

arrow keys. In order to mark a group of several elements, press <Shift> for ablock already marked, and select the element in the lower left or right corner ofthe group. The resulting selection is the smallest cohesive group of elementsthat includes both of these elements.

Observe that all commands can only be executed, if they do not contradict theconventions of the language.

"Insert" "Step Transition(before)"

Symbol: Shortcut: <Ctrl>+<T>

This command inserts a step in the SFC editor followed by a transition in frontof the marked block.

"Insert" "Step Transition(after)"

Symbol: Shortcut: <Ctrl>+<E>

This command inserts a step in the SFC editor followed by a transition after thefirst transition in the marked block.

"Insert" "AlternativeBranch (right)"

Symbol: Shortcut: <Ctrl>+<A>

This command inserts an alternative branch in the SFC editor as a right branchof the marked block. For this the marked block must both begin and end with atransition. The new branch is then made up of one transition.

"Insert" "AlternativeBranch (left)"

Symbol: This command inserts an alternative branch in the SFC editor as the left branchof the marked block. For this the marked block must both begin and end with atransition. The new branch is then made up of one transition.

"Insert" "Parallel Branch(right)"

Symbol: Shortcut: <Ctrl>+<L>

This command inserts a parallel branch in the SFC editor as the right branch ofthe marked block. For this the marked block must both begin and end with astep. The new branch is then made up of one step.

Page 150: Wago Pro Manual

The Graphic Editors

5-30 WAGO-I/O-PRO 32

"Insert" "Parallel Branch(left)"

Symbol: This command inserts a parallel branch in the SFC editor as the left branch ofthe marked block. For this the marked block must both begin and end with astep. The new branch is then made up of one step.

"Insert" "Jump"

Symbol: Shortcut: <Ctrl>+<U>

This command inserts a jump in the SFC editor at the end of the branch, towhich the marked block belongs. For this the branch must be an alternativebranch.

For a inserted jump then the text field 'Step' can be selected and be replaced bythe label of the step which is target of the jump.

"Insert" "Transition-Jump"

Symbol: This command inserts a transition in the SFC editor, followed by a jump at theend of the selected branch. For this the branch must be a parallel branch.

For a inserted jump then the text field 'Step' can be selected and be replaced bythe label of the step which is target of the jump.

"Insert" "Add Entry-Action"

With this command you can add an entry-action to a step. An entry-action isonly executed once, right after the step has become active. The entry-action canbe implemented in a language of your choice.

A step with an entry-action is designated by an "E" in the bottom left corner.

"Insert" "Add Exit-Action"

With this command you can add an exit-action to a step. An exit-action is onlyexecuted once, before the step is deactivated. The exit-action can beimplemented in a language of your choice.

A step with an exit-action is designated by an "X" in the lower right corner.

"Extras" "Paste ParallelBranch (right)"

This command pastes the contents of the clipboard as a right parallel branch ofthe marked block. For this the marked block must both begin and end with astep. The contents of the clipboard must, likewise, be an SFC block that bothbegins and ends with a step.

Page 151: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-31

"Extras" "Paste after"

This command pastes the SFC block on the clipboard after the first step or thefirst transition of the marked block. (Normal copying pastes it in front of themarked block.) This will now be executed, if the resulting SFC structure iscorrect, according to the language norms.

"Extras" "ZoomAction/Transition"

Shortcut: <Alt>+<Enter>

The action of the first step of the marked block or the transition body of the firsttransition of the market block is loaded into the editor in the respectivelanguage, in which it has been written. If the action or the transition body isempty, then the language must be selected, in which it has been written.

"Extras" "ClearAction/Transition"

With this command you can delete the actions of the first step of the markedblock or of the transitions body of the first transition.

If, during a step, you implement either only the action, the entry-action, or theexit-action, then the same will be deleted by the command. Otherwise a dialogbox appears, and you can select which action or actions are to be deleted.

If the cursor is located in the action of an IEC step, then only this associationwill be deleted. If an IEC step with an associated action is selected, then thisassociation will be deleted. During an IEC step with several actions, a selectiondialog box will appear.

"Extras" "Step Attributes"

With this command you can open a dialog box in which you can edit theattributes for the marked step.

Page 152: Wago Pro Manual

The Graphic Editors

5-32 WAGO-I/O-PRO 32

Image 5.13: Dialog Box for Editing Step Attributes

You can take advantage of three different entries in the step attribute dialogbox. Under Minimum Time, you enter the minimum length of time that theprocessing of this step should take. Under the Maximum Time, you enter themaximum length of time that the processing of this step should take. Note thatthe entries are of the TIME type, so you use a TIME constant (i.e. T#3s) or avariable of the TIME type.Under Comment you can insert a comment to thestep. With "Extras" "Options" you can then adjust whether, in the SFCeditor, the comments or the time setting for the steps should be displayed. Onthe right, next to the step, either the comment or the time setting will appear.

If the maximum time is exceeded, SFC flags are set for the user to makeinquiries.

The example shows a step whose execution should last at least two, and at themost, ten seconds. In Online mode, there is, in addition to these two times, adisplay of how long the step has already been active.

"Extras""Time Overview"

With this command you can open a window in which you can edit the timesettings of your SFC steps:

Image 5.14: Time Boundaries Overview for a SFC POU

In the time boundaries overview, all steps of your SFC POU are displayed. Ifyou have entered a time boundary for a step, then the time boundary is

Page 153: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-33

displayed to the right of the step (first, the lower limit, then the upper limit).You can also edit the time boundaries. To do so, click on the desired step in theoverview. The name of the step is then shown below in the window. Go to theMinimum Time or Maximum Time field, and enter the desired time boundarythere. If you close the window with OK, then all of the changes will be stored.

In the example, steps 2 and 6 have a time boundary. Switch1 lasts at least two,and at most, ten seconds. Switch2 lasts at least seven, and at most, eightseconds.

"Extras" "SFC-Overview"

With this command you are given a reduced display of the active SFC POU. Acheck appears before the menu item. For better orientation you can display thenames of the steps, transitions, and jumps in tooltips by placing the mousepointer on an element.

In order to switch back to the normal SFC display, set a marking and then eitherpress <Enter> or select the command once again, and the change will takeplace.

Image 5.15: SFC Overview

"Extras" "Options"

With this command you open a dialog box in which you can set differentoptions for your SFC POU.

Page 154: Wago Pro Manual

The Graphic Editors

5-34 WAGO-I/O-PRO 32

Image 5.16: Dialog Box for Sequential Function Chart Options

In the SFC Options dialog box you can undertake five entries. Under StepHeight, you can enter how many lines high an SFC step can be in your SFCeditor. 4 is the standard setting here. Under Step Width, you can enter howmany columns wide a step should be. 6 is the standard setting here. You canalso preset the Display at Step. With this, you have three possibilities: You caneither have Nothing displayed, or the Comment, or the Time Limits. The lasttwo are shown the way you entered them in "Extras" "Step Attributes".

"Extras" "AssociateAction"

With this command actions and Boolean variables can be associated with IECsteps.

To the right of, and next to the IEC step, an additional divided box is attached,for the association of an action. It is preset in the left field with the qualifier "N"and the name "Action." Both presets can be changed. For this you can use theInput Assistant.

New actions for IEC steps are created in the Object Organizer for an SFC POUwith the "Project" "Add Action" command.

"Extras" "Use IEC-Steps"

Symbol: If this command is activated (denoted by a check in front of the menu item anda printed symbol in the Tool bar), then IEC steps will be inserted instead of thesimplified steps upon insertion of step transitions and parallel branches.

If this option is switched on, the Init step is set as an IEC step when you create anew SFC POU.

This settings are saved in the file "WAGO-IO-PRO.ini" and are restored whenWAGO-I/O-PRO 32 gets started again.

Page 155: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-35

The Sequential FunctionChart in the Online Mode

With the Sequential Function Chart editor in Online mode, the currently-activesteps will be displayed as blue steps. If you have set it under "Extras""Options", then the time management is depicted next to the steps. Under thelower and upper bounds that you have set, a third time indicator will appearfrom which you can read how long the step has already been active.

In the picture above the step depicted has already been active 8 seconds and 410milliseconds. The step must, however, be active for at least 7 minutes beforethe step will be left.

With "Online" "Toggle Breakpoint", a breakpoint is set at a step. Theprocessing then stops in front of the execution of this step. The step with thebreakpoint is colored light blue.

If several steps are active in a parallel branch, then the active step whose actionwill be processed next is displayed in red.

If IEC steps have been used, then all active actions in Online mode will bedisplayed in blue.

SFC also includes support for stepping a step at a time ("Online" "Step Over").With this stepping, the program will always proceed to the next step whoseaction is to be executed.

With "Online" "Step in" you can step into actions. Within the actions, alldebugging capabilities of the corresponding editor are at the user's disposal.

If you place the mouse pointer briefly above a variable, then the type and thecomment about the variable will be displayed in a Tooltip.

Page 156: Wago Pro Manual

The Graphic Editors

5-36 WAGO-I/O-PRO 32

Image 5.17: Sequential Function Chart in the Online Mode with an Active Step (Switch1) and aBreakpoint (Step10)

The Continuous Function Chart Editor (CFC)

It looks like a block which has been produced using the continuous functionchart editor (CFC):

Page 157: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-37

Image 5.18: Editor for continuous function charts

No snap grid is used for the continuous function chart editor so the elementscan be placed anywhere. Elements of the sequential processing list includeblocks, input, output, jump, label, return and comments. The inputs and outputsof these elements can be connected by dragging a connection with the mouse.The connecting line will be drawn automatically. The shortest possibleconnection line is drawn taking into account existing connections. Theconnecting lines are automatically adjusted when the elements are moved. If thecase arises where a connecting line cannot be drawn simply because of lack ofspace, a red line will be shown between the input and the associated outputinstead. This line will be converted into a connecting line just as soon as spaceis available.

One advantage of the continuous function chart as opposed to the usualfunction block diagram editor is the fact that feedback paths can be inserteddirectly.

The most important commands can be found in the context menu

Cursor positions in thecontinuous function charteditor

Each text is a possible cursor position. The selected text is shaded in blue andcan be modified.

In all other cases the current cursor position is shown by a rectangle made up ofpoints. The following is a list of all possible cursor positions with examples:

Page 158: Wago Pro Manual

The Graphic Editors

5-38 WAGO-I/O-PRO 32

1. Trunks of the elements blocks, input, output, jump, label, return andcomments.

2. Text fields for the elements blocks, input, output, jump, label, return andcomments as well as text fields for connectionmarkers:

3. Inputs for the elements block, input, output, jump andreturn:

4. Outputs for the elements block and input:

Page 159: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-39

"Insert" "Block"

Symbol: Shortcut: <Ctrl>+<B>This command can be used to paste in operators, functions, function blocks andprograms. It is always pasted in as an �AND� operator. This can be convertedby Selection and Overwrite of the text into every other operator, into everyfunction, into every function block and every program. The input assistanceserves to select the desired block from the list of supported blocks. If the newblock has another minimum number of inputs, these will be attached. If the newblock has a smaller highest number of inputs, the last inputs will be deleted.

"Insert" "Input"

Symbol: Shortcut: <Ctrl> + <E>This command is used to insert an input. The text offered �???� can be selectedand replaced by a variable or constant. The input assistance can also be usedhere.

"Insert" "Output"

Symbol: Shortcut: <Ctrl>+<A>This command is used to insert an output. The text offered �???� can beselected and replaced by a variable. The input assistance can also be used here.The value which is associated with the input of the output is allocated to thisvariable.

"Insert" "Jump"

Symbol: Shortcut: <Ctrl>+<J>This command is used to insert a jump. The text offered �???� can be selectedand replaced by the jump label to which the program should jump.

"Insert" "Label"

Symbol: Shortcut: <Ctrl>+<L>This command is used to insert a label. The text offered �???� can be selectedand replaced by the jump label.

"Insert" "Return"

Symbol: Shortcut: <Ctrl> + <R>This command is used to insert a RETURN command.

"Insert" "Comment"

Symbol: Shortcut: <Ctrl> + <K>This command is used to insert a comment.

You obtain a new line within the comment with <Ctrl> + <Enter>.

Page 160: Wago Pro Manual

The Graphic Editors

5-40 WAGO-I/O-PRO 32

"Insert" "Block input"

Shortcut: <Ctrl> + <U>This command is used to insert a block input. The number of inputs is variablefor many operators (e.g. ADD can have two or more inputs).

To increase the number of inputs for such an operator by one, the operator itselfmust be selected (Cursor position 1)

"Extras" "Negate"

Symbol: Shortcut: <Ctrl> + <N>This command is used to negate inputs, outputs, jumps or RETURNcommands. The symbol for the negation is a small cross on the connection.

The input of the element block, output, jump or return is negated when it isselected (Cursor position 3)

The output of the element block or input is negated when it is selected (Cursorposition 4).

A negation can be deleted by negating again.

"Extras" "Set/Reset"

Symbol: Shortcut: <Ctrl> + <T>This command can only be used for selected inputs of the element output(Cursor position 3).

The symbol for Set is S and for Reset is R.

VarOut1 is set to TRUE, if VarIn1 delivers TRUE. VarOut1 retains this value,even when VarIn1 springs back to FALSE.

VarOut2 is set to FALSE, if VarIn2 delivers TRUE. VarOut2 retains this value,even when VarIn2 springs back to FALSE.

Multiple activation of this command causes the output to change between Set,Reset and the normal condition.

"Extras" "EN/ENO"

Symbol: Shortcut: <Ctrl> + <0>This command is used to give a selected block (Cursor position 3) an additionalBoolean enable input EN (Enable In) and a Boolean output ENO (Enable Out).

Page 161: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-41

ADD is only executed in this example when the Boolean variable �Bedingung�(condition) is TRUE. VarOut is also set to TRUE after ADD has been executed.ADD will not be executed when the variable �Bedingung� (condition) isFALSE and VarOut retains its value FALSE. The example below shows howthe value ENO can be used for further blocks.

x should initialised to 1 and y initialised to 0. The numbers in the right cornerof the block indicate the order in which the commands are executed.

x will be increased by one until it reaches the value 10. This causes the outputof the block LT(0) to deliver the value FALSE and SUB(3) and ADD(5) will beexecuted. x is set back to the value 1 and y is increased by 1. LT(0) is executedagain as long as x is smaller than 10. y thus count the number of times x passesthough the value range 1 to 10.

"Extras" "Properties..."

Constant input parameters (VAR_INPUT CONSTANT) from functions andfunction blocks are not shown directly in the continuous function chart editor.These can be shown and their value can be changed when one selects the trunkof the block in question (Cursor position 1) and then selects the command�Extras� �Properties� or simply double clicks on the trunk. The following dialogopens:

Image 5.19: Properties dialog

The values of the constant input parameter (VAR_INPUT CONSTANT) can bechanged. Here it is necessary to mark the parameter value in the column Value.Another mouse click or pressing on the space bar allows this to be edited.Confirmation of the change to the value is made by pressing the <Enter> key or

Page 162: Wago Pro Manual

The Graphic Editors

5-42 WAGO-I/O-PRO 32

pressing <Escape> rejects the changes. The button OK stores all of the changeswhich were made.

Selecting elements

One clicks on the trunk of the element (Cursor position 1) to select it.

To mark more elements one presses the <Shift> key and clicks in the elementsrequired, one after the other, or one drags the mouse with the left handmousekey depressed over the elements to be marked.

The command �Extras� �Select all� marks all elements at once.

Moving elements

One or more selected elements can be moved with the arrow keys as one ispressing on the <Shift> key. Another possibility is to move elements using adepressed left mousekey. These elements are placed by releasing the leftmousekey in as far as they do not cover other elements or exceed the foreseensize of the editor. The marked element jumps back to its initial position in suchcases and a warning tone sounds.

Copying elements

One or more selected elements can be copied with the command �Edit� �Copy�and inserted with the command �Edit� �Paste�.

Creating connections

An input of an element can be precisely connected to the output of anotherelement. An output of an element can be connected to the inputs of a number ofother elements.

There are a number of possibilities to connect the input of an element E2 withthe output of an element E1.

Place the mouse on the output of element E1 (Cursor position 4), click with theleft mousekey, hold the left mousekey down and drag the mouse cursor onto theinput of element E2 (Cursor position 3) and let the left mousekey go. Aconnection is made from the output of element E1 to the mouse cursor duringthis dragging operation with the mouse.

Place the mouse on the input of element E2, click with the left mousekey, holdthe left mousekey down and drag the mouse cursor onto the output of elementE1 and let the left mousekey go.

Move one of the elements E1 or E2 (Cursor position 1) and place it in such away by letting go of the left mousekey that the output of element E2 and theinput of element E1 touch.

Where element E2 is a block with a free input, a connection can also be madeby dragging the mouse from an output from E1 to the trunk of E2. A connection

Page 163: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-43

with the free input at the highest position on E2 will be created when themousekey is released. In the case where block E2 does not have a free input butis an operator which can have an input added to it, a new input will beautomatically generated.

The output and input of a block can be connected together (feedback path) byusing this method.

Deleting connections

There are a number of possibilities for removing the connection between theoutput of an element E1 and the input of an element E2:

Select the output of element E1 (Cursor position 4) and press the <Delete> keyor execute the command �Edit� �Delete'. Several connections will be removedat the same if the output of E1 is connected to more than one of inputs.

Select the input of element E2 (Cursor position 4) and press the <Delete> keyor execute the command �Edit� �Delete�.Select the input of E2 with the mouse, hold the left mousekey depressed anddrag the connection from the input to E2 away. The connection is removedwhen the left mousekey is released in a free area of the screen.

Changing connections

A connection between the output of an element E1 and the input of an elementE2 can easily be changed into a connection between the output of element E1and the input of element E3. The mouse is clicked on the input of E2 (Cursorposition 3), the left mousekey is kept depressed, the mouse cursor is moved tothe input of E3 and then released.

"Extras" "Connectionmarker"

Connections can also be represented by a connector (connection marker)instead of a connecting line. Here the output and the associated input have aconnector added to them which is given a unique name.

Where a connection already exists between the two elements which should nowbe represented by connectors, the output of the connecting line is marked(Cursor position 3) and the menu point �Extras� �Connection marker� isselected. The following diagram shows a connection before and after theselection of this menu point.

A unique name is given as standard by the program which begins with M, butwhich can be changed. The connector name can be edited both at the input andat the output.

It is important to know that the connector name is associated with a property ofthe output of a connection and is stored with it.

Page 164: Wago Pro Manual

The Graphic Editors

5-44 WAGO-I/O-PRO 32

1. Edit the connector at the output:

If the text in the connector is replaced, the new connector name is adopted byall associated connectors at the inputs. One cannot, however, select a namewhich already belongs to another connection marker since the uniqueness ofthe connector name would be violated.

2. Edit the connector at the input:

If the text in the connector is replaced, the connection to the old connectionmarker will be deleted and a new connection will be created, or in other wordsonly the name of another existing connection marker can be given.

Connections in connector representations can be converted to normalconnections in that one marks the output of the connections (Cursor position 4)and again selects the menu point �Extras� �Connection marker�.

Order of execution

The elements block, output, jump, return and label each possess a numberindicating the order in which they are executed. In this sequential order theindividual elements are evaluated at run time.

When pasting in an element the number is automatically given according to thetopological sequence (from left to right and from above to below). The newelement receives the number of its topological successor if the sequence hasalready been changed and all higher numbers are increased by one.

The number of an element remains constant when it is moved.

The sequence influences the result and must be changed in certain cases.

If the sequence is displayed, the corresponding sequential execution number isshown in the upper right hand corner of the element.

"Extras" "Order""Display"�

This command switches the display of the order of execution on and off. Thedefault setting is to show it (recognised by a tick (�) in front of the menupoint).

"Extras" "Order" "Ordertopologically"�

Elements are ordered in a topological sequence when the execution takes placefrom left to right and from above to below, that is the number increases fromleft to right and from above to below for topologically arranged elements. Theconnections are not relevant, only the location of the elements is important.

All selected elements are topologically arranged when the command �Extras��Order� �Order topologically� is executed. All elements in the selection aretaken out of the sequential processing list by this process. The elements are thenentered into the remaining sequential processing list individually from bottomright through to upper left. Each marked element is entered into the sequentialprocessing list before its topological successor, i.e. it is inserted before the

Page 165: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-45

element that in a topological sequencing would be executed after it, when allelements in the editor were sequenced according to a topological sequencingsystem. This will be clarified by an example.

Image 5.20: Sequence before the topological ordering of the three elements

The elements with numbers 1, 2 and 3 are selected. If the command �Ordertopologically� is selected the elements are first taken out of the sequentialprocessing list. Var3, the jump and the AND-operator are then inserted againone after the other. Var3 is placed before the label and receives the number 2.The jump is then ordered and receives the number 4 at first but this thenbecomes 5 after the AND is inserted. The new order of execution which arisesis:

Image 5.21: Sequence after the topological ordering of the three elements

When a newly generated block is introduced it will be placed by default in frontof its topological successor in the sequential processing list.

Page 166: Wago Pro Manual

The Graphic Editors

5-46 WAGO-I/O-PRO 32

"Extras" "Order" "Oneforwards"�

With this command all selected elements with the exception of the elementwhich is at the beginning of the sequential processing list are moved one placeforwards in the sequential processing list.

"Extras" "Order" "Onebackwards"�

With this command all selected elements with the exception of the elementwhich is at the end of the sequential processing list are moved one placebackwards in the sequential processing list.

"Extras" "Order" "To thebeginning"�

With this command all selected elements will be moved to the front of thesequential processing list whereby the order within the group of selectedelements is maintained. The order within the group of unselected elements alsoremains the same.

"Extras" "Order" "To theend"�

With this command all selected elements will be moved to the end of thesequential processing list whereby the order within the group of selectedelements is maintained. The order within the group of unselected elements alsoremains the same.

"Extras" "Order" "Ordereverything according todata flow"�

This command effects all elements. The order of execution is determined by thedata flow of the elements and not by their position.

The diagram below shows elements which have been ordered topographically.

Page 167: Wago Pro Manual

Chapter 5 - Editors in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 5-47

Image 5.22: Sequence before the ordering according to data flow

The following arrangement exists after selecting the command:

Image 5.23: Sequence after the ordering according to data flow

When this command is selected the first thing to happen is that the elements areordered topographically. A new sequential processing list is then created. Basedon the known values of the inputs, the computer calculates which of the as yetnot numbered elements can be processed next. In the above �network� theblock AND, for example, could be processed immediately since the values at its

Page 168: Wago Pro Manual

The Graphic Editors

5-48 WAGO-I/O-PRO 32

inputs (1 and 2) are known. Block SUB can only then be processed since theresult from ADD must be known first, etc.

Feedback paths are inserted last.

The advantage of the data flow sequencing is that an output box which isconnected to the output of a block comes immediately after it in the data flowsequencing system which by topological ordering would not always be the case.The topological ordering can deliver another result in some cases than orderingby data flow, a point which one can recognise from the above example.

Feedback paths

Feedback paths can only be displayed directly in the continuous function charteditor and not in the usual function block diagram editor. Here it should beobserved that the output of a block always carries an internal intermediatevariable. The data type of the intermediate variable results, for operators, fromthe largest data type of the inputs.

The data type of a constant is obtained from the smallest possible data type, thatis the constant �1� adopts the data type SINT. If now an addition with feedbackand the constant �1� is executed, the first input gives the data type SINT and thesecond is undefined because of the feedback. Thus the intermediate variable isalso of the type SINT. The value of the intermediate variable is only thenallocated to the output variable.

The diagram below shows an addition with feedback and an addition with avariable. The variables x and y should be of the type INT here.

There are differences between the two additions:

The variable y can be initialised with a value which is not equal to zero but thisis not the case for intermediate variable for the left addition.

The intermediate variable for the left addition has the data type SINT while thaton the right has the data type INT. The variables x and y have different valuesafter the 129th call up. The variable x, although it is of the type INT, containsthe value -127 because the intermediate variable has gone into overflow. Thevariable y contains the value 129, on the other hand.

Page 169: Wago Pro Manual

Chapter 6 - The Resources

WAGO-I/O-PRO 32 6-1

6 The Resources

Overview of the Resources

In the Resources register card of the Object Organizer, there are objects forconfiguring and organizing your project and for keeping track of the values ofthe variables:

• Global Variables that can be utilized in the entire project; the globalvariables of the project as well as the libraries.

• PLC Configuration for configuring your hardware• Task Configuration for controlling your program control via tasks• Sampling Trace for graphic logging of variable values• Watch and Receipt Manager for indicating and presetting variable

values

Image 6.1: Resources

Global Variables

Editing Global Variables

In the Object Organizer, you will find three objects in the Resources registercard in the Global Variables folder (default names of the objects inparentheses).

• Global Variables List (Global Variables)• Variables Configuration (Variable Configuration)

All variables defined in these objects are recognized throughout the project.

If the global variables folder is not opened up (plus sign in front of the folder),you can open it with a doubleclick <Enter> in the line.

Select the corresponding object. The "Object Open" command opens awindow with the previously defined global variables. The editor for this worksthe same way as the declaration editor.

Page 170: Wago Pro Manual

Global Variables

6-2 WAGO-I/O-PRO 32

Several Variables Lists

Normal global variables (VAR_GLOBAL), and variable configurations(VAR_CONFIG) must be defined in separate objects.

If you have declared a large number of global variables, and you would like tostructure your global variables list better, then you can create further variableslists.

In the Object Organizer, select the Global Variables folder or one of theexisting objects with global variables. Then execute the "Project" "ObjectAdd" command. Give the object that appears in the dialog box a correspondingname. With this name an additional object will be created with the key wordVAR_GLOBAL. If you want to have a variable configuration, change thecorresponding key word to VAR_CONFIG.

Global Variables

Normal global variables are defined in an object between the key wordsVAR_GLOBAL and END_VAR. In the Object Organizer in the Resourcesregister card, the object Global_Variables will generally be available. Theobject can be renamed and further objects for global variables can be created.

To create a new global variables list open the dialog New global variable listby 'Project' 'Object' 'Add'. Here you insert a Name for the new list. If you wantto use an export file (*.esp) or a DCF file (*.dcf), which contains the relevantvariable, you can connect it by Link to file. Press Select to get the standarddialog Select text file. DCF files are converted to IEC syntax when called.

If the settings in dialog 'New global variable list' are confirmed by pressing theOK button, the new object is created and the variables' editor opens. The editorfor global variables works just the same as the Declaration Editor. Though if anexternal variable list is used, it cannot be edited in WAGO-I/O-PRO 32.External variable lists only can be edited external and they will be read eachtime the project is opened or compiled again.

Global variables can be used in the entire project.

Syntax:VAR_GLOBAL

(*Declaration of Variables *)END_VAR

Global retain variables additionally receive the key word RETAIN.Syntax:

VAR_GLOBAL RETAIN(*Declaration of Variables *)

END_VARGlobal constants additionally receive the key word CONSTANT.Syntax:

Page 171: Wago Pro Manual

Chapter 6 - The Resources

WAGO-I/O-PRO 32 6-3

VAR_GLOBAL CONSTANT(*Declaration of Variables *)

END_VAR

Variable Configuration

In function blocks it is possible to specify addresses for inputs and outputs thatare not completely defined, if you put the variable definitions between the keywords VAR and END_VAR. Addresses not completely defined are identifiedwith an asterisk.

Example:FUNCTION_BLOCK locioVAR

loci AT %I*: BOOL := TRUE;loco AT %Q*: BOOL;

END_VAR

Here two local I/O-variables are defined, a local-In (%I*) and a local-Out(%Q*).

If you want to configure local I/Os for variables configuration in the ObjectOrganizer in the Resources register card, the object Variable_Configurationwill generally be available. The object then can be renamed and other objectscan be created for the variables configuration.

The editor for variables configuration works like the declaration editor.

Variables for local I/O-configurations must be located between the key wordsVAR_CONFIG and END_VAR.

The name of such a variable consists of a complete instance path through whichthe individual POUs and instance names are separated from one another byperiods. The declaration must contain an address whose class (input/output)corresponds to that of the incompletely specified address (%I*, %Q*) in thefunction block. Also the data type must agree with the declaration in thefunction block.

Configuration variables, whose instance path is invalid because the instancedoes not exist, are also denoted as errors. On the other hand, an error is alsoreported if no configuration exists for an instance variable. In order to receive alist of all necessary configuration variables, the "All Instance Paths" menuitem in the "Insert" menu can be used.

Example:Assume that the following definition for a function block is given in a program:

PROGRAM PLC_PRGVAR

Hugo: locio;Otto: locio;

END_VAR

Then a corrected variable configuration would look this way:

Page 172: Wago Pro Manual

Global Variables

6-4 WAGO-I/O-PRO 32

VAR_CONFIGPLC_PRG. Hugo.loci AT %IX1.0 : BOOL;PLC_PRG. Hugo.loco AT %QX0.0 : BOOL;PLC_PRG. Otto.loci AT %IX1.0 : BOOL;PLC_PRG.Otto.loco AT %QX0.3 : BOOL;

END_VAR

Note: Be aware not to describe an output, which is used in the variablesconfiguration, additionally within the project or by a variable (AT declaration).This would not be noticed.

"Insert" "All InstancePaths"

With this command a VAR_CONFIG - END_VAR-block is generated thatcontains all of the instance paths available in the project. Declarations alreadyon hand do not need to be reinserted in order to contain addresses already inexistence. This menu item can be found in the window for configuration ofvariables if the project is compiled ("Project" "Rebuild All").

Document Frame

Document Frame

If a project is to receive multiple documentations, perhaps with German andEnglish comments, or if you want to document several similar projects that usethe same variable names, then you can save yourself a lot of work by creating adocuframe with the "Extras" "Make Docuframe File" command.

The created file can be loaded into a desired text editor and can be edited. Thefile begins with the DOCUFILE line. Then a listing of the project variablesfollows in an arrangement that assigns three lines to each variable: a VAR linethat shows when a new variable comes; next, a line with the name of thevariable; and, finally, an empty line. You can now replace this line by using acomment to the variable. You can simply delete any variables that you areunable to document. If you want, you can create several document frames foryour project.

Page 173: Wago Pro Manual

Chapter 6 - The Resources

WAGO-I/O-PRO 32 6-5

Image 6.2: Windows Editor with Document Frame

In order to use a document frame, give the "Extras" "Link Docu Frame"command. Now if you document the entire project, or print parts of yourproject, then in the program text, there will be an insertion of the commentproduced in the docuframe into all of the variables. This comment only appearsin the printout!

"Extras" "MakeDocuframe File"

Use this command to create a document frame. The command is at yourdisposal, whenever you select an object from the global variables.

A dialog box will open for saving files under a new name. In the field for thename file, the *.txt extension has already been entered. Select a desired name.Now a text file has been created in which all the variables of your project arelisted.

"Extras" "Link Docu File"

With this command you can select a document frame.

The dialog box for opening files is opened. Choose the desired document frameand press OK. Now if you document the entire project, or print parts of yourproject, then in the program text there will be an insertion of the commentproduced in the docuframe into all of the variables. This comment only appearsin the printout!

To create a document frame, use the "Extras" "Make Docuframe File"command.

Page 174: Wago Pro Manual

PLC Configuration

6-6 WAGO-I/O-PRO 32

PLC Configuration

After having clicked on "PLC Configuration" you can selected a controllervia a dialogue box. You should select the controller in which the program is tobe loaded.

Image 6.3: Dialog box "Coupler Selection"

Task Configuration

In addition to declaring the special PLC_PRG program, you can also control theprocessing of your project using the task management.

The Task Configuration is found as an object in the Resources register cardin the Object Organizer. The task editor contains a series of tasks. The taskdeclaration consists of the name of the task, an entry for the priority the task isto have, and an entry for the condition under which the task is to be executed.This requirement can either be a time interval, according to which the task is tobe executed, or a global variable that, in the event it has a rising edge, bringsabout an execution.

For each task you can now specify a series of programs that will be started bythe task. If the task is executed in the present cycle, then these programs will beprocessed the length of one cycle.

The Task Configuration is displayed in the following form:• The Task Configuration is located in the first line.• Underneath and indented from the Task Configuration, you will find a

sequence of task entries (with name, priority, interval, and occurrence).• Below each task entry, there is again a series of program call ups.

Page 175: Wago Pro Manual

Chapter 6 - The Resources

WAGO-I/O-PRO 32 6-7

Image 6.4: Example for a Task Configuration

In this example of a Task Configuration, Task2 has a lower priority than Task1.Task1, however, is only executed every two seconds. (The entry under Single isdisregarded.) Thus, in this Task Configuration, Task1 is executed every twoseconds, and, in between, Task2 can be executed at any time, provided that theglobal variable "Schalten" has a rising edge.

Which task is beingprocessed?

For the execution, the following rules apply:

• That task is executed, whose condition has been met; i.e., its specified timehas expired, or after its condition variable exhibits a rising edge.

• If several tasks have a valid requirement, then the task with the highestpriority will be executed.

• If several tasks have valid conditions and equivalent priorities, then thetask that has had the longest waiting time will be executed first.

• The most important commands are found in the context menu (right mousebutton or <Ctrl>+<F10>).

Working in the TaskConfiguration

• At the heading of the Task Configuration are the words "TaskConfiguration."If a plus sign is located before the words, then the sequence listis closed. By doubleclicking on the list or pressing <Enter>, you can open thelist. A minus sign now appears.By doubleclicking once more, you can close thelist again.

• For every task, there is a list of program call-ups attached. Likewise, youcan open and close this list the same way.

• With the "Insert" "Insert Task" command, you can insert a task.

• With the "Insert" "Insert Program Call", a program call will beinserted.

• With the "Extras" "Edit Entry" command, you can edit the taskcharacteristics or the program call-up, depending on the selected element.

Page 176: Wago Pro Manual

Task Configuration

6-8 WAGO-I/O-PRO 32

• By clicking on the task or program name, or by pressing the <Space bar>,you can set an edit control box around the name. Then you can change thedesignation directly in the task editor.

"Insert" "Insert Task" or"Insert" "Append Task"

With this command you can insert a new task into the Task Configuration.

If a task is selected, then the "Insert Task" command will be at your disposal.The new task will be inserted in front of the cursor. If the words TaskConfiguration are selected, then the "Append Task" is available, and the newtask will be appended to the end of the existing list.

The dialog box will open for you to set the task attributes.

Image 6.5: Dialog Box for Setting Task Attributes

In the dialog box you can enter the desired attributes: the Name; the Priority(a number between 0 and 31, with the following validities: 0 has the highest,and, 31, the lowest priority); the Interval after which the task should be startedagain; or a variable that, following a raising edge, will cause an execution of thetask (in the Single field). With the Select... button, you can open the InputAssistant to select from the declared variables.

If an entry is on hand for both the interval and for the variable, then only theinterval time will be considered for the execution requirement. If an entry hasnot been made in either of the two fields, then only the priority with the counterwill be considered. This means that in every cycle the task will be considered tobe executable.It will only cease to be executed if another task of higher priorityis likewise executable.

"Insert" "Insert ProgramCall" or "Insert""AppendProgram Call"

With these commands you will open the dialog box for entering a program callto a task in the Task Configuration.

With Insert Program Call", the new program call is inserted in front of thecursor, and with "Append Program Call", the program call is appended to theend of the existing list.

Page 177: Wago Pro Manual

Chapter 6 - The Resources

WAGO-I/O-PRO 32 6-9

Image 6.6: Dialog box for Program Call Entry

In the field, specify a valid program name for your project, or open the InputAssistant with the Select button to select a valid program name. If the selectedprogram requires input variables, then enter these in their usual form and of thedeclared type (for example, prg(invar:=17)).

"Extras" "Edit Entry"

Depending on the element selected, you can use this command in the TaskConfiguration to open either the dialog box for setting the task attributes (see"Insert" "Task") or the dialog box for entering the program call (see "Insert""Program Call").

If the cursor is located at the task entry, and there is no list of program callsappended to the task entry, then you open the dialog for setting thedoubleclicking on the entry or by pressing <Enter>.

If the cursor is located on an entry for a program call, then you can also openthe dialog box for editing the program entry by doubleclicking on the entry.

By clicking on the task or program name, or by pressing the <Space bar>, youcan set an edit control box around the name. Then, you can change thedesignation directly in the task editor.

"Extras" "Set DebugTask"

With this command a debugging task can be set in Online mode in the TaskConfiguration. The text [DEBUG] will appear after the set task.

The debugging capabilities apply, then, only to this task.In other words, theprogram only stops at a breakpoint if the program is gone through by the settask.

Sampling Trace

Sample tracing means that the progression of values for variables is traced overa certain time frame. These values are written in a ring buffer (trace buffer). Ifthe memory is full, then the "oldest" values from the start of the memory will beoverwritten. As a maximum, 20 variables can be traced at the same time. Amaximum of 500 values can be traced per variable.

Page 178: Wago Pro Manual

Sampling Trace

6-10 WAGO-I/O-PRO 32

Since the size of the trace buffer in the PLC has a fixed value, in the event ofvery many or very wide variables (DWORD), fewer than 500 values can betraced.

Example: if 10 WORD variables are traced and if the memory in the PLC is5000 bytes long, then, for every variable, 250 values can be traced.

In order to be able to perform a trace, open the object for a Sampling Tracein the Resources register card in the Object Organizer. After this, you mustenter the trace variables to be traced.(See "Extras" "Trace Configuration".)After you have sent the configuration with "Save Trace to the PLC and havestarted the trace in the PLC ("Start Trace"), then the values of the variableswill be traced. With "Read Trace", the final traced values will be read out anddisplayed graphically as curves.

"Extras" "TraceConfiguration"

With this command you will be given the dialog box for entering the variablesto be traced, as well as diverse trace parameters for the Sampling Trace. Thedialog can also be opened by a double click in the grey area of the dialogSampling Trace.

Page 179: Wago Pro Manual

Chapter 6 - The Resources

WAGO-I/O-PRO 32 6-11

Image 6.7: Dialog Box for Trace Configuration

The list of the Variables to be traced is initially empty. In order to append avariable the variable must be entered in the field under the list. Following this,you can use the Add button or the <Enter> to append the variable to the list.You can also use the Input Assistant.

A variable is deleted from the list when you select the variable and then pressthe Delete button.

A Boolean or analogue variable can be entered into the field Trigger Variable.The input assistance can also be used here. The trigger variable describes thetermination condition of the trace. In Trigger Level you enter the level of ananalogue trigger variable at which the trigger event occurs. When Trigger edgepositive is selected the trigger event occurs after an ascending edge of theBoolean trigger variable or when an analogue variable has passed through thetrigger level from below to above. Negative causes triggering after adescending edge or when an analogue variable went from above to below. Bothcauses triggering for both descending and ascending edges or by a positive ornegative pass, whereas none does not initiate a triggering event at all. TriggerPosition is used to set the percentage of the measured value which will berecorded before the trigger event occurs. If, for example, you enter 25 here then25 % of the measured values are shown before the triggering event and 75%afterwards and then the trace is terminated. The field Sample Rate is used setthe time period between two recordings in milliseconds. The default value �0�means one scanning procedure per cycle.

Select the mode for recalling the recorded values: With Single the Number ofthe defined samples are displayed one time. With Continuous the reading ofthe recording of the defined number of measured values is initiated anew eachtime. If, for example, you enter the number �35� the first display contains thefirst measured values 1 to 35 and the recording of the next 35 measured values(36-70) will then be automatically read, etc.. Manual selection is used to readthe trace recordings specifically with "Extras" "Read trace" .

The recall mode functions independently of whether a trigger variable is set ornot. If no trigger variable is set the trace buffer will be filled with the definednumber of measured values and the buffer contents will be read and displayedon recall.

The button Save is used to store the trace configuration which has been createdin a file. The standard window �File save as� is opened for this purpose.

Stored trace configurations can be retrieved using the button Load. Thestandard window �File open� is opened for this purpose.

Note: Please note that Save and Load in the configuration dialog onlyrelates to the configuration, not to the values of a trace recording (in contrast tothe menu commands "Extras" "Save trace" and "Extras" "Load trace" ).

If the field Trigger Variable is empty, the trace recording will run endlesslyand can be stopped by "Extras" "Stop Trace" .

Page 180: Wago Pro Manual

Sampling Trace

6-12 WAGO-I/O-PRO 32

"Extra" "Start Trace"

Symbol: With this command the trace configuration is transferred to the PLC and thetrace sampling is started in the PLC.

"Extra" "Read Trace"

Symbol: With this command the present trace buffer is read from the PLC, and thevalues of the selected variables are displayed.

"Extra" "Auto Read"

With this command the present trace buffer is read automatically from the PLC,and the values are continuously displayed.

If the trace buffer is automatically read, then a check (�) is located before themenu item.

"Extra" "Stop Trace"

Symbol: This command stops the Sampling Trace in the PLC. .

Selection of the Variablesto be Displayed

The comboboxes to the right, next to the window for displaying curves tracevariables defined in the trace configuration. If a variable is selected from thelist, then after the trace buffer has been read the variable will be displayed in thecorresponding color (Var 0 green, etc.). Variables can also be selected if curvesare already displayed.

A maximum of up to eight variables can be observed simultaneously in thetrace window.

Page 181: Wago Pro Manual

Chapter 6 - The Resources

WAGO-I/O-PRO 32 6-13

Display of the SamplingTrace

Image 6.8: Sampling Trace of various Variables

If a trace buffer is loaded, then the values of all variables to be displayed will beread out and displayed. If no scan frequency has been set, then the X axis willbe inscribed with the continuous number of the traced value. The statusindicator of the trace window (first line) indicates whether the trace buffer isfull and when the trace is completed.

If a value for the scan frequency was specified, then the x axis will specify thetime of the traced value. The time is assigned to the "oldest" traced value. In theexample, e.g., the values for the last 25 seconds are indicated.

The Y axis is inscribed with values in the appropriate data type. The scaling islaid out in a way that allows the lowest and the highest value to fit in theviewing area. In the example, Var 0 has taken on the lowest value of 6, and thehighest value of 100: hence the setting of the scale at the left edge.

If the trigger requirement is met, then a vertical dotted line is displayed at theinterface between the values before and after the appearance of the triggerrequirement.

A memory that has been read will be preserved until you change the project orleave the system.

"Extras" "Cursor Mode"

The easiest way to set a cursor in the monitoring area is to click there with theleft mouse button. A cursor appears and can be moved by the mouse. At the topof the monitoring window the current x-position of the cursor is displayed. Inthe fields next to 'Var 0', 'Var 1', ..., 'Var n' the value of the respective variableis shown.

Another way is the command "Extras" "Cursor mode". With this command twovertical lines will appear in the Sampling Trace. First they are laying one on theother. One of the lines can be moved to the right or to the left by the arrow

Page 182: Wago Pro Manual

Sampling Trace

6-14 WAGO-I/O-PRO 32

keys. By pressing <Ctrl>+<left> or <Ctrl>+<right> the speed of the movementcan be increased by factor 10.

If additionally the <Shift> key is pressed, the second line can be moved,showing the difference to the first one.

"Extras" "Multi Channel"

With this command you can alternate between single-channel and multi-channel display of the Sampling Trace. In the event of a multi-channel display,there is a check (�) in front of the menu item.

The multi-channel display has been preset. Here the display window is dividedinto as many as eight display curves. For each curve the maximum and theminimum value are displayed at the edge.

In a single-channel display, all curves are displayed with the same scaling factorand are superimposed. This can be useful when displaying curve abnormalities.

"Extras" "Show grid"

With this command you can switch on and off the grid in the graphic window.When the grid is switched on, a check (�) will appear next to the menu item.

"Extras" "Y Scaling"

With this command you can change the preset Y scaling of a curve in the tracedisplay.

In the dialog box specify the number of the desired curve (Channel) and thenew maximum (maximum y scale) and the new minimum value (minimum yscale) on the y axis.

By doubleclicking on a curve you will also be given the dialog box. Thechannel and the former value are preset.

Image 6.9: Dialog Box for Setting the Y Scale

"Extras" "Stretch"

Symbol: With this command you can stretch (zoom) the values of the SamplingTracethat are shown. The beginning position is set with the horizontal pictureadjustment bar. With repeated stretches that follow one-after-another, the tracesection displayed in the window will increasingly shrink in size.

This command is the counterpart to "Extras" "Compress".

Page 183: Wago Pro Manual

Chapter 6 - The Resources

WAGO-I/O-PRO 32 6-15

"Extras" "Compress"

Symbol: With this command the values shown for the Sampling Trace are compressed;i.e., after this command you can view the progression of the trace variableswithin a larger time frame. A multiple execution of the command is possible.

This command is the counterpart to "Extras" "Stretch".

"Extras" "Save Trace"

With this command you can save a Sampling Trace (values + configurationdata). The dialog box for saving a file is opened. The file name receives theextension "*.trc".

Be aware, that here you save the traced values as well as the trace configuration,whereas Save trace in the configuration dialog only concerns the configurationdata.

The saved Sampling Trace can be loaded again with "Extras" "Load Trace".

"Extras" "Load Trace"

With this command a saved Sampling Trace (traced values + configurationdata)can be reloaded. The dialog box for opening a file is opened. Select thedesired file with the "*.trc" extension.

With "Extras" "Save Trace" you can save a Sampling Trace.

"Extras" "Trace in ASCII-file"

With this command you can save a Sampling Trace in an ASCII-file. Thedialog box is opened for saving a file. The file name receives the extension"*.txt". The values are deposited in the file according to the following scheme:

WAGO-I/O-PRO TraceD:\WAGO-IO-PRO\PROJECTS\TRAFFICSIGNAL.PROCycle PLC_PRG.COUNTER PLC_PRG.LIGHT10 2 11 2 12 2 1.....

If no frequency scan was set in the trace configuration, then the cycle is locatedin the first column; that means one value per cycle has been recorded at anygiven time. In the other respects, the entry here is for the point in time in ms atwhich the values of the variables have been saved since the Sampling Trace hasbeen run.

In the subsequent columns, the corresponding values of the trace variables aresaved. At any given time the values are separated from one another by a blankspace.

The appertaining variable names are displayed next to one another in the thirdline, according to the sequence (PLC_PRG.COUNTER, PLC_PRG.LIGHT1).

Page 184: Wago Pro Manual

Watch and Receipt Manager

6-16 WAGO-I/O-PRO 32

Watch and Receipt Manager

Watch and ReceiptManager

With the help of the Watch and Receipt Manager you can view the values ofselected variables. The Watch and Receipt Manager also makes it possible topreset the variables with definite values and transfer them as a group to the PLC("Write Receipt"). In the same way, current PLC values can be read into andstored in the Watch and Receipt Manager ("Read Receipt"). These functionsare helpful, for example, for setting and entering of control parameters.

All watch lists created ("Insert" "New Watch List") are indicated in the leftcolumn of the Watch and Receipt Manager.These lists can be selected with amouse click or an arrow key. In the right area of the Watch and ReceiptManager the variables applicable at any given time are indicated.

In order to work with the Watch and Receipt Manager, open the object for theWatch and Receipt Manager in the Resources register card in the Object

Organizer.

Watch and ReceiptManager in the OfflineMode

In Offline Mode, you can create several watch lists in the Watch and ReceiptManager using the "Insert" "New Watch List".

For inputting the variables to be watched, you can call up a list of all variableswith the Input Assistant, or you can enter the variables with the keyboard,according to the following notation:

<POUName>.<Variable Name>

With global variables, the POU Name is left out. You begin with a point. Thevariable name can, once again, contain multiple levels. Addresses can beentered directly.

Example of a multiple-level variable:PLC_PRG.Instance1.Instance2.Structure.Componentname

Example of a global variable:.global1.component1

Page 185: Wago Pro Manual

Chapter 6 - The Resources

WAGO-I/O-PRO 32 6-17

Image 6.10: Watch and Receipt Manager in the Offline Mode

The variables in the watch list can be preset with constant values. That meansthat in Online mode you can use the "Extras" "Write Receipt" command towrite these values into the variables. To do to do must use := to assign theconstant value of the variable:

Example:PLC_PRG.TIMER:=50

In the example, the PLC_PRG.COUNTER variable is preset with the value 6

"Insert" "New Watch List"

With this command a new watch list can be inserted into the Watch and ReceiptManager. Enter the desired name for the watch list in the dialog box thatappears.

"Extras" "Rename WatchList"

With this command you can change the name of a watch list in the Watch andReceipt Manager.

In the dialog box that appears, enter the new name of the watch list.

"Extras" "Save WatchList"

With this command you can save a watch list. The dialog box for saving a fileis opened. The file name is preset with the name of the watch list and is giventhe extension "*.wtc".

The saved watch list can be loaded again with "Extras" "Load Watch List".

"Extras" "Load WatchList"

With this command you can reload a saved watch list. The dialog box is openedfor opening a file. Select the desired file with the "*.wtc" extension. In thedialog box that appears, you can give the watch list a new name. The file nameis preset without an extension.

Page 186: Wago Pro Manual

Watch and Receipt Manager

6-18 WAGO-I/O-PRO 32

With "Extras" "Save Watch List", you can save a watch list.

Watch and ReceiptManager in the OnlineMode

In Online mode, the values of the entered variables are indicated.

Structured values (arrays, structures, or instances of function blocks) aremarked by a plus sign in front of the identifier. By clicking the plus sign withthe mouse or by pressing <Enter>, the variable is opened up or closed.

In order to input new variables, you can turn off the display by using the"Extra" "Active Monitoring" command. After the variables have beenentered, you can use the same command again to activate the display of thevalues.

Image 6.11: Watch- and Receipt Manager in the Online Mode

In the Offline Mode you can preset variables with constant values (throughinputting := <value> after the variable). In the Online Mode, these values cannow be written into the variables, using the "Extras" "Write Receipt"command.

With the "Extras" "Read Receipt" command you can replace the presettingof the variable with the present value of the variable.

Note: Only those values the watch list are loaded which was selected in theWatch and Receipt Manager!

"Extra" "MonitoringActive"

With this command at the Watch and Receipt Manager in the Online mode, thedisplay is turned on or off. If the display is active, a check (�) will appear infront of the menu item.

In order to enter new variables or to preset a value (see Offline Mode), thedisplay must be turned off through the command. After the variables have beenentered, you can use the same command again to activate the display of thevalues.

Page 187: Wago Pro Manual

Chapter 6 - The Resources

WAGO-I/O-PRO 32 6-19

"Extras" "Write Receipt"

With this command in the Online Mode of the Watch and Receipt Manager,you can write the preset values (see Offline Mode) into the variables.

"Extras" "Read Receipt"

With the command, in the Online Mode of the Watch and Receipt Manager,you can replace the presetting of the variables (see Offline Mode) with thepresent value of the variables.

Example:PLC_PRG.Counter [:= <present value>] = <present value>

Force values

In the Watch and Receipt Manager you can also "Force values" and "Writevalues". If you click on the respective variable value, then a dialog box opens,in which you can enter the new value of the variable. Changed variables appearin red in the Watch and Receipt Manager.

Page 188: Wago Pro Manual

Watch and Receipt Manager

6-20 WAGO-I/O-PRO 32

Page 189: Wago Pro Manual

Chapter 7 - Library Manager

WAGO-I/O-PRO 32 7-1

7 Library Manager

Library Manager

The library manager shows all libraries that are connected with the currentproject. The POUs, data types, and global variables of the libraries can be usedthe same way as user-defined POUs, data types, and global variables.

The library manager is opened with the "Window" "Library Manager"command.

Image 7.1: Library Manager

Using the LibraryManager

The window of the library manager is divided into three or four areas by screendividers. The libraries attached to the project are listed in the upper left area.

In the area below that, depending on which register card has been selected,there is a listing of the POUs , Data types, or Global variables of the libraryselected in the upper area.

Folders are opened and closed by doubleclicking the line or pressing <Enter>.There is a plus sign in front of closed folders, and a minus sign in front ofopened folders.

If a POU is selected by clicking the mouse or selecting with the arrow keys thenthe declaration of the POU will appear in the upper right area of the librarymanager; and in the lower right is the graphic display in the form of a black boxwith inputs and outputs.

Page 190: Wago Pro Manual

Library Manager

7-2 WAGO-I/O-PRO 32

With data types and global variables, the declaration is displayed in the rightarea of the library manager.

Standard Library

The library with "standard.lib" is always available. It contains all functions andfunction blocks that are required by the IEC 61131-3 as standard POUs for anIEC programming system. The difference between a standard function and anoperator is that the operator is implicitly recognized by the programmingsystem, while the standard POUs must be tied to the project (standard.lib).

The code for these POUs exists as a C-library and is a component of WAGO-I/O-PRO 32.

User-defined Libraries

If a project is to be compiled in its entity and without errors, then it can besaved in a library with the "Save as" command in the "File" menu. Theproject itself will remain unchanged. Subsequently, you can gain access to theproject under the entered name, just as with the standard library.

"Insert" "AdditionalLibrary"

With this command you can attach an additional library to your project.

In the dialog box for opening a file, choose the desired library with the "*.lib"extension. The library is now listed in the library manager, and you can use theobjects in the library as user-defined objects.

Remove Library

With the "Edit" "Delete" command you can remove a library from a projectand from the library manager.

Page 191: Wago Pro Manual

Chapter 8 - Visualization

WAGO-I/O-PRO 32 8-1

8 Visualization

Create Visualization

Visualization

Visualizations allow you to view your project variables. With the help of thevisualization you can draw geometric elements offline. These can then changetheir forms or colors, in subjection to certain variable values, in Online mode.For example, it possible to display the tendency of a variable to increase in abar chart. You can also deal with input for the program by way of the mouseand the keyboard.

Image 8.1: Example of a Visualization

Create Visualization

In order to create a visualization, you must select the register card for Visualization in the Object Organizer.

Using the "Project" "Object Add" command, you can create a newvisualization object. A dialog box opens in which you can enter the name of thenew visualization. If you have entered a valid name, then you can close thedialog box with OK. A window opens in which you can edit the newvisualization.

Page 192: Wago Pro Manual

Visualization Elements, Insert

8-2 WAGO-I/O-PRO 32

Visualization Elements, Insert

Visualization Elements,Insert

You can insert four different geometric forms, as well as bitmaps and existingvisualizations, into your visualization.

Geometric forms at your disposal include: rectangles, rounded rectangles,ellipses/circles, and polygons.

Go to the "Insert" menu item and select freely from the following commands:

'Rectangle', 'Rounded Rectangle', 'Ellipse', 'Polygon',

'Line�, 'Curve�, 'Bitmap', 'Visualization' . A check appearsin front of the selected command. You can also use the tool bar. The selected

element appears pushed down (for example ).

If you now go to the editor window with the mouse, you will see that the mouse

pointer is identified with the corresponding symbol (for example ). Clickon the desired starting point of your element, and drag the pointer, whilepressing the left mouse button, until the element reaches the desired size.If you want to create a polygon or a line, first click with the mouse on theposition of the first corner of the polygon resp. on the starting point of the line,and then click on the further desired corner points. By doubleclicking on thelast corner point you will close the polygon and it will be completely drawnrespectively the line will be completed

If you want to create a curve (Bezier curves) determine the initial and two otherpoints with mouse clicks to define the circumscribing rectangle. An arc isdrawn after the third mouse click. You can then change the position of the endpoint of the arc by moving the mouse and can then end the process with adouble click or add another arc with additional mouse clicks.

Furthermore pay attention, to the status bar and the change from select andinsert modes.

"Insert" "Rectangle"

Symbol: With the command you can insert a rectangle as an element into your presentvisualization. (Use, see Visualization Elements, Insert)

"Insert" "RoundedRectangle"

Symbol: With the command you can insert a rectangle with rounded corners as anelement in your present visualization. (Use, Visualization Elements, Insert)

Page 193: Wago Pro Manual

Chapter 8 - Visualization

WAGO-I/O-PRO 32 8-3

"Insert" "Ellipse"

Symbol: With the command you can insert a circle or an ellipse as an element in yourpresent visualization. (Use, see Visualization Elements, Insert)

"Insert" "Polygon"

Symbol: With the command you can insert a polygon as an element in your presentvisualization. (Use, see Visualization Elements, Insert).

"Insert" "Line"

Symbol: With the command you can insert a line as an element into your currentvisualization. (Use, see Visualization Elements, Insert).

"Insert" "Curve"

Symbol: With the command you can insert a Bezier curve as an element into yourcurrent visualization. (Use, see Visualization Elements, Insert)..

"Insert" "Bitmap"

Symbol: With the command you can insert a bitmap as an element in your presentvisualization. (Use, see Visualization Elements, Insert)

While pressing the left mouse button, bring up an area in the desired size. Thedialog box is opened for opening a file. Once you have selected the desiredbitmap, it will be inserted into the area brought up.

"Insert" "Visualization"

Symbol: With the command you can insert an existing visualization as an element inyour present visualization. (Use, see Visualization Elements, Insert)

While pressing the left mouse button, bring up an area in the desired size. Aselection list of existing visualizations opens. After you have selected thedesired visualization, it will be inserted in the defined area.

Page 194: Wago Pro Manual

Working with Visualization Elements

8-4 WAGO-I/O-PRO 32

Working with Visualization Elements

Selecting VisualizationElements

In order to select an element, click with the mouse on the element. You can alsoselect the first element of the elements list by pressing the <Tab> key and jumpto the next by each further keystroke. If you press the <Tab> key while pressingthe <Shift> key, you jump backwards in the order of the elements list.In orderto mark multiple elements, press and hold the <Shift> key and click thecorresponding elements, one after another; or, while holding down the leftmouse button, pull a window over the elements to be selected.

In order to select all the elements, use the "Extras" "Select All" command.

Modifying VisualizationElements

You can select an element which has already been inserted by a mouse click onthe element or by pressing the <tab> key. A small black square will appear ateach corner of each of the elements, (with ellipses at the corners of thesurrounding rectangle). Except in the case of polygons, lines or curves furthersquares appear in the middle of the element edges between the corner points.

With a selected element, the turning point (balance point) is also displayed atthe same time. You can then rotate the element around this point with a setmotion/angle. The turning point is displayed as a small black circle with a whitecross ( ). You can drag the turning point with a pressed left mouse button.

You can change the size of the element by clicking on one of the black squaresand, while keeping the left mouse button pressed, controlling the new outline.

With the selection of a polygon, you can drag each individual corner using thesame technique. While doing this, if you press the <Ctrl>-key then anadditional corner point will be inserted at the corner point, an additional cornerpoint will be inserted, which can be dragged by moving the mouse. By pressingthe <Shift>+<Ctrl>-key, you can remove a corner point.

Dragging VisualizationElements

One or more selected elements can be dragged by pressing the left mousebutton or the arrow key.

Copying Visual Elements

One or more selected elements can be inserted with the "Edit""Copy"command, the <Ctrl>+<C> key combination, or the correspondingcopy symbol, and with "Edit" "Paste".

Page 195: Wago Pro Manual

Chapter 8 - Visualization

WAGO-I/O-PRO 32 8-5

A further possibility is to select the elements and then click the mouse in anelement once again, while pressing the <Ctrl>-key. Now you can remove thenewly copied elements from the original ones while pressing the left mousebutton.

Changing the Selectionand Insert Mode

After the insertion of a visualization element, there is an automatic change backinto the selection mode. If you want to insert an additional element the sameway, you can once again select the corresponding command in the menu or the

symbol in the tool bar.

You can also quickly change between the selection mode and the insert modeby pressing the <Ctrl>-key and the right mouse button simultaneously.

In the insert mode, the corresponding symbol will also appear at the mousepointer, and the name will also be indicated in black in the status bar.

Status Bar in theVisualization

In a visualization, the present X and Y position of the mouse pointer isdisplayed in the status bar. The position values are always relative to the upperleft corner of the picture in the status bar. If the mouse pointer is located on anElement, or if the element is being processed, then the number of the elementwill be displayed. If you have selected an element to insert, then this elementwill also appear (for example, Rectangle).

Visualization Elements, Configure

"Extras" "Configure"

With this command you can open the dialog box to configure the selectedvisualization element.

You are given the dialog box for configuration when you doubleclick on theelement.

Select a category in the left area of the dialog box, and fill out the requestedinformation in the right area.

Depending on the visualization element selected, various categories can beselected:

• Shape Rectangle, Rounded Rectangle, Ellipse• Text All• Color Rectangle, Rounded Rectangle, Ellipse, Polygon,

Line, Curve• Motion absolute All• Motion relative All, except Polygon, Line, Curve• Variables All

Page 196: Wago Pro Manual

Visualization Elements, Configure

8-6 WAGO-I/O-PRO 32

• Input All• Tooltip All• Bitmap Bitmap• Visualization Visualization

Shape

In the visualization element configuration dialog box, you can select in theShape category from among Rectangle, Rounded Rectangle, and Ellipserespectively Polygon, Line and Curve. The form will change into the sizealready set.

Image 8.2: Dialog Box for Configuring Visualization Elements (Shape Category)

Text

In the visualization element configuration dialog box, in the Text category youcan set a text for the element.

Enter the text in the Content field. By pressilng <Ctrl>+<Enter> you can insertline breaks.

If you enter "%s" into the text, then this location, in Online mode, will bereplaced by the value of the variable from the Text Output field of theVariables category.

This text will appear in the element, according to the respective HorizontalLeft, Center, or Right positioning, and the respective Top , Center, or Bottompositioning, that was specified in the element.

If you use the Font button, a dialog box for selection of the font will appear.Select the desired font and confirm the dialog with OK. With the StandardFont button you can set the font that is selected below in the "Project""Options". If the font is changed there, then this font will be displayed in allelements except in those elements for which another font has explicitly beenselected by using the Font button.

Page 197: Wago Pro Manual

Chapter 8 - Visualization

WAGO-I/O-PRO 32 8-7

Image 8.3: Dialog Box for Configuring Visualization Elements (Text Category)

Colors

In the visualization element configuration dialog box, in the Color category youcan select primary colors and alarm colors for the inside area and for the frameof your element. Chosing the options no color inside and no frame color youcan create transparent elements.

Image 8.4: Dialog Box for Configuring Visualization Elements (Color Category)

If you now enter a Boolean variable in the Variables category in the ChangeColor field, then the element will be displayed in the Color set, as long as thevariable is FALSE. If the variable is TRUE, then the element will be displayedin its Alarm Color.

Note: The change color function only becomes active, if the PLC is inOnline Mode!

If you want to change the color of the frame, then press the Frame button,instead of the Inside button. In either case, the dialog box will open forselection of the color.

Here can to choose the desired hue from the primary colors and the user-definedcolors. By pressing the Define Colors you can change the user-defined colors.

Page 198: Wago Pro Manual

Visualization Elements, Configure

8-8 WAGO-I/O-PRO 32

Motion absolute

In the visualization element configuration dialog box, in the Motion absolutecategory, X- or Y-Offset fields variables can be entered. These variables canshift the element in the X or the Y direction, depending on the respectivevariable value. A variable in the Scale field changes the size of the elementlinear to the value of the variable.

A variable in the Angle field causes the element to turn on its turning point,depending on the value of the variable. (Positive Value = Mathematic Positive= Clockwise). The value is evaluated in degrees. With polygons, every pointrotates; in other words, the polygon turns. With all other elements, the elementrotates, in such a way, that the upper edge always remains on top.

The turning point appears after a single click on the element, and is displayed asa small black circle with a white cross ( ). You can drag the turning point witha pressed left mouse button.

Image 8.5: Visualization Element Configuration Dialog Box (Motion absolute Category)

Motion relative

In the dialog for configuring visualization elements in the Motion relativecategory, you can assign variables to the individual element edges. Dependingon the values of the variables, the corresponding element edges are then moved.The easiest way to enter variables into the fields is the Input Assistant.

The four entries indicate the four sides of your element. The base position ofthe corners is always at zero.A new value in the variables, in the correspondingcolumn, shifts the boundary in pixels around this value. Therefore, the variablesthat are entered ought to be INT variables.

Note: Positive values shift the horizontal edges downward, or, the verticaledges, to the right!

Page 199: Wago Pro Manual

Chapter 8 - Visualization

WAGO-I/O-PRO 32 8-9

Image 8.6: Dialog Box for Configuration of Visualization Elements (Motion relative Category)

Variables

You can enter the variables that describe the status of the visualization elementsin the Variable category within the dialog box for configuring visualizationelements. The simplest way to enter variables in the fields is to use the InputAssistant.

You can enter Boolean variables in the Invisible and Change color fields. Thevalues in the fields determine their actions. If the variable of the Invisible fieldcontains the value FALSE, the visualization element will be visible. If thevariable contains the value TRUE, the element will be invisible.

If the variable at the Change color field contains the value FALSE, thevisualization element will be displayed in its default color. If the variable isTRUE, the element will be displayed in its alarm color.

You can enter a variable in the Textdisplay field whose value is displayed ifyou have , in addition to the text, inserted %s in the Content field of the Textcategory. In Online mode, "%s" is replaced by the value of the variables foundin Textdisplay.

Image 8.7: Visualization Element Configuration Dialog Box (Variables Category)

Page 200: Wago Pro Manual

Visualization Elements, Configure

8-10 WAGO-I/O-PRO 32

Input

Selecting the field Toggle variable allows you, in online mode, to toggle thevalue of the variables which are located in the input field with every mouseclick on the element. The value of the Boolean variable changes with eachmouse click from TRUE to FALSE and then back to TRUE again at the nextmouse click, etc.

The option Keying variable allows you, in online mode, to change the value ofthe Boolean variable which is located in the input field, between TRUE andFALSE. Place the mouse cursor on the element, press the mousekey and hold itdepressed (the value will, for example, change from TRUE to FALSE). Thevariable changes back to its initial value (TRUE) as soon as you release themousekey.

Selecting the field Zoom to Vis... allows you, in the following field, to enter thename of a visualization object in the same project. While in online mode use amouse click to change to the element in the window of the visualization whichhas been entered. If a program variable of the type STRING (e.g.PLC_PRG.xxx) has been entered, instead of a visualization object, then thisvariable can be used to define the name of the visualization object (e.g. ,visu1�)which the system should change to when a mouse click occurs (e.g. xxx:=,visu1).

The field Zoom to Vis... can be used to configure the return to the callingvisualization by using the command �ZOOMTOCALLER�.

Selecting the option Execute program allows you to enter any executableprogram in the input field and then to execute it in online mode by clicking onthe element with the mouse.

Selecting the option Text input of the variable �Text output� allows you, inonline mode, to allocate a value to a variable over this visualization element.The value which is located in the field Text output of the category Variableswill be written in the variable. Clicking in online mode on the element producesan editing frame in which you can enter the new value of the variable over thekeyboard. Press the <Enter> key to accept the value.

Image 8.8: Visualization Element Configuration Dialog Box (Input Category)

Page 201: Wago Pro Manual

Chapter 8 - Visualization

WAGO-I/O-PRO 32 8-11

ToolTip

The dialog Text for Tooltip offers an input field for text which appears in a textfield as soon as the mouse cursor is passed over the object in online mode. Thetext can be formatted with line breaks by using the key combination <Ctrl> +<Enter>.

Bitmap

You can enter the options for a bitmap in the Bitmap category within thevisualization element configuration dialog box.

Enter the bitmap file and its path in the Bitmap field. You can use the ... buttonto open the standard Windows Browse dialog box from which you can selectthe desired bitmap.

All other entries affect the frame of the bitmap.

By selecting Anisotropic, Isotropic or Fixed you specify how the bitmapshould react to changes in the size of the frame. Anisotropic means that thebitmap remains the same size as the frame which allows you to change theheight and width of the bitmap independently. Isotropic means that the bitmapretains the same proportions even if the overall size is changed (i.e., therelationship between height and width is maintained). If Fixed is selected, theoriginal size of the bitmap will be maintained regardless of the size of theframe.

If the Clip option is selected together with the Fixed setting, only that portionof the bitmap that is contained within the frame will be displayed.

If you select the Draw option, the frame will be displayed in the color selectedin the Color and Alarm color buttons in the color dialog boxes. The alarmcolor will only be used if the variable in the Change Color field in theVariable category is TRUE.

Image 8.9: Visualization Element Configuration Dialog Box (Bitmap Category)

Visualization

You can enter the options for a visualization as an element in anothervisualization in the Visualization category within the visualization element

Page 202: Wago Pro Manual

Additional Visualization Element Functions

8-12 WAGO-I/O-PRO 32

configuration dialog box. Enter the object name for the visualization in theVisualization field. Use the ... button to open a dialog box containing thevisualizations available in this project. Any visualization may be used with theexception of the current one.All other entries affect the visualization frame.If you select the Draw option, the frame will be displayed in the color selectedin the Color and Alarm color buttons in the color dialog boxes. The alarmcolor will only be used if the variable in the Change Color field in theVariables category is TRUE.If Isotropic is selected, the proportions of the visualization will be maintainedeven if the size changes (i.e., the relationship between height and width willremain the same). Otherwise the proportions can be changed.If the Clip option is selected in Online mode, only the original portion of thevisualization will be displayed. For example, if an object extends beyond theoriginal display area, it will be clipped and may disappear from viewcompletely in the visualization.

Image 8.10: Visualization Element Configuration Dialog Box (Visualization Category)

Additional Visualization Element Functions

"Extras" "Send to Front"

Use this command to bring selected visualization elements to the front.

"Extras" "Send to Back"

Use this command to send selected visualization elements to the back.

"Extras" "SelectBackground Bitmap"

Use this command to open the dialog box for selecting files. Select a file withthe extension "*.bmp". The selected bitmap will then appear as the backgroundin your visualization.

Page 203: Wago Pro Manual

Chapter 8 - Visualization

WAGO-I/O-PRO 32 8-13

The bitmap can be removed with the command "Extras" "Clear BackgroundBitmap".

"Extras" "ClearBackground Bitmap"

Use this command to remove the bitmap as the background for the currentvisualization.You can use the command "Extras" "Select Background Bitmap" to select abitmap for the current visualization.

"Extras" "Align"

Use this command to align selected visualization elements.The following alignment options are available:

• Left: the left edge of each of the elements will be aligned to the elementthat is furthest to the left

• the same is true for Right / Top / Bottom• Horizontal Center: each of the elements will be aligned to the average

horizontal center of all elements• Vertical Center: each of the elements will be aligned to the average

vertical center of all elements

"Extras" "Select All"

This command allows you to select all visualization elements within the currentvisualization object.

�Extras� �Select Mode�

This command is used to switch the selection mode on or off. This can also be

achieved using the symbol or by pressing the right mousekey whileholding down the <Ctrl> key at the same time.

"Extras" "Element list"

This command opens a dialog box containing a list of all visualization elementsincluding their number, type and position. The position is given according tothe x and y position of the upper left and lower right corner of the element.

When one or more items have been selected, the corresponding elements in thevisualization are marked for visual control and if necessary the display willscroll to that section of the visualization that contains the elements.

Use the To front button to bring selected visualization elements to the front.Use the To behind button to move them to the back.

Use the Delete button to remove selected visualization elements.

Use the Undo and Redo buttons to undo or restore changes that have beenmade just as you would do with the commands "Edit" "Undo" and "Edit""Redo" . In the dialog box, you can observe the changes that are being made.

Click on OK to close the dialog box and confirm the changes.

Page 204: Wago Pro Manual

Additional Visualization Element Functions

8-14 WAGO-I/O-PRO 32

Image 8.11: Element list dialog box

"Extras" "Settings"

When this command is used, a dialog box will open in which you can makecertain settings that affect the visualization.

Note: The categories Display, Frame and Language also can be edited inthe online mode.

Enter a zoom factor into the field Zoom in the category Presentation ofbetween 10 and 500 % in order to increase or decrease the size of thevisualization display. Selecting Element numbers shows the numbers of theelements in each visualization element when in offline mode.

If Auto-scrolling is selected in the Frame category, the visible portion of thevisualization window will move automatically when you reach the edge whiledrawing or moving a visualization element If Best fit in Online mode isselected, the entire visualization including all elements will be shown in thewindow in Online mode regardless of the size of the window. When IncludeBackground Bitmap is selected, the background bitmap will be fitted into thewindow as well, otherwise only the elements will be considered.

The category Grid is used to define whether the grid points are visible in theoffline mode, whereby the spacing between the visible points is at least 10 evenif the entered size is smaller than that. In this case the grid points only appearwith a spacing which is a multiple of the entered size. Selecting Active causesthe elements to be placed on the snap grid points when they are drawn andmoved. The spacing of the grid points is set in the field Size.

Page 205: Wago Pro Manual

Chapter 8 - Visualization

WAGO-I/O-PRO 32 8-15

Image 8.12: Setting dialog for visualizations (Category Display)

The category Language is used to display the text which has been assigned tothe visualization elements using the options Text and Text for Tooltip in adesired language. You have to prepare a language file as described in thefollowing:

Choose option language file. In the associate input field you give in where youwant to store the file. The extension is '.vis'. You also can use the dialog 'Open'

by pressing the button . If a language file is available already, it will beoffered here.

In the input field next to Language you fill in a keyword for the language,which is currently used in the visualization, i.e. "german" (or "D"). Then pressthe button Save. A file with the extension .vis is created, which now can beedited by a normal text editor. For example you can open the file by notepad:

Bild 8.13: Example of a language file for a visulisation (Category Language)

You get a list of the text variables for the language currently used in thevisualization. It includes a reference to the title of this list, for example"1=german" as reference to the title [german]. You can extend the list bycopying all lines, then replacing the German by English text and setting a new

Page 206: Wago Pro Manual

Additional Visualization Element Functions

8-16 WAGO-I/O-PRO 32

title [english]. Beyond the line 1=german you accordingly have to add2=english.

To view the visualization in one of the prepared languages, open the dialogLanguage again. In the option field beyond Language now you can choosebetween german and english (for the example described above).

Note: The text display does not change before switching to Online Mode !

Bild 8.14: Selection of a language file for a visualization

Operation over thekeyboard - in online mode

The visualization elements can be manipulated in online mode over thefollowing key functions:

Pressing the <Tabulator> key selects the first element in the element list forwhich an input is configured. Each subsequent pressing of the key moves one tothe next element in the list. Pressing the key while keeping the <Shift> keydepressed selects the previous element.

The arrow keys can be used to change from a selected element to aneighbouring one in any direction.

The <Space bar> is used to execute an activity on the selected visualizationelement. If the element is one which has a text output variable, a text input fieldwill be opened which displays the text contents of the variable. Pressing the<Enter> key writes in this value.

"File" "Print" in onlinemode

"File" "Print" is used to print out the contents of the visualization window inonline mode. Visualizations which stretch over the border of the window canlead to inconsistencies particularly when there are moving elements in thevisualization.

Page 207: Wago Pro Manual

Chapter 8 - Visualization

WAGO-I/O-PRO 32 8-17

Page 208: Wago Pro Manual
Page 209: Wago Pro Manual

Chapter 9 - DDE Interface

WAGO-I/O-PRO 32 9-1

9 DDE Interface

DDE Interface

DDE Interface

WAGO-I/O-PRO 32 has a DDE (dynamic data exchange) interface for readingdata. WAGO-I/O-PRO 32 uses this interface to provide other applications thatalso use a DDE Interface with the contents of control variables and IECaddresses.

Activating the DDEInterface

The DDE interface becomes active as soon as the PLC (or the simulation) islogged in.

General Approach toData

A DDE inquiry can be divided into three parts:1. Name of the program (here: WAGO-IO-PRO 32),2. File name and3. Variable name to be read.

Name of the program: WAGO-IO-PRO 32File name: complete project path (c:\example\example.pro).

Variable name: The name of a variable as it appears in the Watch and ReceiptManager .

Which variables can beread?

All addresses and variables are readable. Variables or addresses should beentered in the format used in the Watch and Receipt Manager.

Examples:%IX1.4 (* Reads the input 1.4*)PLC_PRG.TEST (* Reads the variable TEST from the POU PLC_PRG*).GlobVar1 (* Reads the global variable GlobVar1 *)

Linking variables usingWORD

In order to get the current value of the variable TEST from the POU PLC_PRGthrough the DDE interface in Microsoft WORD, a field (e.g., the date) must beinserted in WORD ("Insert" "Field"). Now when you click on the field with theright mouse button and select the command "Toggle Field Codes" you canchange the field function for the chosen text.In our example, this would look asfollows:

Page 210: Wago Pro Manual

DDE Interface

9-2 WAGO-I/O-PRO 32

{ DDEAUTO "WAGO-IO-PRO 32" "C:\PROGRAMS\WAGO-IO-PRO32\PROJECT\IFMBSP.PRO" "PLC_PRG.TEST" }

Click on the field with the right mouse button again, then click on "UpdateField" and the desired variable content appears in the text.

Linking variables usingEXCEL

The following must be entered in Microsoft EXCEL before you can assign avariable to a cell.

='WAGO-IO-PRO 32'|'C:\PROGRAMS\WAGO-IO-PRO32\PROJECT\IFMBSP.PRO'!'PLC_PRG.TEST'

When you click on "Edit" then "Links", the result for this link will be:Type: WAGO-IO-PRO 32Source file: C:\PROGRAMS\WAGO-IO-PRO 32\PROJECT\IFMBSP.PROElement: PLC_PRG.TEST

Accessing variables withIntouch

Link with your project a DDE Access Name <AccessName> with theapplication name WAGO-IO-PRO 32 and the DDE topic nameC:\PROGRAMS\WAGO-IO-PRO 32\PROJECT\IFMBSP.PRO.

Now you can associate DDE type variables with the access name<AccessName>. Enter the name of the variable as the Item Name (e.g.,PLC_PRG.TEST).

Page 211: Wago Pro Manual

Chapter 10 - Using the Keyboard

WAGO-I/O-PRO 32 10-1

10 Using the Keyboard

Use of Keyboard

If you would like to run WAGO-I/O-PRO 32 using only the keyboard, you willfind it necessary to use a few commands that are not found in the menu.

• The function key <F6> allows you to toggle back and forth within theopen POU between the Declaration and the Instruction parts.

• <Alt>+<F6> allows you to move from an open object to the ObjectOrganizer and from there to the Message window if it is open. If a Searchbox is open, <Alt>+<F6> allows you to switch from Object Organizer tothe Search box and from the there back to the object.

• Press <Tab> to move through the input fields and buttons in the dialogboxes.

• The arrow keys allow you to move through the register cards and objectswithin the Object Organizer and Library Manager.

All other actions can be performed using the menu commands or with theshortcuts listed after the menu commands. <Shift>+<F10> opens the contextmenu which contains the commands most frequently used for the selectedobject or for the active editor.

Key Combinations

The following is an overview of all key combinations and function keys:

General Functions

Move between the declaration part and theinstruction part of a POU

<F6>

Move between the Object Organizer, the object andthe message window

<Alt>+<F6>

Context Menu <Shift>+<F10>

Shortcut mode for declarations <Ctrl>+<Enter>

Move from a message in the Message window backto the original position in the editor

<Enter>

Open and close multi-layered variables <Enter>

Open and close folders <Enter>

Switch register cards in the Object Organizer andthe Library Manager

<Arrow keys>

Move to the next field within a dialog box <Tab>

Context sensitive Help <F1>

General Commands

Page 212: Wago Pro Manual

Key Combinations

10-2 WAGO-I/O-PRO 32

"File" "Save" <Ctrl>+<S>

"File" "Print" <Ctrl>+<P>

"File" "Exit" <Alt>+<F4>

"Project" "Check" <Strg>+<F11>

"Project" "Build" <Umschalt>+<F11>

"Project" "Rebuild all" <F11>

"Project" "Delete Object" <Del>

"Project" "Add Object" <Ins>

"Project" "Rename Object" <Spacebar>

"Project" "Open Object" <Enter>

"Edit" "Undo" <Ctrl>+<Z>

"Edit" "Redo" <Ctrl>+<Y>

"Edit" "Cut" <Ctrl>+<X> or<Shift>+<Del>

"Edit" "Copy" <Ctrl>+<C>

"Edit" "Paste" <Ctrl>+<V>

"Edit" "Delete" <Del>

"Edit" "Find next" <F3>

"Edit" "Input Assistant" <F2>

"Edit" "Next Error" <F4>

"Edit" "Previous Error" <Shift>+<F4>

"Online" "Run" <F5>

"Online" "Toggle Breakpoint" <F9>

"Online" "Step over" <F10>

"Online" "Step in" <F8>

"Online" "Single Cycle" <Ctrl>+<F5>

"Online" "Write Values" <Ctrl>+<F7>

"Online" "Force Values" <F7>

"Online" "Release Force" <Shift>+<F7>

"Window" "Messages" <Shift>+<Esc>

FBD Editor Commands

"Insert" "Network (after)" <Shift>+<T>

"Insert" "Assignment" <Ctrl>+<A>

Page 213: Wago Pro Manual

Chapter 10 - Using the Keyboard

WAGO-I/O-PRO 32 10-3

"Insert" "Jump" <Ctrl>+<L>

"Insert" "Return" <Ctrl>+<R>

"Insert" "Operator" <Ctrl>+<O>

"Insert" "Function" <Ctrl>+<F>

"Insert" "Function Block" <Ctrl>+<B>

"Insert" "Input" <Ctrl>+<U>

"Extras" "Negate" <Ctrl>+<N>

"Extras" "Zoom" <Alt>+<Enter>

LD Editor Commands

"Insert" "Network (after)" <Shift>+<T>

"Insert" "Contact" <Ctrl>+<O>

"Insert" "Parallel Contact" <Ctrl>+<R>

"Insert" "Function Block" <Ctrl>+<B>

"Insert" "Coil" <Ctrl>+<L>

"Extras" Paste below" <Ctrl>+<U>

"Extras" "Negate" <Ctrl>+<N>

SFC Editor Commands

"Insert" "Step-Transition (before)" <Ctrl>+<T>

"Insert" "Step-Transition (after)" <Ctrl>+<E>

"Insert" "Alternative Branch (right)" <Ctrl>+<A>

"Insert" "Parallel Branch (right)" <Ctrl>+<L>

"Insert" "Jump"(SFC) <Ctrl>+<U>

"Extras" "Zoom Action/Transition" <Alt>+<Enter>

Move back to the editor from the SFC Overview <Enter>

Work with the PLC Configuration

Open and close organization elements <Enter>

Place an edit control box around the name <Spacebar>

"Extras" "Edit Entry" <Enter>

Work with the Task Configuration

Page 214: Wago Pro Manual

Key Combinations

10-4 WAGO-I/O-PRO 32

Place an edit control box around the task orprogram name

<Spacebar>

Page 215: Wago Pro Manual

Chapter 11 - Data types

WAGO-I/O-PRO 32 11-1

11 Data types

You can use standard data types and user-defined data types whenprogramming. Each identifier is assigned to a data type which dictates howmuch memory space will be reserved and what type of values it stores.

Standard Data types

BOOL

BOOL type variables may be given the values TRUE and FALSE. 8 bits ofmemory space will be reserved.

Integer Data Types

BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, and UDINTare all integer data types

Each of the different number types covers a different range of values. Thefollowing range limitations apply to the integer data types:

Type Lower limit Upper limit Memory space

BYTE 0 255 8 Bit

WORD 0 65535 16 Bit

DWORD 0 4294967295 32 Bit

SINT: -128 127 8 Bit

USINT: 0 255 8 Bit

INT: -32768 32767 16 Bit

UINT: 0 65535 16 Bit

DINT: -2147483648 2147483647 32 Bit

UDINT: 0 4294967295 32 Bit

As a result when larger types are converted to smaller types, information maybe lost.

REAL

REAL is a so-called floating-point type. They are required to represent rationalnumbers. 32 bits of memory space is reserved for REAL.

The use of REAL variables doers, of course not rule out exceeding the numberrange. With the implemented arithmetic operations the maximum or minimumvalue is set if the range is exceeded (where possible). In a program the function

Page 216: Wago Pro Manual

Standard Data types

11-2 WAGO-I/O-PRO 32

block REAL_STATE can be invoked after each operation in order to recognisea number overflow.

Floating point types are saved in IEEE-754 format. The data is saved asfollows:s = Character bit, e = Exponent bit, m = Mantissa bit, . = not in useAddress +0000 +0001 +0002 +0003

emmmmmmm seeeeeee mmmmmmmm mmmmmmmme.g. 3.141592654

STRING

A STRING type variable can contain any string of characters. The size entry inthe declaration determines how much memory space should be reserved for thevariable.It refers to the number of characters in the string and can be placed inparentheses or square brackets. If no size specification is given, the default sizeof 80 characters will be used.

Example of a String Declaration with 35 characters: str:STRING(35):='This is a String';

Page 217: Wago Pro Manual

Chapter 11 - Data types

WAGO-I/O-PRO 32 11-3

Time Data Types

The data types TIME, TIME_OF_DAY (abb. TOD), DATE andDATE_AND_TIME (abb. DT) are handled internally like DWORD.

Type Number display

DATE The display has been in seconds since D#1-1-1970

Example: (low word, high word)

D#1970-01-01 16#0000, 16#0000

D#1970-01-02 16#5180, 16#0001

D#1999-04-28 16#4F80, 16#3726

D#2000-01-01 16#4380, 16#386D

DATE_AND_TIMEor DT

The display has been in seconds sinceDT#1-1-1970-0:0:0.0

Example: (low word, high word)

DT#1970-01-01-00:00:00 16#0000, 16#0000

DT#1970-01-01-00:00:01 16#0001, 16#0000

DT#1999-04-29-11:59:00 16#4984, 16#3728

DT#2000-01-01-00:00:01 16#4381, 16#386D

TIME The display is in milliseconds

Example: (low word, high word)

T#10s0ms 16#2710, 16#0000

T#1440m0s0ms orT#1d

16#5C00, 16#0526

T#60m0s0ms 16#EE80, 16#0036

T#1m0s0ms 16#EA60, 16#0000

T#1s0ms 16#03E8, 16#0000

T#8052m18s3ms orT5d14h12m18s3ms

16#19D3, 16#1CCC

TIME_OF_DAYor TOD

The display is in milliseconds sinceTOD#0:0:0.0

Example: (low word, high word)

TOD#15:36:10.340 16#1764, 16#0359

TOD#11:38 16#09C0, 16#09C0

TOD#00:00 16#0000, 16#0000

TOD#00:00:00.100 16#0064, 16#0000

Page 218: Wago Pro Manual

Defined Data Types

11-4 WAGO-I/O-PRO 32

Defined Data Types

ARRAY

One-, two-, and three-dimensional fields (arrays) are supported as elementarydata types. Arrays can be defined both in the declaration part of a POU and inthe global variable lists. Syntax:

<Field_Name>:ARRAY [<ll1>..<ul1>,<ll2>..<ul2>] OF <elem. Type>. ll1, ll2, ll3identify the lower limit of the field range; ul1, ul2 and ul3 identifythe upper limit. The range values must be integers. Example:

Card_game: ARRAY [1..13, 1..4] OF INT; Initializing Arrays: You can initialize either all of the elements in an array or none of them. Example for initializing arrays:

arr1 : ARRAY [1..5] OF INT := 1,2,3,4,5; arr2 : ARRAY [1..2,3..4] OF INT := 1,3(7); (* short for 1,7,7,7 *) arr3 : ARRAY [1..2,2..3,3..4] OF INT := 2(0),4(4),2,3; (* short for 0,0,4,4,4,4,2,3 *)

Array components are accessed in a two-dimensional array using the followingsyntax:

<Field_Name>[Index1,Index2]

Example: Card_game [9,2]

Note: If you define a function in your project with the name CheckBounds,you can use it to check for range overflows in your project (see chapter 'What iswhat in WAGO-I/O-PRO 32', 'Components of a project', 'Function')

Pointer

Variable or function block addresses are saved in pointers while a program isrunning.

Pointer declarations have the following syntax: <Identifier>: POINTER TO <Datatype/Functionblock>;

A pointer can point to any data type or function block even to user-definedtypes.

The function of the Address Operator ADR is to assign the address of a variableor function block to the pointer.

A pointer can be dereferenced by adding the content operator "^" after thepointer identifier.

Example:

Page 219: Wago Pro Manual

Chapter 11 - Data types

WAGO-I/O-PRO 32 11-5

pt:POINTER TO INT; var_int1:INT := 5; var_int2:INT; pt := ADR(var_int1); var_int2:= pt^; (* var_int2 is now 5 *)

Enumeration

Enumeration is a user-defined data type that is made up of a number of stringconstants. These constants are referred to as enumeration values.

Enumeration values are recognized in all areas of the project even if they werelocally declared within aPOU. It is best to create your enumerations as

objects in the Object Organizer under the register card Data types. Theybegin with the keyword TYPE and end with END_TYPE.

Syntax: TYPE <Identifier>:(<Enum_0> ,<Enum_1>, ...,<Enum_n>); END_TYPE

A variable of the type <Identifier> can take on one of the enumeration valuesand will be initialized with the first one. These values are compatible withwhole numbers which means that you can perform operations with them just asyou would with INT. You can assign a number x to the variable. If theenumeration values are not initialized, counting will begin with 0. Wheninitializing, make certain the initial values are increasing. The validity of thenumber will be reviewed at the time it is run.

Example: TYPE TRAFFIC_SIGNAL: (Red, Yellow, Green:=10); (*The initial value

for each of the colors is red 0, yellow 1, green 10 *) END_TYPE TRAFFIC_SIGNAL1 : TRAFFIC_SIGNAL; TRAFFIC_SIGNAL1:=0; (* The value of the traffic signal is red*) FOR i:= Red TO Green DO i := i + 1; END_FOR;

You may not use the same enumeration value more than once.

Example: TRAFFIC_SIGNAL: (red, yellow, green); COLOR: (blue, white, red); Error: red may not be used for both TRAFFIC_SIGNAL and COLOR.

Structures

Structures are created as objects in the Object Organizer under the register cardData types. They begin with the keywords TYPE and STRUCT and end

with END_STRUCT and END_TYPE.

The syntax for structure declarations is as follows: TYPE <Structurename>: STRUCT <Declaration of Variables 1>

Page 220: Wago Pro Manual

Defined Data Types

11-6 WAGO-I/O-PRO 32

. . <Declaration of Variables n> END_STRUCT END_TYPE

<Structurename> is a type that is recognized throughout the project and can beused like a standard data type.

Interlocking structures are allowed. The only restriction is that variables maynot be placed at addresses (the AT declaration is not allowed!).

Example for a structure definition named Polygonline: TYPE Polygonline: STRUCT Start:ARRAY [1..2] OF INT; Point1:ARRAY [1..2] OF INT; Point2:ARRAY [1..2] OF INT; Point3:ARRAY [1..2] OF INT; Point4:ARRAY [1..2] OF INT; End:ARRAY [1..2] OF INT; END_STRUCT END_TYPE

Example for the initialization of a structure: Poly_1:polygonline := ( Start:=3,3, Point1 =5,2, Point2:=7,3, Point3:=8,5,

Point4:=5,7, End := 3,5);

You can gain access to structure components using the following syntax: <Structure_Name>.<Componentname>

For example, if you have a structure named "Week" that contains a componentnamed "Monday", you can get to it by doing the following:

Week.Monday

Structures may be used as elements of an Array.

Example:TYPE TL_PARAMSTRUCT

index: INT;subindex: BYTE;data: DINT;

END_STRUCTEND_TYPE

PROGRAM STRUCT_ARRAY_TESTVAR

params: ARRAY[1..3] OF TL_PARAM:=(index:= 1, subindex:= 1, data:= 1),(index:= 2, subindex:= 1, data:= 44),(index:= 3, subindex:= 1, data:= 5);

Page 221: Wago Pro Manual

Chapter 11 - Data types

WAGO-I/O-PRO 32 11-7

END_VAR

References

You can use the user-defined reference data type to create an alternative namefor a variable, constant or function block.

Create your references as objects in the Object Organizer under the register cardData types. They begin with the keyword TYPE and end with END_TYPE.

Syntax: TYPE <Identifier>: <Assignment term>; END_TYPE

Example: TYPE message:STRING[50]; END_TYPE;

Page 222: Wago Pro Manual
Page 223: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-1

12 IEC Operators

IEC Operators

WAGO-I/O-PRO 32 supports all IEC Operators. In contrast with the standardfunctions, these operators are recognized implicitly throughout the project.Operators are used like functions in POU implemArithmetic Operators

ADD

Addition of variables of the types: BYTE, WORD, DWORD, SINT, USINT,INT, UINT, DINT, UDINT and REAL.

Two TIME variables can also be added together resulting in another time(e.g., t#45s + t#50s = t#1m35s)

Example in IL: LD 7 ADD 2,4,7 ST Var 1

Example in ST: var1 := 7+2+4+7;

Example in FBD:

MUL

Multiplication of variables of the types: BYTE, WORD, DWORD, SINT,USINT, INT, UINT, DINT, UDINT and REAL.

Example in IL: LD 7 MUL 2,4,7 ST Var 1

Example in ST: var1 := 7*2*4*7;

Example in FBD:

SUB

Subtraction of one variable from another of the types: BYTE, WORD,DWORD, SINT, USINT, INT, UINT, DINT, UDINT and REAL.

A TIME variable may also be subtracted from another TIME variable resultingin third TIME type variable. Note that negative TIME values are undefined.

Page 224: Wago Pro Manual

IEC Operators

12-2 WAGO-I/O-PRO 32

Example in IL: LD 7 SUB 8 ST Var 1

Example in ST: var1 := 7-2;

Example in FBD:

DIV

Division of one variable by another of the types: BYTE, WORD, DWORD,SINT, USINT, INT, UINT, DINT, UDINT and REAL.

Example in IL: LD 8 DIV 2 ST Var 1 (* Result is 4 *)

Example in ST: var1 := 8/2;

Example in FBD:

Hinweis: If you define functions in your project with the namesCheckDivByte, CheckDivWord, CheckDivDWord and CheckDivReal, you canuse them to check the value of the divisor if you use the operator DIV, forexample to avoid a division by 0 (see chapter 'What is what in WAGO-I/O-PRO 32', 'Project components' 'Function')

MOD

Modulo Division of one variable by another of the types: BYTE, WORD,DWORD, SINT, USINT, INT, UINT, DINT, UDINT and REAL. The result ofthis function will be the remainder of the division. This result will be a wholenumber.

Example in IL: LD 9 MOD 2 ST Var 1 (* Result is 1 *)

Example in ST: var1 := 9 MOD 2;

Example in FBD:

Page 225: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-3

INDEXOF

Perform this function to find the internal index for a POU.

Example in ST: var1 := INDEXOF(POU2);

SIZEOF

Perform this function to determine the number of bytes required by the givendata type.

Example in IL: arr1:ARRAY[0..4] OF INT; Var1 INT LD arr1 SIZEOF ST Var 1 (* Result is 10 *)

Example in ST: var1 := SIZEOF(arr1);

Bitstring Operators

AND

Bitwise AND of bit operands. The operands should be of the type BOOL,BYTE, WORD or DWORD.

Example in IL: Var1 BYTE LD 2#1001_0011 AND 2#1000_1010 ST Var 1 (* Result is 2#1000_0010 *)

Example in ST: var1 := 2#1001_0011 AND 2#1000_1010

Example in FBD:

Note: If you have a program step in the SFC like the following

and if you use 68xxx- or C-code generators, please note the following: Theallocation of the value of the second input variable at the AND operator moduleto variable z will not be executed ! This is due to the optmized processing in theSFC in case of value FALSE at the input variable.

Page 226: Wago Pro Manual

Bitstring Operators

12-4 WAGO-I/O-PRO 32

OR

Bitwise OR of bit operands. The operands should be of the type BOOL, BYTE,WORD or DWORD.

Example in IL: var1 :BYTE; LD 2#1001_0011 OR 2#1000_1010 ST var1 (* Result is 2#1001_1011 *)

Example in ST: Var1 := 2#1001_0011 OR 2#1000_1010

Example in FBD:

Note: If you have a program step in the SFC like the following

and if you use 68xxx- or C-code generators, please note the following: Theallocation of the value of the second input variable at the AND operator moduleto variable z will not be executed ! This is due to the optmized processing in theSFC in case of value FALSE at the input variable.

XOR

Bitwise XOR of bit operands. The operands should be of the type BOOL,BYTE, WORD or DWORD.

Example in IL: Var1 :BYTE; LD 2#1001_0011 XOR 2#1000_1010 ST Var1 (* Result is 2#0001_1001 *)

Example in ST: Var1 := 2#1001_0011 XOR 2#1000_1010

Example in FBD:

NOT

Bitwise NOT of a bit operand. The operand should be of the type BOOL,BYTE, WORD or DWORD.

Example in IL: Var1 :BYTE; LD 2#1001_0011

Page 227: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-5

NOT ST Var1 (* Result is 2#0110_1100 *)

Example in ST: Var1 := NOT 2#1001_0011

Example in FBD:

Bit-Shift Operators

SHL

Bitwise left-shift of an operand : erg:= SHL (in, n)

The input variables erg, in and n should be of the type BYTE, WORD, orDWORD. in will be shifted to the left by n bits and filled with zeros on theright.

Note: Please note, that the amount of bits, which is regarded for thearithmetic operation, is pretended by the data type of the input variable !. If theinput variable is a constant the smallest possible data type is regarded. The datatype of the output variable has no effect at all on the arithmetic operation.

See in the following example in hexadecimal notation that you get differentresults for erg_byte and erg_word depending on the data type of the inputvariable (BYTE or WORD), although the values of the input variables in_byteand in_word are the same.

Example in ST:

Example in FBD:

Page 228: Wago Pro Manual

Bit-Shift Operators

12-6 WAGO-I/O-PRO 32

Example in IL: LD 16#45 SHL 2 ST erg_byte

SHR

Bitwise right-shift of an operand: erg:= SHR (in, n)

erg, in and n should be of the typeBYTE, WORD or DWORD. in will beshifted to the right by n bits and filled with zeros on the left.

See the following example in hexadecimal notation to notice the results of thearithmetic operation depending on the type of the input variable (BYTE orWORD).

Example in ST:

Example in FBD:

Example in IL: LD 16#45 SHL 2 ST erg_byte

ROL

Bitwise rotation of an operand to the left: erg:= ROL (in, n)

erg, in and n should be of the typeBYTE, WORD or DWORD. in will beshifted one bit position to the left n times while the bit that is furthest to the leftwill be reinserted from the right.

Note: Please note, that the amount of bits, which is regarded for thearithmetic operation, is pretended by the data type of the input variable !. If the

Page 229: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-7

input variable is a constant the smallest possible data type is regarded. The datatype of the output variable has no effect at all on the arithmetic operation.

See in the following example in hexadecimal notation that you get differentresults for erg_byte and erg_word depending on the data type of the inputvariable (BYTE or WORD), although the values of the input variables in_byteand in_word are the same.

Example in ST:

Example in FBD:

Example in IL: LD 16#45 SHL 2 ST erg_byte

ROR

Bitwise rotation of an operand to the right: erg = ROR (in, n)

erg, in and n should be of the typeBYTE, WORD or DWORD. in will beshifted one bit position to the right n times while the bit that is furthest to theleft will be reinserted from the left.

Note: Please note, that the amount of bits, which is regarded for thearithmetic operation, is pretended by the data type of the input variable !. If theinput variable is a constant the smallest possible data type is regarded. The datatype of the output variable has no effect at all on the arithmetic operation.

See in the following example in hexadecimal notation that you get differentresults for erg_byte and erg_word depending on the data type of the inputvariable (BYTE or WORD), although the values of the input variables in_byteand in_word are the same.

Page 230: Wago Pro Manual

Selection Operators

12-8 WAGO-I/O-PRO 32

Example in ST:

Example in FBD:

Example in IL: LD 16#45 SHL 2 ST erg_byte

Selection Operators

All selection operations can also be performed with variables. For purposes ofclarity we will limit our examples to the following which use constants asoperators.

SEL

Binary Selection. OUT := SEL(G, IN0, IN1) means: OUT := IN0 if G=FALSE; OUT := IN1 if G=TRUE.

IN0, IN1 and OUT can be any type of variable, G must be BOOL. The result ofthe selection is IN0 if G is FALSE, IN1 if G is TRUE.

Example in IL: LD FALSE SEL 3,4 ST Var1 (* Result ist 3 *)

Example in FBD:

Page 231: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-9

MAX

Maximum function. Returns the greater of the two values. OUT := MAX(IN0, IN1)

IN0, IN1 and OUT can be any type of variable.

Example in IL: LD 90 MAX 30 MAX 40 MAX 77 ST Var1 (* Result is 90 *)

Example in FBD:

MIN

Minimum function. Returns the lesser of the two values. OUT := MIN(IN0, IN1)

IN0, IN1 and OUT can be any type of variable.

Example in IL: LD 90 MIN 30 MIN 40 MIN 77 ST Var 1 (* Result is 30 *)

Example in FBD:

LIMIT

Limiting OUT := LIMIT(Min, IN, Max) means: OUT := MIN (MAX (IN, Min), Max)

Max is the upper and Min the lower limit for the result. Should the value INexceed the upper limit Max, LIMIT will return Max. Should IN fall below Min,the result will be Min.

IN and OUT can be any type of variable.

Example in IL: LD 90 LIMIT 30,80 ST Var 1 (*Result is 80 *)

Page 232: Wago Pro Manual

Comparison Operators

12-10 WAGO-I/O-PRO 32

MUX

Multiplexer OUT := MUX(K, IN0,...,INn) means: OUT := INK.

IN0, ...,INn and OUT can be any type of variable. K must be BYTE, WORD,DWORD, SINT, USINT, INT, UINT, DINT or UDINT. MUX selects the Kthvalue from among a group of values.

Example in IL: LD 0 MUX 30,40,50,60,70,80 ST Var 1 (*Result is 30 *)

Comparison Operators

GT

Greater than

A Boolean operator which returns the value TRUE when the value of the firstoperand is greater than that of the second. The operands can be BOOL, BYTE,WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, TIME,DATE, TIME_OF_DAY, DATE_AND_TIME and STRING.

Example in IL: LD 20 GT 30 ST Var 1 (* Result is FALSE *)

Example in ST: VAR1 := 20 > 30 > 40 > 50 > 60 > 70;

Example in FBD:

LT

Less than

A Boolean operator that returns the value TRUE when the value of the firstoperand is less than that of the second. The operands can be BOOL, BYTE,WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL, TIME,DATE, TIME_OF_DAY, DATE_AND_TIME and STRING.

Example in IL: LD 20 LT 30 ST Var 1 (* Result is TRUE *)

Example in ST: VAR1 := 20 < 30;

Page 233: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-11

Example in FBD:

LE

Less than or equal to

A Boolean operator that returns the value TRUE when the value of the firstoperand is less than or equal to that of the second. The operands can be BOOL,BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL,TIME, DATE, TIME_OF_DAY, DATE_AND_TIME and STRING.

Example in IL: LD 20 LE 30 ST Var 1 (* Result is TRUE *)

Example in ST: VAR1 := 20 <= 30;

Example in FBD

GE

Greater than or equal to

A Boolean operator that returns the value TRUE when the value of the firstoperand is greater than or equal to that of the second. The operands can beBOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT,REAL, TIME, DATE, TIME_OF_DAY, DATE_AND_TIME and STRING.

Example in IL: LD 60 GE 40 ST Var 1 (* Result is TRUE *)

Example in ST: VAR1 := 60 >= 40;

Example in FBD:

EQ

Equal to

A Boolean operator that returns the value TRUE when the operands are equal.The operands can be BOOL, BYTE, WORD, DWORD, SINT, USINT, INT,UINT, DINT, UDINT, REAL, TIME, DATE, TIME_OF_DAY,DATE_AND_TIME and STRING.

Example in IL:

Page 234: Wago Pro Manual

Address Operators

12-12 WAGO-I/O-PRO 32

LD 40 EQ 40 ST Var 1 (* Result is TRUE *)

Example in ST: VAR1 := 40 = 40;

Example in FBD:

NE

Not equal to

A Boolean operator that returns that value TRUE when the operands are notequal. The operands can be BOOL, BYTE, WORD, DWORD, SINT, USINT,INT, UINT, DINT, UDINT, REAL, TIME, DATE, TIME_OF_DAY,DATE_AND_TIME and STRING.

Example in IL: LD 40 NE 40 ST Var 1 (* Result is FALSE *)

Example in ST: VAR1 := 40 <> 40;

Example in FBD:

Address Operators

ADR

Address Function

ADR returns the address of its argument in a DWORD. This address can besent to manufacturing functions to be treated as a pointer or it can be assignedto a pointer within the project.

Example in IL: LD Var 1 ADR ST Var 2 man_fun1

Content Operator

A pointer can be dereferenced by adding the content operator "^" after thepointer identifier.

Page 235: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-13

Example in ST: pt:POINTER TO INT; var_int1:INT; var_int2:INT; pt := ADR(var_int1); var_int2:=pt^;

Calling Operator

CAL

Calling a function block or a program

Use CAL in IL to call up a function block instance. The variables that will serveas the input variables are placed in parentheses right after the name of thefunction block instance.

Example: Calling up the instance Inst from a function block where inputvariables Par1 and Par2 are 0 and TRUE respectively.

CAL INST(PAR1 := 0, PAR2 := TRUE)

Type Conversion Functions

Its is forbidden to implicitly convert from a �larger� type to a �smaller� type(for example from INT to BYTE or from DINT to WORD). Special typeconversions are required if one wants to do this. One can basically convert fromany elementary type to any other elementary type.

Syntax: <elem.Typ1>_TO_<elem.Typ2>

BOOL_TO Conversions

Conversion from type BOOL to any other type:

For number types the result is 1, when the operand is TRUE, and 0, when theoperand is FALSE.

For the STRING type the result is �TRUE� or �FALSE�.

Examples in AWL:

LD TRUEBOOL_TO_INTST i

(*Result is 1 *)

LD TRUEBOOL_TO_STRINGST str

(*Result is 'TRUE' *)

Page 236: Wago Pro Manual

Type Conversion Functions

12-14 WAGO-I/O-PRO 32

LD TRUEBOOL_TO_TIMEST t

(*Result is T#1ms *)

LD TRUEBOOL_TO_TODST

(*Result is TOD#00:00:00.001 *)

LD FALSEBOOL_TO_DATEST dat

(*Result is D#1970-01-01 *)

LD TRUEBOOL_TO_DTST dandt

(*Result is DT#1970-01-01-00:00:01 *)

Examples in ST: i:=BOOL_TO_INT(TRUE); (* Result is 1 *) str:=BOOL_TO_STRING(TRUE); (* Result is "TRUE" *) t:=BOOL_TO_TIME(TRUE); (* Result is T#1ms *) tof:=BOOL_TO_TOD(TRUE); (* Result is TOD#00:00:00.001 *) dat:=BOOL_TO_DATE(FALSE); (* Result is D#1970 *) dandt:=BOOL_TO_DT(TRUE); (* Result is DT#1970-01-01-00:00:01 *)

Examples in FUP:

(*Result is 1 *)

(*Result is 'TRUE' *)

(*Result is T#1ms *)

(*Result is TOD#00:00:00.001 *)

(*Result is D#1970-01-01 *)

(*Result is DT#1970-01-01-00:00:01 *)

TO_BOOL Conversions

Conversion from another variable type to BOOL:

The result is TRUE when the operand is not equal to 0. The result is FALSEwhen the operand is equal to 0.

Page 237: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-15

The result is true for STRING type variables when the operand is "TRUE",otherwise the result is FALSE.

Examples in AWL:

LD 213BYTE_TO_BOOLST b

(*Result is TRUE *)

LD 0INT_TO_BOOLST b

(*Result is FALSE *)

LD T#5msTIME_TO_BOOLST b

(*Result is TRUE *)

LD 'TRUE'STRING_TO_BOOLST b

(*Result is TRUE *)

Examples in FUP:

(*Result is TRUE *)

(*Result is FALSE *)

(*Result is TRUE *)

(*Result is TRUE *)

Examples in St: b := BYTE_TO_BOOL(2#11010101); (* Result is TRUE *) b := INT_TO_BOOL(0); (* Result is FALSE *) b := TIME_TO_BOOL(T#5ms); (* Result is TRUE *) b := STRING_TO_BOOL('TRUE'); (* Result is TRUE *)

Page 238: Wago Pro Manual

Type Conversion Functions

12-16 WAGO-I/O-PRO 32

Conversion betweenIntegral Number Types

Conversion from an integral number type to another number type:

When you perform a type conversion from a larger to a smaller type, you risklosing some information. If the number you are converting exceeds the rangelimit, the first bytes for the number will be ignored.

Example in ST: si := INT_TO_SINT(4223); (* Result is 127 *) If you save the integer 4223 (16#107f represented hexadecimally) as a

SINT variable, it will appear as 127 (16#7f represented hexadecimally).

Example in IL: LD 2 INT_TO_REAL MUL 3.5

Example in FBD:

REAL_TO- Conversions

Converting from the variable type REAL to a different type:

The value will be rounded up or down to the nearest whole number andconverted into the new variable type. Exceptions to this are the variable typesSTRING, BOOL and REAL.

When you perform a type conversion from a larger to a smaller type, you risklosing some information.

Example in ST: i := REAL_TO_INT(1.5); (* Result is 2 *) j := REAL_TO_INT(1.4); (* Result is 1 *)

Example in IL: LD 2.7 REAL_TO_INT GE %MW8

Example in FBD:

TIME_TO/TIME_OF_DAY Conversions

Converting from the variable type TIME or TIME_OF_DAY to a different type:

The time will be stored internally in a DWORD in milliseconds (beginning with12:00 A.M. for the TIME_OF_DAY variable). This value will then beconverted.

Page 239: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-17

When you perform a type conversion from a larger to a smaller type, you risklosing some information

For the STRING type variable, the result is a time constant.

Examples in IL:

LD T#12msTIME_TO_STRING

ST str

(*Result is 'T#12ms' *)

LD T#300000msTIME_TO_DWORDST dw

(*Result is 300000 *)

LD TOD#00:00:00.012TOD_TO_SINTST si

(*Result is 12 *)

Examples in St: str :=TIME_TO_STRING(T#12ms); (* Result is T#12ms *) dw:=TIME_TO_DWORD(T#5m); (* Result is 300000 *) si:=TOD_TO_SINT(TOD#00:00:00.012); (* Result is 12 *)

Examples in FBD:

DATE_TO/DT_TOConversions

Converting from the variable type DATE or DATE_AND_TIME to a differenttype:

The date will be stored internally in a DWORD in seconds since Jan. 1, 1970.This value will then be converted.

When you perform a type conversion from a larger to a smaller type, you risklosing some information

For STRING type variables, the result is the date constant.

Examples in St: b :=DATE_TO_BOOL(D#1970-01-01); (* Result is FALSE *) i :=DATE_TO_INT(D#1970-01-15); (* Result is 29952 *) byt :=DT_TO_BYTE(DT#1970-01-15-05:05:05); (* Result is 129 *) str:=DT_TO_STRING(DT#1998-02-13-14:20); (* Result is

'DT#1998-02-13-14:20' *)

Page 240: Wago Pro Manual

Numeric Functions

12-18 WAGO-I/O-PRO 32

STRING_TO Conversions

Converting from the variable type STRING to a different type:

The operand from the STRING type variable must contain a value that is validin the target variable type, otherwise the result will be 0.

Examples in St: b :=STRING_TO_BOOL('TRUE'); (* Result is TRUE *) w :=STRING_TO_WORD('abc34'); (* Result is 0 *) t :=STRING_TO_TIME('T#127ms'); (* Result is T#127ms *)

TRUNC

Converting from REAL to INT. The whole number portion of the value will beused.

When you perform a type conversion from a larger to a smaller type, you risklosingsome information

Examples in ST: i:=TRUNC(1.9); (* Result is 1 *) i:=TRUNC(-1.4); (* Result is 1 *)

Example in IL: LD 2.7 TRUNC GE %MW8

Numeric Functions

ABS

Returns the absolute value of a number. ABS(-2) equals 2.

The following type combinations for input and output variables are possible: IN OUT

INT INT, REAL, WORD, DWORD, DINT REAL REAL BYTE INT, REAL, BYTE, WORD, DWORD, DINT WORD INT, REAL, WORD, DWORD, DINT DWORD REAL, DWORD, DINT SINT REAL USINT REAL UINT INT, REAL, WORD, DWORD, DINT, UDINT, UINT DINT REAL, DWORD, DINT UDINT REAL, DWORD, DINT, UDINT

Example in IL: LD 2 ABS ST i (*Result is 2 *)

Page 241: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-19

Example in ST: i:=ABS(-2);

Example in FBD:

SQRT

Returns the square root of a number.

IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT,UINT, UDINT, OUT must be type REAL.

Example in IL: LD 16 SQRT ST q (*Result is 4 *)

Example in ST: q:=SQRT(16);

Example in FBD:

LN

Returns the natural logarithm of a number.

IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT,UINT, UDINT, OUT must be type REAL.

Example in IL: LD 45 LN ST q (*Result is 3.80666 *)

Example in ST: q:=LN(45);

Example in FBD:

LOG

Returns the logarithm of a number in base 10.

IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT,UINT, UDINT, OUT must be type REAL.

Example in IL: LD 314.5 LOG ST q (*Result is 2.49762 *)

Page 242: Wago Pro Manual

Numeric Functions

12-20 WAGO-I/O-PRO 32

Example in ST: q:=LOG(314.5);

Example in FBD:

EXP

Returns the exponential function.

IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT,UINT, UDINT, OUT must be type REAL.

Example in IL: LD 2 EXP ST q (*Result is 9.7448e+009 *)

Example in ST: q:=EXP(2);

Example in FBD:

SIN

Returns the sine of a number.

IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT,UINT, UDINT, OUT must be type REAL.

Example in IL: LD 0.5 SIN ST q (*Result is 0.479426 *)

Example in ST: q:=SIN(0.5);

Example in FBD:

COS

Returns the cosine of number. The value is calculated in arch minutes.

IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT,UINT, UDINT, OUT must be type Typ REAL.

Example in IL: LD 0.5 COS ST q (*Result is 0.877583 *)

Example in ST:q:=COS(0.5);

Page 243: Wago Pro Manual

Chapter 12 - IEC Operators

WAGO-I/O-PRO 32 12-21

Example in FBD:

TAN

Returns the tangent of a number. The value is calculated in arch minutes. INcan be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT,UINT, UDINT, OUT must be type REAL.

Example in IL: LD 0.5 TAN ST q (*Result is 0.546302 *)

Example in ST: q:=TAN(0.5);

Example in FBD:

ASIN

Returns the arc sine (inverse function of sine) of a number. .

IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT,UINT, UDINT, OUT must be type REAL.

Example in IL: LD 0.5 ASIN ST q (*Result is 0.523599 *)

Example in ST: q:=ASIN(0.5);

Example in FBD:

ACOS

Returns the arc cosine (inverse function of cosine) of a number. The value iscalculated in arch minutes.

IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT,UINT, UDINT, OUT must be type REAL.

Example in IL: LD 0.5 ABS ST q (*Result is 1.0472 *)

Page 244: Wago Pro Manual

Numeric Functions

12-22 WAGO-I/O-PRO 32

Example in ST: q:=ACOS(0.5);

Example in FBD:

ATAN

Returns the arc tangent (inverse function of tangent) of a number. The value iscalculated in arch minutes.

IN can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT,UINT, UDINT, OUT must be type REAL.

Example in IL: LD 0.5 ABS ST q (*Result is 0.463648 *)

Example in ST: q:=ATAN(0.5);

Example in FBD:

EXPT

Exponentiation of a variable with another variable: OUT = IN1IN2.

IN1 and IN2 can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT,USINT, UINT, UDINT, OUT must be type REAL.

Example in IL: LD 7 EXPT 2 ST var1 (*Result is 49 *)

Example in ST: var1 := (7,2);

Example in FBD:

Page 245: Wago Pro Manual

Chapter 13 - Standard Library Elements

WAGO-I/O-PRO 32 13-1

13 Standard Library Elements

String Functions

LEN

Returns the length of a string. Input STR is of type STRING, the return value ofthe function is type INT.

Example in IL: LD 'SUSI' LEN ST VarINT1 (* Ergebnis ist 4 *)

Example in FBD:

Example in ST: VarSTRING1 := LEN (�SUSI�);

LEFT

Left returns the left, initial string for a given string. Input STR is type STRING,SIZE is of type INT, the return value of the function is type STRING.

LEFT (STR, SIZE) means: Take the first SIZE character from the right in thestring STR.

Example in IL: LD 'SUSI' LEFT 3 ST VarSTRING1 (* Ergebnis ist �SUS� *)

Example in FBD:

Example in ST: VarSTRING1 := LEFT (�SUSI�,3);

RIGHT

Right returns the right, initial string for a given string.

RIGHT (STR, SIZE) means: Take the first SIZE character from the right in thestring STR.

Input STR is of type STRING, SIZE is of type INT, the return value of thefunction is of type STRING.

Page 246: Wago Pro Manual

String Functions

13-2 WAGO-I/O-PRO 32

Example in IL: LD 'SUSI' RIGHT 3 ST VarSTRING1 (* Ergebnis ist �USI� *)

Example in FBD:

Example in ST: VarSTRING1 := RIGHT (�SUSI�,3);

MID

Mid returns a partial string from within a string.

Input STR is type STRING, LEN and POS are type INT, the return value of thefunction is type STRING.

MID (STR, LEN, POS) means: Retrieve LEN characters from the STR stringbeginning with the character at position POS.

Example in IL: LD 'SUSI' RIGHT 2,2 ST VarSTRING1 (* Ergebnis ist �US� *)

Example in FBD:

Example in ST: VarSTRING1 := MID (�SUSI�,2,2);

CONCAT

Concatenation (combination) of two strings.

The input variables STR1 and STR2 as well as the return value of the functionare type STRING.

Example in IL: LD 'SUSI' CONCAT �WILLI� ST VarSTRING1 (* Ergebnis ist �SUSIWILLI� *)

Page 247: Wago Pro Manual

Chapter 13 - Standard Library Elements

WAGO-I/O-PRO 32 13-3

Example in FBD:

Example in ST: VarSTRING1 := CONCAT (�SUSI�,�WILLI�);

INSERT

INSERT inserts a string into another string at a defined point.

The input variables STR1 and STR2 are type STRING, POS is type INT andthe return value of the function is type STRING.

INSERT(STR1, STR2, POS) means: insert STR2 into STR1 after positionPOS.

Example in IL: LD 'SUSI' INSERT �XY�,2 ST VarSTRING1 (* Ergebnis ist �SUXYSI� *)

Example in FBD:

Example in ST: VarSTRING1 := INSERT (�SUSI�,�XY�,2);

DELETE

DELETE removes a partial string from a larger string at a defined position.

The input variable STR is type STRING, LEN and POS are type INT, the returnvalue of the function is type STRING.

DELETE(STR, L, P) means: Delete L characters from STR beginning with thecharacter in the P position.

Example in IL: LD 'SUXYSI' DELETE 2,23 ST Var1 (* Ergebnis ist �SUSI� *)

Example in FBD:

Example in ST:Var1 := DELETE (�SUXYSI�,2,3);

Page 248: Wago Pro Manual

String Functions

13-4 WAGO-I/O-PRO 32

REPLACE

REPLACE replaces a partial string from a larger string with a third string.

The input variable STR1 and STR2 are type STRING, LEN and POS are typeINT, the return value of the function is type STRING.

REPLACE(STR1, STR2, L, P) means: Replace L characters from STR1 withSTR2 beginning with the character in the P position.

Example in IL: LD 'SUXYSI' REPLACE 'K', 2,2 ST VarSTRING1 (* Ergebnis ist �SKYSI� *)

Example in FBD:

Example in ST:VarSTRING1 := REPLACE (�SUXYSI�,�K�,2,2);

FIND

FIND searches for a partial string within a string.

The input variable STR1 and STR2 are type STRING, the return value of thefunction is type STRING.

FIND(STR1, STR2) means: Find the position of the first character where STR2appears in STR1 for the first time. If STR2 is not found in STR1, then OUT:=0.

Example in IL: LD 'SUXYSI' FIND 'XY' ST VarINT1 (* Ergebnis ist �3� *)

Example in FBD:

Example in ST:VarINT1 := FIND (�SUXYSI�,�XY�);

Page 249: Wago Pro Manual

Chapter 13 - Standard Library Elements

WAGO-I/O-PRO 32 13-5

Bistable Function Blocks

SR

Making Bistable Function Blocks dominant:

Q1 = SR (SET1, RESET) means: Q1 = (NOT RESET AND Q1) OR SET1

The input variables SET1 and RESET as well as the output variable Q1 are typeBOOL.

Declaration example: SRInst : SR ;

Example in IL: CAL SRInst(SET1 := VarBOOL1, RESET := VarBOOL2) LD SRInst.Q1 ST VarBOOL3

Example in FBD:

Example in ST: SRInst(SET1:= VarBOOL1 , RESET:=VarBOOL2 );VarBOOL3 := SRInst.Q1 ;

RS

Resetting Bistable Function Blocks Q1 = RS (SET, RESET1) means:

Q1 = NOT RESET1 AND (Q1 OR SET) The input variables SET and RESET1 as well as the output variable Q1 are typeBOOL.

Declaration example: RSInst : RS ;

Example in IL: CAL RSInst(SET := VarBOOL1, RESET1 := VarBOOL2) LD RSInst.Q1 ST VarBOOL3

Example in FBD:

Page 250: Wago Pro Manual

Trigger

13-6 WAGO-I/O-PRO 32

Example in ST: RSInst(SET:= VarBOOL1 , RESET1:=VarBOOL2 ); VarBOOL3 := RSInst.Q1 ;

SEMA

A Software Semaphore (Interruptible) BUSY = SEMA(CLAIM, RELEASE) means:

BUSY := X; IF CLAIM THEN X:=TRUE; ELSE IF RELEASE THEN BUSY := FALSE; X:= FALSE; END_IF

X is an internal BOOL variable that is FALSE when it is initialized.The input variables CLAIM and RELEASE as well as the output variableBUSY are type BOOL. If BUSY is TRUE when SEMA is called up, this means that a value has alreadybeen assigned to SEMA (SEMA was called up with CLAIM = TRUE). IfBUSY is FALSE, SEMA has not yet been called up or it has been released(called up with RELEASE = TRUE).

Declaration example: SEMAInst : SEMA ;

Example in IL: CAL SEMAInst(CLAIM := VarBOOL1, RELEASE := VarBOOL2) LD SEMAInst.BUSY ST VarBOOL3

Example in FBD:

Example in ST: SEMAInst(CLAIM:= VarBOOL1 , RELEASE:=VarBOOL2 );VarBOOL3 := SEMAInst.BUSY;

Trigger

R_TRIG

The function block R_TRIG detects a rising edge. FUNCTION_BLOCK R_TRIG VAR_INPUT CLK : BOOL; END_VAR VAR_OUTPUT Q : BOOL; END_VAR

Page 251: Wago Pro Manual

Chapter 13 - Standard Library Elements

WAGO-I/O-PRO 32 13-7

VAR M : BOOL := FALSE; END_VAR Q0 := CLK AND NOT M; M := CLK; END_FUNCTION_BLOCK

The output Q0 and the help variable M will remain FALSE as long as the inputvariable CLK is FALSE. As soon as S1 returns TRUE, Q will first returnTRUE, then M will be set to TRUE. This means each time the function is calledup, Q will return FALSE until CLK has falling edge followed by an rising edge.

Declaration example: RTRIGInst : R_TRIG ;

Example in IL: CAL RTRIGInst(CLK := VarBOOL1) LD RTRIGInst.Q ST VarBOOL2

Example in FBD:

Example in ST: RTRIGInst(CLK:= VarBOOL1);VarBOOL2 := RTRIGInst.Q;

F_TRIG

The function block F_TRIG a falling edge. FUNCTION_BLOCK F_TRIG VAR_INPUT CLK: BOOL; END_VAR VAR_OUTPUT Q: BOOL; END_VAR VAR M: BOOL := FALSE; END_VAR Q := NOT CLK AND NOT M; M := NOT CLK; END_FUNCTION_BLOCK

The output Q and the help variable M will remain FALSE as long as the inputvariable CLK returns TRUE. As soon as CLK returns FALSE, Q will firstreturn TRUE, then M will be set to TRUE. This means each time the function iscalled up, Q will return FALSE until CLK has a rising followed by a fallingedge.

Page 252: Wago Pro Manual

Counter

13-8 WAGO-I/O-PRO 32

Declaration example: FTRIGInst : F_TRIG ;

Example in IL: CAL FTRIGInst(CLK := VarBOOL1) LD FTRIGInst.Q ST VarBOOL2

Example in FBD:

Example in ST: FTRIGInst(CLK:= VarBOOL1);VarBOOL2 := FTRIGInst.Q;

Counter

CTU

The function block Incrementer:

The input variables CU and RESET as well as the output variable Q are typeBOOL, the input variable PV and the output variable CV are type WORD.

The counter variable CV will be initialized with 0 if RESET is TRUE. If CUhas a rising edge from FALSE to TRUE, CV will be raised by 1.Q will returnTRUE when CV is greater than or equal to the upper limit PV.

Declaration example: CTUInst : CTU ;

Example in IL: CAL CTUInst(CU := VarBOOL1, RESET := VarBOOL2, PV := VarINT1) LD CTUInst.Q ST VarBOOL3 LD CTUInst.CV ST VarINT2

Example in FBD:

Example in ST: CTUInst(CU:= VarBOOL1, RESET:=VarBOOL2 , PV:= VarINT1); VarBOOL3 := CTUInst.Q ;VarINT2 := CTUInst.CV;

Page 253: Wago Pro Manual

Chapter 13 - Standard Library Elements

WAGO-I/O-PRO 32 13-9

CTD

Function Block Decrementer:

The input variables CD and LOAD_ as well as the output variable Q are typeBOOL, the input variable PV and the output variable CV are type INT.

When LOAD_ is TRUE, the counter variable CV will be initialized with theupper limit PV. If CD has a rising edge from FALSE to TRUE, CV will belowered by 1 provided CV is greater than 0 (i.e., it doesn't cause the value tofall below 0).

Q returns TRUE when CVis equal 0.

Declaration example: CTDInst : CTD ;

Example in IL: CAL CTDInst(CD := VarBOOL1, LOAD := VarBOOL2, PV := VarINT1) LD CTDInst.Q ST VarBOOL3 LD CTDInst.CV ST VarINT2

Example in FBD:

Example in ST: CTDInst(CD:= VarBOOL1, LOAD:=VarBOOL2 , PV:= VarINT1); VarBOOL3 := CTDInst.Q ;VarINT2 := CTDInst.CV;

CTUD

Function Block Incrementer/Decrementer

The input variables CU, CD, RESET, LOAD_ as well as the output variablesQU and QD are type BOOL, PV and CV are type WORD.

If RESET is valid, the counter variable CV will be initialized with 0. If LOADis valid, CV will be initialized with PV.

If CU has a rising edge from FALSE to TRUE, CV will be raised by 1. If CDhas a rising edge from FALSE to TRUE, CV will be lowered by 1 provided thisdoes not cause the value to fall below 0.

QU returns TRUE when CV has become greater than or equal to PV.

QD returns TRUE when CV has become equal to 0.

Declaration example: CTUDInst : CUTD ;

Page 254: Wago Pro Manual

Timer

13-10 WAGO-I/O-PRO 32

Example in IL: CAL CTUDInst(CU := VarBOOL2, RESET := VarBOOL3, LOAD :=

VarBOOL4, PV := VarINT1) LD CTUDInst.QU ST VarBOOL5 LD CTUDInst.QD ST VarBOOL6 LD CTUDInst.CV ST VarINT2

Example in FBD:

Example in ST: CTUDInst(CU := VarBOOL1, CU:= VarBOOL2, RESET := VarBOOL3,

LOAD:=VarBOOL4 , PV:= VarINT1); VarBOOL5 := CTUDInst.QU ; VarBOOL6 := CTUDInst.QD ; VarINT2 := CTUDInst.CV;

Timer

TP

The function blockTimer is a trigger.

TP(IN, PT, Q, ET) means:

IN and PT are input variables of the BOOL and TIME types respectively. Q andET are output variables of the BOOL and TIME types respectively. If IN isFALSE, Q is FALSE and ET is 0.

As soon as IN becomes TRUE, the time will begin to be counted inmilliseconds in ET until its value is equal to PT.It will then remain constant.

Q is TRUE if IN is TRUE and ET is less than or equal to PT. Otherwise it isFALSE.

Q returns a signal for the time period given in PT.

Page 255: Wago Pro Manual

Chapter 13 - Standard Library Elements

WAGO-I/O-PRO 32 13-11

Graphic Display of the TP Time Sequence:

Declaration example: TPInst : TP ;

Example in IL: CAL TPInst(IN := VarBOOL1, PT := T#5s) LD TPInst.Q ST VarBOOL2

Example in FBD:

Example in ST: TPInst(IN := VarBOOL1, PT:= T#5s);VarBOOL2 :=TPInst.Q;

TON

The function block Timer On Delay implements a turn-on delay.

TON(IN, PT, Q, ET) means:

IN and PT are input variables of the BOOL and TIME types respectively. Q andET are output variables of the BOOL and TIME types respectively. If IN isFALSE, Q is FALSE and ET is 0.

As soon as IN becomes TRUE, the time will begin to be counted inmilliseconds in ET until its value is equal to PT.It will then remain constant.

Q is TRUE when IN is TRUE and ET is equal to PT. Otherwise it is FALSE.

Thus, Q has a rising edge when the time indicated in PT in milliseconds has runout.

Graphic display of TON behavior over time:

Declaration example: TONInst : TON ;

Page 256: Wago Pro Manual

Timer

13-12 WAGO-I/O-PRO 32

Example in IL: CAL TONInst(IN := VarBOOL1, PT := T#5s) LD TONInst.Q ST VarBOOL2

Example in FBD:

Example in ST: TONInst(IN := VarBOOL1, PT:= T#5s);

TOF

The function block TOF implements a turn-off delay.

TOF(IN, PT, Q, ET) means:

IN and PT are input variables type BOOL respectively TIME. Q and E areoutput variabls type BOOL respectively TIME. If IN is TRUE, the outputs areTRU respectively 0.

As soon as IN becomes FALSE, in ET the time will begin to be counted inmilliseconds in ET until its value is equal to PT.It will then remain constant.

Q is FALSE when IN is FALSE und ET equal PT. Otherwise it is TRUE.

Thus, Q has a falling edge when the time indicated in PT in milliseconds hasrun out.

Graphic display of TOF behavior over time:

Declaration example: TOFInst : TOF ;

Example in IL: CAL TOFInst(IN := VarBOOL1, PT := T#5s) LD TOFInst.Q ST VarBOOL2

Example in FBD:

Page 257: Wago Pro Manual

Chapter 13 - Standard Library Elements

WAGO-I/O-PRO 32 13-13

Example in ST: TOFInst(IN := VarBOOL1, PT:= T#5s); VarBOOL2 :=TOFInst.Q;

Page 258: Wago Pro Manual

Timer

13-14 WAGO-I/O-PRO 32

Page 259: Wago Pro Manual

Chapter 14 - The UTIL.LIB Library

WAGO-I/O-PRO 32 14-1

14 The UTIL.LIB Library

This library contains an additional collection of various blocks which can beused for BCD conversion, bit/byte functions, mathematical help functions, ascontroller, signal generators, function manipulators and for analogue valueprocessing.

BCD conversion

A byte in the BCD format contains integers between 0 and 99. Four bits areused for each decimal place. The ten decimal place is stored in the bits 4-7.Thus the BCD format is similar to the hexadecimal presentation, with thesimple difference that only values between 0 and 99 can be stored in a BCDbyte, whereas a hexadecimal byte reaches from 0 to FF.

An example: The integer 51 should be converted to BCD format. 5 inbinary is 0101, 1 in binary is 0001, which makes the BCD byte 01010001,which corresponds to the value $51=81.

BCD_TO_INT

This function converts a byte in BCD format into an INT value:

The input value of the function is type BYTE and the output is type INT.

Where a byte should be converted which is not in the BCD format the output is-1.

Examples in ST: i:=BCD_TO_INT(73); (* Result is 49 *) k:=BCD_TO_INT(151); (* Result is 97 *) l:=BCD_TO_INT(15); (* Output -1, because it is not in BCD format

*)

INT_TO_BCD_

This function converts an INTEGER value into a byte in BCD format:

The input value of the function is type INT, the output is type BYTE.

The number 255 will be outputted where an INTEGER value should beconverted which cannot be converted into a BCD byte.

Examples in ST: i:=INT_TO_BCD(49); (* Result is 73 *) k:=BCD_TO_INT(97); (* Result is 151 *) l:=BCD_TO_INT(100); (* Error! Output: 255 *)

Page 260: Wago Pro Manual

Bit/byte functions

14-2 WAGO-I/O-PRO 32

Bit/byte functions

EXTRACT

Inputs to this function are a DWORD X, as well as a BYTE N. The output is aBOOL value, which contains the content of the Nth bit of the input X, wherebythe function begins to count from the zero bit.

Examples in ST: FLAG:=EXTRACT(X:=81, N:=4); (* Result : TRUE, because 81 is

binary 1010001, so the 4th bit is 1 *) FLAG:=EXTRACT(X:=33, N:=0); (* Result : TRUE, because 33 is

binary 100001, so the bit �0� is 1 *)

PACK

This function is capable of delivering back eight input bits B0, B1, ..., B7 fromtype BOOL as a BYTE.

The function block UNPACK is closely related to this function.

PUTBIT

The input to this function consists of a DWORD X, a BYTE N and a BOOLeanvalue B.

PUTBIT sets the Nth bit from X on the value B, whereby it starts counting fromthe zero bit.

Example in ST: A:=38; (* binary 100110 *) B:=PUTBIT(A,4,TRUE); (* Result : 54 = 2#110110 *) C:=PUTBIT(A,1,FALSE); (* Result : 36 = 2#100100 *)

UNPACK

UNPACK converts the input B from type BYTE into 8 output variablesB0,...,B7 of the type BOOL, and this is the opposite to PACK.

Example in FBD: Output:

Page 261: Wago Pro Manual

Chapter 14 - The UTIL.LIB Library

WAGO-I/O-PRO 32 14-3

Mathematical help functions

DERIVATIVE

This function block approximately determines the local derivation.

The function value is delivered as a REAL variable by using IN. TM containsthe time which has passed in msec in a DWORD and the input of RESET of thetype BOOL allows the function block to start anew through the delivery of thevalue TRUE.

The output OUT is of the type REAL.

In order to obtain the best possible result, DERIVATIVE approximates usingthe last four values, in order to hold errors which are produced by inaccuraciesin the input parameters as low as possible.

Block in FBD:

INTEGRAL

This function block approximately determines the integral of the function.

In an analogue fashion to DERIVATIVE, the function value is delivered as aREAL variable by using IN. TM contains the time which has passed in msec ina DWORD and the input of RESET of the type BOOL allows the functionblock to start anew with the value TRUE.

The output OUT is of the type REAL.

The integral is approximated by two step functions. The average of these isdelivered as the approximated integral.

Block in FBD: Example: Integration of a linear function:

STATISTICS_INT

This function block calculates some standard statistical values:

The input IN is of the type INT. All values are initialised anew when theBOOLean input RESET is TRUE.

Page 262: Wago Pro Manual

Controllers

14-4 WAGO-I/O-PRO 32

The output MN contains the minimum, MX of the maximum value from IN.AVG describes the average, that is the expected value of IN. All three outputsare of the type INT.

Block in FBD:

STATISTICS_REAL

This function block corresponds to STATISTICS_INT, except that the input INis of the type REAL like the outputs MN, MX, AVG.

VARIANCE

VARIANCE calculates the variance of the entered values.

The input IN is of the type REAL, RESET is of the type BOOL and the outputOUT is again of the type REAL.

This block calculates the variance of the inputted values. VARIANCE can bereset with RESET=TRUE.

The standard deviation can easily be calculated as the square root of theVARIANCE.

Controllers

P

The P controller function block:

ACTUAL (actual value) and DESIRED (desired or nominal value) as well asKP, the proportionality coefficient, are all input values of the type REAL.

The output, the absolute control output (OUT), is also of the type REAL andsatisfies the equation:

OUT = ACTUAL + KP⋅∆ , whereby ∆=DESIRED-ACTUAL

Example in FBD:

Page 263: Wago Pro Manual

Chapter 14 - The UTIL.LIB Library

WAGO-I/O-PRO 32 14-5

PD

The PD controller function block:

ACTUAL (actual value) and DESIRED (desired or nominal value) as well asKP, the proportionality coefficient, are all input values of the type REAL. TD isof the type DWORD and contains the derivative action time in msec. RESET isof the type BOOL and serves to reset the controller.

The output, the absolute control output (OUT), is of the type REAL, and iscalculated as follows:

OUT = ACTUAL + KP⋅ (∆ + TD⋅ δ∆δt ) , whereby ∆=DESIRED-

ACTUAL

Example in FBD:

PID

The PID controller function block:

ACTUAL (actual value) and DESIRED (desired or nominal value) as well asKP, the proportionality coefficient, are all input values of the type REAL. TR,the integral action time, and TD, the derivative action time, are delivered inmsec by a DWORD. RESET is of the type BOOL and serves to reset thecontroller.

The output, the absolute control output (OUT), is again of the type REAL, andis calculated as follows:

OUT = ACTUAL + KP⋅ (∆ + 1TR ��∆(t)dt + TD⋅

δ∆δt )

The PID controller can be easily converted to a PI controller by setting TD=0.

Example in FBD:

Page 264: Wago Pro Manual

Signal generators

14-6 WAGO-I/O-PRO 32

Signal generators

BLINK

The function block BLINK generates a pulsating signal. The input consists ofENABLE of the type BOOL, as well as TIMELOW and TIMEHIGH of the typeTIME. The output OUT is of the type BOOL.

If ENABLE is set to TRUE, BLINK begins, to set the output for the time periodTIMEHIGH to TRUE, and then afterwards to set it for the time periodTIMELOW to FALSE.

Example in FBD:

GEN

The function generator generates typical periodic functions:

The inputs are a composition consisting of MODE from the pre-definedcounting type GEN_MODE, BASE of the type BOOL, of the PERIOD of thetype TIME, of two INT values CYCLES and AMPLITUDE and of theBOOLean RESET input. An INT is generated with the designation OUT.

The MODE describes the function which should be generated, whereby theenumeration values TRIANGLE and TRIANGLE_POS deliver two triangularfunctions, SAWTOOTH_RISE an ascending, SAWTOOTH_FALL adescending sawtooth, RECTANGLE a rectangular signal and SINE andCOSINE the sine and cosine:

TRIANGLE:

TRIANGLE_POS:

SAWTOOTH_RISE:

SAWTOOTH_FALL:

Page 265: Wago Pro Manual

Chapter 14 - The UTIL.LIB Library

WAGO-I/O-PRO 32 14-7

RECTANGLE:

SINUS:

COSINUS:

BASE defines whether the cycle period is really related to a defined time(BASE=TRUE) or whether it is related to a particular number of cycles, whichmeans the number of calls of function block (BASE=FALSE).

PERIOD or CYCLES defines the corresponding cycle period.

AMPLITUDE defines, in a trivial way, the amplitude of the function to begenerated.

The function generator is again set to 0 as soon as RESET=TRUE.

Example in FBD:

Function manipulators

CHARCURVE

This function block serves to represent values, piece by piece, on a linearfunction:

IN of the type INT is fed with the value to be manipulated. The BYTE Ndesignates the number of points which defines the presentation function. This

Page 266: Wago Pro Manual

Function manipulators

14-8 WAGO-I/O-PRO 32

characteristic line is then generated in an ARRAY P[0..10] with P of the typePOINT which is a structure based on two INT values (X and Y).

The output consists of OUT of the type INT, the manipulated value and BYTEERR, which will indicate an error if necessary.

The points P[0]..P[N-1] in the ARRAY must be sorted according to their Xvalues, otherwise ERR receives the value 1. If the input IN is not betweenP[0].X and P[N-1].X, ERR=2 and OUT contains the corresponding limitingvalue P[0].X or P[N-1].X.

If N lies outside of the allowed values which are between 2 and 11, thenERR=4.

Example in ST:

First of all ARRAY P must be defined in the header: VAR ... CHARACTERISTIC_LINE:CHARCURVE; KL:ARRAY[0..10] OF POINT:=(X:=0,Y:=0),(X:=250,Y:=50),

(X:=500,Y:=150),(X:=750,Y:=400),7((X:=1000,Y:=1000)); COUNTER:INT; ... END_VAR

We then feed CHARCURVE with an increasing value: COUNTER:=COUNTER+10;

CHARACTERISTIC_LINE(IN:=COUNTER,N:=5,P:=KL);

The subsequent tracing illustrates the effect:

RAMP_INT

RAMP_INT serves to limit the ascendance or descendance of the functionbeing fed:

The input consists on the one hand out of three INT values: IN, the functioninput, and ASCEND and DESCEND, the maximum increase or decrease for agiven time interval, which is defined by TIMEBASE of the type TIME. SettingRESET to TRUE causes RAMP_INT to be initialised anew.

The output OUT of the type INT contains the ascend and descend limitedfunction value.

When TIMEBASE is set to t#0s, ASCEND and DESCEND are not related tothe time interval, but remain the same.

Page 267: Wago Pro Manual

Chapter 14 - The UTIL.LIB Library

WAGO-I/O-PRO 32 14-9

Example in FBD:

RAMP_REAL

RAMP_REAL functions exactly in the same way as RAMP_INT, with thesimple difference that the inputs IN, ASCEND, DESCEND and the outputOUT are of the type REAL.

Analogue value processing

HYSTERESIS

The input to this function block consists of three INT values IN, HIGH andLOW. The output OUT is of the type BOOL.

If IN goes below the limiting value LOW, OUT becomes TRUE. If IN goesover the upper limit HIGH, FALSE is delivered.

An illustrative example:

Page 268: Wago Pro Manual

Analogue value processing

14-10 WAGO-I/O-PRO 32

LIMITALARM

This function block specifies, whether the input value is within a set range andwhich limits it has violated if it has done so.

The input values IN, HIGH and LOW are each of the type INT, while theoutputs O, U and IL are of the type BOOL.

If the upper limit HIGH is exceeded by IN, O becomes TRUE, and when IN isbelow LOW, U becomes TRUE. IL is TRUE if IN lies between LOW andHIGH.

Example in FBD: Result:

Page 269: Wago Pro Manual

Chapter 15 - Operands in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 15-1

15 Operands in WAGO-I/O-PRO 32

Operands

Constants, variables, addresses and possibly function calls can appear asoperands.

Constants

BOOL Constants

BOOL constants are the logical values TRUE and FALSE.

TIME Constants

TIME constants can be declared in WAGO-I/O-PRO 32. These are generallyused to operate the timer in the standard library. A TIME constant is alwaysmade up of an initial "t" or "T" (or "time" or "TIME" spelled out) and a numbersign "#".

This is followed by the actual time declaration which can include days(identified by "d"), hours (identified by "h"), minutes (identified by "m"),seconds (identified by "s") and milliseconds (identified by "ms"). Please notethat the time entries must be given in this order according to length (d before hbefore m before s before ms) but you are not required to include all timeincrements.

Examples of correct TIME constants in a ST assignment: TIME1 := T#14ms; TIME1 := T#100S12ms; (*The highest component may be allowed to

exceed its limit*) TIME1 := t#12h34m15s;

the following would be incorrect: TIME1 := t#5m68s; (*limit exceeded in a lower component*) TIME1 := 15ms; (*T# is missing*) TIME1 := t#4ms13d; (*Incorrect order of entries*)

DATE Constants

These constants can be used to enter dates. A DATE constant is declaredbeginning with a "d", "D", "DATE" or "date" followed by "#". You can thenenter any date with format Year-Month-Day.

Examples: DATE#1996-05-06 d#1972-03-29

Page 270: Wago Pro Manual

Constants

15-2 WAGO-I/O-PRO 32

TIME_OF_DAYConstants

Use this type of constant to store times of the day. A TIME_OF_DAYdeclaration begins with "tod#", "TOD#", "TIME_OF_DAY#" or"time_of_day#" followed by a time with the format: Hour:Minute:Second. Youcan enter seconds as real numbers or you can enter fractions of a second.

Examples: TIME_OF_DAY#15:36:30.123 tod#00:00:00

DATE_AND_TIMEConstants

Date constants and the time of day can also be combined to form so-calledDATE_AND_TIME constants. DATE_AND_TIME constants begin with "dt#","DT#", "DATE_AND_TIME#" or "date_and_time#". Place a hyphen after thedate followed by the time.

Examples: DATE_AND_TIME#1996-05-06-15:36:30 dt#1972-03-29-00:00:00

Number Constants

Number values can appear as binary numbers, octal numbers, decimal numbersand hexadecimal numbers. If an integer value is not a decimal number, youmust write its base followed by the number sign (#) in front of the integerconstant. The values for the numbers 10-15 in hexadecimal numbers will berepresented as always by the letters A-F.

You may include the underscore character within the number.

Examples: 14 (Decimal number) 2#1001_0011 (Binary number) 8#67 (Octal number) 16#A (Hexadecimal number)

These number values can be from the variable types BYTE, WORD, DWORD,SINT, USINT, INT, UINT, DINT, UDINT or REAL.

Implicit conversions from "larger" to "smaller" variable types are not permitted.This means that a DINT variable cannot simply be used as an INT variable.You must use the type conversion (see the Type Conversions chapter in theappendix).

REAL Constants

REAL constants can be given as decimal fractions and representedexponentially. Use the standard American format with the decimal point to dothis.

Example: 7.4 instead of 7,4

Page 271: Wago Pro Manual

Chapter 15 - Operands in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 15-3

1.64e+009 instead of 1,64e+009

STRING Constants

A string is a sequence of characters. STRING constants are preceded andfollowed by single quotation marks. You may also enter blank spaces andspecial characters (umlauts for instance). They will be treated just like all othercharacters.

In character sequences, the combination of the dollar sign ($) followed by twohexadecimal numbers is interpreted as a hexadecimal representation of the eightbit character code. In addition, the combination of two characters that beginwith the dollar sign are interpreted as shown below when they appear in acharacter sequence:

$$ Dollar signs

$' Single quotation mark

$L or $l Line feed

$N or $n New line

$P or $p Page feed

$R or $r Line break

$T or $t Tab

Examples: 'w1Wüß?' ' Abby and Craig ' ':-)'

Variables

Variables can be declared either locally in the declaration part of a POU or in aglobal variable list.

The variable identifier may not contain any blank spaces or special characters,may not be declared more than once and cannot be the same as any of thekeywords. Capitalization is not recognized which means that VAR1, Var1, andvar1 are all the same variable. The underscore character is recognized inidentifiers (e.g., "A_BCD" and "AB_CD" are considered two differentidentifiers). An identifier may not have more than one underscore character in arow. The first 32 characters are significant.

Variables can be used anywhere the declared type allows for them.

You can access available variables through the Input Assistant.

System Flags

System flags are implicitly declared variables that are different on each specificPLC. To find out which system flags are available in your system, use thecommand "Insert" "Operand" An Input Assistant dialog box pops up, selectthe category System Variable.

Page 272: Wago Pro Manual

Addresses

15-4 WAGO-I/O-PRO 32

Accessing variables forarrays, structures andPOUs.

Two-dimensional array components can be accessed using the followingsyntax:

<Fieldname>[Index1, Index2]

Structure variables can be accessed using the following syntax: <Structurename>.<Variablenname>

Function block and program variables can be accessed using the followingsyntax:

<Functionblockname>.<Variablename>

Addresses

Address

The direct display of individual memory locations is done through the use ofspecial character sequences. These sequences are a concatenation of the percentsign "%", a range prefix, a prefix for the size and one or more natural numbers.

The following range prefixes are supported: I Input Q Output M Memory location

The following size prefixes are supported: X Single bit None Single bit B Byte (8 Bits) W Word (16 Bits) D Double word (32 Bits)

Examples: %QX75 and %Q75 Output bit 75 %IW215 Input word 215 %QB7 Output byte 7 %MD48 Double word in memory position 48 in the memory

location. %IW2.5 depending on the PLC Configuration

The current PLC Configuration for the program determines whether or not anaddress is valid.

Memory location

You can use any supported size to access the memory location.

For example, the address %MD48 would address bytes numbers 192, 193, 194,and 195 in the memory location area (48 * 4 = 192). The number of the firstbyte is 0.

Page 273: Wago Pro Manual

Chapter 15 - Operands in WAGO-I/O-PRO 32

WAGO-I/O-PRO 32 15-5

You can access words, bytes and even bits in the same way: the address%MX5.0 allows you to access the first bit in the fifth word (Bits are generallysaved wordwise).

Functions

In ST a function call can also appear as an operand.

Example: Result := Fct(7) + 3;

Page 274: Wago Pro Manual

Functions

15-6 WAGO-I/O-PRO 32

Page 275: Wago Pro Manual

Chapter 16 - Command Line/Command File Commands

WAGO-I/O-PRO 32 16-1

16 Command Line/Command File Commands

Command Line Commands

When WAGO-I/O-PRO 32 is started, you can add commands in the commandline which will be asserted during execution of the program. These commandsstart with a �/�. Capitalization/Use of small letters is not regarded. Thecommands will be executed sequentially from the left to the right.

/debug Additional debug outputs like listings etc. are activated./online Immediately after start WAGO-I/O-PRO 32 tries to go online with

the current project./run After login WAGO-I/O-PRO 32 starts the application program.

Only valid in combination with /online./show ...

/show hide

/show icon/show max/show normal

Settings for the WAGO-I/O-PRO 32 frame window can be made:

The window will not be displayed, it also will not be representedin the task menu.The window will be minimized in display.The window will be maximized in display.The window will be displayed in the same status as it was duringthe last closing.

/out <outfile> All messages are displayed in the message window andadditionally are written in the file <outfile>.

/cmd<cmdfile>

After starting the commands of the <cmdfile> get executed.

Example for a command line:

The project ampel.pro gets opened, but no window opens. The commandsincluded in the command file command.cmd will be executed.C:\ampel.pro /show hide /cmd command.cmd

Command File (cmdfile) Commands

See the following table for a list of commands, which can be used in acommand file (<cmdfile>). You can call the command file by a command line(see above). Capitalizing/Use of small letters is not regarded. The commandline will be displayed as a message in the message window and can be givenout in a message file (see below). Additionally to the command a �@� isprefixed. All signs after a semicolon (;) will be ignored (comment).

Commands of the online menu:

Page 276: Wago Pro Manual

Command File (cmdfile) Commands

16-2 WAGO-I/O-PRO 32

online login Login with the loaded project ('Online Login')

online logout Logout ('Online' 'Logout')

online run Start of the application program ('Online' 'Run')

online sim Switch on of simulation mode (�) 'Online''Simulation')

online sim off Switch off of simulation mode ('Online' 'Simulation')

Commands of the file menufile new A new project is created ('File' 'New')

file open <projectfile> The project <projectfile> will be loaded ('File' 'Open')

file close The current project will be closed ('File' 'Close')

file save The current project will be stored ('File' 'Save')

file saveas <projectfile> The current project will be saved with the file name<projectfile> ('File' 'Save as')

file quit WAGO-I/O-PRO 32 will be closed ('File' 'Exit')

Commands of the project menu:project compile The current project will be compiled by "Rebuild all"

('Project' 'Rebuild all')

project check The current project will be checked ('Project' 'Check')

project build The current project will be built ('Projekt' 'Build')

project import <file1> ...<fileN>

The files <file1> ... <fileN> get imported into thecurrent project ('Project' 'Import')

project export <expfile> The current project will be exported in the file<expfile> ('Project' 'Export')

project expmul Each object of the current project will be exported inan own file, which gets the name of the object.

Commands for the control of the message file:out open <msgfile> The file <msgfile> opens as message file. New

messages will be appended

out close The currently shown message file will be closed.

out clear All messages of the currently opened message file willbe deleted.

Page 277: Wago Pro Manual

Chapter 16 - Command Line/Command File Commands

WAGO-I/O-PRO 32 16-3

Commands for the control of messages:echo on The command lines will be displayed as messages.

echo off The command lines will not be displayed as messages.

echo <text> <text> will be displayed in the message window.

Commands for the control of replace of objects respectively for the control offiles for import, export, replace:replace ok

replace yes

Replace

replace no Do not replace

replace yesall Replace all

replace noall Replace none

Commands for the control of the default parameters of WAGO-I/O-PRO 32dialogs:query on Dialogs are displayed and need user input

query off ok All dialogs respond as if the user had clicked on the'OK' button

query off no All dialogs respond as if the user had clicked on the'No' button

query off cancel All dialogs respond as if the user had clicked on the'Cancel' button

Debug command:debug corresponds to the command "/debug" in the command

line

Command for calling command files as subroutines:call <parameter1> ...<parameter10>

Command files are called as subroutines. Up to tenparameters can be consigned. In the subroutine calledyou can access the parameters using $0 - $9.

Command for setting the libraries used by WAGO-I/O-PRO 32:dir lib <libdir> <libdir> is set as library directory

dir compile <compiledir> <compiledir> is set as directory for compile files

Page 278: Wago Pro Manual

Command File (cmdfile) Commands

16-4 WAGO-I/O-PRO 32

Command for setting a delay time concerning execution of the CMDFILEs:delay 5000 Wartet 5 Sekunden

Commands for control of the Watch and Receipt Manager:watchlist load <file> The watch list saved in <file> will be loaded

Watchliste and the appropriate window will be opened('Extras' 'Load Watch List')

watchlist save <file> Saves the current watch list in <file> ('Extras' 'SaveWatch List')

watchlist set <text> A previous loaded watch list gets the name <text>('Extras' 'Rename Watch List')

watchlist read The values of the watch variables are updated ('Extras''Read Receipt')

watchlist write The values of the watch list are written to the watchvariables ('Extras' 'Write Receipt')

Example of a command file:

A command file like shown below will open the project file ampel.pro, willthen load a watch list, which was stored as w.wtc, will then start the applicationprogram and write � after 1 second delay - the values of the variables into thewatch list watch.wtc (which will be saved) and will finally close the project.file open C:\work\projects\WAGO-IO-PRO_test\ampel.proquery off okwatchlist load c:\work\w.wtconline loginonline rundelay 1000watchlist readwatchlist save c:\work\watch.wtconline logoutfile close

Page 279: Wago Pro Manual

Chapter 17 - Error messages

WAGO-I/O-PRO 32 17-1

17 Error messages

Error messages

Here you will find the error messages that the parser displays (italics) andpossible causes.They are shown in alphabetical order:

Replace the term or the constant with a variable.

A

"A jump must have exactly one label"Change the jump destination to a defined label.

"Address expected after 'AT'"Insert a valid address after the AT or change the keyword AT.

"ADR does not require an expression orconstant or addressed variable asoperand"

Replace the term or the constant with a variable.

"At least one statement is required"Enter an instruction.

"At most 4 numerical fields allowed inaddresses"

Remove the extra address fields.

C

"CAL, CALC, or CALN require functionblock instance as operand"

Declare an instance for the function block that you would like to call up.

"CASE requires selector of an integertype"

Change the selector to an INT type selector.

Page 280: Wago Pro Manual

D

17-2 WAGO-I/O-PRO 32

"Closing bracket with no correspondingopening bracket"

Remove the end bracket or insert the beginning one.

"Comments are only allowed at the endof the line in IL"

Write the comments at the end of the line.

"<Component> is not a component of<variable>"

If the variable is a structure, change the component into one of the componentsthat are declared in this structure.

If the variable is a function block instance, change the <component> into aninput or output parameter that is declared in this function block.

"Conditional Operator requires typeBOOL"

The result of the previous instruction is not a BOOL type variable. Insert anoperator or a function whose result is BOOL.

D

"Duplicate definition of identifier<name>"

Rename one of the identifiers.

"Duplicate definition of label <names>"Remove one of the defined labels.

E

"End value of FOR statement must be oftype INT"

Change the variable to an INT type variable.

"END_STRUCT or identifier expected"A structure definition must end with the keyword END_STRUCT.

Page 281: Wago Pro Manual

Chapter 17 - Error messages

WAGO-I/O-PRO 32 17-3

"END_VAR or identifier expected"Write in valid identifier or END_VAR at the beginning of the declaration part.

"Error in initial value"Enter a constant (constants) for the initial value which corresponds to thedeclaration type.

"EXIT outside a loop"Remove EXIT.

"Expecting Number, ELSE orEND_CASE"

The end of a CASE statement is incorrect. Add the keyword END_CASE.

"Expecting type specification"Write a valid type behind the identification in the declaration

"Expression expected"An expression must be entered at this point.

"Expression in FOR statement is notvariable with write access"

Change the variable to a variable with write permission.

"Extra characters following valid watchexpression"

Remove the extra characters.

F

"Function block call requires functionblock instance"

Insert the name of the desired instance or remove the call for the function block.

"Function name not allowed here"Replace the function call with a variable or a constant.

Page 282: Wago Pro Manual

I

17-4 WAGO-I/O-PRO 32

I

"Identifier <name> not defined"Declare this variable in the declaration part of the POU or in the global variablelist.

"Identifier expected"Enter a valid identifier at the beginning of the declaration part.

"<Identifier> is not a function"Change <identifier> into one of the functions from the libraries that are linkedto the project or into one of the function declared in the project.

"IF and ELSIF require a Booleanexpression for the condition"

Change the expression to an expression with a BOOL type result.

"IL Operator Expected"Change the first word in the line to a valid operator or a valid function.

"Illegal time constants"Check to see if the time constant you wrote is correct and change any mistakesyou find. Possible mistakes are:The t or # is missing at the beginning.A timeentry appears twice (e.g., t#4d2d).

Incorrect sequence of times.Incorrect time indicator (the d, h, m, s or ms ismissing).

"Increment value of FOR statement mustbe of type INT"

Change the variable to an INT type variable.

"Index expression of an array must betype INT"

Change the index into a constant or an INT type variable.

"'[<index]' needs array variables"Declare the identifier before the bracket as an array or change it into a declaredarray variable.

Page 283: Wago Pro Manual

Chapter 17 - Error messages

WAGO-I/O-PRO 32 17-5

"INI operator needs function blockinstance or a data unit type instance"

Change the operands into a function block instance. To do this, declare theoperand as a function block or use a previously declared function block, or usea data unit type instance.

"Integer number or symbolic constantexpected"

Only integers or symbolic constants can be used as the condition for a CASEinstance. Change the incorrect condition.

"Invalid address: <Address>"Check in your PLC Configuration to see which addresses are allowed andreplace the addresses with permissible addresses or change the PLCConfiguration.

"Invalid characters follow the validexpression: '<name>'"

Remove the extra characters.

"It is not possible to locate amultidimensional array to an address"

Clear the address assignment.

"It is not possible to locate an array ofan array to an address"

Clear the address assignment.

"It is not possible to locate an array ofstrings to an address"

Clear the address assignment.

J

"Jump and Return are only allowed onthe right side of a network"

Delete the jump or return that is not allowed.

"Jump and Return require an Booleaninput"

Page 284: Wago Pro Manual

K

17-6 WAGO-I/O-PRO 32

The result of the previous instruction is not a BOOL result. Insert an operator ora function with a result of the type BOOL.

"Jump to an undefined step: <Name>"Change <name> into the name of an existing step or add a step named <name>.

K

"Keywords must be uppercase"Change how the keyword is written.

L

"Label in brackets not allowed"Remove the label or the parentheses.

"<Label> label is not defined"Define a label with the name <LabelName> or change <LabelName> into adefined label.

"LD expected"The instruction "LD" is the only one allowed in this line.

M

"Multiple underscore in identifier"Remove one of the underscore characters from the identifier.

N

"<Name> function has too fewparameters"

Add the missing parameters.

"<Name> is no function block"Replace <name> with the name of a valid function block.

Page 285: Wago Pro Manual

Chapter 17 - Error messages

WAGO-I/O-PRO 32 17-7

"<Name> is not an input variable of thecalled function block"

Check over the input variables for the called function block and change<name> into one of these variables.

"'N' modifier requires a BOOL typeoperand"

Remove the N and negate the operand explicitly with the NOT operator.

"<Name> must be a declared instance ofthe function block <FBName>"

Change the text of the function block instance (initialized with "Instance") intoan identifier for a valid function block instance declaration.

"Name used in interface is not identicalwith POU name"

Rename your POU with the menu command "Project" "Object Rename" orchange the name of the POU in its declaration part. The name must appeardirectly after the keywords, PROGRAM, FUNCTION or FUNCTIONBLOCK.

"'.' needs structure variable."The identifier to the left of '.' is not a structure variable or instance for afunction block. Change the identifier into a structure variable or into a instancefor a function block or remove the period and the identifier to its right.

"No *.obj found"Turn on Simulation Mode.

"No comma allowed after ')'"Remove the comma.

"No instance specied for call of functionblock <name>"

Change the text of the instance for function block <name> (initialized with"Instance") in the identifier of a valid instance declaration.

"No write access to variable <Name>allowed"

Change <name> into a variable with write permission.

Page 286: Wago Pro Manual

O

17-8 WAGO-I/O-PRO 32

"NOT requires an operand of typeBOOL"

Change the operand into a BOOL type operand.

"Number expected after '+' or '-'"Change the word after + or - into a valid constant.

"Number is expected after ','"Remove the comma or insert an additional number.

"<Number> operands is too few for<operator>. At least <number> areneeded"

Check to see how many operands the operator <operator> requires and removethose that aren't needed.

"<Number> operands is too many for<operator>. Exactly <number> areneeded."

Check to see how many operands the operator <operator> requires and insertthe ones that are missing.

O

"Only BOOL variables are allowed at abit address"

Change the type of declaration to BOOL or change the address to a differentformat.

"Only VAR and VAR_GLOBAL can belocated to addresses"

Copy the declaration into a VAR or VAR_GLOBAL area.

"Operand expected"Add an additional operand.

"<Operator> in parentheses is notallowed"

This operator is not allowed within parentheses. Either remove the parenthesesor the operator.

Page 287: Wago Pro Manual

Chapter 17 - Error messages

WAGO-I/O-PRO 32 17-9

"Operator is not extendable. Remove thesurplus operands"

Check the number of operands for this operator and remove the surplusoperands.

"Out of Memory"Leave the system by saving. Close Windows, restart it and then restart thecompilation

"Overflow of identifier list"You must learn to restrain yourself, no more than 64000 identifiers are allowed.

P

"POU <Name> is not defined in theproject"

Define a POU named <name> using the menu command "Project" "Objectadd" or change the name to the name of the POU defined.

"POU <Name>needs exactly <number>inputs"

Check the number of input variables this POU requires, then add or removethem as needed.

"POU ends incorrectly: add ST or deletethe last expression."

The POU ends with an incomplete expression. Add the correct ending or deleteit.

S

"Start value of FOR statement must be oftype INT"

Change the variable to an INT type variable.

"Step name is no identifier: <name>"Change the identifier <name> to a valid identifier.

"Step names are duplicated: '<Name>'"

Page 288: Wago Pro Manual

T

17-10 WAGO-I/O-PRO 32

Change one of the names.

"<string> is not an operator"Change <string> into a valid operator.

T

"Too few indices for array"Check how many indices are declared for the array (1, 2, or 3) and add thosethat are needed.

"Too many indices for array"Check how many indices are declared for the array(1, 2, or 3) and remove theextra ones.

"Too many parameters in function<Name>"

Delete the extra parameters.

"Type mismatch in parameter <name>of <name>: Cannot convert <Type1>into <Type2>."

Use a <Type2> type variable for the assignment to the <name> parameter orchange the type of assigned variable to <Type1>.

"Type mismatch in parameter<number>: Cannot convert <type> to<type>."

Check the type of the operand with the number <number> of this operator,function or function block. Change the type of the variable that caused the errorto a type that is allowed or select a new variable of an allowed type.

"Type mismatch in parameter<Parameter> of <POU>: Cannotconvert <Type1> into <Type2>."

Check to see what type of <parameter> parameter are required in the <POU>POU. Change the type of the variable that caused the error to <Type2> or selectanother variable that is <Type2>.

Page 289: Wago Pro Manual

Chapter 17 - Error messages

WAGO-I/O-PRO 32 17-11

"Type mismatch on input _1_variable<name>: Cannot convert <Type1> into<Type2>."

A value that is <Type2> (which is not allowed) is assigned to the variable<name>. Change the variable or the constant into a variable or constant of thetype <Type1>.

"Type mismatch: Cannot convert<Type1> into <Type2>."

Check the required types of operators (search for Operator in your help file) andchange the variable type that produced the error into a type that is allowed orselect another variable.

U

"Unexpected end of text in brackets"Insert an end bracket.

"Unexpected End"In the declaration part: Add the keyword END_VAR to the end of thedeclaration part.

In the text editor: Insert instructions that end the last instruction sequence (e.g.,ST).

Page 290: Wago Pro Manual

V

17-12 WAGO-I/O-PRO 32

"Unknown type: <string>"Change <string> into a valid type.

"Unrecognized variable or address"This watch variable is not declared in the project. Press <F2> to access helpwith declared variables.

"UNTIL requires a BOOL expression ascondition"

Change the expression to an expression with a BOOL type result.

V

"VAR, VAR_INPUT, VAR_OUTPUT orVAR_INOUT expected"

The first line after the name of the POU must contain one of these keywords.

"Variable of FOR statement must be oftype INT. "

Change the variable to an INT type variable.

"Variable with write access or directaddress required for ST, STN, S, R"

Replace the first operand with a variable that has write permission.

W

"WHILE requires a Boolean expressionas its condition"

Change the expression to an expression with a BOOL type result.

Rename your POU with the menu command "Project" "Object Rename" orchange the name of the POU in its declaration part. The name must appeardirectly after the keywords, PROGRAM, FUNCTION or FUNCTIONBLOCK.

Page 291: Wago Pro Manual

Chapter 18 – Quick Start

WAGO-I/O-PRO 32 18-1

18 Quick Start

Task

To assist you to quickly start programming with WAGO-I/O-PRO 32 thefollowing will show you how to create, test and print out a small program.Following this you can change and extend this program in accordance with yourown ideas.

The following links are to be made:

Output Q0.1 is TRUE, when the inputs I0.1 and I0.2 are TRUE or if input I0.3is TRUE. These relationships are represented in the following table, wherebythe inputs and outputs are assigned to variables.

IN1 AT %IX0.1 IN2 AT %IX0.2 IN3 AT %IX0.3 OUT1 AT %QX0.1

FALSE FALSE FALSE FALSE

TRUE FALSE FALSE FALSE

FALSE TRUE FALSE FALSE

TRUE TRUE FALSE TRUE

FALSE/TRUE FALSE/TRUE TRUE TRUE

In addition a small visualisation will be created, where the variables are to besymbolised by various geometric elements.

Start

This is how WAGO-I/O-PRO 32 is started:

���� Click on "Start" in the Windows task bar to open the "Start" menu.

���� In the "Start" menu select the "Program" option, to open the"Program" folder.

���� To open the "WAGO-I/O-PRO 32*" folder select "WAGO-I/O-PRO32*".

���� Click on the link "WAGO-I/O-PRO 32 V2.1 English", to open the"WAGO-I/O-PRO 32" program.

* or the name you have selected

Page 292: Wago Pro Manual

Start

18-2 WAGO-I/O-PRO 32

After the first start of WAGO-I/O-PRO 32 the following dialog appears on themonitor for controller selection:

Image 18.1: Dialog box "Controller Selection"

���� Mark the coupler to be used in test with the mouse.

(In this example the MODBUS-Controller 750-815 is used.)

���� Conclude the entry with "OK".

If a controller has already been selected and you want to change the setting, theabove dialog can be reached via the "Object Organizer". For this click on the"PLC Configuration" in the "Resources" register card.

Image 18.2: Object Organizer, register "Resources"

Page 293: Wago Pro Manual

Chapter 18 – Quick Start

WAGO-I/O-PRO 32 18-3

PLC_PRG

���� Open a new project by clicking the menu point "New" under "File".

The following dialog now appears for selecting the type and programminglanguage of the POU PLC_PRG:

Image 18.3: Dialog box "New POU"

This POU is already pre-defined and must not be renamed. This is the mainprogram and must be present in every project, in which no task configuration isused. The POU is called up precisely once per control cycle.

���� Select the programming language "Ladder Diagram" (LD).

The editing window for this POU appears after acknowledging with "OK".

Image 18.4: PLC_PRG, not yet programmed

The above window section includes the declaration section. Here the variabledeclaration is automatically entered when programming. The declarationsection is shown in the example as a list. A possible alternative is a tabledisplay.

The variables links are created in the lower half of the window (body). Thefollowing buttons are required for editing the links:

Image 18.5: Buttons for linking in a ladder diagram

Page 294: Wago Pro Manual

PLC_PRG

18-4 WAGO-I/O-PRO 32

���� Using the left hand mouse key press on the "Contact" button to createthe first link.

The first contact is shown in the network.

���� Replace the question marks above the contact by IN1 (1st variable).Mark the network by actuating the left hand mouse key.

���� Repeat this procedure accordingly to link the second variable IN2

���� Click the "Parallel Contact" button to link the third variable (IN3) andenter the variables designation.

���� Click on the "Coil" button and write OUT1 to replace the questionmark.

Following each entry of a not yet declared variable a dialog is displayed askingfor its declaration:

Image 18.6: Dialog box "Variables declaration"

The variables are already declared as local variables (VAR) with the data typeBOOL.

���� Enter the attendant addresses with a preceding percent symbol. Theseaddresses can be obtained from the task table.

Image 18.7: PLC_PRG with variables declaration and rump

���� Click on the "Project" "Check" menu point to check the program.

This activates the program check. Formal errors are displayed in a messagewindow.

���� Save the program created to date under "File" "Save", in the samemanner as familiar under other WINDOWS applications.

Page 295: Wago Pro Manual

Chapter 18 – Quick Start

WAGO-I/O-PRO 32 18-5

Following this a visualisation can be created or this can be skipped andcontinued with the simulation of the PLC_PRG.

Visualization

���� Click in the "Object Organizer" on the register card "Visualization"and select the menu point "Add..." under "Project".

Image 18.8: Object Organizer, register "Visualization"

Following this a dialog appears for a new visualization.

Image 18.9: Dialog box "New Visualization"

���� Enter a name, e.g. "Graphic" and close the entry with "OK".

Following this open an editing window in which the visualization can becreated. Here various geometric elements are available, e.g. rectangle andellipse.

���� Click on the "Insert" menu point and select "Ellipse". If you now clickin the editing window and move the mouse pointer with the left handmouse key pressed, a circle can be generated at the desired size. Thiselement will later be allocated the variable IN1.

Page 296: Wago Pro Manual

Visualization

18-6 WAGO-I/O-PRO 32

Image 18.10: Editing window for visualization

���� Double click on the circle. A dialog opens "Regular ElementConfiguration".

In this dialog the element can be allocated various functions.

���� Select the menu point "Text" under "Category".

���� Enter IN1 under "Content".

This text appears later in the circle created.

Image 18.11: Dialog box editing visualization, categorie "Text"

���� Select the element fill colour for the condition display of the variableIN1 under "Color".

IN1 = FALSE => "Color" => white

IN1 = TRUE => "Alarm color" => blue

Image 18.12: Dialog box editing visualization, categorie "Color"

Page 297: Wago Pro Manual

Chapter 18 – Quick Start

WAGO-I/O-PRO 32 18-7

Image 18.13: Dialog box "Color"

���� Enter the variable PLC_PRG.IN1 under the menu point "Variables""Change color".

In the case of a condition change of the variable IN1 from FALSE to TRUE andvice versa the element colour change is made in run mode.

Image 18.14: Dialog box editing visualization, categorie "Variables"

���� Enter the variable PLC_PRG.IN1 under the menu point "Input""Toggle variable".

Each time the circle is clicked the status of the variable IN1 changes fromFALSE to TRUE and vice versa.

Image 18.15: Dialog box editing visualization, categorie "Input"

���� Conclude the configuration entries with "OK".

Page 298: Wago Pro Manual

Visualization

18-8 WAGO-I/O-PRO 32

���� Copy the configured element three times and distribute the generatedelements in the editing window. Then double click on the first copy andchange all entries of configuration IN1 to IN2. Proceed accordingly forthe second and third copy.

���� Arrange the variables IN3 and IN4 in a different form.

���� Using the "Shape" menu point assign the variable IN3 a rounded offrectangle and the variable Out1 a rectangle.

Image 18.16: Dialog box editing visualization, categorie "Shape"

Image 18.17: Editing window for visualization object

���� Activate a program check and save the project.

Page 299: Wago Pro Manual

Chapter 18 – Quick Start

WAGO-I/O-PRO 32 18-9

Simulation mode

Make the program test in simulation mode first. Here a fieldbus node withprogrammable fieldbus controller and bus modules is not necessary.

���� Click in "Object Organizer" in the register card "POU" on the POU"PLC_PRG" as well as in the register card "Visualization" "Graphic"and display the corresponding editing windows.

The online commands available are combined in the menu bar under "Online".

���� Select the "Simulation Mode" in this menu point and then "Login"under this menu point.

���� To start the program processing click on "Run".

A corresponding message ("ONLINE, SIM, RUN") appears in the bottom lineof the picture.

Image 18.18: Simulation PLC_PRG and Graphic

If a variable is FALSE, the interior of the allocated contact symbol will bewhite. If TRUE, it will be shown blue.

By double clicking on the elements for IN1, IN2 and IN3 the allocated variablesare alternately set or reset. The elements are shown white or blue. The colour ofthe element for OUT1 is dependent upon the links condition.

Page 300: Wago Pro Manual

Control mode

18-10 WAGO-I/O-PRO 32

Control mode

Following the test in simulation mode the program created should first be testedon a programmable fieldbus controller.

The fieldbus nodes in the example comprise of the following units:

• 1 off programmable fieldbus contoller (MODBUS) 750-815

• 1 off digital input module 750-402

• 1 off digital output module 750-504

• 1 off end module 750-600

• 1 off communication cable 750-920

(The communication cable is a component part of the WAGO programmingtools IEC 1131-3)

Image 18.19: MODBUS Controller with digital inputs and outputs

���� Supply the fieldbus node with 24V DC (see MODBUS manual).

���� Connect the COMX interface of your PC to the communication interfaceof the controller. Use the WAGO communication cable for this purpose.

���� Click the "Simulation" menu point under "online".

The previously displayed check mark is hidden.

Page 301: Wago Pro Manual

Chapter 18 – Quick Start

WAGO-I/O-PRO 32 18-11

Communication between WAGO-I/O-PRO 32 and the controller is via theWAGO-I/O-PRO 32 Server (Gateway). The communication driver is requiredfor serial data transfer. This driver and its parameterization are entered in the"Communication Parameters" dialog.

���� To call up this dialog, click on the "Communication Parameters"menu point under "Online".

In its basic setting there are no entries in this dialog.

Image 18.20: Dialog box "Communikation parameters" without drivers

���� Click on "New" to select a new channel for the driver.

The "Communication Parameters: New Channels" dialog appears:

Image 18.21: Dialog box for driver selection

���� Mark the "Serial (RS232)" driver in the selection window to configurethe serial connection between PC and controller.

���� Enter the driver name above the selection window and click on "OK" toconclude the selection.

The "Communication Parameters" dialog appears again.

Page 302: Wago Pro Manual

Control mode

18-12 WAGO-I/O-PRO 32

Image 18.22: Dialog box "Communikation Parametesr", with drivers and parameters

The serial driver (RS232) is now entered below the minus character in the"Channels" field. In the field to the right the values of the communicationparameter for the selected driver are displayed. These values correspond to thedefault setting of the MODBUS controller. For these reason they need not bechanged.

���� Click on "OK" to take over the driver and its parameter values.

The controller test can now start. (For this the operating mode switch of thecontrollers must be in the middle or upper setting. The address switch is on"00".)

���� Click the "Loggin" menu point under "Online" to log into thecontroller.

(The WAGO-I/O-PRO 32 Server is active during on-line operation. Thecommunication parameters cannot be polled.)

As there is still no program in the controller, you will be asked whether theprogram should be loaded.

���� Acknowledge with "Yes".

Following this the current program will be loaded.

���� Once the program is loaded, start the program processing with"Online" "Run".

"ONLINE RUN" is signalled on the right end of the status bar.

Once voltage (+24V) is applied to the inputs this can be seen in the PLC_PRGwindow or the graphic by the blue coloured contacts or geometrical elements.Clicking the geometrical element, however, no longer leads to a status changeof the variables.

���� End the online operation with the "Online" "Logout" menu point.

Page 303: Wago Pro Manual

Chapter 18 – Quick Start

WAGO-I/O-PRO 32 18-13

Documentation

Following this it is necessary to parameterize the documentation for this projectand print it out. This can only be performed in off-line mode.

���� Select the command "Printer Setup" in the "File" menu.

The "Documentation Setup" dialog is opened. Using this dialog the layout ofthe pages to be printed can be defined.

Image 18.23: Dialog box "Documentation Setup"

���� Enter the following path with the name of the print file in the File field:

C:/Programs/WAGO-IO-PRO 32/WORK/QUICK_START.DFR

(As standard the documentation is saved in the DEFAULT.DFR file.)

���� Click on "Edit", to open the documentation page layout.

Here you can enter the number of pages, date, file and POU name, as well asposition graphics on the pages and lay down the text area in which thedocumentation is to be printed.

���� Select the "Placeholder" menu under "Insert".

You then receive a selection of the following placeholders:

• Page actual number of pages

• POUName current POU

• FileName project name

• Date current date

• Content content of current POU

���� Click on a placeholder, e.g. Page.

���� Pull a rectangle in the editing window with the left hand mouse keypressed and position at the required position.

In addition you can create text fields for free text input, e.g. for company namesand addresses.

���� For this click on the "Insert""Rectangle" menu point. Pull acorrespondingly large field and select a dialog for text entry by doubleclicking.

In addition a Bitmap graphic can be inserted in the page using the "Insert" "Bitmap" menu point, e.g. a company logo.

Page 304: Wago Pro Manual

Documentation

18-14 WAGO-I/O-PRO 32

Image 18.24: Page Layout

���� Close the window.

You are asked in a dialog whether you want to save the entries.

���� Click on "Yes".

���� To print out the project click on "Project" "Document..."

The following dialog appears:

Image 18.25: Dialog box "Document Project"

���� Select the POU to be printed with the mouse.

The dialog to be printed is shown after acknowledging with "OK".

���� Continue with printing in the familiar manner for WINDOWS.

Page 305: Wago Pro Manual

Chapter 19 � Compliance List

WAGO-I/O-PRO 32 19-1

19 Compliance List

Tables

Conformance of WAGO-I/O-PRO 32 Version 2.1 with IEC 61131-3.The following tables show the current status of WAGO-I/O-PRO 32 Version 2.1. Missingfeatures will be added during to the further development of WAGO-I/O-PRO 32. The numbersin the first column of the table refer to the first edition of the standard released in March 1993.The description in the first line of a table section refers to the whole section in most cases.

Table � No. Description WAGO-I/O-PRO 32 Remarks1-1 character set yes1-2 lower case letters yes1-3a yes in binary, octal- and

hexadecimal constants1-3b - except in comments and

strings1-4a yes as quote in strings1-4b - except in comments and

strings1-5a - except in comments and

strings, because the graphiceditors are not characterbased

1-5b - except in comments andstrings

1-6a yes1-6b -2-1 identifier yes2-2 yes2-3 yes3-1 comments yes4-1 numeric constants yes4-2 yes4-3 yes4-4 yes4-5 yes4-6 yes4-7 yes4-8 yes5-1 string constants yes6-2 non printable characters yes6-3 yes6-4 yes6-5 yes becomes "\n"6-6 yes6-7 yes6-8 yes7-1a duration constants yes7-1b yes

Page 306: Wago Pro Manual

19-2 WAGO-I/O-PRO 32

7-2a yes7-2b yes8-1 date and time yes8-2 yes8-3 yes8-4 yes8-5 yes8-6 yes10-1 BOOL yes10-2 SINT yes10-3 INT yes10-4 DINT yes10-5 LINT no10-6 USINT yes10-7 UINT yes10-8 UDINT yes10-9 ULINT no10-10 REAL yes10-11 LREAL yes10-12 TIME yes10-13 DATE yes10-14 TIME_OF_DAY yes10-15 DATE_AND_TIME yes10-16 STRING yes10-17 BYTE yes10-18 WORD yes10-19 DWORD yes10-20 LWORD no12-1 derived data types yes12-2 yes12-3 no12-4 yes12-5 yes14-1 initialising of derived data types yes14-2 yes14-3 no14-4 no14-5 yes14-6 no15-1 direct addresses yes15-2 yes15-3 yes15-4 yes15-5 yes15-6 yes15-7 yes15-8 yes15-9 no16-1 VAR yes16-2 VAR_INPUT yes16-3 VAR_OUTPUT yes16-4 VAR_IN_OUT yes16-5 VAR_EXTERNAL - not necessary because all

global variables areaccessible in every POU,without further declaration

Page 307: Wago Pro Manual

Chapter 19 � Compliance List

WAGO-I/O-PRO 32 19-3

16-6 VAR_GLOBAL yes16-7 VAR_ACCESS no16-8 RETAIN yes16-9 CONSTANT yes16-10 AT yes17-1 declaration of variables no17-2 no17-3 yes17-4 yes array of Bool are not packed!17-5 yes17-6 yes17-7 yes17-8 yes18-1 initial value assignment no18-2 no18-3 yes18-4 yes array of BOOL is not packed!18-5 yes18-6 yes18-7 yes18-8 yes18-9 yes19-1 negation of inputs yes19-2 negation of outputs yes20-1 EN/ENO no20-2 yes in free FBD/ not in structure

based FBD20-3 yes21-1 overloading yes Operators (+, - , AND, OR

etc.) are overloaded.21-2 no There are no typed version of

operators. All standard- anduser functions are typed.

22-1 type conversation yes REAL_TO_INT rounds to thenearest integer, whereasREAL_TO_INT(x.5) isequivalent to x+1

22-2 TRUNC() yes22-3 BCD_TO_INT no22-4 INT_TO_BCD no23-1 ABS yes23-2 SQRT yes23-3 LN yes23-4 LOG yes23-5 EXP yes23-6 SIN yes23-7 COS yes23-8 TAN yes23-9 ASIN yes23-10 ACOS yes23-11 ATAN yes24-12 ADD yes24-13 MUL yes24-14 SUB yes24-15 DIV yes24-16 MOD yes

Page 308: Wago Pro Manual

19-4 WAGO-I/O-PRO 32

24-17 EXPT yes the usage of "**" as operatoris not supported

24-18 MOVE yes25-1 SHL yes25-2 SHR yes25-3 ROR yes25-4 ROL yes26-5 AND yes26-6 OR yes26-7 XOR yes26-8 NEINT yes27-1 SEL yes27-2a MAX yes as operator (only two

parameters)27-2b MIN yes as operator (only two

parameters)27-3 LIMIT yes27-4 MUX yes28-5 GT yes only two operands28-6 GE yes only two operands28-7 EQ yes only two operands28-8 LE yes only two operands28-9 LT yes only two operands28-10 NE yes only two operands29-1 LEN yes29-2 LEFT yes29-3 RIGHT yes29-4 MID yes29-5 CONCAT yes29-6 INSERT yes29-7 DELETE yes29-8 REPLACE yes29-9 FIND yes30-1 date and time functions yes30-2 no30-3 no30-4 yes30-5 no30-6 no30-7 no30-8 no30-9 no30-10 no30-11 no30-12 no30-13 no30-14 no31-1 Functions of enumeration types yes31-2 yes31-3 yes31-4 yes33-1 function blocks yes33-2 yes33-3 yes33-4a yes33-4b yes

Page 309: Wago Pro Manual

Chapter 19 � Compliance List

WAGO-I/O-PRO 32 19-5

33-5a yes33-5b yes33-6a yes33-6b yes33-7a yes33-7b yes33-8a no33-8b no33-9a no33-9b no34-1 SR yes34-2 RS yes34-3 SEMA yes35-1 R_TRIG yes35-2 F_TRIG yes36-1 CTU yes36-2 CTD yes36-3 CTUD yes37-1 TP yes37-2a TON yes37-2b T---0 no37-3a TOF yes37-3b 0---T no37-4 RTC yes39-1..9b program declaration - like 33-1..9b39-10 no39-11..14 - see 17-1..439-15-18 - see 18-1..439-19 yes39-20 no39-21 no40-1 SFC steps yes40-2 yes via import, not in editor.40-3a - in non-IEC-Steps access to

step flag by step name40-3b yes not in simple steps40-4 yes not in simple steps41-1 transitions yes in separate window41-2 yes in separate window41-3 yes in separate window41-4a no41-4b no41-5 yes in separate window or via

import41-6 yes in separate window or via

import41-7a yes41-7b yes41-7c yes41-7d yes42-1 actions yes42-2l yes42-2s yes42-2f yes42-3s yes42-3i yes

Page 310: Wago Pro Manual

19-6 WAGO-I/O-PRO 32

43-1 step-action association yes43-2 yes43-3 yes via import, not in editor43-4 yes in separete window, N

modifier is implicitly used,name of action is the same asname of step

44-1 action blocks yes44-2 yes44-3 no44-4 actions programmed in IL yes in separate window44-5 actions programmed in ST yes in separate window44-6 actions programmed in LD yes in separate window44-7 actions programmed in FBD yes in separate window44-8 usage of actions in LD no44-9 usage of actions in FBD no45-1 action qualifier yes45-2 yes45-3 yes45-4 yes45-5 yes45-6 yes45-7 yes45-8 yes45-9 yes45-10 yes46-1 sequence evolution yes46-2a yes46-2b no46-2c yes46-3 yes46-4 yes46-5a yes46-5b no46-5c yes46-6a yes using jump46-6b no46-6c yes using jump46-7 no49-1 configuration and resources no49-2 no49-3 no49-4 no49-5a no49-5b no49-6a no49-6b no49-6c no49-7 no49-8a no49-8b no49-9a no49-9b no49-10a no49-10b no49-10c no

Page 311: Wago Pro Manual

Chapter 19 � Compliance List

WAGO-I/O-PRO 32 19-7

49-10d no49-10e no49-10f no50-1a tasks yes50-1b yes50-2a no50-2b no50-3a yes50-3b yes50-4a no50-4b no50-5a yes51 instruction list fields yes52-1 instruction list operators yes52-2 yes52-3 yes52-4 yes52-5 no52-6 yes52-7 yes52-8 yes52-9 yes52-10 yes52-11 yes52-12 yes52-13 yes52-14 yes52-15 yes52-16 yes52-17 yes52-18 yes52-19 yes52-20 yes52-21 yes53-1 function block invocation in IL yes53-2 yes53-3 no54-4 function block input operators no54-5 no54-6 no54-7 no54-8 no54-9 no54-10 no54-11 no54-12 no54-13 no55-1 operators in ST yes55-2 yes55-3 no55-4 yes55-5 yes55-6 yes55-7 yes55-8 yes55-9 yes

Page 312: Wago Pro Manual

19-8 WAGO-I/O-PRO 32

55-10 yes55-11 yes55-12 yes55-13 yes55-14 no55-15 yes55-16 yes55-17 yes56-1 statements in ST yes56-2 yes56-3 yes56-4 yes56-5 yes56-6 yes56-7 yes56-8 yes56-9 yes56-10 yes57-1 graphical languages no57-2 yes57-3 no57-4 yes57-5 no57-6 yes in free FBD57-7 no57-8 yes in free FBD57-9 no57-10 yes57-11 no57-12 yes57-13 no57-14 yes in free FBD58-1 graphic execution control (Jump

and Return)yes

58-2 yes58-3 yes58-4 yes58-5 yes58-6 yes58-7 yes58-8 yes59-1 powerrail yes59-2 yes60-1 LD link elements yes60-2 yes61-1 contacts yes61-2 yes61-3 yes61-4 yes61-5 no61-6 no61-7 no61-8 no62-1 coils yes62-2 yes62-3 yes

Page 313: Wago Pro Manual

Chapter 19 � Compliance List

WAGO-I/O-PRO 32 19-9

62-4 yes62-5 no62-6 no62-7 no62-8 no62-9 no

Page 314: Wago Pro Manual

19-10 WAGO-I/O-PRO 32

Page 315: Wago Pro Manual

Chapter 19 � Compliance List

WAGO-I/O-PRO 32 19-11

Implementation dependent Parameters

Clause Description WAGO-I/O-PRO 322.1.1 National characters used '$' ad '#' is used. Using '!' or '|' in graphical

languages is not necessary (full graphic).

2.1.2 Maximum length of identifiers no limitation

2.1.5 Maximum length of comments no limitation

2.2.3.1 Range of duration 2^32 ms = 49,71 days

2.3.1 Range of TIME variables 2^32 ms = 49,71 days

Range of TIME_OF_DAY variablesRange of DATE_AND_TIME variables

1970-01-01-00:00 � 2106-02-06-06:28:151970-01-01 � 2106-02-06

2.3.3 Maximum numbers of array subscript 3

Maximum number of structure elements no limitation

Maximum numbers of variables perdeclaration

no limitation

2.3.3.1 Maximum number of enumerated values not supported

2.3.3.2 Default maximum length of string variables 80 characters

Maximum allowed length of String variables 255 characters

2.4.1.1 Maximaum numbers of hierachial levels 4

Logical or physical mapping physical mapping

2.4.1.2 Maximum number of subscripts 3

Maximum range of subscripts 64 KB

Maximum number of levels of structures no limitation

2.4.3 Maximum number of variables perdeclaration

no limitation

2.5 Information about execution time of POUs not supported

2.5.1.1 Method of function represenation Name

2.5.1.5 Maximum number of inputs of extensiblefunctions

no limitation

2.5.2.3.3 Pvmin of counters -32 768

Pvmax of counters +32 767

2.5.3 Program size limitations 32 KB

2.6.2 Precision of step elapsed time 1 ms

Maximum number of Steps per SFC no limitation

2.6.3 Maximum number of transitions per Stepand per SFC

no limitation

2.6.4 Action control mechanism In simple Steps an action is executed everycycle, when its step is activeIn IEC-Steps, the execution of an actiondepends on the result of the call of its actioncontrol block

Page 316: Wago Pro Manual

19-12 WAGO-I/O-PRO 32

2.6.4.2 Maximum number of action blocks persimple stepMaximum number of action blocks perIEC_Step

1

10

2.6.5 Graphic indication of step state Step becomes blue

Transition clearing time Within on controller cycle

Maximum width of convergence/divergenceconstruts

no limitation

2.7.1 Contens of RESOURCE libraries Not supported

2.7.2 Tasks Tasks are supported with premptive or non-premptive scheduling, depending on thetarget.Tasks are enabled by an event or by a timerand can be ordered by priority (0-31).

3.3.2.3 Maximum number of CASE selections no limitation

3.3.2.4 Value of control variable upon termination ofFOR loop

One step behind the upper limit.

4.1.1 Graphic representation Full graphics

Restrictions of network topology in structurebased FBD

Only Expression "Trees" allowed withmultiple intermediate results. That means nosplitting of output lines, except for assigningit to a result.No restrictions on network topology in freeFBD.

4.1.3 Evaluation order of feedback loops In structure based FBD, explicit loops arenot supported by topology. In implicit loopsthe evaluation order is defined by the user.

In free FBD, explicit loops are supported.The evaluation order is defined by the user,whereas the user can define topologicalevaluation order (from left to right, from topto bottom) or data flow evaluation order(from inputs to outputs).

Page 317: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 A-1

Appendix A: Additional Libraries

Installation

The additional libraries are on the WAGO-I/O-PRO 32 CD.

The installation program is started from the D drive in the followinginstructions. In case you would like to use another drive, please enter thecorresponding letter.

To install additional libraries:

1. Put the WAGO-I/O-PRO 32-CD in the D drive.

2. In case "Autoplay" is selected in your system the set-up will be startedautomatically. Proceed with step 6.

If the set-up is not starting automatically please proceed with step 3.

3. Select "Execute" in the Windows "Start" menu

4. Start the WAGO-I/O-PRO 32 set-up.

5. Enter "D:\setup.exe" (D is the drive with the WAGO-I/O-PRO-32-CD) and start the set-up by clicking on "OK".

6. Select the set-up language.

The rest of the set-up is taking place via menus. Please follow the instructionsto complete the set-up. If possible the proposed settings should be adopted.

You will be asked for the set-up type during the installation.

���� Click on "Additional libraries installation" and confirm with "Next".A dialog appears to select the libraries.

���� Select the components you would like to install and delete the ones youwouldn�t like to install.

Page 318: Wago Pro Manual

A-2 WAGO-I/O-PRO 32

Page 319: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 A-3

Contents

Fbusconf.lib*InterBusS.lib*Mod_com.lib*Standard.lib*System.lib*

*These libraries are ready installed in WAGO-I/O-PRO 32.

Page 320: Wago Pro Manual

A-4 WAGO-I/O-PRO 32

Page 321: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 Fbusconf A-1

WAGO-I/O-PRO 32 Library

Fbusconf.lib

Contents

FbusConf_Version .......................................................................................3FieldbusConfiguration..................................................................................4ReadFieldbusConfiguration .........................................................................7

Page 322: Wago Pro Manual

A-2 Fbusconf WAGO-I/O-PRO 32

Page 323: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 Fbusconf A-3

FbusConf_Version

WAGO-I/O-PRO 32 Library elementsCategory: Controller ConfigurationName: FbusConf_VersionType: Function X Function block ProgramLibrary name: Fbusconf.libApplicable to: 750-812, 750-814, 750-815 and 750-816

(all MODBUS Controllers)

Input parameter: Data type: Comments:EN BOOL A TRUE at this input activates this

function.

Return value: Data type: Comments:VERSION WORD Library version

Graphic display:

Time behaviour:

EN

FbusConf_Version

Function description:

The FbusConf_Version function feeds back the current version number of the library.This function can be used during program development for information purposes. Inaddition, version related conflicts can be avoided during the running time.

Page 324: Wago Pro Manual

FieldbusConfiguration

A-4 Fbusconf WAGO-I/O-PRO 32

FieldbusConfiguration

WAGO-I/O-PRO 32 Library elementsCategory: Controller configurationName: FieldbusConfigurationType: Function Function block X ProgramLibrary name: Fbusconf.libApplicable to: 750-812, 750-814, 750-815 und 750-816

(all MODBUS controllers)

Input parameter: Data type: Comments:STARTWORKING BOOL A TRUE at this input activates the function

block. It is only performed once. Ifparameters are to be changed severaltimes, the FB can be set several timesfrom FALSE to TRUE.

BAUDRATE WORD Table index for the baud rate. [0..7]BYTEFRAME WORD Table index for parity and number of stop

bits. [0..3]DATALENGTH BOOL TRUE = 7 Bit, FALSE = 8 Bit

ENDOFFRAMETIME WORD Table index for recognising the end of atelegram (END of Frame). [0..7]

ASCIIRTUMODE BOOL TRUE = RTU Mode,FALSE = ASCII Mode

ERRORCHECKING BOOL TRUE = Protocol check activated, FALSE= protocol check is not required (ErrorCheck) Note: the check sum must betransmitted, even with false values.

EXTENDEDFUNCTIONS

BOOL TRUE = Access to the extended parameteris possible,FALSE = access is protected.

NOWATCHDOG BOOL TRUE = Watchdog cannot be activated,FALSE = Watchdog can be activated.

Output parameter: Data type: Comments:RESULT BOOL TRUE as soon as the function block is

started. Becomes FALSE if the parameterswere already set.

Page 325: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 Fbusconf A-5

Graphical display:

Time behaviour:

STARTWORKING

Parameter

RESULT

Function description:

This function block allows the programmer to configure the modbus interface. Asopposed to the 750-3xx Modbus coupler the parameters are set here by means offunction blocks. The parameters correspond to the setting of the Dil switches.Special SW Tools are no longer necessary. If the function block is also recorded inthe user program, the automatic configuration is performed even following acontroller change over. The settings are taken over in the controller parameter block.If the required parameters are not already set, a software reset is automaticallymade in Bus operation and the controller restarts with the selected parameters. Thefunction can be appended to the PLC cycle and is performed only once with aconstantly applied TRUE at the INPUT STARTWORKING.

If the controller is only to be configured once independent of the machineconfiguration, a program comprising of only one POU can be downloaded from theprogramming system and started. A software reset is not performed when operatingon the programming system.

Page 326: Wago Pro Manual

FieldbusConfiguration

A-6 Fbusconf WAGO-I/O-PRO 32

Baud rate:750-812,750-814

Baud rate:750-815,750-816

BAUDRATEvalue

150 Bd 38400 Bd 0300 Bd 57600 Bd 1600 Bd 115200 Bd 21200 Bd 1200 Bd 32400 Bd 2400 Bd 44800 Bd 4800 Bd 59600 Bd 9600 Bd 619200 Bd 19200 Bd 7

Byte Frame Datalength

Stopbits

DATALENGTHvalue

BYTEFRAMEvalue

no Parity 8 bit 1 FALSE 0even Parity 8 bit 1 FALSE 1odd Parity 8 bit 1 FALSE 2no Parity 8 bit 2 FALSE 3no Parity 7 bit 2 TRUE 0even Parity 7 bit 1 TRUE 1odd Parity 7 bit 1 TRUE 2no Parity 7 bit 3 TRUE 3

End of Frame ENDOFFRAMETIMEValue

3 x ByteframeTime

0

100 ms 1200 ms 2500 ms 31 s 41 ms 510 ms 650 ms 7

Page 327: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 Fbusconf A-7

ReadFieldbusConfiguration

WAGO-I/O-PRO 32 Library elementsCategory: Controller configurationName: ReadFieldbusConfigurationType: Function Function block X ProgramLibrary name: Fbusconf.libApplicable to: 750-812, 750-814, 750-815 und 750-816

(all MODBUS controllers)

Input parameter: Data type: Comments:EN BOOL A TRUE at this input activates the function

block.

Output parameters: Data type: Comments:BAUDRATE WORD Table index for the baud rate. [0..7]BYTEFRAME WORD Table index for parity and number of stop

bits. [0..3]DATALENGTH BOOL TRUE = 7 Bit, FALSE = 8 BitENDOFFRAMETIME WORD Table index for end recognition of a

telegram (END of Frame). [0..7]ASCIIRTUMODE BOOL TRUE = RTU Mode,

FALSE = ASCII ModeERRORCHECKING BOOL TRUE = Protocol check activated, FALSE

= a protocol check is not made (ErrorCheck) Note: the check sum must in allcases be transmitted, even with falsevalues.

EXTENDEDFUNCTIONS

BOOL TRUE = access is possible to the extendedparameters,FALSE = access is prohibited.

NOWATCHDOG BOOL TRUE = Watchdog cannot be activated,FALSE = Watchdog can be activated.

Page 328: Wago Pro Manual

ReadFieldbusConfiguration

A-8 Fbusconf WAGO-I/O-PRO 32

Graphic display:

Time behaviour:

EN

Result

Function description:

This function block reads the current configuration of the MODBUS interface.

Baud rate:750-812,750-814

Baud rate:750-815,750-816

BAUDRATEValue

150 Bd 38400 Bd 0300 Bd 57600 Bd 1600 Bd 115200 Bd 21200 Bd 1200 Bd 32400 Bd 2400 Bd 44800 Bd 4800 Bd 59600 Bd 9600 Bd 619200 Bd 19200 Bd 7

Page 329: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 Fbusconf A-9

ByteFrame

Datalength

Stopbits

DATALENGTHvalue

BYTEFRAMEvalue

no Parity 8 bit 1 FALSE 0evenParity

8 bit 1 FALSE 1

oddParity

8 bit 1 FALSE 2

no Parity 8 bit 2 FALSE 3no Parity 7 bit 2 TRUE 0evenParity

7 bit 1 TRUE 1

oddParity

7 bit 1 TRUE 2

no Parity 7 bit 3 TRUE 3

End ofFrame

ENDOFFRAMETIMEValue

3 x ByteframeTime

0

100 ms 1200 ms 2500 ms 31 s 41 ms 510 ms 650 ms 7

Page 330: Wago Pro Manual

A-10 Fbusconf WAGO-I/O-PRO 32

Page 331: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 InterBusS.lib A-1

WAGO-I/O-PRO 32 Library

InterBusS.lib

Contents

IBS_READ_CONFIGURATION................................................................3IBS_READ_PI_CONFIGURATION ..........................................................5IBS_SET_PI_CONFIGURATION ............................................................10INTERBUS_VERSION.............................................................................15Appendix ....................................................................................................16

ID codes for InterBus-S controller 750-804...................................16Data width for InterBus-S controller 750-804 ...............................17Table to determine the data width for InterBus-S controller 750-804..................................................................................................18

Page 332: Wago Pro Manual

A-2 InterBusS.lib WAGO-I/O-PRO 32

Page 333: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 InterBusS.lib A-3

IBS_READ_CONFIGURATION

WAGO-I/O-PRO 32 Library elementsCategory: InterBus S Fieldbus CommunicationName: IBS_READ_CONFIGURATIONType: Function Function block x ProgramLibrary name: InterBusS.libApplicable to: Programmable InterBus-S-Controller 750-804

Input parameters: Data type: Comments:EN BOOL FB execution control. The function is

executed on a rising edge at EN.

Return value: Data type: Comments:ENO BOOL FB execution result. ENO is TRUE as

long as EN is TRUE.LEN BYTE Length of fieldbus data in bytes. It may

be different to the size of the PItransfered via the fieldbus becauseInterBus-S does not support all possibledata length. (See also appendix)

ID BYTE Currently used module ID Code

1: Digital Output2: Digital Input3: Mixed Digital49: Analog Output51: Analog Input52: Mixed Analog

ERROR WORD Error argument.0: no error1: function not supported

Page 334: Wago Pro Manual

A-4 InterBusS.lib WAGO-I/O-PRO 32

Header:

FUNCTIONBLOCK IBS_READ_CONFIGURATION(* read PI configuration *)VAR_INPUT

EN: BOOL;END_VARVAR_OUTPUT

ENO: BOOL;LEN:BYTE;ID:BYTE;ERROR:WORD;

END_VAR

Graphic display:

Time behaviour:

EN

ENO

LEN, ID, ERROR

Function description:

This function block reads the length of the fieldbus data set by the configuration ofthe IBS_SET_PI_CONFIGURATION function block.

See also: IBS_SET_PI_CONFIGURATION, IBS_READ_PI_CONFIGURATION,

Page 335: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 InterBusS.lib A-5

IBS_READ_PI_CONFIGURATION

WAGO-I/O-PRO 32 Library elementsCategory: InterBus S Fieldbus CommunicationName: IBS_READ_PI_CONFIGURATIONType: Function Function block X ProgramLibrary name: InterBusS.libApplicable to: Programmable InterBus-S-Controller 750-804

Input parameter: Data type: Comments:

EN BOOL FB execution control. The function isexecuted on a rising edge at EN.

Output parameter: Data type: Comments:ENO BOOL FB execution result. ENO is TRUE as long

as EN is TRUE.SP1TO8 BYTE Bit field to configure the special purpose

process image data. This data is mappedto the first position of the PI transferred viathe fieldbus.SP1TO8.0 0 = PI communication

interface is disabled.1 = PI communicationinterface is enabled.Communication data transferuses the first word of the PI.

SP1TO8.1 0 = extended terminaldiagnostics disabled.1 = extended terminaldiagnostics enabled.Diagnostic data transfer usesthe first word of the PI ifSP1TO8.0 = 0. If thecommunication interface isenabled (SP1TO8.0 = 1), thendiagnostics data uses thesecond word of the PI.

SP1TO8.2 0 = initialise fieldbus chip afterpower on.1 = initialise fieldbus chip afterexecution of IBS_SET_PI_CONFIGURATION.

Page 336: Wago Pro Manual

IBS_READ_PI_CONFIGURATION

A-6 InterBusS.lib WAGO-I/O-PRO 32

SP1TO8.3 0 = set PI length according tomodules configuration1 = set PI to maximum datalength ( 64 bytes)

SP1TO8.4 0 = PLC access to fieldbusterminals is enabled1= PLC access to fieldbusterminals is disabled

SP1T08.5 0 = In case of fieldbus failurethe outputs of the terminalswhich are assigned to fieldbuscontrol will be reset by thefieldbus chip hardware.1 = Output terminals assignedto fieldbus control may bereset by the PLC (SP1T08.4must be set to 0 in this case).

M01TO08 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 1st module data mapped to PIxxxxxx1x: 2nd module data mapped to PI�1xxxxxxx: 8th module data mapped to PI

M09TO16 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 9th modules data mapped to PIxxxxxx1x: 10th modules data mapped to PI�1xxxxxxx: 16th modules data mapped to PI

M17TO24 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 17th modules data mapped to PIxxxxxx1x: 18th modules data mapped to PI�1xxxxxxx: 24th modules data mapped to PI

M25TO32 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 25th modules data mapped to PIxxxxxx1x: 26th modules data mapped to PI�1xxxxxxx: 32th modules data mapped to PI

Page 337: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 InterBusS.lib A-7

M33TO40 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 33th module data mapped to PIxxxxxx1x: 34th module data mapped to PI�1xxxxxxx: 40th module data mapped to PI

M41TO48 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 41th module data mapped to PIxxxxxx1x: 42 th module data mapped to PI�1xxxxxxx: 48 th module data mapped to PI

M49TO56 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 49 th module data mapped to PIxxxxxx1x: 50 th module data mapped to PI�1xxxxxxx: 56 th module data mapped to PI

M57TO64 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 57 th module data mapped to PIxxxxxx1x: 58 th module data mapped to PI�1xxxxxxx: 64 th module data mapped to PI

PLC_IN_LEN BYTE Number of bytes of the PLC input processimage appended to the PI transferred viathe fieldbus. These bytes are added to theend (behind modules data) starting at aword address. If the number of IO Bytes isodd a spare byte is added.

PLC_OUT_LEN BYTE Number of bytes of the PLC processoutput image appended to the PItransferred via the fieldbus. These bytesare added to the end (behind modulesdata) starting at a word address. If thenumber of IO Bytes is odd a spare byte isadded.

Page 338: Wago Pro Manual

IBS_READ_PI_CONFIGURATION

A-8 InterBusS.lib WAGO-I/O-PRO 32

ID_CODE BYTE Currently configured module ID Code0: Auto Id code based on moduleconfiguration.1: digital outputs2: digital inputs3: digital inputs and outputs49: analog outputs51: analog inputs52: analog inputs and outputs

ERROR WORD Error argument.0x0000: no error0x0001: function not supported0x8001: ID_CODE invalid0x8003: PLC_IN_LEN invalid0x8004: PLC_OUT_LEN invalid

Header:

FUNCTIONBLOCK IBS_READ_PI_CONFIGURATIONVAR_INPUT

EN: BOOL;END_VARVAR_OUTPUT

ENO: BOOL;SP1TO8:BYTE;M01TO08:BYTE;M09TO16:BYTE;M17TO24:BYTE;M25TO32:BYTE;M33TO40:BYTE;M41TO48:BYTE;M49TO56:BYTE;M57TO64:BYTE;PLC_IN_LEN:BYTE;PLC_OUT_LEN:BYTE;ID_CODE:BYTE;ERROR:WORD;

END_VAR

Page 339: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 InterBusS.lib A-9

Graphic display:

Time behaviour:

EN

ENO

SP1TO8, MxxTOxx,PLC_IN_LEN, PLC_OUT_LEN,ID_CODE, ERROR

Functional description:

This function block reads the current configuration, set byIBS_SET_PI_CONFIGURATION.

The output SP1TO8 indicates which special controller data is mapped, e.g. theprocess image communication of the data word in the fieldbus data. It indicates inaddition whether the PLC access to the module data is released or locked.

The outputs MxxTOxx indicate which module data is mapped in the process image.

In addition the number of PLC fieldbus data which can be processed by the PLC.

See also: IBS_SET_PI_CONFIGURATION, IBS_READ_CONFIGURATION,

Page 340: Wago Pro Manual

IBS_SET_PI_CONFIGURATION

A-10 InterBusS.lib WAGO-I/O-PRO 32

IBS_SET_PI_CONFIGURATION

WAGO-I/O-PRO 32 Library elementsCategory: InterBus S Fieldbus CommunicationName: IBS_SET_PI_CONFIGURATIONType: Function Function block X ProgramLibrary name: InterBusS.libApplicable to: Programmable InterBus-S-Controller 750-804

Input parameter: Data type: Comments:EN BOOL FB execution control. The function block is

executed on a rising edge at EN.SP1TO8 BYTE Bit field to configure the special purpose

process image data. This data is mappedto the first position of the PI transferred viathe fieldbus.SP1TO8.0 0 = PI communication

interface is disabled.1 = PI communicationinterface is enabled.Communication data transferuses the first word of the PI.

SP1TO8.1 0 = extended terminaldiagnostics disabled.1 = extended terminaldiagnostics enabled.Diagnostic data transfer usesthe first word of the PI ifSP1TO8.0 = 0. If thecommunication interface isenabled (SP1TO8.0 = 1), thendiagnostics data uses thesecond word of the PI.

SP1TO8.2 0 = initialise fieldbus controllerafter power on.1 = initialise fieldbuscontroller after execution ofSET_PI_CONFIGURATION.

SP1TO8.3 0 = set PI length according tomodules configuration1 = set PI to maximum datalength ( 64 bytes)

Page 341: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 InterBusS.lib A-11

SP1TO8.4 0 = PLC access to fieldbusterminals is enabled1= PLC access to fieldbusterminals is disabled

SP1T08.5 0 = In case of fieldbus failurethe outputs of the terminalswhich are assigned to fieldbuscontrol will be reset by thefieldbus chip hardware.1 = Output terminals assignedto fieldbus control may bereset by the PLC (SP1T08.4must be set to 0 in this case).

M01TO08 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 1st module data mappedxxxxxx1x: 2nd module data mapped�1xxxxxxx: 8th module data mapped

M09TO16 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 9th modules data mapped to PIxxxxxx1x: 10th modules data mapped to PI�1xxxxxxx: 16th modules data mapped to PI

M17TO24 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 17th modules data mapped to PIxxxxxx1x: 18th modules data mapped to PI�1xxxxxxx: 24th modules data mapped to PI

M25TO32 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 25th modules data mapped to PIxxxxxx1x: 26th modules data mapped to PI�1xxxxxxx: 32th modules data mapped to PI

M33TO40 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 33th module data mapped to PIxxxxxx1x: 34th module data mapped to PI�1xxxxxxx: 40th module data mapped to PI

Page 342: Wago Pro Manual

IBS_SET_PI_CONFIGURATION

A-12 InterBusS.lib WAGO-I/O-PRO 32

M41TO48 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 41th module data mapped to PIxxxxxx1x: 42 th module data mapped to PI�1xxxxxxx: 48 th module data mapped to PI

M49TO56 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PI.xxxxxxx1: 49 th module data mapped to PIxxxxxx1x: 50 th module data mapped to PI�1xxxxxxx: 56 th module data mapped to PI

M57TO64 BYTE Bit field to configure the process imagedata transferred via the fieldbus. The dataof each module can be mapped into the PIxxxxxxx1: 57 th module data mapped to PIxxxxxx1x: 58 th module data mapped to PI�1xxxxxxx: 64 th module data mapped to PI

PLC_IN_LEN BYTE Number of bytes of the PLC input processimage appended to the PI transferred viathe fieldbus. These bytes are added to thePI behind the modules data starting at aword address. If the number of IO Bytes isodd a spare byte is added.

PLC_OUT_LEN BYTE Number of bytes of the PLC processoutput image appended to the PItransferred via the fieldbus. These bytesare added to the PI behind the modulesdata starting at a word address. If thenumber of IO Bytes is odd a spare byte isadded.

ID_CODE BYTE Module ID Code0: Automatic ID code, based on moduleconfiguration.1: Digital output2: Digital input3: Mixed digital inputs and outputs49: Analog output51: Analog input52: Mixed analog inputs and outputs

Page 343: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 InterBusS.lib A-13

Output parameter: Data type: Comments:ENO BOOL FB execution result. ENO is TRUE as long

as EN is TRUE.LEN BYTE Length of fieldbus data. It may be different

to the set value because InterBus-S doesnot support all possible data length.

ID BYTE Node ID code. If the ID_CODE was set to0 the return value for ID depends onmodule configuration. In other cases itreturns ID_CODE.

ERROR WORD Error argument.0x0000: no error0x0001 : function not supported0x8000 : unknown error0x8001 : invalid ID_CODE specified0x8002 : invalid length detected0x8003 : PLC_IN_LEN > 64 bytes0x8004 : PLC_OUT_LEN > 64 bytes0x8005 : total input data length > 64 bytes0x8006 : total output data length > 64bytes

Header:

FUNCTIONBLOCK IBS_SET_PI_CONFIGURATIONVAR_INPUT

EN: BOOL;SP1TO8:BYTE;M01TO08:BYTE;M09TO16:BYTE;M17TO24:BYTE;M25TO32:BYTE;M33TO40:BYTE;M41TO48:BYTE;M49TO56:BYTE;M57TO64:BYTE;PLC_IN_LEN:BYTE;PLC_OUT_LEN:BYTE;ID_CODE:BYTE;

END_VARVAR_OUTPUT

ENO: BOOL;LEN:BYTE;ID:BYTE;ERROR:WORD;

END_VAR

Page 344: Wago Pro Manual

IBS_SET_PI_CONFIGURATION

A-14 InterBusS.lib WAGO-I/O-PRO 32

Graphic display:

Time behaviour:

EN

ENO

SP1TO8, MxxTOxx, PLC_IN_LEN, PLC_OUT_LEN, ID_CODE

LEN, ID, ERROR

Functional description:

This function sets the configuration of the process image. Since the process imagetransferred via the fieldbus is limited to 32 words, it may be helpful to configure theportion of data transferred to the master.

The inputs MxxTOxx specify which modules data is mapped into the PI.

SP1TO8 let users map special controller data e.g. the PI communication data wordinto the fieldbus data.

It is also possible to set the number of PLC fieldbus data that can be accessed bythe PLC via IO addresses %IX256.0 %IB512 %IW256 or %ID128 and %QX256.0%QB512 %QW256 or %QD128.

PLC fieldbus data ---Special data----------Module data----------Inputs / Outputs--- Process image

See also: IBS_READ_PI_CONFIGURATION, IBS_READ_CONFIGURATION,

Page 345: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 InterBusS.lib A-15

INTERBUS_VERSION

WAGO-I/O-PRO 32 Library elementsCategory: InterBus S Fieldbus CommunicationName: INTERBUS_VERSIONType: Function X Function block ProgramLibrary name: InterBusS.libApplicable to: Programmable InterBus-S-Controller 750-804

Input parameter: Data type: Comments:EN BOOL FB execution control. The function is

executed if EN is TRUE.

Return value: Data type: Comments:INTERBUS_VERSION WORD Version number for this library.

Counting starts at 1.

Header:

FUNCTION INTERBUS_VERSION : WORDVAR_INPUT

EN: BOOL;END_VAR

Graphic display:

Time behaviour:

EN

INTERBUS_VERSION

Function description:

The function INTERBUS_VERSION returns the current version number of the library�InterBusS.lib�. It is for information purposes only during PLC applicationdevelopment time. During runtime it is possible to detect version conflicts.

Version: Description:1.0 Start-up version

Page 346: Wago Pro Manual

Appendix

A-16 InterBusS.lib WAGO-I/O-PRO 32

Appendix

ID codes for InterBus-S controller 750-804Depending on the modules used the InterBus-S controller transmits different IDcodes to the master.

ID codedez, hex

Binaryoutput

Binaryinput

Digitaloutput

Digitaloutput

1, 0x1 x2, 0x2 x3, 0x3 x x49, 0x31 - x50, 0x32 - x51, 0x33 - - x x

[x]: available[ ]: is not available[-]: could also be available

The InterBus-S controller 750-804 is a remote bus slave

Page 347: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 InterBusS.lib A-17

Data width for InterBus-S controller 750-804The data width is set to the minimum data width possible for the connectedmodules. The highest value of input data width and output data width isselected.

Possible values for the data width are :

Possible data width Supported by fieldbuscontroller

0 word x1 nibble1 byte3 nibbles1 word x3 nibbles3 bytes2 words x5 nibbles5 bytes3 words x4 words x5 words x6 words x7 words x8 words x9 words x10 words x12 words x14 words x16 words x24 words x32 words x

Page 348: Wago Pro Manual

Appendix

A-18 InterBusS.lib WAGO-I/O-PRO 32

Table to determine the data width for InterBus-S controller 750-804Column A indicates the number of output words and row E indicates thenumber of input words

Page 349: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 InterBusS.lib A-19

Page 350: Wago Pro Manual

A-20 InterBusS.lib WAGO-I/O-PRO 32

Page 351: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-1

WAGO-I/O-PRO 32 Library

Mod_com.lib

Contents

ADD_DESC (Data type)..............................................................................2ADD_PI_INFORMATION..........................................................................4CRC16..........................................................................................................6FBUS_ERROR_INFORMATION...............................................................7GET_DIGITAL_INPUT_OFFSET..............................................................8GET_DIGITAL_OUTPUT_OFFSET........................................................10KBUS_ERROR_INFORMATION............................................................12MOD_COM_VERSION ............................................................................13MODULE_INFO (Data type) ....................................................................15MODULE_INFO_ACCESS (Data type) ...................................................16PI_INFORMATION ..................................................................................18READ_INPUT_BIT...................................................................................19READ_INPUT_WORD.............................................................................20READ_OUTPUT_BIT...............................................................................21READ_OUTPUT_WORD.........................................................................22SET_DIGITAL_INPUT_OFFSET ............................................................23SET_DIGITAL_OUTPUT_OFFSET ........................................................25SLAVE_ADDRESS...................................................................................27WRITE_OUTPUT_BIT .............................................................................28WRITE_OUTPUT_WORD .......................................................................29

Page 352: Wago Pro Manual

ADD_DESC (Data type)

A-2 Mod_com.lib WAGO-I/O-PRO 32

ADD_DESC (Data type)

WAGO-I/O-PRO 32 Library elementsCategory: More detailed information about the PLC process imageName: ADD_DESCType: Data type XLibrary name: Mod_com.libApplicable to: ADD_PI_INFORMATIONStructure:

Elements: Data type: Comments:posPAA WORD Bit position of the module in the PLC

output process image.posPAE WORD Bit position of the module in the PLC

input process image.sizePAA BYTE Number of bits assigned to this module

in the PLC output process image.

sizePAE BYTE Number of bits assigned to this modulein the PLC input process image.

channels BYTE Number of logic channels (only forcomplex modules).

altFormat BYTE 0: Standard output format1: Alternative output format

Header:

TYPE ADD_DESC :

STRUCT

posPAA : WORD;

posPAE : WORD;

sizePAA : BYTE;

sizePAE : BYTE;

channels : BYTE;

altFormat : BYTE;

END_STRUCT

END_TYPE

Page 353: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-3

Data type description:

This data type is a structure and provides more detail process image informationregarding a module.

Page 354: Wago Pro Manual

ADD_PI_INFORMATION

A-4 Mod_com.lib WAGO-I/O-PRO 32

ADD_PI_INFORMATION

WAGO-I/O-PRO 32 Library elementsCategory: More detailed information about the PLC process imageName: ADD_PI_INFORMATIONType: Function X Function block ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers except MODBUS

Input parameter: Data type: Comments:EN BOOL A TRUE at this input activates the

function.pAccess POINTER TO

MODULE_INFO_ACCESS

Pointer to a structure describing themodules from which more detailedprocess image information is to bedetermined.

pInfo POINTER TOMODULE_INFO

Pointer to a structure in which the moredetailed process image information of amodule is to be saved. If information isto be determined from several modulesthen a pointer must be transferred to anarray of this structure type. In this casefield limits are not checked!The structure, or the array of thisstructure must be initialised with ZEROprior to each selection.

Return value: Data type: Comments:ADD_PI_INFORMATION BOOL FALSE:

The function was performed incorrectly.Possible entries in the structureMODULE_INFO to which 'pInfo� refers,are invalid.

TRUE:The function was successfullyperformed.

Page 355: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-5

Graphic display:

Time behaviour:

Function description:

Using this function more detailed process image information can be determinedregarding the modules (see components of the structure MODULE_INFO).

Example of how to determine information of all connected modules:

VAR

access : MODULE_INFO_ACCESS;

info : ARRAY[0..63] OF MODULE_INFO;

END_VAR

access.physicalPosTo := 0;

access.moduleType := 0;

ADD_PI_INFORMATION( 1, ADR(access), ADR(info[0]) );

Available from library version 3.0

Page 356: Wago Pro Manual

CRC16

A-6 Mod_com.lib WAGO-I/O-PRO 32

CRC16

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access to process imageName: CRC16Type: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:INPUT BYTE Further input byte for which a CRC is to

be calculated.EN BOOL A rising edge at this input signals the

initialisation of the function block andcalculates the CRC for the first byte.With TRUE the CRC is calculated oneach of the following bytes. WithFALSE no calculation is performed.

Output parameters: Data type: Comments:CRC WORD The calculated value for the CRC. The

CRC value is present at this outputfollowing each invocation.

Graphic display:

Time behaviour:

INPUT

CRC

EN

Function description:

The CTC 16 function block calculates the CRC16 value for a number of input bytes.

Page 357: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-7

FBUS_ERROR_INFORMATION

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access to system variablesName: FBUS_ERROR_INFORMATIONType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:FBUS_ERROR BOOL A TRUE at this output indicates a

fieldbus error.ERROR WORD Error occurred. The error messages are

fieldbus specific (see individualcontroller description).

Graphic display:

Time behaviour:

Function description:

This function block offers the programmer the possibility to obtain information on thestatus of the fieldbus communication. The values of the ERROR output are fieldbusspecific.

With MODBUS for instance, the current status of the communication monitoring(Watchdog) is indicated. (0: no error, 1: Watchdog has detected �time exceeded".)

Page 358: Wago Pro Manual

GET_DIGITAL_INPUT_OFFSET

A-8 Mod_com.lib WAGO-I/O-PRO 32

GET_DIGITAL_INPUT_OFFSET

WAGO-I/O-PRO 32 Library elementsCategory: Access to process imageName: GET_DIGITAL_INPUT_OFFSETType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:DIG_IN_OFFSET WORD Pre-assigned value for the byte address

from which the bits of the digital inputmodules are to be filed. Thepermissible value range is 0..511.

ERROR WORD Fault encountered.0: No fault0x8001: The given value is too smalland will collide with the analog data.0x8003: The given value is too largeand will collide with the variable ranges.0x8005: The given value is larger thanthe maximum permissible value.

Header:

FUNCTION_BLOCK GET_DIGITAL_INPUT_OFFSET

VAR_OUTPUT

DIG_IN_OFFSET: WORD;

ERROR: WORD;

END_VAR

Graphic display:

Page 359: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-9

Time behaviour:

Function description:

This function reads the current value of the saved address offset for the digitalinputs. The value is pre-assigned with the function blockSET_DIGITAL_INPUT_OFFSET and permanently saved in the controller. The readvalue is identical with the pre-assigned value. In case of a fault the output ERROR ofthe FB is set to a value not equal to 0. No communication takes place between thecontroller and the modules. This status is displayed via the blink code 10 by the blinkargument 1 on the IO LED of the controller.

The default value when supplying the controllers is 0. As the value is savedpermanently, for safety reasons the value should be set once again in the userprogram.

The current start address for the bits of the digital inputs can be interrogated with theFB PI_INFORMATION. The output INPUTBITS_OFFSET emits the value.

Page 360: Wago Pro Manual

GET_DIGITAL_OUTPUT_OFFSET

A-10 Mod_com.lib WAGO-I/O-PRO 32

GET_DIGITAL_OUTPUT_OFFSET

WAGO-I/O-PRO 32 Library elementsCategory: Access to process imageName: GET_DIGITAL_OUTPUT_OFFSETType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:DIG_OUT_OFFSET WORD Pre-assigned value for the byte address

from which the bits of the digital outputmodules are to be filed. Thepermissible value range is 0..511.

ERROR WORD Fault encountered.0: No fault0x8002: The given value is too smalland will collide with the analogue data.0x8004: The given value is too largeand will collide with the variable ranges.0x8006: The given value is larger thanthe maximum permissible value.

Header:

FUNCTION_BLOCK GET_DIGITAL_OUTPUT_OFFSET

VAR_OUTPUT

DIG_OUT_OFFSET: WORD;

ERROR: WORD;

END_VAR

Graphic display:

Page 361: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-11

Time behaviour:

Function description:

This function reads the current value of the saved address offset for the digitaloutputs. The value is pre-assigned with the function blockSET_DIGITAL_OUTPUT_OFFSET and permanently saved in the controller. Theread value is identical with the pre-assigned value. In case of a fault the outputERROR of the FB is set to a value not equal to 0. No communication takes placebetween the controller and the modules. This status is displayed via the blink code10 by the blink argument 1 on the IO LED of the controller.

The default value when supplying the controllers is 0. As the value is savedpermanently, for safety reasons the value should be set once again in the userprogram.

The current start address for the bits of the digital outputs can be interrogated withthe FB PI_INFORMATION. The output OUTPUTBITS_OFFSET emits the value.

Page 362: Wago Pro Manual

KBUS_ERROR_INFORMATION

A-12 Mod_com.lib WAGO-I/O-PRO 32

KBUS_ERROR_INFORMATION

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access system variablesName: KBUS_ERROR_INFORMATIONType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:KBUS_ERROR BOOL A TRUE at this output indicates a

terminal bus error.BITLEN WORD Terminal bus bit lengthTERMINALS WORD Number of existing terminals blocksERROR WORDERROR_ARG WORDFAIL_ADDRESS WORD In the event of a terminal bus error

indicates the terminal number wherethe error has occurred.

Graphic display:

Time behaviour:

Function description:

This function block offers the programmer the possibility of receiving informationabout the condition and configuration of the internal bus.

Page 363: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-13

MOD_COM_VERSION

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access to the process imageName: MOD_COM_VERSIONType: Function X Function block ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:EN BOOL A TRUE at this input actives this

function.

Return value: Data type: Comments:MOD_COM_VERSION WORD Library version

Graphic display:

Time behaviour:

EN

MOD_COM_VERSION

Function description:

The function of the MOD_COM_VERSION returns the current version number of thelibrary. This function can be used during the program development for information. Inaddition version conflicts during the running time can be avoided.

Page 364: Wago Pro Manual

MOD_COM_VERSION

A-14 Mod_com.lib WAGO-I/O-PRO 32

Version: Description:1.0 First version1.1 The function blocks READ_OUTPUT_WORD and

READ_OUTPUT_BIT were supplemented.2.0 The function blocks GET_DIGITAL_INPUT_OFFSET,

GET_DIGITAL_OUTPUT_OFFSET,SET_DIGITAL_INPUT_OFFSET andSET_DIGITAL_OUTPUT_OFFSET were supplemented.

3.0 The function ADD_PI_INFORMATION and the data typesMODULE_INFO_ACCESS, MODULE_INFO and ADD_DESC areadded.

Page 365: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-15

MODULE_INFO (Data type)

WAGO-I/O-PRO 32 Library elementsCategory: More detailed information about the PLC process imageName: MODULE_INFOType: Data type XLibrary name: Mod_com.libApplicable to: ADD_PI_INFORMATIONStructure:

Elements: Value: Comments:physicalPos BYTE Physical module position

(1-64).moduleType WORD The last 3 digits of the module

designation (750-xxx).desc ADD_DESC Structure variable with more detailed

information.

Header:

TYPE MODULE_INFO :

STRUCT

physicalPos : BYTE;

moduleType : WORD;

desc : ADD_DESC;

END_STRUCT

END_TYPE

Data type description:

This data type is a structure and supplies extended process image information withregard to a module.For digital modules no exact module designation can be determined. For this reasonthe 'module type' assumes one of the following values:16#00D0: This digital module does not assume any bits in the PLC input or output

process image.16#00D1: This digital module only occupies bits in the input process image of the

PLC16#00D2: This digital module only occupies bits in the output process image of the

PLC16#00D3: This digital module occupies bits in the input and the output process

image of the PLC.

Page 366: Wago Pro Manual

MODULE_INFO_ACCESS (Data type)

A-16 Mod_com.lib WAGO-I/O-PRO 32

MODULE_INFO_ACCESS (Data type)

WAGO-I/O-PRO 32 Library elementsCategory: More detailed information about the PLC process imageName: MODULE_INFO_ACCESSType: Datentyp XLibrary name: Mod_com.libApplicable to: ADD_PI_INFORMATIONStructure:

Elements: Data type: Comments:physicalPosOf BYTE Physical position of the first module

from which the more detailedinformation is to be determined(1-64).

physicalPosTo BYTE Physical position of the last modulefrom which the more detailedinformation is to be determined(0-64).

typeNumber BYTE Which module of a row of a type ismeant (1-64).

moduleType WORD The last 3 numbers of the moduledesignation (750-xxx).

window WORD Window for 'module type' in ascendingdirection.

Header:

TYPE MODULE_INFO_ACCESS :

STRUCT

physicalPosOf : BYTE;

physicalPosTo : BYTE;

typeNumber : BYTE;

moduleType : WORD;

window : WORD;

END_STRUCT

END_TYPE

Page 367: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-17

Data type description:

This data type is a structure and indicates which module more detailed processimage information is to be determined.

Three different access types are possible:

physicalPosTo <> 0:Determine more detailed module information from 'physicalPosOf' to'physicalPosTo'. 'physicalPosOf' and 'physicalPosTo' may be identical.

physicalPosTo = 0 AND moduleType <> 0:Determine more detailed module information which is specified by 'type number','module type' and 'window'.

physicalPosTo = 0 AND moduleType = 0:Determine more detailed information of all connected modules.

Example:

Determine information for the 3rd connected module of type 750-650/651/652/653:

physicalPosTo = 0

typeNumber = 3;

moduleType = 650;

window = 3;

Page 368: Wago Pro Manual

PI_INFORMATION

A-18 Mod_com.lib WAGO-I/O-PRO 32

PI_INFORMATION

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access to process imageName: PI_INFORMATIONType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:ANALOG_OUTLENGTH WORD Number of analog output bitsANALOG_INLENGTH WORD Number of analog input bitsDIGITAL_OUTLENGTH WORD Number of digital output bitsDIGITAL_INLENGTH WORD Number of digital input bitsOUTPUTBITS_OFFSET WORD Number of bytesINPUTBITS_OFFSET WORD Number of bytes

Graphic display:

Time behaviour:

Function description:

This function block offers the programmer the possibility to obtain information aboutthe structure of the process image.

Page 369: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-19

READ_INPUT_BIT

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access to the process imageName: READ_INPUT_BITType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:WORD_ADDRESS WORD Here the word address of the bit in the

process image is transferred.BIT_ADDRESS WORD Here the bit position in the word is

transferred.

Output parameters: Data type: Comments:VALUE BOOL Current value of the read bitERROR BOOL TRUE in case an error has occurred.

Possible errors are an inadmissibleaddress. Otherwise FALSE

Graphic display:

Time behaviour:

WORD_ADDRESS

VALUE

BIT_ADDRESS

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to theprocess image. The current value of the input bit is made available immediately afterinvoking the FB at the outputs. The function block must be used with particular careas here the guidelines of IEC 61131-3 �all addresses are assigned at the time ofprogramming and during the running time� are not adhered to.

Page 370: Wago Pro Manual

READ_INPUT_WORD

A-20 Mod_com.lib WAGO-I/O-PRO 32

READ_INPUT_WORD

WAGO-I/O-PRO - Library elementsCategory: Indirect access to process imageName: READ_INPUT_WORDType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:WORD_ADDRESS WORD Here the word address of the word is

transferred to the process image.

Output parameters: Data type: Comments:VALUE WORD Current value of the read wordERROR BOOL TRUE if an error has occurred. Possible

errors are an inadmissible address,otherwise FALSE

Graphic display:

Time behaviour:

WORD_ADDRESS

VALUE

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to theprocess image. The current value of the input word is made available immediatelyafter invoking the FB at the outputs. The function block must be used with particularcare as here the guidelines of IEC 61131-3 �all addresses are assigned at the timeof programming and during the running time� are not adhered to.

Page 371: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-21

READ_OUTPUT_BIT

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access to process imageName: READ_OUTPUT_BITType: Function Function block X ProgramLibrary name: Mod_com.lib (from Version 1.1)Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:WORD_ADDRESS WORD Here the word address of the bit are

transferred to the process image.BIT_ADDRESS WORD Here the bit position in the word is

transferred.

Output parameters: Data type: Comments:VALUE BOOL Current value of the read bit.ERROR BOOL TRUE if an error has occurred. Possible

errors are an inadmissible address,otherwise FALSE.

Graphic display:

Time behaviour:

WORD_ADDRESS

VALUE

BIT_ADDRESS

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to theprocess image. The current value of the output bit is made available immediatelyafter invoking the FB at the outputs. The function block must be used with particularcare as here the guidelines of IEC 61131-3 �all addresses are assigned at the timeof programming and during the running time� are not adhered to.

Page 372: Wago Pro Manual

READ_OUTPUT_WORD

A-22 Mod_com.lib WAGO-I/O-PRO 32

READ_OUTPUT_WORD

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access to process imageName: READ_OUTPUT_WORDType: Function Function block X ProgramLibrary name: Mod_com.lib (from Version 1.1)Applicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:WORD_ADDRESS WORD Here the word address of the bits are

transferred to the process image.

Output parameters: Data type: Comments:VALUE WORD Current value of the read bit.ERROR BOOL TRUE if an error has occurred. Possible

errors are an inadmissible address,otherwise FALSE.

Graphic display:

Time behaviour:

WORD_ADDRESS

VALUE

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to theprocess image. The current value of the output word is made available immediatelyafter invoking the FB at the outputs. The function block must be used with particularcare as here the guidelines of IEC 61131-3 �all addresses are assigned at the timeof programming and during the running time� are not adhered to.

Page 373: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-23

SET_DIGITAL_INPUT_OFFSET

WAGO-I/O-PRO 32 Library elementsCategory: Access to process imageName: SET_DIGITAL_INPUT_OFFSETType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:EN BOOL FB execution control. The function

block is executed on a rising edge atEN.

DIG_IN_OFFSET WORD Byte address, from where the bits of thedigital input modules are to be filed.The permissible value range is 0..511.With the assignment of 0 the digitalinputs are saved directly behind thebytes of the analogue modules, ifanalogue modules are present.

Output parameters: Data type: Comments:ENO BOOL FB execution result. ENO is TRUE as

long as EN is TRUE.ERROR WORD Fault encountered.

0: No fault0x8001: The given value is too smalland will collide with the analogue data.0x8003: The given value is too largeand will collide with the variable ranges.0x8005: The given value is larger thanthe maximum permissible value.

Header:

FUNCTION_BLOCK SET_DIGITAL_INPUT_OFFSET

VAR_INPUT

EN: BOOL;

DIG_IN_OFFSET: WORD;

END_VAR

VAR_OUTPUT

ENO: BOOL;

ERROR: WORD;

END_VAR

Page 374: Wago Pro Manual

SET_DIGITAL_INPUT_OFFSET

A-24 Mod_com.lib WAGO-I/O-PRO 32

Graphic display:

Time behaviour:

EN

DIG_IN_OFFSET

ERROR

ENO

Function description:

This function sets the address offsets current value for the digital inputs. Thechanged configuration is used when reading the input PA during the next PLC cycle.The value is permanently saved in the controller.

When entering an invalid offset value the controller transmits the blink code 10 withthe blink argument 1. The data exchange between the controller and the modules isstopped.

The default value when supplying the controllers is 0. As the value is savedpermanently, for safety reasons the value should be set once again in the userprogram.

The saved value can be read with the FB GET_DIGITAL_INPUT_OFFSET.The current start address for the bits of the digital outputs can be interrogated withthe FB PI_INFORMATION. The output INPUTBITS_OFFSET emits the value.

Page 375: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-25

SET_DIGITAL_OUTPUT_OFFSET

WAGO-I/O-PRO 32 Library elementsCategory: Access to process imageName: SET_DIGITAL_OUTPUT_OFFSETType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:EN BOOL FB execution control. The function

block is executed on a rising edge atEN.

DIG_OUT_OFFSET WORD Byte address, from where the bits of thedigital output modules are to be filed.The permissible value range is 0..511.With the assignment of 0 the digitaloutputs are saved directly behind thebytes of the analogue modules, ifanalogue modules are present.

Output parameters: Data type: Comments:ENO BOOL FB execution result. ENO is TRUE as

long as EN is TRUE.ERROR WORD Fault encountered.

0: No fault0x8002: The given value is too smalland will collide with the analogue data.0x8004: The given value is too largeand will collide with the variable ranges.0x8006: The given value is larger thanthe maximum permissible value.

Header:

FUNCTION_BLOCK SET_DIGITAL_OUTPUT_OFFSET

VAR_INPUT

EN: BOOL;

DIG_OUT_OFFSET: WORD;

END_VAR

VAR_OUTPUT

ENO: BOOL;

ERROR: WORD;

END_VAR

Page 376: Wago Pro Manual

SET_DIGITAL_OUTPUT_OFFSET

A-26 Mod_com.lib WAGO-I/O-PRO 32

Graphic display:

Time behaviour:

EN

DIG_OUT_OFFSET

ERROR

ENO

Function description:

This function sets the address offsets current value for the digital outputs. Thechanged configuration is used when writing the output PA during the next PLC cycle.The value is permanently saved in the controller.

When entering an invalid offset value the controller transmits the blink code 10 withthe blink argument 2. The data exchange between the controller and the modules isstopped.The default value when supplying the controllers is 0. As the value is savedpermanently, for safety reasons the value should be set once again in the userprogram.

The saved value can be read with the FB GET_DIGITAL_OUTPUT_OFFSET.The current start address for the bits of the digital outputs can be interrogated withthe FB PI_INFORMATION. The output OUTPUTBITS_OFFSET emits the value.

Page 377: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-27

SLAVE_ADDRESS

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access to system variablesName: SLAVE_ADDRESSType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:

Output parameters: Data type: Comments:SLAVE_ADDRESS BYTE The current node address.

Graphic display:

Time behaviour:

Function description:

This function block allows the programmer access to the address set on theprogrammable fieldbus controller. The address is made available when invoking theFB.

Page 378: Wago Pro Manual

WRITE_OUTPUT_BIT

A-28 Mod_com.lib WAGO-I/O-PRO 32

WRITE_OUTPUT_BIT

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access to process imageName: WRITE_OUTPUT_BITType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:WORD_ADDRESS WORD Here the word address of the word is

transferred to the process image.BIT_ADDRESS WORD Here the bit position in the word is

transferred.VALUE BIT Value to be written.

Output parameters: Data type: Comments:ERROR BOOL TRUE if an error has occurred. Possible

errors are an inadmissible address,otherwise FALSE.

Graphic display:

Time behaviour:

WORD_ADDRESS

VALUE

BIT_ADDRESS

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to theprocess image. The current value of the output bit is made available immediatelyafter invoking the FB. The function block must be used with particular care as herethe guidelines of IEC 61131-3 �all addresses are assigned at the time ofprogramming and during the running time� are not adhered to.

Page 379: Wago Pro Manual

Appendix A � Additional Labraries

WAGO-I/O-PRO 32 Mod_com A-29

WRITE_OUTPUT_WORD

WAGO-I/O-PRO 32 Library elementsCategory: Indirect access to process imageName: WRITE_OUTPUT_WORDType: Function Function block X ProgramLibrary name: Mod_com.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:WORD_ADDRESS WORD Here the word address of the word is

transferred to the process image.VALUE WORD Value to be written.

Output parameters: Data type: Comments:ERROR BOOL TRUE if an error has occurred. Possible

errors are an inadmissible address,otherwise FALSE.

Graphic display:

Time behaviour:

WORD_ADDRESS

VALUE

ERROR

Function description:

This function block offers the programmer the possibility of indirect access to theprocess image. The current value of the output word is made available immediatelyafter invoking the FB. The function block must be used with particular care as herethe guidelines of IEC 61131-3 �all addresses are assigned at the time ofprogramming and during the running time� are not adhered to.

Page 380: Wago Pro Manual

A-30 Mod_com.lib WAGO-I/O-PRO 32

Page 381: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 Standard A-1

WAGO-I/O-PRO 32 Library

Standard.lib

Contents

ASCIIBYTE_TO_STRING .........................................................................3REAL_STATE.............................................................................................4STANDARD_VERSION.............................................................................6STRING_COMPARE ..................................................................................7STRING_TO_ASCIIBYTE .........................................................................8

Page 382: Wago Pro Manual

A-2 Standard WAGO-I/O-PRO 32

Page 383: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 Standard A-3

ASCIIBYTE_TO_STRING

WAGO-I/O-PRO 32 Library elementsCategory: STRING functionName: ASCIIBYTE_TO_STRINGType: Function X Function block ProgramLibrary name: Standard.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:byt BYTE The input value is a number of data

type BYTE.

Return value: Data type: Comments:ASCIIBYTE_TO_STRING STRING The return value of the function is a

character of data type STRING.

Graphic display:

Time behaviour:

Function description:

This function convents a number from data type BYTE to a character of data typeSTRING.

Page 384: Wago Pro Manual

REAL_STATE

A-4 Standard WAGO-I/O-PRO 32

REAL_STATE

WAGO-I/O-PRO 32 Library elementsCategory: Information about Real operationsName: REAL_STATEType: Function Function block X ProgramLibrary name: Standard.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:RESET BOOL A TRUE initialises the variable error

again to zero.

Output parameters: Data type: Comments:ERROR BYTE A value unequal to zero indicates an

error with a real operation.

Graphic display:

Time behaviour:

Function description:

This function block offers the programmer the possibility to react to errors occurringduring computation with floating point numbers. In a program the function blockREAL_STATE can be invoked after each operation in order to recognize a numberoverflow. In the event of an error, the ERROR output adopts a value unequal zero.

Page 385: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 Standard A-5

The following output values are possible:

ERROR = 3 -> Integer overflowERROR = 4 -> Floating overflowERROR = 5 -> Floating underflowERROR = 7 -> Divide by zeroERROR = 9 -> Undefined floatERROR = 10 -> Conversion errorERROR = 11 -> Floating point stack underflowERROR = 12 -> Floating point stack overflow

Page 386: Wago Pro Manual

STANDARD_VERSION

A-6 Standard WAGO-I/O-PRO 32

STANDARD_VERSION

WAGO-I/O-PRO 32 Library elementsCategory: Running time diagnosisName: STANDARD_VERSIONType: Function X Function block ProgramLibrary name: Standard.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:EN BOOL A TRUE at this input activates this

function.

Return value: Data type: Comments:STANDARD_VERSION WORD Library version of Standard.lib.

Graphic display:

Time behaviour:

EN

STANDARD VERSION

Function description:

The STANDARD_VERSION function returns the current library version number. Thisfunction can be used for information purposes during program development.Furthermore it can serve to avoid version conflicts with the running time.

Version: Description:

1.0 First version (16#100)

Page 387: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 Standard A-7

STRING_COMPARE

WAGO-I/O-PRO 32 Library elementsCategory: STRING functionName: STRING_COMPAREType: Function X Function block ProgramLibrary name: Standard.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:STR1 STRING A character string with max. 255

characters.STR2 STRING A character string with max. 255

characters.

Return value: Data type: Comments:STRING_COMPARE BOOL Returns the results of the comparison.

Graphic display:

Time behaviour:

Function description:

Using this function the programmer can compare two character strings each withmax. 255 characters. If they coincide function feeds back TRUE. If the characterchains are, however, not identical FALSE is feedback.

Page 388: Wago Pro Manual

STRING_TO_ASCIIBYTE

A-8 Standard WAGO-I/O-PRO 32

STRING_TO_ASCIIBYTE

WAGO-I/O-PRO 32 Library elementsCategory: STRING functionName: STRING_TO_ASCIIBYTEType: Function X Function block ProgramLibrary name: Standard.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:str STRING A character string with max. 255

characters.

Return value: Data type: Comments:STRING_TO_ASCIIBYTE BYTE The return value of the function is a

number of data type BYTE.

Graphic display:

Time behaviour:

Function description:

This function converts a character, from data type STRING to a character of datatype BYTE.

Page 389: Wago Pro Manual

Appendix A � Additional Libraries

WAGO-I/O-PRO 32 Standard A-9

Page 390: Wago Pro Manual

Appendix A - Additional Libraries

WAGO-I/O-PRO 32 System A-1

WAGO-I/O-PRO 32 Library

System.lib

Contents

GET_ACT_CYCLE.....................................................................................3GET_MAX_CYCLE....................................................................................4GET_MIN_CYCLE .....................................................................................5GET_PLC_ACT_CYCLE............................................................................6GET_PLC_MAX_CYCLE ..........................................................................7GET_PLC_MIN_CYCLE............................................................................8GET_PROGRAM_ID ..................................................................................9GET_RUN_VALUE ..................................................................................10GET_STOP_VALUE.................................................................................11SYSTEM_VERSION.................................................................................12

Page 391: Wago Pro Manual

A-2 System WAGO-I/O-PRO 32

Page 392: Wago Pro Manual

Appendix A - Additional Libraries

WAGO-I/O-PRO 32 System A-3

GET_ACT_CYCLE

WAGO-I/O-PRO 32 Library elementsCategory: Running time diagnosisName: GET_ACT_CYCLEType: Function X Function block ProgramLibrary name: System.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:RESET BOOL A TRUE at this input resets the output

value (only for compatibility reasonswith other xxx_CYCLE functions).

Return value: Data type: Comments:GET_ACT_CYCLE TIME Current cycle time for a complete

program cycle, consisting of a I/0processing, user program andoperating system functions.

Graphic display:

Time behaviour:

RESET

GET_ACT_CYCLE 00

Function description:

The GET_ACT_CYCLE function returns the current time for the execution of aprogram cycle including I/0 processing and operating system functions with a 1 msresolution.

Page 393: Wago Pro Manual

GET_MAX_CYCLE

A-4 System WAGO-I/O-PRO 32

GET_MAX_CYCLE

WAGO-I/O-PRO 32 Library elementsCategory: Running time diagnosisName: GET_MAX_CYCLEType: Function X Function block ProgramLibrary name: System.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:RESET BOOL A TRUE at this input resets the output

value. (only for compatibility reasonswith other xxx_CYCLE functions)

Return value: Data type: Comments:GET_MAX_CYCLE TIME Maximum cycle time for a complete

program cycles consisting of I/0processing, user program andoperation system functions since thelast reset (or program start).

Graphic display:

Time behaviour:

RESET

GET_MAX_CYCLE 00

Function description:

The GET_MAX_CYCLE function returns the maximum time for the execution of aprogram cycle including I/0 processing and operating system functions with a 1 msresolution. the output value is set to 0 following a program start.

Page 394: Wago Pro Manual

Appendix A - Additional Libraries

WAGO-I/O-PRO 32 System A-5

GET_MIN_CYCLE

WAGO-I/O-PRO 32 Library elementsCategory: Running time diagnosisName: GET_MIN_CYCLEType: Function X Function block ProgramLibrary name: System.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:RESET BOOL A TRUE at this input resets the output

value. (only for compatibility reasonswith other xxx_CYCLE functions).

Return value: Data type: Comments:GET_MIN_CYCLE TIME Minimum cycle time for a complete

program cycles consisting of I/0processing, user program andoperation system functions since thelast reset (or program start).

Graphic display:

Time behaviour:

RESET

GET_MIN_CYCLE maxmax

Function description:

The GET_MIN_CYCLE function returns the minimum time for the execution of aprogram cycle including I/0 processing and operating system function with a 1 msresolution. Following a program start, the output value is set to the numericalmaximum value (T#1m5s535ms).

Page 395: Wago Pro Manual

GET_PLC_ACT_CYCLE

A-6 System WAGO-I/O-PRO 32

GET_PLC_ACT_CYCLE

WAGO-I/O-PRO 32 Library elementsCategory: Running time diagnosisName: GET_PLC_ACT_CYCLEType: Function X Function block ProgramLibrary name: System.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:RESET BOOL A TRUE at this input resets the output

value. (only for compatibility reasonswith other xxx_CYCLE functions).

Return value: Data type: Comments:GET_PLC_ACT_CYCLE TIME Current cycle time for a complete

program cycle of the user program.

Graphic display:

Time behaviour:

RESET

GET PLC ACT CYCLE 00

Function description:

The GET_PLC_ACT_CYCLE function returns the current time for the execution of aprogram cycle at a 1 ms resolution.

Page 396: Wago Pro Manual

Appendix A - Additional Libraries

WAGO-I/O-PRO 32 System A-7

GET_PLC_MAX_CYCLE

WAGO-I/O-PRO 32 Library elementsCategory: Running time diagnosisName: GET_PLC_MAX_CYCLEType: Function X Function block ProgramLibrary name: System.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:RESET BOOL A TRUE at this input resets the output

value. (only for compatibility reasonswith other xxx_CYCLE functions).

Return value: Data type: Comments:GET_PLC_MAX_CYCLE TIME Maximum cycle time for a complete

program cycle of the user programsince the last reset (or program start).

Graphic display:

Time behaviour:

RESET

GET_PLC_MAX_CYCLE 00

Function description:

The GET_PLC_MAX_CYCLE function returns the maximum time for the execution ofa program cycle at a 1 ms resolution. Following a program start, the output value isset to 0.

Page 397: Wago Pro Manual

GET_PLC_MIN_CYCLE

A-8 System WAGO-I/O-PRO 32

GET_PLC_MIN_CYCLE

WAGO-I/O-PRO 32 Library elementsCategory: Running time diagnosisName: GET_PLC_MIN_CYCLEType: Function X Function block ProgramLibrary name: System.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:RESET BOOL A TRUE at this input resets the output

value. (only for compatibility reasonswith other xxx_CYCLE functions).

Return value: Data type: Comments:GET_PLC_MIN_CYCLE TIME Minimum cycle time for a complete

program cycle of the user programsince the last reset (or program start).

Graphic display:

Time behaviour:

RESET

GET_PLC_MIN_CYCLE maxmax

Function description:

The GET_PLC_MIN_CYCLE function returns the minimum time for the execution ofa program cycle with a 1 ms resolution. Following a program start, the output value isset to the numerical maximum value (T#1m5s535ms).

Page 398: Wago Pro Manual

Appendix A - Additional Libraries

WAGO-I/O-PRO 32 System A-9

GET_PROGRAM_ID

WAGO-I/O-PRO 32 Library elementsCategory: Running time diagnosisName: GET_PROGRAM_IDType: Function X Function block ProgramLibrary name: System.libApplicable to: All programmable fieldbus controllers

Input parameter: Data type: Comments:EN BOOL This function is activated by a TRUE at

this input.

Return value: Data type: Comments:GET_PROGRAM_ID DWORD Program ID of the current SPS

programm

Graphic display:

Time behaviour:

Function description:

The function GET_PROGRAM_ID sends back the current ID of the SPS program.The identifier being modified with each online change, this function can be used toidentify an online change.

Available as from library version 3.0

Page 399: Wago Pro Manual

GET_RUN_VALUE

A-10 System WAGO-I/O-PRO 32

GET_RUN_VALUE

WAGO-I/O-PRO - Library elementsCategory: Running time diagnosisName: GET_RUN_VALUEType: Function X Function block ProgramLibrary name: System.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:RESET BOOL The value at this input is not taken into

account (the input has only beeninserted because functions must havean input).

Return value: Data type: Comments:GET_RUN_VALUE BOOL The output is TRUE for one cycle after

a PLC start.

Graphic display:

Time behaviour:

RESET

GET_RUN_VALUE

Start

Function description:

The GET_RUN_VALUE function helps to recognise the first PLC cycle after theprogram start. The user can then program the PLC starting behaviour. The output isTRUE only for one cycle. See also GET_STOP_VALUE to recognise a programstop.

Available as from library version 2.0

Page 400: Wago Pro Manual

Appendix A - Additional Libraries

WAGO-I/O-PRO 32 System A-11

GET_STOP_VALUE

WAGO-I/O-PRO 32 Library elementsCategory: Running time diagnosisName: GET_STOP_VALUEType: Function X Function block ProgramLibrary name: System.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:RESET BOOL The value at this input is not taken into

account (the input has only beeninserted because functions must havean input).

Return value: Data type: Comments:GET_STOP_VALUE BOOL The output is TRUE in the last cycle

before a PLC stop.

Graphic display:

Time behaviour:

RESET

GET_STOP_VALUE

Stop

Function description:

The GET_STOP_VALUE function helps to recognise the last PLC cycle before aprogram stop. The user can then program the PLC behaviour when stopped. Theoutput is TRUE only for one cycle. See also GET_ RUN _VALUE to recognise aprogram start.

The PLC outputs can be switched in a safe state with this function.

Available as from library version 2.0

Page 401: Wago Pro Manual

SYSTEM_VERSION

A-12 System WAGO-I/O-PRO 32

SYSTEM_VERSION

WAGO-I/O-PRO 32 Library elementsCategory: Running time diagnosisName: SYSTEM_VERSIONType: Function X Function block ProgramLibrary name: System.libApplicable to: All programmable fieldbus controllers

Input parameters: Data type: Comments:EN BOOL A TRUE at this input activates this

function.

Return value: Data type: Comments:SYSTEM_VERSION WORD Library version.

Graphic display:

Time behaviour:

EN

SYSTEM_VERSION

Function description:

The SYSTEM_VERSION function returns the current library version number. Thisfunction can be used for information purposes during program development.Furthermore it can serve to avoid version conflicts with the running time.

Version: Description:

1.0 First version (16#100)2.0 The GET_RUN_VALUE function and

GET_STOP_VALUE have been completed (16#200)3.0 The function GET_PROGRAM_ID was supplemented. (16#300)

Page 402: Wago Pro Manual

A-14 System WAGO-I/O-PRO 32

Page 403: Wago Pro Manual

Appendix B � Communication Drivers

WAGO-I/O-PRO 32 B-1

Appendix B: Communication Drivers

Installation

The communication drivers are on the WAGO-I/O-PRO 32 CD.

The installation program is started from the D drive in the followinginstructions. In case you would like to use another drive, please enter thecorresponding letter.

To install communication drivers:

1. Put the WAGO-I/O-PRO 32-CD in the D drive.

2. In case "Autoplay" is selected in your system the set-up will be startedautomatically. Proceed with step 6.

If the set-up is not starting automatically please proceed with step 3.

3. Select "Execute" in the Windows "Start" menu

4. Start the WAGO-I/O-PRO 32 set-up.

5. Enter "D:\setup.exe" (D is the drive with the WAGO-I/O-PRO-32-CD) and start the set-up by clicking on "OK".

6. Select the set-up language.

The rest of the set-up is taking place via menus. Please follow the instructionsto complete the set-up. If possible the proposed settings should be adopted.

You will be asked for the set-up type during the installation.

���� Click on "Communication driver installation" and confirm with"Next".

A dialog appears to select the libraries.

���� Select the components you would like to install and delete the ones youwouldn�t like to install.

Page 404: Wago Pro Manual

Appendix B � Communication Drivers

B-2 WAGO-I/O-PRO 32

Page 405: Wago Pro Manual

Appendix B � Communication Drivers

WAGO-I/O-PRO 32 B-3

Contents

CANopen DSP302CANopen HilscherModbusOPC ClientOPC Client 2 TagsPI Applicom DriverPI Hilscher DriverPipe*Serial (Modem)*Serial (RS232)*TCP/IP*TCP/IP (Level 2)*

*These communication drivers are ready installed in WAGO-I/O-PRO 32.

Page 406: Wago Pro Manual

Appendix B � Communication Drivers

B-4 WAGO-I/O-PRO 32

Page 407: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 CANopen DSP302 B-1

CANopen DSP302

WAGO-I/O-PRO 32 Communication drivers

Category: CANopen communicationName: GDrvStd.dll, CAN_AC2_3S.dll, CAN_VCI.dllHardware: STZP CAN card with VCI Interface or Softing AC2Software: -Operating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: Currently not in use

(In the future all CANopen programmable fieldbus controllers)

Communicationparameters:

Range of value: Comments:

Node number 1 ... 127 Enter the module ID of the controllerwith which a connection is to be made.The connection is made via the defaultSDOs.

Baud rate 10 kBd,20 kBd,50 kBd,125 kBd,250 kBd,500 kBd,800 kBd,1 MBd

The required baud rate is selectedhere. Only set a baud rate which isused in the entire network.

CAN card driver [Name of the CANcard interface DLL]currentlyCAN_AC2_3S andCAN_VCI

Enter the name of the DLL whichcreates the link to the CAN card driver.Undertake the configuration of the CANcard must using the cardmanufacturer’s tools.

Page 408: Wago Pro Manual

CANopen DSP302

B-2 CANopen DSP302 WAGO-I/O-PRO 32

Graphic display:

Image B.3: Graphic display CANopen DSP302

Function description:

Two objects are defined in the CIA DS 302, permitting a program download and aconnection to the programming system.

The objects „Download Program Data“ (0x1F50) and „OS Command“ (0x1023) areused.

During program download all programs are written to the index 1 ( program number1) of the „Download Program Data“ object.

In addition the indexes 1 (Command), 2 (Status) and 3 (Reply) of the object „O OSCommand“ (0x1023) are used.

System configuration:

ONTxDRxD

I/O RUNI/O ERR

0

5678 9

1234

0

5678

9 1234

MODBUS

WA

GO

�� ���� ��I/

O �� ��

�� ��S

YSTE

M7

50

-31

2

CRC24V 0V

++

- -

WAGO750-554

- -

S S

++

WAGO750-600

ONTxDRxD

I/O RUNI/O ERR

0

56789

1234

0

5678

9 1234

MODBUS

WA

GO

�� ���� ��I/

O �� ��

�� ��S

YSTE

M7

50

-31

2

CRC24V 0V

++

- -

WAGO750-554

- -

S S

++

WAGO750-600

CANopenslave

CANopenmaster

Image B.4: System configuration CANopen DSP302

Page 409: Wago Pro Manual

Appendix B � Communication Drivers

WAGO-I/O-PRO 32 CANopen Hilscher B-1

CANopen Hilscher

WAGO-I/O-PRO 32 Communication driversCategory: CANopen communicationName: CANopenHilscher.dllHardware: Hilscher fieldbus interface cards for PCs

e. g. CIF 30-xxxSoftware: -Operating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: All CANopen programmable fieldbus controllers

Communicationparameters:

Range of value: Comments:

Interface Board 0,Board 1Board 2,Board 3

Select the interface board. Up to 4Hilscher fieldbus boards can beinstalled in a PC. This parameterspecifies the board to be used.

Baudrate 10 kBd,20 kBd,50 kBd,100 kBd,125 kBd,250 kBd,500 kBd,800 kBd,1 MBd

The required baudrate is selected here.Only set a baud rate which is used inthe entire network.

Node ID 1 ... 126 Enter the module ID of the controllerwith which the connection is to bemade.The connection is made via the default-SDOs.

Database RETAIN;CLEAR

Do not configure the Hilscher board asCANopen master. To ensure this thedatabase can be cleared by selecting�CLEAR" on the board.

Debug level 16#0000 ...16#FFFF

Set this parameter to 0. The parameteris only used for debugging.

Page 410: Wago Pro Manual

CANopen Hilscher

B-2 CANopen Hilscher WAGO-I/O-PRO 32

Graphic display:

Image B.5: Graphic display CANopen Hilscher

Function description:

All CANopen controllers offer the possibility of making a communication connectionvia the CAN interface. For this the manufacturer specific object �ComWagoPro�(Index 4A00) was introduced. Data to be sent to the controller are written on index 1.The feedback values are read by index 2.

The driver CANopenHilscher makes a communication connection between the PCand controller via SDOs. Prerequisite being a Hilscher CANopen interface board.This board must not be configured with the system configurator. If the master wasalready configured then clear the database on the interface board. The interfaceboard will otherwise attempt to configure the assigned nodes.Each board can only establish a connection to one node simultaneously.

System configuration:

ONTxDRxD

I/O RUNI/O ERR

0

5678 9

12 34

0

5678

9 12 34

MODBUS

WA

GO

�� ���� ��I/

O �� ��

�� ��S

YSTE

M7

50

-31

2

CRC24V 0V

++

- -

WAGO750-554

- -

S S

++

WAGO750-600

ONTxDRxD

I/O RUNI/O ERR

0

5678 9

1234

0

5678

9 12 34

MODBUS

WA

GO

�� ���� ��I/

O �� ��

�� ��S

YSTE

M7

50

-31

2

CRC24V 0V

++

- -

WAGO750-554

- -

S S

++

WAGO750-600

CANopenslave

CANopenmaster

Image B.6: System configuration CANopen Hilscher

Page 411: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 MODBUS B-1

MODBUS

WAGO-I/O-PRO 32 Communication drivers

Category: MODBUS communicationName: ModbusDriver.dllHardware: -Software: -Operating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: All MODBUS programmable fieldbus controllers

Communicationparameters:

Range of value: Comments:

MODBUSnode adress

1 ... 99 MODBUS slave addresses.

Mode RTU MODBUS transmission mode.With MODBUS the ASCII or RTU modecan be selected for coding thetransmitted characters. Thetransmission mode used must coincidewith the controller settings.

Interface COM1; COM2;COM3, COM4,COM5, COM6,COM7, COM8;COM9

This parameter selects the Windowsdriver for the PC serial interface.

Baudrate 110 Bd, 300 Bd,600 Bd, 1200 Bd;2400 Bd, 4800 Bd,9600 Bd, 19200 Bd,38400 Bd;56000 Bd,57600 Bd,115200 Bd,128000 Bd,256000 Bd

Transmission rate for the serialcommunication.The value must coincide with the valueset in the controller.

String lenght 8 Bit,7 Bit

Length of the data in a byte frame.Always use 8 bits for the RTU mode.This value must coincide with thecontroller settings.

Page 412: Wago Pro Manual

MODBUS

B-2 MODBUS WAGO-I/O-PRO 32

Parity None,even,odd,1 bit,0 bit

The byte frame can be saved withadditional bits. The parity type isselected with this parameter. The valuemust coincide with the controllersettings.

Stop bits 1,1.5,2

The length of the stop bit can beentered to extend the byte frames. Thisvalue must coincide with the controllersettings.

RTS Control disabled,enabled,handshake,toggle

Conversion from RS232 to RS485 isgenerally performed with the controlsignal RTS. The RTS signal thencontrols the bus drivers (transmit orreceive). The selected value mustharmonise with the converter settings.The settings have no meaning for theRS232 controller. The „Toggle“ settingis only converted by the operatingsystem NT4.0.

Debug level 16#0000 ...16#FFFF

This parameter must be set to 0. Thisparameter is only used for debugging.

Graphic display:

Image B.9: Graphic display MODBUS Driver

Page 413: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 MODBUS B-3

Function description:

MODBUS controllers can be programmed directly from a PC via MODBUS. For thisthe „ModbusDriver" is used. MODBUS being a Single-Master-Bus system, ensurethat no second master is active during programming.

The driver communicates via the function code 13. The communication data ispacked in a MODBUS frame.

System configuration:

Image B.10: System configuration MODBUS Driver

Page 414: Wago Pro Manual

MODBUS

B-4 MODBUS WAGO-I/O-PRO 32

Page 415: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 OPC Client B-1

OPC Client

WAGO-I/O-PRO 32 Communication drivers

Category: Process image communicationName: OPCclientDriver.dllHardware: -Software: Optional OPC server with access to the controller I/O dataOperating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: All programmable fieldbus controllers

Communicationparameters:

Range of value: Comments:

OPC server ID [Identification of allOPC serversavailable on thecomputer]

Selection of all of the OPC serveravailable on the computer. Whenstarting the WAGO-I/O-PRO 32 serverthis information is read out of theregistry. The OPC server whichsupplies the tags for PA communicationis selected here. The server must becorrespondingly configured in advance.The selected OPC server in thecommunication driver must be checkedafter a new OPC server is installed onthe computer.

OPC tag ID [Tag name] The tag via which the PAcommunication is to be performed isentered here. The tag must be of a readand write type.

OPC tag data type 2-Byte signedinteger, VT_I2

OPC tag data type.Currently only 2 byte signed integer canbe selected.

Debug level 16#0000 ....16#FFFF

This parameter must be set to 0. Thisparameter is only used for debuggingpurposes.

Page 416: Wago Pro Manual

OPC Client

B-2 OPC Client WAGO-I/O-PRO 32

Graphic display:

Image B.11: Graphic display OPC Client

Function description:

All controllers offer the possibility of establishing a communication connection via thedata in the process image. For this an additional word is introduced into the inputand output image. The configuration is described in the manual for the individualcontroller under „PA communication".

The „OPCclient" driver establishes a communication connection between PC andcontroller via this data with the aid of an OPC server. Prerequisite being an OPCserver, which permits access to the controller I/O data. The server must be on thecomputer, on which the WAGO I/O PRO 32 Server is running. On the server thecommunication words in the I/O image of the controller must be configured as a writeand read tag.

The communication can be tested by the output of the values 16#0000 and16#0007. The communication channel is reset with the output of the value 16#0000.Following this 16#0000 appears in the read tag. The channel function is tested withthe value 16#0007. If the channel is correctly configured the input word will be16#0004. This same method can be used to check the configuration of the OPCtags.

Do not use the PA communication tags for applications. If an output is requiredselect the value 16#0000.

The „OPC Browser" tool can be used to simplify handling of the sometimes very longtag names. The tool shows all tags on a server. The marked tag can be copied intothe Windows clipboard and pasted into WAGO-I/O-Pro 32.

Also refer to „OPC Client 2 Tags".

Page 417: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 OPC Client B-3

System configuration:

ONTxDRxD

I/O RUNI/O ERR

0

56789 1234

0

56789 1234

MODBUS

WA

GO

�� ���� ��I/

O �� ��

�� ��S

YSTE

M7

50

-31

2

CRC24V 0V

++

- -

WAGO750-554

- -

S S

++

WAGO750-600

WAGO-I/O-PRO 32

OPC Server

Image B.12: System Configuration OPC Client

Page 418: Wago Pro Manual

OPC Client

B-4 OPC Client WAGO-I/O-PRO 32

Page 419: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 OPC Client 2 Tags B-1

OPC Client 2 Tags

WAGO-I/O-PRO 32 Communication drivers

Category: Process image communicationName: OPCclientDriver2Tags.dllHardware: -Software: Optional OPC server with access to the I/O data of the

controllersOperating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: All programmable fieldbus controllers

Communicationparameters:

Range of value: Comments:

OPC server ID [Designation of allavailable OPCservers on thecomputer]

Selection of all OPC servers availableon the computer.This information is read out of theregistry when starting the WAGO-I/O-PRO 32 server. The OPC server isselected here which supplies the tagsto the PA communication. The servermust be correspondingly configured inadvance.After installing a new OPC server onthe computer, the selected OPC servermust be checked in the communicationdriver.

OPC read tag ID [Read Tagname]

The tag is entered here via which theinput word of the PA communication isread.

OPC read tag datatype

2-byte signedinteger, VT_I2

Data type of the OPC tags.Currently only 2 byte signed integer canbe selected.

OPC write tag ID [Write Tagname]

The tag is entered which permits towrite in the output word of the PAcommunication.

OPC write tag datatype

2-byte signedinteger, VT_I2

Data type of the OPC tag.Currently only 2 byte signed integer canbe selected.

Debug level 16#0000 ....16#FFFF

This parameter must be set to 0. Thisparameter is only used for debuggingpurposes.

Page 420: Wago Pro Manual

OPC Client 2 Tags

B-2 OPC Client 2 Tags WAGO-I/O-PRO 32

Graphic display:

Image B.13: Graphic display OPC Client 2 Tags

Function description:

All controllers offer the possibility of opening up a communication connection via thedata in the process image. For this an additional word is introduced into the inputand output image. The configuration is described in the manual for the individualcontroller under „PA communication".

The „OPCclientDriver2Tags" driver establishes a communication connectionbetween PC and controller via this data with the aid of an OPC server. Prerequisitebeing an OPC server, which permits access to the controller I/O data. The servermust be on the computer, on which the WAGO I/O PRO 32 Server is running. On theserver the communication words in the I/O image of the controller must beconfigured as a write and read tag.

The communication channel can be tested by the output of values 16#0000 and16#0007. The communication channel is reset with the output of the value 16#0000.Following this 16#0000 appears in the read tag. The channel function is tested withthe value 16#0007. If the channel is correctly configured the input word will be16#0004. This same method can be used to check the configuration of the OPCtags.

Do not use the PA communication tags for applications. If an output is requiredselect the value 16#0000.

The „OPC Browser" tool can be used to simplify handling of the sometimes very longtag names. The tool shows all tags on a server. The marked tag can be copied intothe Windows clipboard and pasted into WAGO-I/O-Pro 32.

Also refer to „OPC Client".

Page 421: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 OPC Client 2 Tags B-3

System configuration:

ONTxDRxD

I/O RUNI/O ERR

0

56789 1234

0

56789 1234

MODBUS

WA

GO

�� ���� ��I/

O �� ��

�� ��S

YSTE

M7

50

-31

2

CRC24V 0V

++

- -

WAGO750-554

- -

S S

++

WAGO750-600

WAGO-I/O-PRO 32

OPC Server

Image B.14: System configuration OPC Client 2 Tags

Page 422: Wago Pro Manual

OPC Client 2 Tags

B-4 OPC Client 2 Tags WAGO-I/O-PRO 32

Page 423: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 PI Applicom Driver B-1

PI Applicom Driver

WAGO-I/O-PRO 32 Communication drivers

Category: Process image communicationName: PIApplicomDriver.DLLHardware: Applicom® Feldbus Interface cards for PCs

e.g. PCI2000PFBSoftware: -Operating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: All controllers

Communicationparameters:

Range of value: Comments:

Interface Board1 ... Board8 Interface card selection. Up to 8Applicom® fieldbus cards can beinstalled in a PC. This parameter showsthe card to be used. It is currently notevaluated.

Interface channel 0 ... 31 Channel number selection. The channelnumber is established during projectplanning with the PCCONF program.

Equipment number 0 ... 255 Equipment number selection. Theequipment number is establishedduring project planning with thePCCONF program.

Input address 0 ... 2047 The address for the communicationword is given in the saving image of theIO data, which is read by the controller.The offset is shown in number of bytes.

Output address 0 ... 2047 The address for the communicationword is given in the saving image of theIO data, which is written in thecontroller. The offset is displayed innumber of bytes.

Data encoding Intel format orMotorola format

Here the byte sequence within a wordis set. Generally the Intel format shouldbe set. The Motorola format is usedwith some FB (e.g. InterBus-S). In thiscase it may be necessary to changeover to Motorola format.

Debug level 16#0000 ...16#FFFF

This parameter must be set to 0. Theparameter is only used for debuggingpurposes.

Page 424: Wago Pro Manual

Appendix B – Communication Drivers

B-2 PI Applicom Driver WAGO-I/O-PRO 32

Graphic display:

Image B.1: Graphic Applicom PI Driver

Function description:

All controllers offer the possibility of a communication connection via the data in theprocess image. For this an additional word is inserted in the input and output image.The configuration is described in the manual for the individual controller under theheading PA communication.

The Applicom PI Driver establishes a communication between the PC and controllerusing this data. Prerequisite being an Applicom® interface card. This card isconfigured with the PCCONF configuration tool so that the PA communications wordappears in the IO mask.

A test of the communication channel can be made by the output of values 16#0000and 16#0007. The communication channel is reset with the output of value 16#0000.Following this 16#0000 appears in the input word. The channel function is testedwith value 16#0007. If the channel configuration is correct the input word will be16#0004. This method can also be used to check the position of the data in the cardsaving image.

The data words for PA communication should not be transmitted by the application. If anoutput must be made select value 16#0000 .

Page 425: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 PI Applicom Driver B-3

System configuration:

Image B.2: System configuration Applicom PI Driver

Page 426: Wago Pro Manual

Appendix B – Communication Drivers

B-4 PI Applicom Driver WAGO-I/O-PRO 32

Page 427: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 PI Hilscher Driver B-1

PI Hilscher Driver

WAGO-I/O-PRO 32 Communication drivers

Category: Process image communicationName: PIHilscherDriver.DLLHardware: Hilscher fieldbus interface cards for PC's

e. g. CIF 30-xxxSoftware: -Operating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: All programmable fieldbus controllers

Communicationparameters:

Range of value: Comments:

Interface Board 0,Board 1,Board 2,Board 3

Selection of the interface board. Up to 44 Hilscher fieldbus boards can beinstalled in a PC. This parameterspecifies the board to be used.

Input address 0 ... 2047 The address for the communicationword in the process image of the I/Odata read by the controller is givenhere. The offset is specified in numberof bytes.

Output address 0 ... 2047 The address for the communicationword in the process image of the I/Odata written into the controller is givenhere. The offset is specified in numberof bytes.

Data encoding Intel format orMotorola format

The byte sequence within a word is sethere. Generally the Intel format shouldbe set. Some fieldbuses (e.g. IntelBus-S) use the Motorola format. Here it maybe necessary to change over toMotorola format.

Debug level 16#0000 ...16#FFFF

This parameter must be set to 0. Theparameter is only used for debuggingpurposes.

Page 428: Wago Pro Manual

PI Hilscher Driver

B-2 PI Hilscher Driver WAGO-I/O-PRO 32

Graphic display:

Image B.7: Graphic display PI Hilscher Driver

Function description:

All controllers offer the possibility of establishing a communication connection via thedata in the process image. For this an additional word is introduced into the inputand output image. The configuration is described in the manual for the individualcontroller under „PA communication".

The HilscherPIDriver driver establishes a communication connection between thePC and controller via this data. Prerequisite is a Hilscher interface board. This boardis configured with the system configurator so that the PA communication wordsappear in the I/O image. The communication channel can be tested by the output ofthe values 16#0000 and 16#0007. The communication channel is reset with theoutput of the value 16#0000. Following this 16#0000 appears in the input word. Thechannel function is tested with the value 16#0007. If the channel is correctlyconfigured, the input word assumes 16#0004. This method allows checking the dataposition in the process image.

The data words for PA communication should not be put out by the application. If anoutput is necessary select the value 16#0000.

(PA = Process imageI/O = Inputs/Outputs)

Page 429: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 PI Hilscher Driver B-3

System configuration:

Image B.8: System configuration PI Hilscher Driver

Page 430: Wago Pro Manual

PI Hilscher Driver

B-4 PI Hilscher Driver WAGO-I/O-PRO 32

Page 431: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 Pipe B-1

Pipe

WAGO-I/O-PRO 32 Communication drivers

Category: Standard communicationName: GDrvStd.dllHardware: -Software: -Operating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: Currently cannot be used.

Communicationparameters:

Range of value: Comments:

Pipe [Name of the namedpipe]

Enter here the named pipe which is tobe used for communication.

Timeout 0 ... 255 The timeout time is entered here inseconds.

Graphic display:

Image B.15: Graphic display Pipe

Page 432: Wago Pro Manual

Pipe

B-2 Pipe WAGO-I/O-PRO 32

Function description:

System configuration:

Page 433: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 Serial (Modem) B-1

Serial (Modem)

WAGO-I/O-PRO 32 Communication drivers

Category: Standard communicationName: GDrvStd.dllHardware: Modem, Configuration cable Item no. 750-920Software: -Operating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: All programmable fieldbus controllers

Communicationparameters:

Range of value: Comments:

Init [Character string forinitialising]

This character string is transmitted toinitialise the modem. The content ismodem specific and should be checkedin the modem manual.

Dial [Character string forselecting thetelephone number]

This character string is transmitted fordialling the number. The character to betransmitted is dependent upon thetelephone system used. Check this inthe modem manual.

Hangup [Character string forterminatingcommunication]

This character string is transmitted forterminating the modem connection. Thecontent is modem specific and shouldbe checked in your modem manual

Break [Character string forswitching overbetween datatransfer and modemconfiguration]

This character string is used to switchover between data transfer and modemconfiguration. Modems generally usethe character string „+++“.

Timeout 0 ... 255 The timeout for recognising a break isentered here. Refer to your modemmanual for more precise details.

Port COM1,COM2,[available interfaces]

This parameter selects the Windowsdriver for the PC serial interface.

Page 434: Wago Pro Manual

Serial (Modem)

B-2 Serial (Modem) WAGO-I/O-PRO 32

Baudrate 4800 Bd,9600 Bd,19200 Bd,38400 Bd,57600 Bd,115200 Bd

Transmission rate for serialcommunication. The value must be setto 19200 Bd.

Parity no,even,odd

The byte frame can be protected withadditional bits. This parameter selectsthe parity type. "Even" must beselected.

Stop bits 1,1.5,2

The length of the stop bit can beentered to extend the byte frame.

Motorola byteorder No,Yes

Select the value "No".

Graphic display:

Image B.17: Graphic display Serial (Modem)

Function description:

All controllers can be linked to the configuration interface via a modem connection.Two modems are required for this. The modem on the controller side is configured to„auto answer“ and the fixed baud rate 19200 with „even Parity" and „8 Bit datawidth". The second modem is linked to the PC. A transparent connection is createdvia the telephone line between the PC and configuration interface after selecting themodem on the controller side.

Page 435: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 Serial (Modem) B-3

System configuration:

ONTxDRxD

I/O RUNI/O ERR

0

56789 1234

0

5678

9 1234

MODBUS

WA

GO

�� ���� ��I/

O �� ��

�� ��S

YSTE

M7

50

-31

2

CRC24V 0V

++

- -

WAGO750-554

- -

S S

++

WAGO750-600

Image B.18: System configuration Serial (Modem)

Page 436: Wago Pro Manual

Serial (Modem)

B-4 Serial (Modem) WAGO-I/O-PRO 32

Page 437: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 Serial (RS232) B-1

Serial (RS232)

WAGO-I/O-PRO 32 Communication drivers

Category: Standard communicationName: GDrvStd.dllHardware: Configuration cable Item no. 750-920Software: -Operating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: All programmable fieldbus controllers

Communicationparameters:

Range of value: Comments:

Port COM1,COM2[available interfaces]

This parameter selects the Windowsdriver for the PC serial interface.

Baudrate 4800 Bd, 9600 Bd,19200 Bd,38400 Bd,57600 Bd,115200 Bd

Transmission rate for serialcommunication. Set this value to19200 Bd.

Parity no,even,odd

The byte frame can be protected withadditional bits. This parameter selectsthe parity type. "Even" must beselected.

Stop bits 1,1.5,2

The length of the stop bit can beentered to extend the byte frame.

Motorola byteorder No,Yes

Select the value "No".

Page 438: Wago Pro Manual

Serial (RS232)

B-2 Serial (RS232) WAGO-I/O-PRO 32

Graphic display:

Image B.19: Graphic display Serial (RS232)

Function description:

All controllers can be directly programmed from a PC via the configuration interface.

System configuration:

ONTxDRxD

I/O RUNI/O ERR

0

5678

9 12 34

0

5678

9 1234

MODBUS

WA

GO

�� ���� ��I

/O �� ��

�� ��S

YSTE

M7

50

-31

2

CRC24V 0V

++

- -

WAGO750-554

- -

S S

++

WAGO750-600

CANopenmaster

COMx

750-920

Image B.20: System configuration Serial (RS232)

Page 439: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 TCP/IP B-1

TCP/IP

WAGO-I/O-PRO 32 Communication driver

Category: Standard communicationName: GDrvStd.dllHardware: Network card for Ethernet (Terminal server)Software: TCP/IP Network protocol (component part of Windows)Operating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: Currently cannot be used

Communicationparameters:

Range of value: Comments:

Address [IP address],[Host-Name]

The IP address or the host name isentered here. „Localhost" can be usedfor the own computer.The syntax for an IP address is :xxx.xxx.xxx.xxx. (e.g. 134.28.42.13).

Port 0 ... 65535,preferentially 2455

Port number to be used for theconnection.Generally the port number for theWAGO-I/O system (2455) should beused. If 2455 is not used then the portnumber for a dynamic connection in therange 49152 ... 65535 should be used.The range 0 ... 1023 is reserved for the„well known" ports. The range 1024 ...49151 is assigned manufacturerspecific.

Motorola byteorder No,Yes

Select the value „No"

Page 440: Wago Pro Manual

TCP/IP

B-2 TCP/IP WAGO-I/O-PRO 32

Graphic display:

Image B.21: Graphic display TCP/IP

Function description:

System configuration:

Page 441: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 TCP/IP (Level 2) B-1

TCP/IP (Level 2)

WAGO-I/O-PRO 32 Communication drivers

Category: Standard communicationName: GDrvStd.dllHardware: Network card for Ethernet (Terminal server)Software: TCP/IP Network protocol (component part of Windows)Operating system: Windows 95, Windows 98, Windows NT 4.0Applicable to: Ethernet controller

(with terminal server for all programmable fieldbus controller)

Communicationparameters:

Range of value: Comments:

Address [IP address],[Host-Name]

The IP address of the host name isentered here. „Localhost" can be usedfor the own computer.The syntax for an IP address is :xxx.xxx.xxx.xxx. (e.g. 134.28.42.13).

Port 0 ... 65535,preferentially 2455

Port number to be used for theconnection.Generally the port number for theWAGO-I/O system (2455) should beused. If 2455 is not used then the portnumber for dynamic connections in therange 49152 ... 65535 should be used.The range 0 ... 1023 is reserved for the„well known" ports. The range 1024 ...49151 is assigned manufacturerspecific.

Motorola byteorder No,Yes

Select the value „No"

Page 442: Wago Pro Manual

TCP/IP (Level 2)

B-2 TCP/IP (Level 2) WAGO-I/O-PRO 32

Graphic display:

Image B.23: Graphic display TCP/IP (Level 2)

Function description:

All Ethernet controllers can be directly programmed from a PC via a network card.

If a terminal server is used with a configuration cable, all controllers can beprogrammed via the network.

Page 443: Wago Pro Manual

Appendix B – Communication Drivers

WAGO-I/O-PRO 32 TCP/IP (Level 2) B-3

System configuration:

Image B.24: System configuration TCP/IP (Level 2)

Page 444: Wago Pro Manual

TCP/IP (Level 2)

B-4 TCP/IP (Level 2) WAGO-I/O-PRO 32

Page 445: Wago Pro Manual

Chapter 20 - Bibliography

WAGO-I/O-PRO 32 20-1

20 Bibliography

English

R. W. Lewis�Programming industrial control systems using IEC 1131-3�The institution of Electrical Engineers, LondonISBN 0-8529695-0-3; Please note UPDATED IN 1997

Dr. Monari, Prof. Bonfatti and Dr. Sampieri�IEC 1131-3 Programming Methodology�Software engineering methods for industrial automated systemsISBN 2-9511585-0-5

German

Hans-Joachim Adam, Mathias Adam"SPS"Programmieren in Anweisungsliste nach IEC 1131-3Elektor Verlag, AachenISBN 3-89576-048-X

Karl-Heinz John, Michael Tiegelkamp�SPS-Programmierung mit IEC 1131-3�Konzepte und Programmiersprachen, Anforderungen an Programmiersysteme,EntscheidungshilfenSpringer Verlag Berlin Heidelberg1997ISBN 3-540-62639-5

Peter Neumann, Eberhard E. Grötsch, Christoph Lubkoll, René Simon�SPS Standard: IEC 61131�Programmierung in verteilten AutomatisierungssystemenR. Oldenbourg Verlag München Wien 1998,ISBN 3-486-27005-2

Page 446: Wago Pro Manual

Bibliography

20-2 WAGO-I/O-PRO 32

VDE-Schriftenreihe � Normen verständlich"IEC 61131-3 � Wozu?"I. Rolle (Hrsg.) A. Lehmann, H. - P. Otto, L. Trapp, H. WegmannVDE-Verlag, BerlinISBN 3-8007-2309-3

Peter Wratil�Moderne Programmiertechnik für Automatisierungssysteme�EN 61131 (IEC 1131) verstehen und anwendenVogel Verlag Würzburg 1996ISBN 3-8023-1575-8

Web addresses

http://www.wago.com

http://www.plcopen.org

Page 447: Wago Pro Manual

Chapter 21 - Glossary

WAGO-I/O-PRO 32 21-1

21 Glossary

Absolute AddressRepresentation of individual memory cells using special character strings:

1st character: Recent symbol (%)

2nd character: Category (I = Input location, Q = Output location,M = Memory location)

3rd character: Memory size (X = Single bit, B = Byte, W = Word,D = Double Word)

following characters: Address

Example: %IX4.15

ConfigurationThe highest level of a PLC system, wich contains one or more resources

Data typeDefines the properties of a variable, such as value range and bit length

Declaration blockA list of declarations of identical types of variables in the first section of a POU

Derived data typesSelf defined data type, based on a elementary data type

Elementary data typeStandard data type predefined by IEC 61131-3

EN Input(Enable In) Enable input for a POU in Ladder logic or Function block diagram.The POU with EN input is only processed if the EN input value is TRUE.

FBAbbr. for Function block

FBDAbbr. for Function block diagram

Page 448: Wago Pro Manual

Glossary

21-2 WAGO-I/O-PRO 32

FB instanceCopy of the structured data block of a Function block, permitting the multipleuse of a created structures with varying parameters (e.g. Standard Funktionblocks). The data block saves internal values and statuses of the function blocksfor longer than one cycle.

FieldA series of elements of the same date type

FlagMemory for physical addressing

FUNAbbr. for Function

FunctionPOU, wich always the same result (as function value) with the same inputvalue; it has no local variable wich can save values beyond one invocation.

Function blockPOU, wich provides one or more values when executed. This can be saved as alocal variable ("Memory").

Function block diagram(Abbr.: FBD) graphically oriented programming language with networks withcontain Functions and Function blocks. The logic and arithmetic behaviour ofthese POU's is represented as a block.

IEC 61131-3International standard from the year 1993 for modern systems with PLCfunctionality. Based on a structured software model it defines a series of highcapacity programming languages, wich can be used for varying automationtasks.

ILAbbr. for Instruction list

Instruction list(Abbr.: IL) is a widely used text language close to that used for assemblers forPLC's (similar to Step5/Step7)

I/O peripheryThe Input and output modules belonging to a node together with their physicalprocess addresses

Page 449: Wago Pro Manual

Chapter 21 - Glossary

WAGO-I/O-PRO 32 21-3

Ladder diagram(Abbr.: LD) graphically orientated programming language wich uses theprinciple of an electric circuit with contacts and coils for the representation oflinks.

LDAbbr. for Ladder diagram

PLCAbbr. for Programmable Logic Controls

POU libraryA collection of POU's avaible to the programmer for the creation of controlprograms

PROGAbb. for Program

ProgramElement of a resource. The program is the highest level of the POU, i.e.Functions and Function blocks are invoked by a program. The time behaviourof the program is established by the attendant Tasks.

Programmable Fieldbus ControllerWAGO bus coupler with PLC functionality for

- Signal pre-processing

- Defined reaction in case of a fieldbus failure

- Decentral intelligence

Programmable Logic Controls(Abbr.: PLC) Component of industrial automation systems for the control,regulation, monitoring, visualisation as well as data collection and processingor processes

ProjectIncludes all objects of a control program (POU, data types, visualisations,resources and libraries)

ResourceLanguage element of a Configuration. A resource is task and program allotted.

Page 450: Wago Pro Manual

Glossary

21-4 WAGO-I/O-PRO 32

Sequential flow diagram(Abbr.: SFD) graphically oriented language, wich allows timed sequences ofvarious actions to be described within a program (similar to a flow chart andGraphcet)

SFCAbbr. for Sequential flow diagram

STAbbr. for Structured Text

Standard Function blocksFunction blocks defined by IEC 1131-3 wich meet the main requirements ofcontrol systems

StepIn an SFC program this stands for an area in wich instructions are processed foras long as it is active

Structured Text(Abbr.: ST) comprises of a series of instructions wich can be performed as instandard languages (e.g. Pascal) either conditionally ("IF...THEN...ELSE") or inloops ("WHILE...DO")

TaskDefines the running behaviour of Programs and Function blocks

TransitionTransitions from one SFC step to the next, dependent upon the Transition status

Transition conditionsCondition (Boolean value) for the activation of the next step in a SFC program

VariableData memory with a value defined by data type and information definingconcerning the variable declaration. Variables can be assigned physicaladdresses (inputs, outputs, flags).

Variables declarationDefining variables in a declaration block together with the variable name, thedata type and, if necessary, the initial value, area details and field properties

Page 451: Wago Pro Manual

Chapter 22 - Index

WAGO-I/O-PRO 32 22-1

22 Index

AABS 12-18Absolute Value 12-18Access rights 4-32ACOS 12-21Action 2-10, 2-20, 2-21, 3-8, 4-33Action Init 3-7Active step 2-22ADD 12-1Address Function 12-12Addresses 15-4ADR 12-12ALLIAS 11-7Alternative Branch in SFC 2-25, 5-29AND 12-3Arc cosine 12-21Arc sine 10-26 12-21Arc tangent 12-22Argument 2-3, 2-7ARRAY 11-4ASIN 12-21Assignment 2-14, 5-17Assignment Combs 5-19Assignment operator 2-16AT Declaration 5-4ATAN 12-22Auto Load 4-5Auto Save 4-5Autodeclaration 4-7, 5-5Autoformat 4-7

BBackup, automatic 4-5BCD conversion 14-1BCD_TO_INT 14-1Binding of ST operators 2-14Bitmap 8-3, 8-11Bitvalues 4-8BLINK 14-6Body 5-1, 5-13, 5-14, 5-22, 5-28Bookmark in Help 4-54BOOL 11-1BOOL Constants 15-1BOOL_TO Conversions 12-13Breakpoint 2-2, 2-29, 4-43, 5-10, 5-11, 5-35Breakpoint Dialog Box 4-44Breakpoint position 4-43Build 4-11, 4-21BYTE 11-1BYTE Constants 15-2

CCAL 12-13Call tree 4-22, 4-34Calling a function 2-3Calling a function block 2-7, 2-14Calling function blocks in ST 2-16CASE 2-15CASE instruction 2-17Changing connections in CFC 5-43CHARCURVE 14-7CheckBounds 2-4, 11-4CheckDivByte 2-5CheckDivDWord 2-5CheckDivReal 2-5CheckDivWord 2-5Coil 2-27, 5-24Collapse Node 4-29Colors 4-9, 8-7Comment 5-7, 5-8, 5-15Communications Parameters Gateway 4-47Comparing projects 4-24Compress 6-15CONCAT 13-2Concatenation 13-2Connection marker in CFC 5-43CONSTANT 5-3, 6-3Constants 5-3Contact 2-27, 5-23Content Operator 11-4, 12-12Context menu 4-4Context Sensitive Help 4-55Conversion of Integral Number Types 12-16Conversions of types 12-13Convert object 4-31Copy 4-37Copy in Help 4-53Copying in CFC 5-42Copying in FBD 5-21COS 12-20Cosine 12-20Create Backup 4-5Creating connections in CFC 5-42Cross reference list 4-22, 4-34CTD 13-9CTU 13-8CTUD 13-9Cut 4-37Cutting in FBD 5-21

DData types 2-11, 4-2, 11-1DATE 11-3DATE Constants 15-1DATE_AND_TIME 11-3DATE_AND_TIME Constants 15-2DATE_TO Conversions 12-17

Page 452: Wago Pro Manual

Index

22-2 WAGO-I/O-PRO 32

DCF file 6-2DDE Interface 9-1Debugger 5-10Debugging 2-29, 4-11, 5-15Declaration 3-5Declaration Editor 5-1Declaration Part 2-2, 5-1, 5-13, 5-14, 5-22, 5-28Declarations as tables 4-7, 5-6Declare Variable 4-41Declare, automatic 4-7, 5-5Defined Data Types 11-4Delete 4-38DELETE 13-3Deleting a Transition 5-31Deleting an Action 5-31Deleting connections in CFC 5-43Deleting in FBD 5-21Dereferencing 11-4, 12-12DERIVATIVE 14-3Desktop 4-8DINT 11-1DINT Constants 15-2Directory 4-10DIV 12-2

CheckDivByte 2-5CheckDivDWord 2-5CheckDivReal 2-5CheckDivWord 2-5

Division durch 0 2-5Document 4-19, 4-22Document Frame 6-4Download 4-13, 4-43, 4-51Drag&Drop 4-29DT 11-3DT_TO Conversions 12-17DWORD 11-1DWORD Constants 15-2

EEdit Menu

Copy 4-37Cut 4-37, 5-21Delete 4-38Find 4-39Find next 4-39Input Assistant 4-40Next error 4-41Paste 4-38, 5-21Previous error 4-41Redo 4-37Replace 4-39Undo 4-36

Editing functions 4-36Editor options 4-6Editors 5-1, 5-13, 5-14, 5-22, 5-28EN Input 2-28, 5-24EN POU 2-28END_FUNCTION_BLOCK 2-5

END_PROGRAM 2-9END_TYPE 11-5, 11-6, 11-7Endless loop 1-7Entering Trace Variables 6-10Entry action 5-30Entry action 2-22Enumeration 11-5EQ 12-11Error messages 17-1EXIT 2-15, 2-20Exit action 5-30Exit action 2-22EXP 12-20Expand Node 4-29Exponential Function 12-20Exponentiation 12-22Export 4-23export file 6-2Expression 2-14EXPT 12-22External library 4-18EXTRACT 14-2Extras Menu

Align 8-13Associate Action 5-34Auto Read 6-12Clear Action/Transition 5-31Clear Background Bitmap 8-12 8-13Compress 6-15Configure 8-5Cursor Mode 6-13Edit Entry 6-9Element list 8-13Link Docuframe File 6-5Load Trace 6-15Load Watch List 6-17Make Docuframe File 6-5Monitoring Active 6-18Monitoring Options 5-10Multi Channel 6-14Negate 5-20, 5-27Options 5-15, 5-33Paste above 5-27Paste after 5-26, 5-31Paste below 5-26Paste Parallel Branch (right) 5-30Previous version 4-36Read Receipt 6-19Read Trace 6-12Rename Watch List 6-17Save Trace 6-15Save Watch List 6-17Select All 8-13Select Background Bitmap 8-12Send to Back 8-12Send to Front 8-12Set Debug Task 6-9Set/Reset 5-20, 5-27Settings 8-14

Page 453: Wago Pro Manual

Chapter 22 - Index

WAGO-I/O-PRO 32 22-3

SFC Overview 5-33Show grid 6-14Start Trace 6-12Step Attributes 5-31Stop Trace 6-12Stretch 6-14Time Overview 5-32Trace Configuration 6-10Trace in ASCII-file 6-15Use IEC Steps 5-34Write Receipt 6-19Y Scaling 6-14Zoom 5-20Zoom Action/Transition 5-31

FF_TRIG 13-7falling edge 13-7FBD 2-4, 2-8, 2-26, 4-43, 5-16FBD Editor 5-16Feedback paths in CFC 5-48Fields 2-3, 11-4File 4-16File Menu

Close 4-17Exit 4-21New 4-16Open 4-16Print 4-18Printer Setup 4-19Save 4-17Save as 4-17

Find 4-39FIND 13-4Flow Control 4-46, 5-13Folder 4-29Font 4-7FOR 2-18FOR loop 2-15, 2-18Forcing 4-45, 5-8, 6-19Formatting, automatic 4-7Function 2-3, 15-5FUNCTION 2-3Function Block 2-5Function block call 2-7Function Block Diagram 2-4, 2-8, 4-43, 5-16Function Block in FBD 5-19Function block in LD 2-27Function block, instance 2-6Function call 2-3Function declaration 2-3Function in FBD 5-19FUNCTION_BLOCK 2-5

GGateway 4-47

Gateway Server 4-47GE 12-11GEN 14-6Global Constants 6-2Global Retain Variables 6-2Global Variables 6-1, 6-2Graphic Editors 5-14Grid 8-14GT 12-10

HHelp 4-52Help Menu

Contents and Index 4-52Help Topics Window 4-52HYSTERESIS 14-9

IIdentifier 5-3, 15-3IEC 61131-3 2-30IEC Step 2-22, 5-34IEC steps 2-23Iecsfc.lib 2-23IF instruction 2-15, 2-17IL 2-3, 2-6, 2-7, 2-12, 4-43, 5-12IL Editor 5-12IL operator 2-12Implicit at load 4-13Implicit variables in SFC 2-24Import 4-24Index Window 4-54INDEXOF 12-3Initialization 5-3Input and Output Variable 5-2Input Assistant 4-40Input in FBD 5-19Input Variable 5-1INSERT 13-3Insert in LD 5-26Insert in SFC 5-29Insert Menu

Add Entry-Action 5-30Add Exit-Action 5-30Additional Library 7-2All Instance Paths 6-4Alternative Branch (left) 5-29Alternative Branch (right) 5-29Append Program Call 6-8Append Task 6-8Assignment 5-17Bitmap 8-2, 8-3Coil 5-24Comment 5-15Contact 5-23Declarations Keywords 5-4Ellipse 8-2, 8-3

Page 454: Wago Pro Manual

Index

22-4 WAGO-I/O-PRO 32

Function 5-9, 5-19Function Block 5-10, 5-19, 5-24Function with EN 5-25Input 5-19Insert at Blocks 5-24, 5-26Insert Program Call 6-8Insert Task 6-8Jump 5-18, 5-26, 5-30Line 8-3Network (after) 5-15Network (before) 5-15New Declaration 5-7New Watch List 6-17Operand 5-9Operator 5-9, 5-18Operator with EN 5-25Output 5-19Parallel Branch (left) 5-30Parallel Branch (right) 5-29Parallel Contact 5-24Placeholder 4-20Polygon 8-2, 8-3Rectangle 8-2RETURN 5-18, 5-26Rounded Rectangle 8-2Step Transition (after) 5-29Step Transition (before) 5-29 5-29Transition-Jump 5-30Types 5-4Visualization 8-2, 8-3

Insert mode 5-8Insert Network 5-15Instance 2-6Instance name 2-6, 2-7Instruction 2-12, 2-14, 2-15Instruction List 2-3, 2-6, 2-7, 2-12, 4-43, 5-12INT 11-1INT Constants 15-2INT_TO_BCD 14-1INTEGRAL 14-3Internal library 4-18

JJump 2-25, 5-18Jump in SFC 5-28, 5-30

KKeywords 5-3, 5-4

LLabel 5-14Ladder Diagram 2-26, 4-43, 5-22LD 2-26, 4-43, 5-22LD Editor 5-22LE 12-11

LEFT 13-1LEN 13-1Library 2-11, 4-18Library directory 4-10Library Manager 3-4, 7-1Library, Define 7-2Library, Insert 7-2LIMIT 12-9LIMITALARM 14-10Line number field 4-44, 4-46, 5-11Line Number of the Text Editor 5-12Line numbers 5-6LN 12-19Load & Save 4-4Load Trace 6-15Load trace configuration 6-11Load Watch List 6-17Local Variable 5-2LOG 12-19Log in 4-42Logarithm 12-19Logout 4-42Loop 2-13, 2-15LT 12-10

MMain Help Window 4-53Main program 2-9Mark 4-8Marking in SFC 5-28MAX 12-9Memory location 15-4Menu Bar 4-1Menü Edit

Declare Variable 4-41Menu Extras

Connection marker 5-43Display order 5-44EN/ENO 5-40Negate 5-40Order - One backwards 5-46Order - One forwards 5-46Order � To the beginning 5-46Order � To the end 5-46Order everything according to data flow 5-46Order topologically 5-44Properties 5-41Select All 5-42Select Mode 8-13Set/Reset 5-40

Menu InsertBlock 5-39Block input 5-40Curve 8-3Input 5-39Jump 5-39Label 5-39Output 5-39

Page 455: Wago Pro Manual

Chapter 22 - Index

WAGO-I/O-PRO 32 22-5

Return 5-39Menu Online

Communications Parameters Gateway 4-47Sourcecode download 4-51

Menu ProjectAdd Action 4-33

Merge 4-25Message window 4-3MID 13-2MIN 12-9MOD 12-2Modifier 2-12Monitoring 2-29, 4-42, 5-7, 5-10, 6-18Moving in CFC 5-42MUL 12-1Multi Channel 6-14MUX 12-10

NNE 12-12Negation in FBD 5-20Negation in LD 5-27Network 5-15, 5-16Network Comment 5-15Network in FBD 2-26, 3-2Network in LD 2-27Network in SFC 3-7Network number field 4-44, 4-46New Folder 4-29Next error 4-41NOT 12-4Note in Help 4-53Notice at load 4-13Number Constants 15-2Number of data segments 4-12

OObject 2-2, 4-28Object Organizer 4-2Online 2-2, 5-10, 5-15, 6-18Online Change 4-21, 4-27Online functions 4-42Online in Security mode 4-9Online Menu

Breakpoint Dialog Box 4-44Download 4-43Force values 4-45Log in 4-42Logout 4-42Release Force 4-46Reset 4-43Run 4-43Show Call Stack 4-46Simulation 4-47Single Cycle 4-45Step in 4-45

Step over 4-44Stop 4-43Toggle Breakpoint 4-43Write values 4-45

Online Mode 4-42Declaration Editor 5-7Function Block Diagram Editor 5-21Ladder Editor 5-27Network Editor 5-15Sequential Function Chart Editor 5-35Text Editor 5-10Watch- and Receipt Manager 6-18

Operand 2-3, 5-9Operands 15-1Operator in FBD 3-4, 5-18Operators 5-9, 12-1Options 4-4OR 12-4Order of execution in CFC 5-44Output in FBD 5-19Output Variable 5-2Overwrite mode 5-8

PP 14-4PACK 14-2Parallel Branch in SFC 2-25, 5-29, 5-30Parallel Contacts 2-27, 5-24Password 4-12Passwords for user groups 4-28Pasting 4-38Pasting in FBD 5-21PD 14-5PID 14-5Placeholder 4-20PLC 4-42, 4-45PLC_PRG 2-9Pointer 11-4POINTER 11-4POU (Program Organization Unit) 2-1, 2-9, 3-1, 4-2Presentation 8-14Previous error 4-41Previous version 4-36Print 4-18Program 2-8PROGRAM 2-9Program call 2-8Project 2-1, 2-8, 3-1Project directory 4-10Project info 4-5, 4-25Project Menu

Add object 4-30Build 4-21Check all 4-21Compare 4-24Convert object 4-31Copy object 4-31Delete Object 4-30

Page 456: Wago Pro Manual

Index

22-6 WAGO-I/O-PRO 32

Document 4-22Export 4-23Global Replace 4-26Global Search 4-26Import 4-24Merge 4-25Object access rights 4-32Open object 4-32Options 4-4Passwords for user groups 4-28Project info 4-25Rebuild all 4-21Register Changes 4-27Rename object 4-31Show call tree 4-34Show cross reference list 4-34Show unused variables 4-35View instance 4-33

Project version 1.5 4-18PUTBIT 14-2

QQualifier 2-23

RR_TRIG 13-6RAMP_INT 14-8RAMP_REAL 14-9Read Receipt 6-19Read trace 6-11Read Trace 6-12REAL 11-1REAL Constants 15-2REAL_TO Conversions 12-16Receipt Manager 6-16Redo 4-37References 11-7Register Changes 4-27REPEAT 2-15REPEAT loop 2-19Replace 4-26, 4-39REPLACE 13-4Reset 4-43Reset Output 5-20, 5-27Resources 2-11, 4-2, 6-1RETAIN 5-2, 6-2Retain Variable 5-2RETURN 2-14, 2-17, 5-18RIGHT 13-1rising edge 13-6ROL 12-6ROR 12-7Rotation 12-6, 12-7RS 13-5Run 4-43

SSample Rate 6-11Sampling Trace 2-28, 6-9Save 4-17Save before compile 4-11Save Trace 6-15Screen divider 4-2SEL 12-8Selecting 4-8Selecting in CFC 5-42SEMA 13-6Sequential Function Chart 2-4, 2-8, 2-20, 3-7, 4-43,

5-28Set Output 5-20, 5-27Set/Reset coils 2-28SFC 2-4, 2-8, 2-20, 3-7, 4-43, 5-28SFC Editor 5-28SFC Flags 2-24SFC library 2-23SFC Overview 5-33SFCCurrentStep 2-25SFCEnableLimit 2-24SFCError 2-25SFCErrorPOU 2-25SFCErrorStep 2-25SFCInit 2-24SFCPause 2-25SFCQuitError 2-24SFCTrans 2-25Shift 12-5SHL 12-5Shortcut Mode 5-5Show Call Stack 4-46Show grid 6-14SHR 12-6Simulation 2-29, 3-14, 4-42, 4-47SIN 12-20Sine 12-20Single Cycle 4-45Single Step 2-29, 4-44, 5-35SINT 11-1SINT Constants 15-2SIZEOF 12-3Sourcecode download 4-51Sourcedownload 4-13SQRT 12-19Square Root 12-19SR 13-5ST 2-3, 2-7, 2-13, 4-43, 5-13ST Editor 5-13ST operand 2-14ST operator 2-14Standard data types 11-1Standard Function 7-2Standard Library 3-4, 7-2Standard POUs 2-3Standard.lib 7-2Start Trace 6-12

Page 457: Wago Pro Manual

Chapter 22 - Index

WAGO-I/O-PRO 32 22-7

Statistics 4-26STATISTICS_INT 14-3STATISTICS_REAL 14-4Status bar 4-3, 4-9, 8-5Step 2-21, 4-44, 5-28Step Attributes 5-31Step Init 2-22Stepping 5-10, 5-15, 5-35Stop 4-43Stop Trace 6-12Stretch 6-14STRING 11-2STRING Constants 15-3String Functions 13-1STRING_TO Conversions 12-18STRUCT 11-5Structured Text 2-3, 2-7, 2-13, 4-43, 5-13Structures 2-3, 11-5SUB 12-1Syntax Coloring 5-1, 5-4System Flag 15-3

TTab-width 4-7TAN 12-21Tangent 12-21Task Configuration 6-6Text Editors 5-8TIME 11-3TIME Constants 15-1Time Management in SFC Editor 5-32TIME_OF_DAY 11-3TIME_OF_DAY Constants 15-2TIME_TO Conversions 12-16Timer 13-10TO_BOOL Conversions 12-14TOD 11-3TOD_TO Conversions 12-16TOF 13-12TON 13-11Tool bar 4-2, 4-9Tooltip 4-2, 4-29, 5-8, 5-10, 5-15, 5-22, 5-28TP 3-5, 13-10Trace Buffer 6-9, 6-13Trace in ASCII-file 6-15Trace Variable 6-12Trace, Automatically Read 6-12Transition 2-22, 5-28Trigger 2-28, 6-11, 13-6Trigger Edge 6-11Trigger Level 6-11Trigger Position 6-11TRUNC 12-18TYPE 11-5, 11-7Type Conversions 12-13Types 5-4

UUDINT 11-1UDINT Constants 15-2UINT 11-1UINT Constants 15-2Undo 4-36UNPACK 14-2Unused variables 4-22User group 4-27User information 4-6USINT 11-1USINT Constants 15-2

VVAR 5-2, 5-6VAR_CONFIG 6-2, 6-3VAR_GLOBAL 5-6, 6-2VAR_IN_OUT 5-2VAR_INOUT 5-6VAR_INPUT 5-1, 5-6VAR_INPUT CONSTANT 5-41VAR_OUTPUT 5-2, 5-6Variable Configuration 6-3Variables 15-3Variables declaration 5-3VARIANCE 14-4Visualization 2-11, 4-2, 8-1

Bitmap 8-11Colors 8-7File - Print 8-16Input 8-10Motion absolute 8-8Motion relative 8-8Operation in online mode 8-16Operation over the keyboard 8-16Shape 8-6Text 8-6Tooltip 8-11Variables 8-9

Visualization Elements, Configure 8-5Visualization Elements, Copy 8-4Visualization Elements, Insert 8-2Visualization Elements, Shift, Move 8-4

WWAGO-I/O-PRO 2-1WAGO-I/O-PRO 32 Server 4-47Watch and Receipt Manager 6-16Watch and Receipt Manager Offline 6-16Watch and Receipt Manager Online 6-18Watch List 6-16Watch Variable 5-8, 5-21Watchdog 1-7WHILE loop 2-15, 2-19Window 4-51

Page 458: Wago Pro Manual

Index

22-8 WAGO-I/O-PRO 32

Window MenuArrange symbols 4-51Cascade 4-51Close all 4-51Library Manager 7-1Messages 4-52Tile Horizontal 4-51Tile Vertical 4-51

WORD 11-1WORD Constants 15-2Work space 4-3Write protection password 4-12Write Receipt 6-19

XXOR 12-4

YY Scaling 6-14

ZZoom 5-20Zoom Action 5-31Zoom Transition 5-31