Eliwell FREE Studio Plus Operating Guide 06-22 en
Eliwell FREE Studio Plus Operating Guide 06-22 en
Operating Guide
Original instructions
9MA10256.03
06/2022
www.eliwell.com
Legal Information
The Schneider Electric brand and any trademarks of Schneider Electric SE and its
subsidiaries referred to in this guide are the property of Schneider Electric SE or its
subsidiaries. All other brands may be trademarks of their respective owners.
This guide and its content are protected under applicable copyright laws and
furnished for informational use only. No part of this guide may be reproduced or
transmitted in any form or by any means (electronic, mechanical, photocopying,
recording, or otherwise), for any purpose, without the prior written permission of
Schneider Electric.
Schneider Electric does not grant any right or license for commercial use of the guide
or its content, except for a non-exclusive and personal license to consult it on an "as
is" basis. Schneider Electric products and equipment should be installed, operated,
serviced, and maintained only by qualified personnel.
As standards, specifications, and designs change from time to time, information
contained in this guide may be subject to change without notice.
To the extent permitted by applicable law, no responsibility or liability is assumed by
Schneider Electric and its subsidiaries for any errors or omissions in the informational
content of this material or consequences arising out of or resulting from the use of the
information contained herein.
9MA10256.03 3
Managing Resources Elements .................................................................54
Overview............................................................................................54
Resources Window .......................................................................54
Supported Protocols......................................................................56
Target Device .....................................................................................57
Modbus Objects..................................................................................58
Target Menus .....................................................................................60
Target Menu FREE Evolution/FREE Advance..................................60
Target Menu FREE Smart ..............................................................61
I/O Mapping........................................................................................62
Alarms ...............................................................................................62
Web Site ............................................................................................63
CAN Expansion Bus............................................................................65
CAN Expansion Bus Overview .......................................................65
Using an Expansion Module as CAN Expansion Bus Field
Slave............................................................................................66
CAN Expansion Bus for FREE Panel EVP.......................................69
CAN Custom Device......................................................................70
Using a CAN Custom Device .........................................................71
CAN Expansion Bus Field - Virtual Master Channels........................74
RS485 ...............................................................................................75
Overview ......................................................................................75
Using a EVE7500 27 I/O as RS485 Slave .......................................76
Generic Modbus Object Overview.................................................77
Generic Modbus Object Messages ...............................................77
Modbus Custom Devices .............................................................79
Using a Modbus Custom Device.....................................................81
Ethernet .............................................................................................82
Plugins...............................................................................................84
Technical Reference .................................................................................86
Modbus Protocol.................................................................................86
Overview ......................................................................................86
Data Types ...................................................................................87
Function Codes.............................................................................87
Programming .............................................................................................88
The Programming Tab.............................................................................89
Overview of the Programming Window .................................................89
Menu Bar ...........................................................................................91
Toolbars .............................................................................................92
Project Options.........................................................................................98
Project Options ...................................................................................98
General Tab..................................................................................98
Code Generation Tab ....................................................................99
Build Output Tab ......................................................................... 101
Debug Tab .................................................................................. 102
Build Events Tab ......................................................................... 103
Cross Reference Tab................................................................... 104
Run-time Checks Tab .................................................................. 105
Advanced Tab ............................................................................. 106
Working with Libraries ....................................................................... 106
Library Manager.......................................................................... 106
4 9MA10256.03
Exporting to a Library .................................................................. 108
Importing from a Library or Another Source ................................... 108
Updating Existing Libraries .......................................................... 110
Managing Project Elements..................................................................... 111
Project Window................................................................................. 111
Program Organization Units............................................................... 112
Overview .................................................................................... 112
Creating a Program ..................................................................... 112
Creating a Function Block/Function .............................................. 112
Editing POUs .............................................................................. 113
Source Code Encryption/Decryption ............................................. 114
Variables .......................................................................................... 114
Global Variables.......................................................................... 115
Local Variables ........................................................................... 119
Creating Multiple Variables .......................................................... 121
Tasks ............................................................................................... 122
Associating a Program to a Task................................................... 122
Task Configuration ...................................................................... 123
Derived Data Types .......................................................................... 124
Overview .................................................................................... 124
Typedefs .................................................................................... 124
Structures................................................................................... 126
Enumerations ............................................................................. 128
Subranges.................................................................................. 129
Browse the Project............................................................................ 130
Overview .................................................................................... 130
Object Browser ........................................................................... 131
Search with the Find in Project Command ..................................... 135
Project Custom Workspace ............................................................... 136
Overview .................................................................................... 136
Enable Custom Workspace Into an Existing Project ....................... 137
Workspaces Migration ................................................................. 137
Custom Workspace Basic Units.................................................... 138
Custom Workspace Operations.................................................... 138
Workspace Elements with Limitations ........................................... 139
Editing the Source Code ......................................................................... 140
Overview.......................................................................................... 140
Instruction List (IL) Editor................................................................... 140
Overview .................................................................................... 140
Editing Functions ........................................................................ 140
Reference to PLC Objects ........................................................... 141
Automatic Error Location ............................................................. 141
Bookmarks ................................................................................. 141
Function Block Diagram (FBD) Editor ................................................. 142
Overview .................................................................................... 142
Creating a New FBD Document.................................................... 142
Adding/Removing Networks ......................................................... 143
Labeling Networks....................................................................... 143
Inserting and Connecting Blocks .................................................. 144
Editing Networks ......................................................................... 146
Modifying Properties of Blocks ..................................................... 146
9MA10256.03 5
Getting Information on a Block ..................................................... 146
Automatic Error Retrieval ............................................................. 146
Ladder Diagram (LD) Editor ............................................................... 147
Overview .................................................................................... 147
Creating a New LD Document ...................................................... 147
Adding/Removing Networks ......................................................... 147
Labeling Networks....................................................................... 148
Inserting Contacts ....................................................................... 148
Inserting Coils ............................................................................. 150
Inserting Blocks .......................................................................... 151
Editing Coils and Contacts Properties ........................................... 151
Editing Networks ......................................................................... 152
Modifying Properties of Blocks ..................................................... 152
Getting Information on a Block ..................................................... 153
Automatic Error Retrieval ............................................................. 153
Inserting Variables....................................................................... 153
Inserting Constants ..................................................................... 154
Inserting Expression.................................................................... 154
Comments.................................................................................. 154
Branches.................................................................................... 155
Structured Text (ST) Editor ................................................................ 156
Overview .................................................................................... 156
Creating and Editing ST Objects................................................... 156
Editing Functions ........................................................................ 156
Reference to PLC Objects ........................................................... 157
Automatic Error Location ............................................................. 157
Bookmarks ................................................................................. 157
Sequential Function Chart (SFC) Editor .............................................. 158
Overview .................................................................................... 158
Creating a New SFC Document.................................................... 158
Inserting a New SFC Element ...................................................... 158
Connecting SFC Elements........................................................... 159
Assigning an Action to a Step....................................................... 159
Specifying a Conditional Transition ............................................... 160
Assigning Conditional Code to a Transition ................................... 161
Specifying the Destination of a Jump ............................................ 162
Editing SFC Networks ................................................................. 163
Variables Editor ................................................................................ 163
Overview .................................................................................... 163
Opening a Variables Editor........................................................... 164
Creating a New Variable .............................................................. 164
Editing Variables ......................................................................... 164
Deleting Variables ....................................................................... 166
Sorting Variables ......................................................................... 167
Copying Variables ....................................................................... 167
Compiling .............................................................................................. 168
Overview.......................................................................................... 168
Compiling the Project ........................................................................ 168
Overview .................................................................................... 168
Image File Loading...................................................................... 169
Compiler Output ............................................................................... 169
6 9MA10256.03
Overview .................................................................................... 169
Compiler Errors........................................................................... 170
Command-Line Compiler................................................................... 171
Launching the Application ....................................................................... 172
Overview.......................................................................................... 172
Setting Up the Communication........................................................... 172
Overview .................................................................................... 172
Saving the Last Used Communication Port.................................... 177
Connect to a Device .......................................................................... 177
On-Line Status ................................................................................. 178
Connection Status....................................................................... 178
Project Status ............................................................................. 178
Downloading the Application.............................................................. 179
Control the PLC Execution................................................................. 180
Simulation.............................................................................................. 182
Simulation Function .......................................................................... 182
Overview .................................................................................... 182
Simulation Environment Components ........................................... 183
Simulation Operating Modes.............................................................. 183
Simulation with FREE Studio Plus ...................................................... 184
Simulation Interface .......................................................................... 185
Simulation Interface Overview...................................................... 185
Control Panel.............................................................................. 186
Target Panel ............................................................................... 186
I/O Panels .................................................................................. 187
I/O Panels List ............................................................................ 189
Debugging ............................................................................................. 190
Overview.......................................................................................... 190
Watch Window.................................................................................. 190
Overview .................................................................................... 190
Opening and Closing the Watch Window....................................... 191
Adding Items to the Watch Window............................................... 191
Removing a Variable ................................................................... 193
Refreshment of Values ................................................................ 193
Changing the Format of Data ....................................................... 194
Working with Watch Lists ............................................................. 195
Autosave Watch List.................................................................... 195
Oscilloscope..................................................................................... 196
Overview .................................................................................... 196
Opening and Closing the Oscilloscope.......................................... 197
Adding Items to the Oscilloscope.................................................. 197
Removing a Variable ................................................................... 199
Variables Sampling...................................................................... 199
Controlling Data Acquisition and Display ....................................... 200
Changing the Polling Rate ........................................................... 205
Saving and Printing the Graph...................................................... 205
Edit and Debug Mode........................................................................ 207
Live Debug....................................................................................... 208
Overview .................................................................................... 208
SFC Simulation ........................................................................... 208
LD Simulation ............................................................................. 209
9MA10256.03 7
FBD Simulation ........................................................................... 210
IL and ST Simulation ................................................................... 210
Triggers ........................................................................................... 211
Trigger Window........................................................................... 211
Debugging with Trigger Windows ................................................. 215
Graphic Triggers ............................................................................... 226
Graphic Trigger Window .............................................................. 226
Debugging with the Graphic Trigger Window ................................. 231
Language Reference .............................................................................. 243
Common Elements ........................................................................... 243
Overview .................................................................................... 243
Basic Elements ........................................................................... 243
Elementary Data Types ............................................................... 244
Derived Data Types..................................................................... 245
Literals ....................................................................................... 246
Variables .................................................................................... 248
Program Organization Units ......................................................... 251
Operator and Standard Blocks ..................................................... 254
Instruction List (IL) ............................................................................ 267
Overview .................................................................................... 267
Syntax and Semantics ................................................................. 267
Standard Operators..................................................................... 268
Calling Functions and Function Blocks.......................................... 269
Function Block Diagram (FBD)........................................................... 270
Overview .................................................................................... 270
Representation of Lines and Blocks.............................................. 270
Direction of Flow in Networks ....................................................... 271
Evaluation of Networks ................................................................ 271
Execution Control Elements ......................................................... 272
Ladder Diagram (LD) ........................................................................ 274
Overview .................................................................................... 274
Power Rails ................................................................................ 274
Link Elements and States ............................................................ 274
Contacts..................................................................................... 275
Coils .......................................................................................... 275
Operators, Functions, and Function Blocks ................................... 276
Structured Text (ST) .......................................................................... 276
Overview .................................................................................... 276
Expressions................................................................................ 277
Statements in ST......................................................................... 278
Assignments............................................................................... 278
Function and Function Block Statements ...................................... 279
Selection Statements .................................................................. 280
Iteration Statements .................................................................... 281
IFDEF Statement to Exclude a Portion of Code ................................... 283
Using IFDEF in ST Languages ..................................................... 283
Using IFDEF in LD Languages ..................................................... 283
Using IFDEF in FBD Languages................................................... 284
IFDEF Supported Format............................................................. 285
Sequential Function Chart (SFC)........................................................ 285
Overview .................................................................................... 285
8 9MA10256.03
Steps ......................................................................................... 286
Transitions.................................................................................. 288
Rules of Evolution ....................................................................... 289
SFC Control Flags....................................................................... 292
Check an SFC POU from Other Programs .................................... 293
FREE Studio Plus Language Extensions ............................................ 295
Overview .................................................................................... 295
Macros ....................................................................................... 295
Pointers...................................................................................... 295
Waiting Statement ....................................................................... 296
Display ..................................................................................................... 310
The Display Tab..................................................................................... 311
Overview of the Display Window ....................................................... 311
Menu Bar ......................................................................................... 314
Toolbar............................................................................................. 315
Managing Display Elements .................................................................... 319
Managing Pages............................................................................... 319
Pages Overview.......................................................................... 319
Child Pages ................................................................................ 320
Pop-up Pages ............................................................................. 322
Basic Page Settings .................................................................... 323
Basic Page Operations ................................................................ 326
Organization of Created Pages .......................................................... 329
HMI Actions Window ................................................................... 329
Project Properties ....................................................................... 330
Frameset.................................................................................... 331
Multiple Pages Management........................................................ 332
Automatic Documentation............................................................ 333
Insertion of Controls .......................................................................... 334
Controls ..................................................................................... 334
Static.......................................................................................... 335
Graphic ...................................................................................... 335
Check Box .................................................................................. 336
Combo Box................................................................................. 337
Image......................................................................................... 337
Animation ................................................................................... 339
Edit Box...................................................................................... 340
Button ........................................................................................ 345
Text Box ..................................................................................... 348
Progress Bar............................................................................... 349
Editing Control Properties.................................................................. 350
Visibility and Updating of Controls ................................................ 350
Page and Object Properties ......................................................... 352
Declaration of Variables..................................................................... 362
Types of Variables ....................................................................... 362
Data Management....................................................................... 362
Description of Parameter File ....................................................... 364
Using Advanced Features ................................................................. 365
Events........................................................................................ 365
Resources .................................................................................. 368
File for Target Description........................................................................ 372
9MA10256.03 9
Functions and Function Blocks for HMI .................................................... 377
Functions for HMI ............................................................................. 377
Function Blocks for HMI .................................................................... 387
Commissioning ........................................................................................ 397
The Commissioning Tab ....................................................................... 398
Overview of the Commissioning Window .......................................... 398
Menu Bar ......................................................................................... 399
Toolbar............................................................................................. 399
Managing Commissioning Elements ........................................................ 401
Overview.......................................................................................... 401
Commissioning Window .............................................................. 401
Read and Write BIOS Parameters ................................................ 402
Target Device ................................................................................... 404
Overview .................................................................................... 404
General ...................................................................................... 404
Communication........................................................................... 404
Information ................................................................................. 405
Download Settings ...................................................................... 406
Other Operations ........................................................................ 406
Debugging ............................................................................................. 408
Overview.......................................................................................... 408
Commissioning Watch Window .......................................................... 408
Commissioning Oscilloscope Window ................................................ 409
Appendices .............................................................................................. 410
Installer Pro Project ................................................................................ 411
Overview.......................................................................................... 411
Compatibility Range .......................................................................... 411
Installer Pro Project Features............................................................. 412
PLC Parameters Navigation Tree ................................................. 413
I/O Definition............................................................................... 413
Softscope ................................................................................... 419
Automatic Generation of Expansion Code ..................................... 422
Televis Driver Generation ........................................................................ 426
Overview.......................................................................................... 426
Configuration Page Layout ................................................................ 427
EEPROM Parameters ................................................................. 428
Status Variable............................................................................ 429
BIOS Parameters ........................................................................ 432
Custom Dictionaries .................................................................... 432
Televis Command Configuration................................................... 433
Projects Outputs ............................................................................... 433
Glossary ................................................................................................... 435
Index ......................................................................................................... 441
10 9MA10256.03
Safety Information
Safety Information
Important Information
Read these instructions carefully, and look at the equipment to become familiar
with the device before trying to install, operate, service, or maintain it. The
following special messages may appear throughout this documentation or on the
equipment to warn of potential hazards or to call attention to information that
clarifies or simplifies a procedure.
The addition of this symbol to a “Danger” or “Warning” safety label indicates that an
electrical hazard exists which will result in personal injury if the instructions are not
followed.
This is the safety alert symbol. It is used to alert you to potential personal injury
hazards. Obey all safety messages that follow this symbol to avoid possible injury or
death.
! DANGER
DANGER indicates a hazardous situation which, if not avoided, will result in death or serious
injury.
! WARNING
WARNING indicates a hazardous situation which, if not avoided, could result in death or
serious injury.
! CAUTION
CAUTION indicates a hazardous situation which, if not avoided, could result in minor or
moderate injury.
NOTICE
NOTICE is used to address practices not related to physical injury.
Please Note
Electrical equipment should be installed, operated, serviced, and maintained only
by qualified personnel. No responsibility is assumed by Schneider Electric or
Eliwell for any consequences arising out of the use of this material.
A qualified person is one who has skills and knowledge related to the construction
and operation of electrical equipment and its installation, and has received safety
training to recognize and avoid the hazards involved.
9MA10256.03 11
About the Book
Validity Note
The information in this document is applicable only for FREE Studio Plus
products.
This document has been updated for the release of FREE Studio Plus V1.5.0.
For product compliance and environmental information (RoHS, REACH, PEP,
EOLI, etc.), go to https://www.eliwell.com/en/Support/Green-Premium.html.
The technical characteristics of the devices described in the present document
also appear online. To access the information online, go to the Eliwell home page
www.eliwell.com.
Related Documents
Title of documentation Reference number
FREE Smart Logic Controller 9MA10251
FREE AVP1000 Display Color Touchscreen Flush Mounting – Instruction Sheet 9IS54608
You can download these technical publications, the present document and other
technical information from our website www.eliwell.com.
12 9MA10256.03
About the Book
WARNING
LOSS OF CONTROL
• The designer of any control scheme must consider the potential failure
modes of control paths and, for certain critical control functions, provide a
means to achieve a safe state during and after a path failure. Examples of
critical control functions are emergency stop and overtravel stop, power
outage and restart.
• Separate or redundant control paths must be provided for critical control
functions.
• System control paths may include communication links. Consideration must
be given to the implications of unanticipated transmission delays or failures
of the link.
• Observe all accident prevention regulations and local safety guidelines.1
• Each implementation of this equipment must be individually and thoroughly
tested for proper operation before being placed into service.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
1For additional information, refer to NEMA ICS 1.1 (latest edition), "Safety
Guidelines for the Application, Installation, and Maintenance of Solid State
Control" and to NEMA ICS 7.1 (latest edition), "Safety Standards for Construction
and Guide for Selection, Installation and Operation of Adjustable-Speed Drive
Systems" or their equivalent governing your particular location.
WARNING
UNINTENDED EQUIPMENT OPERATION
• Only use software approved by Eliwell for use with this equipment.
• Update your application program every time you change the physical
hardware configuration.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
9MA10256.03 13
About the Book
Standard Description
ISO 12100:2010 Safety of machinery - General principles for design - Risk assessment
and risk reduction
EN 60204-1:2006 Safety of machinery - Electrical equipment of machines - Part 1: General
requirements
In addition, terms used in the present document may tangentially be used as they
are derived from other standards such as:
Standard Description
IEC 61158 series Digital data communications for measurement and control – Fieldbus for
use in industrial control systems
Finally, the term zone of operation may be used in conjunction with the description
of specific hazards, and is defined as it is for a hazard zone or danger zone in the
Machinery Directive (2006/42/EC) and ISO 12100:2010.
NOTE: The aforementioned standards may or may not apply to the specific
products cited in the present documentation. For more information concerning
the individual standards applicable to the products described herein, see the
characteristics tables for those product references.
14 9MA10256.03
Getting Started with FREE Studio Plus
What’s in This Part
Getting Started with FREE Studio Plus.............................................................16
Software Interface ..........................................................................................24
Managing Projects .........................................................................................41
9MA10256.03 15
Getting Started with FREE Studio Plus
Features
FREE Studio Plus is an IEC 61131-3 Integrated Development Environment
supporting the whole range of languages defined in the standard.
In order to support the user in the activities involved in the development of an
application, FREE Studio Plus includes:
• Textual source code editors programming languages:
◦ Instruction List (IL) , page 267
◦ Structured Text (ST), page 276
• Graphical source code editors programming languages:
◦ Ladder Diagram (LD), page 274
◦ Function Block Diagram (FBD), page 270
◦ Sequential Function Chart (SFC), page 285
• A compiler, which translates applications written according to the IEC
standard directly into object code, avoiding the need for a run-time interpreter,
thus making the program execution as fast as possible.
• A communication system which allows the download of the application to the
target environment.
• A set of debugging tools, ranging from an easy-to-use watch window to more
powerful tools, which allows the sampling of fast changing data directly on the
target environment.
16 9MA10256.03
Getting Started with FREE Studio Plus
For more information about the tabs of FREE Studio Plus, refer to Tabs, page 25.
Registering
To register your FREE Studio Plus software during installation:
Step Action
1 Click the Register now button at the top of the Welcome page window.
2 Follow the instructions on the Registration Wizard. Click the Help button for more
details.
9MA10256.03 17
Getting Started with FREE Studio Plus
Step Action
To view details on the license key installed on your PC, click About on the
Welcome page window.
Supported Devices
Logic Controllers
For more information about the logic controllers, refer to the following hardware
guides:
SMP•••• / SMD•••• /SMC•••• FREE Smart Logic Controller FREE Smart Logic Controller -
Hardware Guide
EV•7500 FREE Evolution Logic Controller FREE Evolution Logic Controller -
Hardware Guide
AV•••••••5•500 FREE Advance AV••••••5•500 Logic Controller FREE Advance Logic Controller -
Hardware Guide
AV••••••6•500 FREE Advance AV••••••6•500 Logic Controller
EWCM 9000 PRO (HF) EWCM 9000 PRO (HF) Logic Controller EWCM 9000 PRO - User Guide
Expansion Modules
For more information about the expansion modules and their compatibility, refer to
the following hardware guides:
EVEVD••000500 FREE EVEVD Electronic Expansion Valve Driver FREE EVEVD Electronic Expansion
Valve Driver - Hardware Guide
18 9MA10256.03
Getting Started with FREE Studio Plus
Displays
For more information about the displays and their compatibility, refer to the
following hardware guides:
WARNING
AUTOMATIC RESTART OF CONTROLLER
• Do not download your application without first accessing the state of your
machine or process.
• Do not download your application without first ascertaining that there is no
risk of injury to anyone in or around your machine or process.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
9MA10256.03 19
Getting Started with FREE Studio Plus
20 9MA10256.03
Getting Started with FREE Studio Plus
9MA10256.03 21
Getting Started with FREE Studio Plus
Debugging in
simulator mode
Define Targets
(Discover through
Ethernet & USB)
Program
Download/Upload
Deploy Commissioning
Read and edit
parameters
Simulate targets
Produce
Operating Modes
Introduction
The operating modes provide control to develop, debug, monitor, and modify the
application when the controller is connected or not connected to FREE Studio
Plus.
FREE Studio Plus can operate in the following modes:
• Offline mode
• Online mode
• Simulator mode
22 9MA10256.03
Getting Started with FREE Studio Plus
Offline Mode
FREE Studio Plus operates in offline mode when no physical connection to a logic
controller has been established.
In offline mode, you configure FREE Studio Plus to match the hardware
components you are targeting, then develop your application.
Online Mode
FREE Studio Plus operates in online mode when a logic controller is physically
connected to the PC.
In online mode, you can download your application to the logic controller.
Downloading and uploading application is not possible in the simulator mode.
FREE Studio Plus then synchronizes the application in the PC memory with the
version stored in the logic controller, allowing you to debug, monitor, and modify
the application.
WARNING
AUTOMATIC RESTART OF CONTROLLER
• Do not download your application without first accessing the state of your
machine or process.
• Do not download your application without first ascertaining that there is no
risk of injury to anyone in or around your machine or process.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
You can modify certain elements of a program in online mode. For example, you
can add or delete rungs, or modify the values of certain function block parameters.
NOTE: Online program modifications are subjected to the predefined
configuration. For more information, refer to Live Debug, page 208 and
Triggers, page 211.
Simulator Mode
FREE Studio Plus operates in simulator mode when a connection has been
established with a simulated logic controller. In simulator mode, no physical
connection to a logic controller is established; instead FREE Studio Plus simulates
a connection to a logic controller and the expansion modules to run and test the
program.
For more information, refer to Simulation, page 182.
9MA10256.03 23
Software Interface
Software Interface
What’s in This Chapter
Overview ......................................................................................................24
Software Interface Customization ...................................................................35
Overview
Welcome Window
The Welcome window is always displayed when you launch FREE Studio Plus.
Use this window to select and open an existing project or create a project, page
41.
Main Window
The FREE Studio Plus main window provides access to menus and commands,
windows, and toolbars.
The illustration presents the FREE Studio Plus main window:
4 3 1 2 6 7
C:\My Project\My Project.plcprj
Free Studio Plus
Configuration Programming Display Commissioning
Resources Catalog
Configuration
FREEADVANCE CONFIGURATION Device name Version
FreeAdvance
Modbus objects
EEPROM Parameters
Status variables
Enums
BIOS Parameters
Menus
I/O Mapping
Local
Field
Alarms
Web Site
BACnet Objects
Device
Analog Value Objects
Binary Value Objects
Calendar Objects
Multi State Value Objects
Schedule Objects
Notification Class Objects
LON Profile
CAN Exp bus
RS485-1 Data export Export
RS485-2
Ethernet
Resources
Plugins
Output
Preprocessing Application completed.
Preprocessing Communication completed.
Preprocessing Pumping completed.
Preprocessing display completed.
0 warnings, 0 errors
7 7 8 5
Item Description
2 Tabs, page 25
4 Toolbars, page 34
5 Workspace, page 35
6 Editor window
24 9MA10256.03
Software Interface
Item Description
Project Toolbar
The project toolbar is located at the top left of the main window which provides
access to the main commands using icons:
Icon Description
New project: creates a new project, any opened project must be closed. If the project
is not saved, a dialog box asks to save the project.
For more information, refer to Download and Upload Applications, page 48.
Tabs
FREE Studio Plus consists of four development environments for programming
controllers:
• Configuration, page 51
For creating networks. It is the entry point of the software.
• Programming, page 88
For creating and managing libraries, controller applications and diagnostics.
It includes a Simulation mode, page 182, dedicated to software developers,
for running and testing controller applications without a logic controller and
expansion modules physically connected.
• Display, page 310
For creating the graphical interface on built-in displays and remote displays.
• Commissioning, page 397
For downloading the project to the connected logic controller device and
modifying device parameters from a serial port.
9MA10256.03 25
Software Interface
Menu Bars
Overview
FREE Studio Plus has several different menus. Most of them depend on the
context. They may or may not appear depending on the tab or the action you are
performing.
Tab Menu
All File, page 28
View, page 33
Help, page 28
Project, page 30
On-line, page 29
Options, page 29
Window, page 34
Scheme, page 31
Variables, page 32
Tools, page 32
Recipes, page 31
Target, page 32
Debug Menu
Command Icon Key Description
Start/Stop watch value - Starts or stops (toggle) the evaluation of the symbols added in the watch
window.
Inserts new item into watch Shift+F8 Inserts a new item into the Watch window.
Quick watch symbol - F11 View and force the value of the selected symbol.
Live debug mode - If debug mode is running, starts or stops (toggle) the live debug mode.
26 9MA10256.03
Software Interface
Change current instance - - Changes the current function block instance (live debug mode).
Developer Menu
This menu gives access to features allowing you to share your project with other
developers:
Import EDS - - Import EDS (Electronic Data Sheet) file, page 70.
Run Modbus custom Editor - - Run Modbus custom editor, page 79.
Build Web site - - Generate a website to manage the target device remotely, page 63.
Generate EDE files - - Generates the Engineering Data Exchange (EDE) files in CSV format (in order to
be used by SCADA BACnet supervisor).
Edit Menu
Command Icon Key Description
Cut Ctrl+X Removes the selected items from the active document and stores them in a
system buffer.
Paste Ctrl+V Pastes in the active document the contents of the system buffer.
Shift+F
Bookmarks... - - Allows to manage the existing bookmarks.
9MA10256.03 27
Software Interface
Add/toggle - Ctrl+F2 Adds a bookmark to mark lines. If a bookmark is already defined, removes it.
Find… Ctrl+F Asks user to type a string and searches for its first instance within the active
document from the current location of the cursor.
Find next F3 Iterates between the results of the research, found by the Find command.
Replace - Ctrl+H Allows you to automatically replace one or all the instances of a string with
another string.
Insert/Move mode - Toggle between those two editing modes, used to insert or move blocks.
Connection mode - Editing mode which allows user to draw logical wires to connect pins.
Watch mode - Editing mode which allows user to add variables to any debugging tool.
File Menu
This menu gives access to features allowing you to manage your project:
Save project as… - - Saves the current open project specifying new name, location and extension,
page 44.
Print… Ctrl+P Prints the document of the currently active window, page 43.
Print preview - Creates a preview of the document of the currently active window, ready to be
printed.
Help Menu
This menu gives access to features allowing you to read documentation about
hardware or some specific FREE Studio Plus features:
28 9MA10256.03
Software Interface
Index - - Lists the Help keywords and opens the related topic.
Context - F1 Context-sensitive help. Opens the topic related to the currently active window.
On-line Menu
Command Icon Key Description
Set up communication... - - Lets you set the properties of the connection to the target, page 172.
Download code F5 Download the configuration and PLC application of the project to the device, page
179.
Download options… - - Allows to set the properties of the source code downloaded to the target.
Force image upload - - If the target device is connected, allows to upload the image file.
Force debug symbols - - If the target device is connected, allows to upload the debug symbols file.
upload
Cold restart - Restarts the PLC execution and both retain and non-retain variables are reset.
Warm restart - Restarts the PLC execution and non-retain variables are reset.
Hot restart - Restarts the PLC execution without any reset on variables.
Read all logs again - - Reloads the remote logs from target.
Options Menu
This menu gives access to features allowing to manage the commissioning
options:
Logging options… - - Select what types of information are recorded in the event log.
Refresh interval… - - Set refresh interval for monitor, graph, and auto-refresh (ms).
Page Menu
This menu gives access to features allowing to add objects on pages:
9MA10256.03 29
Software Interface
Parameters Menu
This menu gives access to features allowing to manage project parameters:
Select all - Ctrl+A Select the parameters from the Resources window
Auto refresh mode - - Changing parameter values in the application are written automatically to the
target device.
Export to text file… - - Export the parameters of the Resources window as a *.csv text file.
Import values from other - - Apply parameter values from another project to the current project.
project…
Project Menu
This menu gives access to features allowing you to compile your project and to
manage your target device:
30 9MA10256.03
Software Interface
Select target... - - Lets you select a new target for the project, page 47.
Refresh current target - - Allows to update the target file for the same version of the target.
Option - - Allows to enable Installer Pro project and/or Televis driver generation
features.
Recipes Menu
This menu gives access to features allowing you to manage recipes:
Import recipe - - Import an existing recipe from the hard drive disk or a removable media.
Export recipe - - Export an existing recipe to the hard drive disk or a removable media.
Set recipe values - - Applying the change in the value of the selected parameter to the value of the
recipe.
Delete parameters from recipe - - Delete one or more selected parameters from the actual recipe folder.
Write all recipe values - - Download the recipes to the target device.
Scheme Menu
Command Icon Key Description
9MA10256.03 31
Software Interface
Decrement pins Ctrl + ‘-’ Decrements the number of input pins of some operators and embedded
functions.
Enable EN/ENO pins E Displays the enable input and output pins.
Target Menu
This menu gives access to features allowing you to set the communication
settings:
Communication settings - - Select and configure the protocol to use to communicate with the target device.,
page 404
Tools Menu
Command Icon Key Description
Variables Menu
Command Icon Key Description
Add - -
Automatic - - Creates a new automatic variable. A dialog is prompted in order to specify the
new variable.
Mapped variable - Ctrl+ Creates a new mapped variable. A dialog is prompted in order to specify the new
variable.
Shift+M
Constant - - Creates a new constant. A dialog is prompted in order to specify the new
constant.
Retain - - Creates a new retain variable. A dialog is prompted in order to specify the new
variable.
Insert - Ctrl+ Adds a new row to the grid in the currently active editor.
Shift+Ins
Delete - Delete Deletes the variable in the selected row of the currently active table.
Group - - Opens a dialog box which lets you create and delete groups of variables.
32 9MA10256.03
Software Interface
View Menu
This menu gives access to features allowing you to choose what is displayed in
the workspace:
PLC run-time status - - Shows or hides the PLC run-time status bar.
Operators and blocks - - Shows or hides the Operators and blocks window.
Full screen Ctrl+U Expands the currently active document window to fill entire screen,
page 38. (Esc to exit from this mode).
9MA10256.03 33
Software Interface
Window Menu
Command Icon Key Description
Cascade - - Displaces the open documents in cascade so that they completely overlap except
for the caption.
Tile - - The PLC editors area is split into frames having the same dimensions, depending
on the number of currently open documents. Each frame is automatically assigned
to one of such documents.
Arrange Icons - - Displaces the icons of the minimized documents in the bottom left-hand corner of
the PLC editors area.
Close all - - Closes the open documents.
Toolbars
FREE Studio Plus has several toolbars dedicated to software tabs:
Debug
FBD
SFC
LD
Network
Configuration Configuration, page 53
HMI Project
HMI Profiles
Commissioning Commissioning, page 399
Tool Windows
FREE Studio Plus has several tool windows dedicated to software tabs:
Watch
Properties Window
Oscilloscope
Library Tree
34 9MA10256.03
Software Interface
HMI Properties
HMI Actions
HMI Vars and Parameters
HMI Templates
Commissioning Watch
Commissioning
Oscilloscope
Status Bar
Overview
The status bar is located at the bottom right of the FREE Studio Plus window. It
indicates the state of communication and the status of the application currently
executing on the target device.
Layout
Overview
The layout of the software workspace can be freely customized in order to suit
your needs.
The layout configuration is saved on application exit. Your modifications remain
between different working sessions.
Reset Layout
To reset layout parameters to default values of standard layout:
9MA10256.03 35
Software Interface
Step Action
3 Click OK button.
4 In Program options dialog box, click OK button.
NOTE: When you reset the layout, all the tab layouts are reset.
Toolbars
Show/Hide
To show or hide a toolbar, proceed as follow:
Step Action
2
The toolbar list is displayed in a pop-up window:
Main
Project
Debug
FBD Bar
SFC Bar
LD bar
Network
Configuration
HMI Page
HMI Project
HMI Profils
Commissioning
Move
To move a toolbar, click its left border and drag it to the new destination.
36 9MA10256.03
Software Interface
Step Action
Step Action
1 Click the title bar of the tool window and move the pointer.
A guide diamond appears, move the pointer over the desired portion of the guide
diamond. The designated area is shaded.
9MA10256.03 37
Software Interface
Window Management
Overview
FREE Studio Plus allows you to navigate between the opened source code editor
windows.
Document Tab
To switch between the currently open editors, click the title program on the tab
located below the programming window.
Window Menu
The Window menu allows you:
• To present the currently opened programs in a cascade.
• To present the currently opened programs in tiles.
• To arrange the icons of the minimized documents in the bottom left-hand
corner of the editors window.
• To close the currently opened programs.
• To switch between the currently opened programs by clicking the title
program.
Window
Cascade
Tile
Arrange Icons
Close All
1 main
2 Ungrouped_vars
Windows… Alt+W
38 9MA10256.03
Software Interface
Software Options
Overview
FREE Studio Plus allows you to customize some options of the software.
To display the dialog box options, click File > Options….
General
General tab allows you to configure:
• Visual Theme:
It is just possible to choose, in the Color theme list, the Standard color
theme.
• Save options:
◦ Autosave: if Autosave box is checked, the software periodically saves
the whole project. You can specify the period of execution of this task by
entering the number of minutes between two automatic savings in Interval
(min) box.
◦ Max previous version to keep: it indicates the maximum number of
copies of the project that must be zipped and stored in the
PreviousVersions folder.
• Output window:
You can specify the family and the size of the font used for output window.
• Communication:
If Use last port check box is selected, the last used port is set as the default
one.
• Tooltip:
If Enable tooltip on editors check box is selected, small information boxes
appear when the cursor is placed over a symbol in the editors.
• Tool windows:
You can specify the family and the size of the font used for tool windows.
Reset bars positions: the layout of the dock bars in the IDE is reinitiate to
default positions and dimensions. In order to take effect, the software must be
restarted.
• Source editors options:
If ST - LD: Auto declaration of variables check box is selected, variables
are automatically declared for ST and Ladder programs.
Graphic Editor
This panel lets you edit the properties of the LD, FBD, and SFC source code
editors.
You can specify the family and the size of the font used for graphical editors.
You can also modify the colors of the graphical object.
Text Editors
You can specify the family and the size of the font both for code and variable
editors.
9MA10256.03 39
Software Interface
Language
You can modify the language of the environment:
Step Action
Custom Tools
You can add up to 16 commands to the Custom tools menu. These commands
can be associated with any program that runs on your operating system. You can
also specify arguments for any command that you add to the Custom tools
menu.
To add a tool to the Custom tools menu:
Step Action
1 In the Command box, type the full path of the program file you want to use as a tool.
Otherwise, you can select the program file by clicking the browse button.
2 In the Arguments box, type the arguments - if any - to be passed to the executable
command mentioned at the first step. They must be separated by a space.
3 In Menu string box, type the name you want to give to the tool you are adding.
4 Click Add button to insert the new command into the suitable menu.
5 Click OK button to confirm, or Cancel button to quit.
For example, if you want to add Windows Calculator to the Custom tools menu:
Step Action
The name you gave to this tool (in this example, Calc) is now displayed in the Custom
tools menu.
Merge
If Enable Merge check box is selected, you can configure the following
parameters:
• Identical name:
◦ Objects with different types
◦ Object with same type (not variables)
◦ Variables
• Check address:
◦ Overlapped
◦ Copy\Paste mapped variable
For more information about Merge, refer to Merge Function, page 109.
40 9MA10256.03
Managing Projects
Managing Projects
What’s in This Chapter
Create a New Project.....................................................................................41
Print a Project ...............................................................................................43
Save a Project...............................................................................................44
Manage Existing Projects...............................................................................45
Distribute Projects .........................................................................................46
Export CSV Files...........................................................................................46
Select The Target Device ..............................................................................47
Build All ........................................................................................................48
Download a Project to The Target ...................................................................48
Installer Software ..........................................................................................49
Close FREE Studio Plus ................................................................................50
Welcome Page
When FREE Studio Plus starts, the Welcome page appears:
9MA10256.03 41
Managing Projects
Step Action
The string you enter is also the name of the folder which contains the files making up the
project.
The name can be modified afterward, refer to Project Options, page 98.
4 If Case-sensitive check box is selected, the source code of the project is case-sensitive.
This option can be modified afterward, refer to Project Options, page 98.
NOTE: This option is not compliant with IEC 61131-3 standard.
WARNING
UNINTENDED EQUIPMENT OPERATION
• Always verify that your application program operates as it did prior to the
conversion, having all the correct configurations, parameters, parameter
values, functions, and function blocks as required.
• Modify the application as necessary such that it conforms to its previous
operation.
• Thoroughly test and validate the newly compiled version prior to putting your
application into service.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
42 9MA10256.03
Managing Projects
Click File > New project or File icon of the project toolbar to display the New
project window:
NOTE: If you already have an open project, a dialog box appears to ask you if
you want to save the current project.
Create a new project:
Step Action
The string you enter is also the name of the folder which contains the files making up the
project.
The name can be modified afterward, refer to Project Options, page 98.
4 If Case-sensitive check box is selected, the source code of the project is case-sensitive.
This option can be modified afterward, refer to Project Options, page 98.
NOTE: This option is not compliant with IEC 61131-3 standard.
5 Click OK button.
Print a Project
Print the Project
FREE Studio Plus allows you to print the data which make up the project such as
programs and variables.
To print a project:
Step Action
3 Click OK button.
9MA10256.03 43
Managing Projects
Step Action
3 Click OK button.
Print Preview
To preview your printing before, click File > Print preview. The preview is
displayed in the current working window.
Save a Project
Overview
FREE Studio Plus projects can be saved as files to the local PC or into a server
directory. This file has the extension *.plcprj or *.ppjs and contains:
• The source code of the program.
• The current hardware configuration.
• Settings and preferences of the FREE Studio Plus project.
Step Action
3 Browse and select the new folder in which to store the project file.
5 Click OK button.
44 9MA10256.03
Managing Projects
AutoSave
FREE Studio Plus includes an AutoSave feature that periodically saves your
project as you work on it.
AutoSave saves data in a separate folder, called Backup, stored at the same
location of the project folder.
If you regularly save or close the currently opened file, the associated auto save
file is deleted, unless the save file command is canceled or terminated in error. In
this case, the file is kept. If you reopen a project for which an appropriate auto
save file is found, the AutoSave Backup dialog box is displayed. You can reopen
the auto save project or the saved last version.
You can specify the interval time (in minutes) between saving. By default,
AutoSave is running with 1 minute of interval. For more information, refer to Save
options, page 39.
Backup Copies
FREE Studio Plus includes a backup feature of the previous version of the project
on which you are working.
When you explicitly save the project, FREE Studio Plus saves the current version
(before save) of the project in the PreviousVersions folder stored at the same
location of the project folder.
You can set the upper limit of the backup files to be kept on your PC. By default
this is 10; set to 0 if you want to disable this feature. For more information, refer to
Save options, page 39.
Step Action
Result: An editor consistent with the object type is opened. For example, when you
double-click the name of a project POU, the appropriate source code editor is
displayed; if you double-click the name of a global variable, the variable editor is
displayed.
FREE Studio Plus cannot modify elements of a project when at least one of the
following conditions holds:
• FREE Studio Plus is in debug mode.
9MA10256.03 45
Managing Projects
Distribute Projects
Overview
To share a project with another developer, send either a copy of one or more
project files or a redistributable source module (RSM) generated by FREE Studio
Plus.
In the former case, the number of files to share depends on the format of the
project file:
• PLC single project file (.ppjs file extension): the project file itself contains
the whole information needed to run the application (assuming the receiving
developer has an appropriate available target device). It includes the source
code modules so that only the .ppjs file is needed to share the project.
• PLC multiple project file (.ppjx or .ppj file extension): the project file
contains only the links to the source code modules composing the project,
which are stored as single files in the project directory. The whole directory is
needed to share the project.
• Full XML PLC project file (.plcprj): the project file is generated entirely in
XML language. The information contained in the project file and its behavior
are the same as .ppjs file extension.
To generate a redistributable source module (RSM), click Project > Generate
redistributable source module.
FREE Studio Plus displays the name of the RSM file and lets you choose whether
to protect the file with a password. To protect the file, a password must be entered.
The advantages of the RSM file format are:
• It is encoded in binary format, thus it can only be read by third parties which
use FREE Studio Plus.
• It can require a password when opening the file in FREE Studio Plus.
• Its size is reduced because it is a binary file.
46 9MA10256.03
Managing Projects
Data Export
To export data:
Step Action
4 In Data Export window, select data you want to export and click OK button.
5 In the Save As dialog box, choose the name of your file and click Save button.
Step Action
4 If you confirm, click Yes button to complete the conversion or No button to quit.
If you click Yes button, FREE Studio Plus updates the project to work with the new target.
It also makes a backup copy of the project files in a subdirectory inside the project
directory. Therefore you can roll back the operation by manually (that is, using Windows
Explorer) replacing the project files with the backup copy.
9MA10256.03 47
Managing Projects
WARNING
UNINTENDED EQUIPMENT OPERATION
• Always verify that your application program operates as it did prior to the
conversion, having all the correct configurations, parameters, parameter
values, functions, and function blocks as required.
• Modify the application as necessary such that it conforms to its previous
operation.
• Thoroughly test and validate the newly compiled version prior to putting your
application into service.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Build All
Overview
To compile your project, click Build All icon in the project toolbar.
The result of the compilation is displayed in the Output window, page 91.
Modbus
DMI MFK USB A USBA/ USB/ Ethernet
program- program- Memory USB Mini- RS485 Cable
ming cable ming stick key B Cable adapter
FREE - - - -
Smart
FREE - -
Evolution
(1)
A- - - -
V••••••505-
(1)
00
A- - -
V•••••••6•5-
00
(1) An Ethernet communication module must be connected to the controller, except for FREE Panel
EVP which has integrated Ethernet communications.
48 9MA10256.03
Managing Projects
Step Action
1 Configure the communication with the Device Link Manager Config, accessible in:
• On-line > Set up communication… menu of Configuration tab or
Programming tab.
• Or Target > Communication settings menu of Commissioning tab.
The properties are visible and can be edited by clicking Properties. The protocol must
be activated beforehand.
For more information on the hardware connection, refer to the related hardware guides.
3
Connect the target using On-line > Connect menu of Configuration tab or
Programming tab.
For more information, refer to Connect to a Device, page 177 and On-Line Status, page
178
4 Download the project from Configuration tab or Programming tab:
• Select On-line > Download code
• Or press F5
It is also possible to use the Download all button in the project toolbar.
WARNING
AUTOMATIC RESTART OF CONTROLLER
• Do not download your application without first accessing the state of your
machine or process.
• Do not download your application without first ascertaining that there is no
risk of injury to anyone in or around your machine or process.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
NOTICE
INOPERABLE EQUIPMENT
• Do not interrupt the transfer of the application program or a firmware change
once the transfer has begun.
• Re-initiate the transfer if the transfer is interrupted for any reason.
• Do not attempt to place the device into service until the file transfer has
completed successfully.
Failure to follow these instructions can result in equipment damage.
Installer Software
Description
A stand-alone software, Installer software, is delivered in addition with FREE
Studio Plus.
9MA10256.03 49
Managing Projects
You can run it via the Windows start menu or the icon on the desktop after
installing FREE Studio Plus.
Tree Catalog
Untitled Device name Version Description
Add new device to project Open project Choose from disk... FreeAdvance Small 668 FreeAdvance Small
Connection Status
Network scan Device name Description
Ready DISCONNECTED
50 9MA10256.03
Configuration
What’s in This Part
The Configuration Tab ..................................................................................52
Managing Resources Elements.......................................................................54
Technical Reference.......................................................................................86
9MA10256.03 51
The Configuration Tab
1 2 3
C:\My Project\My Project.plcprj
Free Studio Plus
Configuration Programming Display Commissioning
Resources Catalog
Configuration
FREEADVANCE CONFIGURATION Device name Version
FreeAdvance
Modbus objects
EEPROM Parameters
Status variables
Enums
BIOS Parameters
Menus
I/O Mapping
Local
Field
Alarms
Web Site
BACnet Objects
Device
Analog Value Objects
Binary Value Objects
Calendar Objects
Multi State Value Objects
Schedule Objects
Notification Class Objects
LON Profile
CAN Exp bus
RS485-1 Data export Export
RS485-2
Ethernet
Resources
Plugins
Output
Preprocessing Application completed.
Preprocessing Communication completed.
Preprocessing Pumping completed.
Preprocessing display completed.
0 warnings, 0 errors
5 4
Item Description
3 Editor window This window allows you to edit the content of the current selection in Resources window.
4 Catalog window This window shows the devices available from the catalog.
NOTE: Dynamic visibility of devices based on selections (for example communication modules).
5 Output window This window shows the messages relating to the development of the project (file opening, reading/
writing errors, status of connection to device, and so on).
NOTE: The connection to the device is also visible in the status bar, page 35.
For more information, refer to Download and Upload Applications, page 48.
52 9MA10256.03
The Configuration Tab
Menu Bar
Overview
The menu bar of Configuration tab is composed of these menus:
• File, page 28
• View, page 33
• Project, page 30
• On-line, page 29
• Developer, page 27
• Help, page 28
Toolbar
Introduction
The toolbar appears at the top of the FREE Studio Plus window to provide access
to frequently used functions.
For generalities of toolbars, refer to Toolbars description, page 34.
Configuration Toolbar
The Configuration toolbar has the following buttons:
Icon Description
Compile
Download the configuration and PLC application of the project to the device.
9MA10256.03 53
Managing Resources Elements
Overview
Resources Window
Overview
The Resources window allows you to configure the device:
• Define parameters and variables.
• Create and configure the embedded website (for FREE Evolution and FREE
Advance only).
• Configure the hardware structure of the project.
• Configure communication protocols.
Target device, page 57 Shows the picture of the target device and allows you to configure some settings.
Modbus objects, page 58 Define the EEPROM parameters (non-volatile memory parameters) and Status variables
which may then be used in the application code.
Menus, page 60 Manages menus where you can group the Modbus objects that are shown in
Commissioning.
I/O Mapping, page 62 Defines the links between variables and physical I/O of the target device.
Alarms, page 62 Defines alarm variables which status must be managed by the developer.
Web Site, page 63 Defines website pages to monitor the device from a web browser.
54 9MA10256.03
Managing Resources Elements
Help Shows LED reference for the developer. For FREE Smart only.
WARNING
UNINTENDED EQUIPMENT OPERATION
Update the configuration of your program each time you add or delete any type
of I/O expansions on your I/O bus, or you add or delete any devices on your
field bus.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Expansion Bus
You must monitor within your application the state of the bus and the error state of
the module(s) on the bus, and to take the appropriate action necessary given your
particular application.
WARNING
UNINTENDED EQUIPMENT OPERATION
• Include in your risk assessment the possibility of unsuccessful
communication between the logic controller and any I/O expansion modules.
• Monitor the state of the I/O expansion bus using the dedicated %SW system
words and take appropriate actions as determined by your risk assessment.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
9MA10256.03 55
Managing Resources Elements
Supported Protocols
Overview
Each device has the following resources, which are shown as nodes of the target.
Select the Mode and add the device from the catalog:
RS485 On-board
RS485 On-board
Ethernet On-board
RS485-1 On-board
RS485-2 On-board
RS485-1 On-board
RS485-2 On-board
Ethernet On-board
RS485-1 On-board
RS485-2 On-board
56 9MA10256.03
Managing Resources Elements
Ethernet On-board
NOTE: The Catalog window shows the devices that can be added (by
dragging them) to the corresponding protocol.
NOTE: On the RS485 protocol, you can also connect generic Modbus
devices.
Target Device
Overview
In the Resources window, double-click the title of the project to display the editor
window.
The editor window presents the graphic of the target device and lets you access
some settings.
9MA10256.03 57
Managing Resources Elements
Modbus Objects
Overview
Modbus objects allow you to define EEPROM parameters (non-volatile memory
parameters) and Status variables, which can be displayed on the target device
and read using the Modbus protocol, page 86.
EEPROM parameters (non-volatile memory parameters) and Status variables
can be used in the application code. They appear in the Project window: Project
> Aux Variables > Global Shared.
It is possible to add or remove parameters and variables (with Add and Remove
buttons) in the same way as for variables in the Project window.
The Recalc button allows you to recalculate the addresses of the selected rows.
EEPROM Parameters
Column Description
Display label Name displayed in the application menu of the FREE Smart target (4-digit 7
segments).
Size Significant only in the case of STRING type. Dimension (Length) of the string.
Default and max= 31 characters.
Read only Enables/disables editing of Status variables.
Unit Unit of measurement of Device Type displayed on Device and if available with
icon on target.
Installer Access This column does not apply to FREE Evolution/FREE Advance.
Level
Refer to Visibility of Menu Resources, page 61.
58 9MA10256.03
Managing Resources Elements
Column Description
Note
NOTICE
Do not use non-volatile memory registers for cyclic write operations.
Failure to follow these instructions can result in equipment damage.
Status Variables
Status variables allow you to define the status variables which can be
displayed in the menu of the device.
NOTE: For FREE Smart, each variable has a transcoding on the controller
due to the 4-digit / 7-segment display. In the Display label box, you can select
the transcoding and see a preview on the display by clicking the ellipsis (…).
Some letters are not displayed (for example x and z) so there is a blank space
on the display. If the display label is SET, S E t appears on the display.
Name Display label
Setting Status variable SET
7 Segments Preview
Close
Column Description
Display label Name displayed in the application menu of the FREE Smart target (4-digit 7
segments).
Size Significant only in the case of STRING type. Dimension (Length) of the string.
Default and max= 31 characters.
Read only Enables/disables editing of Status variables.
9MA10256.03 59
Managing Resources Elements
Column Description
Unit Unit of measurement of Device Type displayed on Device and if available with
icon on target.
Note
Installer access User access level required to see and modify related parameter.
level
Enums
Enums allows you to define enumeration elements which can be used in the
Device Type column of the editor window.
For more information about Enums, refer to Enumerations, page 128.
Enums, which are generated and managed in Programming window can be
viewed in Web Site pages as all the other parameters.
BIOS Parameters
Target Menus
Target Menu FREE Evolution/FREE Advance
Overview
The target menu can be created by using the Configuration tab. In the
Resources window, right-click Menus and select Add Menu command.
The BIOS menu is factory-set and is visible from Device.
The main functions of the keys/LEDs of the target device can be programmed by
using the Display. LEDs are also programmable from in the Operators and
blocks window from the Programming.
In this section, you can define a menu (not visible on the display) and the folders/
variables of which it is composed.
The menu can consist of one or more folders, defined by the developer, into which
are entered:
60 9MA10256.03
Managing Resources Elements
The LEDs are managed by the developer by using target variable sysLocalLeds.
The elements entered in the table in this section are displayed on Device.
Menu Prg
The Prg menu can consist of one or more folders, defined by the developer, into
which are inserted:
• EEPROM parameters (non-volatile memory parameters).
• Status variables.
• BIOS parameters.
• Inputs and outputs.
Menu Set
The Set menu is created in the same way as the Prg menu.
The Set menu contains the AL folder.
Level 1
Level 2 Yes Yes
Level 2
9MA10256.03 61
Managing Resources Elements
I/O Mapping
FREE Smart I/O Mapping
You can define the links between variables and physical I/O of FREE Smart:
• Local: local variables of the controller module.
• Extended: variables of the expansion module.
• Remote: variables on the displays.
Alarms
FREE Smart Alarms
It is possible to define alarm variables which status must be managed by the
developer.
Alarm variables can be used in the application code. They appear in the Project
window: Project > Aux Variables > Global shared.
If the variable assumes a value other than zero, the label is displayed in the
Alarms folder (AL) of the set menu in FREE Smart.
In the Resources window, click Alarm to display the Alarm variable list.
This table presents the columns of the editor window:
Column Description
Name Resource name which may be used by the developer in the controller
application.
Short name Name displayed in the application menu of the FREE Smart/FREE Evolution
target (4-digit).
NOTE: If not filled, the text displayed on the controller will be the 4 first
characters of the variable.
Description Description of the variable.
62 9MA10256.03
Managing Resources Elements
NOTE: Each variable has a transcoding on the controller due to the 4-digit / 7-
segment display. In the Short name label box, you can see a preview on the
display by clicking the ellipsis (…).
Some letters are not displayed (for example x and z) so there is a blank space
on the display. If the text is SET, S E t appears on the display.
Web Site
Web Functionalities
The FREE Advance features web functionalities, offering makers of machinery
and systems integrators remote access. Having a web-based connection in
machines reduces support and maintenance by minimizing call-out charges. End
users also benefit, as they can monitor their own systems both locally and from
distance, using the graphics interface of any browser.
Main web functionalities:
• Web-based access.
• Remote reading.
• Local and remote system control, including alarms management.
• Preventive and predictive maintenance.
• Email alarm alerts.
‘WEB MENU TITLE’ WEB TABLE PAGE
# Name Control Label Section Text size Img filename Img X Img Y Enum values
Care must be taken and provisions made for use of this product as a control
device to avoid inadvertent consequences of commanded machine operation,
controller state changes, or alteration of data memory or machine operating
parameters.
9MA10256.03 63
Managing Resources Elements
WARNING
UNINTENDED EQUIPMENT OPERATION
• Configure and install the mechanism that enables the remote HMI local to
the machine so that local control over the machine can be maintained
regardless of the remote commands sent to the application.
• You must have a complete understanding of the application and the machine
before attempting to control the application remotely.
• Take the precautions necessary to assure that you are operating remotely on
the intended machine by having clear, identifying documentation within the
application and its remote connection.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
NOTE: Schneider Electric and Eliwell adhere to industry best practices in the
development and implementation of control systems. This includes a
"Defense-in-Depth" approach to secure an Industrial Control System. This
approach places the controllers behind one or more firewalls to restrict access
to authorized personnel and protocols only.
WARNING
UNAUTHENTICATED ACCESS AND SUBSEQUENT UNAUTHORIZED
MACHINE OPERATION
• Evaluate whether your environment or your machines are connected to your
critical infrastructure and, if so, take appropriate steps in terms of prevention,
based on Defense-in-Depth, before connecting the automation system to
any network.
• Limit the number of devices connected to a network to the minimum
necessary.
• Isolate your industrial network from other networks inside your company.
• Protect any network against unintended access by using firewalls, VPN, or
other, proven security measures.
• Monitor activities within your systems.
• Prevent subject devices from direct access or direct link by unauthorized
parties or unauthenticated actions.
• Prepare a recovery plan including backup of your system and process
information.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
WARNING
UNINTENDED EQUIPMENT OPERATION
• Define a secure password for the Web Functionalities, and do not allow
unauthorized or otherwise unqualified personnel to use the features therein.
• Ensure that there is a local, competent, and qualified observer present when
operating on the controller from a remote location.
• Configure and install the mechanism that enables the remote HMI local to
the machine so that local control over the machine can be maintained
regardless of the remote commands sent to the application.
• You must have a complete understanding of the application and the machine
before attempting to control the application remotely.
• Take the precautions necessary to assure that you are operating remotely on
the intended machine by having clear, identifying documentation within the
application and its remote connection.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
64 9MA10256.03
Managing Resources Elements
Baud rate
500 Kb/s
250 Kb/s
125 Kb/s
50 Kb/s
Master Settings
Node ID (1...122,125): 125 ?
9MA10256.03 65
Managing Resources Elements
66 9MA10256.03
Managing Resources Elements
FREE Studio Plus knows the Expansion EVE6000/10200 dictionary. Each object
can be assigned to a PLC variable.
Follow this procedure do assign an object to a PLC variable:
Step Action
1
Click Assign button.
2 Select the PLC variable that you want to assign to the PLC object:
9MA10256.03 67
Managing Resources Elements
Step Action
68 9MA10256.03
Managing Resources Elements
CAN Expansion Bus with FREE Evolution Expansion Module and FREE
Evolution
In this configuration example, you want to use EVE7500 as expansion of a FREE
Evolution device. The same can be done for other logic controllers.
Configure FREE Evolution CAN Expansion Bus in Master (for field) mode. From
the Catalog window, it is possible to select EXPANSION EVE 7500 (SIC) node
and drop it on the CAN Expansion Bus node.
EXPANSION EVE 7500 (SIC) configuration is similar to CAN Custom
configuration (Using a CAN Custom Device, page 71) with dynamic PDO mapping
feature disabled. Available Input/Output objects that can be mapped on PLC
variables via PDO are listed in PDO TX - INPUT and PDO RX - OUTPUT.
Field Mode
To connect FREE Panel EVP in this mode select FREE Evolution Display or Free
Evolution EVC CAN Expansion bus node and select the option Master (for field)
then take FREE Panel EVP device from Catalog tab and drop it over CAN
Expansion bus node.
Select Free Evolution EVP_1 child node and configure Network settings.
Probes:
Free Evolution EVD_1 can access to Free Evolution EVP_1 on-board probes.
To do so select Probes - Input tab then it is possible to map a Free Evolution
EVD_1 parameter to let it obtain the value of an on-board Free Evolution EVD
probe.
Choose one of the probes and click Assign button. Take one of the Free
Evolution EVD_1 INT parameter and click OK button.
HMI:
It is possible to associate to a FREE Panel EVP (configured as CAN Expansion
bus field slave) an HMI project with local pages. FREE Panel EVP would be able
to show its own target variables and parameters of the CAN Expansion bus
master to which it belongs.
9MA10256.03 69
Managing Resources Elements
Network Mode
The HMI remoting and binding mode can be configured with the Installer
software, page 49.
In this connection mode, FREE Panel EVP can be linked to one of the remote
devices that are available on the network to navigate HMI Remote pages provided
by other devices.
Using the Installer software, it is possible to do so by indicating one of the
available HMI Remote devices of the network.
For example:
You have a CAN Expansion bus network with Free Evolution EVD_1 and Free
Evolution EVC_1 then add as first-level node Free Evolution EVP_1 to the
network taking it from Catalog panel.
Click CAN Exp bus node of Free Evolution EVP_1 and select Master (for HMI
remoting and binding) node, assign unique Node ID and select network CAN Exp
bus1.
Binding of variables between Free Evolution EVP_1 and Free Evolution EVC_1
and Free Evolution EVD_1 is allowed in a network of this type (see chapter CAN
Expansion bus - Binding, page 66 for more details).
HMI Remote pages:
In CAN Expansion bus network mode, it is possible to configure FREE Panel EVP
in order to be linked to 0 to 10 remote devices that can provide HMI Remote pages
to the keyboard.
To add HMI Remote pages select Free Evolution EVP_1 node, then press Add
on the HMI Remote pages box thus all available devices will be displayed and the
user can select the pages to navigate.
70 9MA10256.03
Managing Resources Elements
Import
Import EDSEDS
Comments:
Conforamnce class = S20
Product function = Frequency Converter
Supported profiles = 402 V3
Boot-up time = 100ms
Number of Objects
OK Cancel
9MA10256.03 71
Managing Resources Elements
General Tab
72 9MA10256.03
Managing Resources Elements
Add Remove
In this page, you can insert a list of objects and values to send to the slave at boot
for configuration purposes, using SDO packets.
Press the Add button, choose the objects to send, and then insert their Value in
the grid.
Some objects are handled automatically, for example the Transmission type and
Event timer are configured automatically depending on the PDO Tx comm
settings and PDO Rx comm settings in the General tab.
# Idx Sub PDO Bit COBID Object Name Type Size Label DataBlock
1 6041 0 1 0 0 Statusword UINT 16
2 6044 0 1 16 0 Control Effort INT 16
3 2061 2a 3 0 0 NM1 (12741) UINT 16
4 2061 2b 3 16 0 NM2 (12742) UINT 16
5 2061 2c 3 32 0 NM3 (12743) UINT 16
6 2061 2d 3 48 0 NM4 (12744) UINT 16
9MA10256.03 73
Managing Resources Elements
# Idx Sub PDO Bit COBID Object Name Type Size Label Data Block
1 6040 0 1 0 0 Controlword UINT 16
2 6042 0 1 16 0 Target Velocity INT 16
3 2061 3e 3 0 0 NC1 (12761) UINT 16
4 2061 3f 3 16 0 NC2 (12762) UINT 16
5 2061 40 3 32 0 NC3 (12763) UINT 16
6 2061 41 3 48 0 NC4 (12764) UINT 16
Description
When CAN Expansion bus is in use on a FREE Evolution device in Master mode
(field), three master channels are opened.
First master channel is used to process requests that arrive to its physical node ID
(the ID assigned by you in the configuration box). Supervisor PC should be
connected using this node ID. CAN Expansion bus physical node ID addr must be
chosen in a range between 1 to 122 or 125.
Two other virtual master channels are opened on this device and are dedicated to
the communication with keyboards (max 2 for each CAN Expansion bus network).
Virtual master node IDs have fixed values:
ch_1 = 123
ch_2 = 124
74 9MA10256.03
Managing Resources Elements
RS485
Overview
Description
FREE Evolution Display / FREE Panel EVP has one on-board RS485 port, plus
another one available as an external plugin. Each port can be configured as Not
used (disabled) or Modbus Master (field).
FREE Advance has two on-board RS485 ports.
The first port (RS485-1) is used for Modbus Slave - BACnet MS/TP. The RS485-2
port can be configured as Modbus Slave - BACnet MS/TP or Modbus Master
(for field).
RS485 CONFIGURATION
19200 b/s
38400 b/s
57600 b/s
115200 b/s
Field
When you configure the RS485 port as Master the target acts as a Modbus RTU
master on this port. So you can connect Modbus slave devices.
For a Modbus master port, you must configure:
• Baud rate used in this Modbus network (in b/s).
• Serial mode (parity, data bits, stop bits).
To add a Modbus slaves, right-click RS485 and select Add command. You can
also drag a Modbus slave from the Catalog window to the RS485 item in the
Resources window.
After you added and configured the Modbus slaves, page 76, you can link the
remote objects of the slave and the internal PLC variables to read or write.
The set of PLC objects you can read or write is made of:
• Status variables.
• Field variables declared in I/O Mapping > Field.
9MA10256.03 75
Managing Resources Elements
76 9MA10256.03
Managing Resources Elements
Step Action
2 • Drag Generic Modbus from the Catalog window to RS485 item in the
Resources window.
• Or you can right-click RS485 and select Add command.
Generic Modbus appears under RS485 item.
You can use the Generic Modbus when you want to configure manually and have
full control over the single Modbus messages to send to the slave.
Another typical usage is for third-party devices that you plan to use once in your
project, and you do not want to put in the catalog for future reuse.
In the main page of the Generic Modbus you can configure:
• A name for the object in the project.
• Its Modbus address (in the range 1…247).
• Its Node number (node ID)(in the range 0…127): this value is incremented
automatically, and can be used in the PLC program to index the
SysMbMRtuNodeStatus[] array that contains diagnostic information about
each slave node.
9MA10256.03 77
Managing Resources Elements
To add a function to a Generic Modbus object, drag a Modbus function from the
Catalog window to Generic Modbus item in the Resources window. You can
also right-click Generic Modbus and select Add command.
Catalog
1 0x01 Read Coils Reads one or more read-only discrete output 1-bit
coils
2 0x02 Read Discrete Inputs Reads one or more read-only digital inputs 1-bit
4 0x04 Read Input Registers Reads one or more read-only registers 16-bit
5 0x05 Write Single Coil Writes one discrete output coil 1-bit
6 0x06 Write Single Register Writes single analog output holding register 16-bit
15 0x0F Write Multiple Coils Writes one or more digital outputs 1-bit
The messages are processed in the order they are inserted in the tree.
General Tab
Select the Modbus function added to the tree to display its configuration window:
MODBUS FC
GENERAL
78 9MA10256.03
Managing Resources Elements
• Wait before send: this is the wait time before sending another request to the
salve device.
Coils Tab
Beside the General tab, each different message has a second tab where you can
configure the list of objects to read or write.
Using the Add button, insert one row for each Modbus object to read or write, up
to 16 elements. The first row has the address configured in the Address box in
the General tab, and the other rows increment and follow.
For each row, press the Assign button to choose the PLC object to link and to be
read or written with this Modbus message; you cannot leave unassigned rows in
the message.
NOTE: Remember to rebuild the PLC project to see an updated list of PLC
variables here.
9MA10256.03 79
Managing Resources Elements
ModbusCustomEditor
Device Version
Name: ModbusCustomDeviceName
Version: 1.0
Device Info
Max message size (bit): 2000
80 9MA10256.03
Managing Resources Elements
General Tab
In the General tab you can configure:
• Its Modbus address (in the range 1…247).
• Its Node number (in the range 0…127); this value is incremented
automatically, and can be used in the PLC program to index the
SysMbMRtuNodeStatus[] array that contains diagnostic information about
each slave node.
• Polling time: the Modbus messages are processed with this period (ms); for
writing operations, value 0 means to write it only on variation of the value, for
reading operations value 0 means maximum speed.
• Timeout: the operation is unsuccessful when this time-out expires (ms).
• Wait before send: this is an additional timeout (to be used with slow slaves
that do not answer if the messages are sent too fast).
GENERAL tab of MODBUS CUSTOM CONFIGURATION:
TimeOut: 1000 ms
Here you can note that for Modbus custom the Polling time, Timeout, and Wait
before send are generic for the whole device while for the Generic Modbus you
can put specific different values for each single message. This is because with the
Modbus custom the low-level Modbus messages are automatically calculated.
However, you cannot “fine-tune” them because these settings are global.
9MA10256.03 81
Managing Resources Elements
Insert in the Input tab the Modbus objects to READ from the Modbus slave (and to
put into PLC variables). Insert in the Output tab the Modbus objects to WRITE to
the Modbus slave (and to get from the PLC variables).
NOTE: Remember to rebuild the PLC project with Application to see an
updated list of PLC variables here.
Configuration creates the correct Modbus messages analyzing the sequence of
addresses and types. If the addresses are consecutive and the types are
homogeneous, different objects are grouped in single messages to optimize the
communication.
The maximum number of registers configured with the ModbusCustomEditor is
also considered, along with the maximum number of registers per message of the
master (16 for the FREE Evolution/FREE Advance).
The grouping and generation of the Modbus messages is automatic and
recalculated at each compilation.
Ethernet
Description
FREE Panel EVP / AV•••••••6•500 are provided with an integrated Ethernet port.
FREE Evolution/AV••••••50500 can have one Ethernet port, available as an
external communication module.
The Ethernet port can be configured as a Modbus TCP in two ways:
• Server only: the controller supports communication from other controller
requests.
• Client/Server: the controller supports Modbus TCP communication from
other controller requests as well as making requests to other controllers.
NOTE: Schneider Electric and Eliwell adhere to industry best practices in the
development and implementation of control systems. This includes a
"Defense-in-Depth" approach to secure an Industrial Control System. This
approach places the controllers behind one or more firewalls to restrict access
to authorized personnel and protocols only.
82 9MA10256.03
Managing Resources Elements
WARNING
UNAUTHENTICATED ACCESS AND SUBSEQUENT UNAUTHORIZED
MACHINE OPERATION
• Evaluate whether your environment or your machines are connected to your
critical infrastructure and, if so, take appropriate steps in terms of prevention,
based on Defense-in-Depth, before connecting the automation system to
any network.
• Limit the number of devices connected to a network to the minimum
necessary.
• Isolate your industrial network from other networks inside your company.
• Protect any network against unintended access by using firewalls, VPN, or
other, proven security measures.
• Monitor activities within your systems.
• Prevent subject devices from direct access or direct link by unauthorized
parties or unauthenticated actions.
• Prepare a recovery plan including backup of your system and process
information.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Configuration
To configure the Ethernet port:
• Select Client/Server or Server only.
• Enter the additional Modbus TCP sockets (0 by default).
The IP address is stored in Modbus objects > BIOS Parameters.
Client/Server
The Client/Server configuration allows the controller to send requests and to read
responses from or to other devices connected on the same Ethernet network.
You can attach Modbus devices and exchange data.
You can add generic Modbus devices, page 77, or custom devices created with
the Modbus custom Editor, page 79 in the same way as for RS485.
After you added and configured the Modbus nodes, you can add Generic Modbus
Objects Messages, page 77 to define the READ or WRITE functions.
The set of controller objects you can send or receive is made of:
• EEPROM Parameters (non-volatile memory parameters)
• Status variables
The configuration page for the Binding object in Modbus TCP is the same as the
CAN Expansion bus. Refer to chapter CAN Expansion bus - Binding, page 66 for
a description and usage of this page.
9MA10256.03 83
Managing Resources Elements
MODBUS FC
GENERAL
The only difference from CAN Expansion bus Binding is that here you have one
more column named Timeout, where you can configure the specific time-out in
ms for each object exchanged.
Plugins
Communication Modules Range Overview
The communication modules (plugins) that can be added are displayed in the
Catalog window.
Drag the communication module into the Plugins element.
Example of RS232 configuration window:
RS232 CONFIGURATION
19200 b/s
38400 b/s
57600 b/s
115200 b/s
Consistency
Word Swap
84 9MA10256.03
Managing Resources Elements
EVS00EB000000 Ethernet, Modbus TCP, BACnet/IP, Modbus SL, 1 RJ45 FREE Evolution(1)
and BACnet MS/TP
2 screw terminal blocks
EVS00PB000000 PROFIBUS 1 SUB-D 9 FREE Evolution(1)
(1) Not applicable to FREE Panel EVP
(2) Not applicable to EVS00R4000000
For further information about communication modules, refer to the FREE EVS
Plugin Instruction Sheet 9IS54405.
9MA10256.03 85
Technical Reference
Technical Reference
What’s in This Chapter
Modbus Protocol ...........................................................................................86
Modbus Protocol
Overview
Introduction
The transmission mode used is RTU. The frame does not contain message
header and end of message bytes.
Principle
Only one device can transmit on the line at a time.
The master manages the exchanges and only it can take the initiative.
It interrogates each of the slaves in succession.
No slave can send a message unless it is asked to do so.
The master repeats the question when there is an incorrect exchange, and
declares the interrogated slave unavailable if no response is received within a
given time period.
If a slave does not receive a message, it sends an exception response to the
master. The master may or may not repeat the request.
Direct slave-to-slave communications are not possible.
For slave-to-slave communication, the application software must therefore be
designed to interrogate a slave and send back data received to the other slave.
The 2 types of dialogue are possible between master and slaves:
• The master sends a request to a slave and waits for its response
• The master sends a request to all slaves without waiting for a response
(broadcasting principle)
Addresses
Address specification:
• The device Modbus address can be configured from 1 to 247.
• Address 0 coded in a request sent by the master is reserved for broadcasting.
Slave devices take account of the request, but do not respond to it.
86 9MA10256.03
Technical Reference
Data Types
Description
Information is stored in the Slave device in four different types: two types are on/
off discrete values (coils and contacts) and two are numerical values (registers).
• Discrete Input Contacts (read only), 1-bit.
• Discrete Output Coils (read/write), 1-bit.
• Analog Input Registers (read only), 16-bit.
• Analog Output Holding Registers (read/write), 16-bit.
To handle more complex data types (like 32-bit integers or floating point), you
have to use two or more consecutive registers and read or write them together.
Function Codes
Description
The Modbus protocol specifies different “function codes” for each Modbus
message:
• 01 (01 hex): Read Discrete Output Coils.
• 05 (05 hex): Write single Discrete Output Coil.
• 15 (0F hex): Write multiple Discrete Output Coils.
• 02 (02 hex): Read Discrete Input Contacts.
• 04 (04 hex): Read Analog Input Registers.
• 03 (03 hex): Read Analog Output Holding Registers.
• 06 (06 hex): Write single Analog Output Holding Register.
• 16 (10 hex): Write multiple Analog Output Holding Registers.
9MA10256.03 87
Programming
What’s in This Part
The Programming Tab ..................................................................................89
Project Options ..............................................................................................98
Managing Project Elements .......................................................................... 111
Editing the Source Code ............................................................................... 140
Compiling .................................................................................................... 168
Launching the Application ............................................................................. 172
Simulation ................................................................................................... 182
Debugging ................................................................................................... 190
Language Reference .................................................................................... 243
88 9MA10256.03
The Programming Tab
WARNING
UNINTENDED EQUIPMENT OPERATION
• Verify that the installation and set up procedures have been completed.
• Before operational tests are performed, remove the blocks or other
temporary holding means used for shipment from the component devices.
• Remove tools, meters, and debris from equipment.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
General Description
The Programming work environment has various windows for developing the
controller application (for example programming in IEC 61131-3 compatible
languages), testing, debugging, and controller application downloading to the
target device.
In the Programming, you have two download possibilities:
WARNING
AUTOMATIC RESTART OF CONTROLLER
• Do not download your application without first accessing the state of your
machine or process.
• Do not download your application without first ascertaining that there is no
risk of injury to anyone in or around your machine or process.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
9MA10256.03 89
The Programming Tab
3 1 2 4 6
C:\My Project\My Project.plcprj
Free Studio Plus
Configuration Programming Display Commissioning
File Edit View Project On-line Debug Variables Window Tools Help
main
Build Find in project Debug Resources HMI Output Operator and standard blocks Target variables Target blocks
Ready EDIT MODE .... NOT CONNECTED
7 5 8
Item Description
1 Toolbars Many functions available in menus are displayed here in form of icons in toolbars.
These icons help you to create the application. The most used are in Main and Project
toolbars.
For information about how to manage the toolbars, refer to Toolbars, page 36.
2 Local variables window The global and local variables of the code displayed in the source code editor (programs,
function blocks, and functions) appear here.
For more information about how to use the Local variables window, refer to Variables, page
114.
3 Project window This window enables you to:
• Manage the application code.
• Manage and define complex variables defined by you.
• Manage the target device menu.
For information about how to use the Project window, refer to Project Window, page 111.
4 Source code editor This window enables you to manage, edit, and use file/print source to write in any of the five
programming languages defined by the IEC 61131-3 standard.
The definition of both global and local variables is supported by specific spreadsheet-like
editors.
For information about how to use the source code editor, refer to Editing the Source Code,
page 140.
5 Watch window This window enables you to manage variables debugging by displaying their status in
numerical format when the application is running and connected to the target device.
For more information about how to use the Watch window, refer to Watch Window, page 190.
6 Library Tree window The Library Tree window contains a set of different library objects, excepts for two generic
folders which are default for any project. These two folders are Operator and Blocks folder
and Target folder which are colored in green.
Each object is grouped into the folder to which it belongs. These folders are useful to group the
library elements logically.
To display the properties of an object, right-click its name and select Object Properties
command. The Properties Window appears and displays its properties.
For information about how to manage libraries, refer to Working with Libraries, page 106.
90 9MA10256.03
The Programming Tab
Item Description
7 Output window This tool window shows the messages relating to the development of the project. For more
details, refer to Output window description, page 91.
8 Operators and blocks This tool enables you to manage default function libraries or function libraries created by you.
window
The window is divided into various tabs, one for each library.
Output Window
This tool window shows the messages relating to the development of the project.
The window is divided into five tabs:
• Build: information related to the file opening, compilation errors, and
downloading code to a device.
• Find in project: result of the Find in project activity.
• Debug: information about debugging activities (for example breakpoints).
• Resources: messages related to the target device.
• HMI Output: messages related to Display activity.
NOTE: The connection to the target device is also visible in the status bar,
page 35.
Menu Bar
Overview
The menu bar of Programming tab is composed of these menus:
• File, page 28
• Edit, page 27
• View, page 33
• Project, page 30
• On-line, page 29
• Debug, page 26
• Scheme, page 31
• Variables, page 32
• Window, page 34
• Tools, page 32
• Help, page 28
NOTE: Programming has a multi-document interface (MDI), so you may find
some disabled commands or even some unavailable menus, depending on
what kind of document is currently active.
9MA10256.03 91
The Programming Tab
Toolbars
Introduction
The toolbars appear at the top of the FREE Studio Plus window to provide access
to frequently used functions.
The description of commands is displayed in the lower left corner of the main
window when you place the mouse tracker on the command icon.
Main Toolbar
The main toolbar has the following buttons:
Undo Ctrl+Z
Click once to undo the most recent action in the program editor.
Click the down arrow and select an action from the list to undo all
actions up to and including the selected action.
Redo Ctrl+Y
Click the down arrow and select an action from the list to redo all
actions up to and including the selected action.
Cut Ctrl+X
Copy Ctrl+C
Paste Ctrl+V
Find Ctrl+F
Find next F3
Go to symbol Shift+F12
Print Ctrl+P
Workspace Ctrl+W
Output Ctrl+R
92 9MA10256.03
The Programming Tab
Watch Ctrl+T
Oscilloscope Ctrl+K
Project Toolbar
The project toolbar has the following buttons:
Compile F7
Simulation mode -
Code download F5
Halt -
Cold restart -
Warm restart -
Hot restart -
Reboot target -
Object browser -
Library manager -
Object properties -
9MA10256.03 93
The Programming Tab
Insert record -
Delete record -
Debug Toolbar
The debug toolbar has the following buttons:
Add/remove trigger F9
Run -
Step -
Breakpoint list -
FBD Toolbar
The FBD toolbar has the following buttons:
Move/Insert -
Connection -
Watch -
New block -
Variable -
Constant -
94 9MA10256.03
The Programming Tab
Expression -
Return -
Jump -
Comment -
FBD properties -
View source -
SFC Toolbar
The SFC toolbar has the following buttons:
New step -
New transition -
New jump -
9MA10256.03 95
The Programming Tab
Move a transition up -
New action -
LD Toolbar
The LD toolbar has the following buttons:
Coil Shift+O
Open object O
Negated object C
Positive object P
Negative object N
Reset object R
Set object S
New branch -
Network Toolbar
The Network toolbar has the following buttons:
96 9MA10256.03
The Programming Tab
Insert top -
Insert bottom -
Insert after -
Insert before -
View grid -
Auto connect -
9MA10256.03 97
Project Options
Project Options
What’s in This Chapter
Project Options .............................................................................................98
Working with Libraries ................................................................................. 106
Project Options
General Information
You can edit significant project options choosing Project > Options….
General Tab
Overview
General tab of the Project options window:
Project options
Project info
Author:
Note:
Legacy options
Use legacy LD editor
Use customizable workspace
Main features
98 9MA10256.03
Project Options
• Use legacy LD editor: the new Ladder Diagram editor is easier to use, by
helping user in common operations working on the diagram is faster and
more efficient. By default, this option is active. For more information, refer to
Ladder Diagram (LD) Editor, page 147.
• Use customizable workspace: allows user to manage the project tree in
order to reach a more efficient workspace. By default, this option is active. For
more information, refer to Project Custom Workspace, page 136.
• Multiple files project: allows user to save project in *.xplc format.
• Custom sort of project folders: enables Move up and Move down
commands in the context menu of the folder, in the project tree.
Project options
OK Cancel Apply ?
9MA10256.03 99
Project Options
100 9MA10256.03
Project Options
Project options
Debug MyProject_debug.bin
OK Cancel Apply ?
Here you can edit some significant properties of the output files generated by
compiling operation.
Downloadable target files section:
• Create downloadable target files: if this option is checked the compiler
generates the binary files that can be downloaded to the target. You can
specify custom filenames or use the default names.
Only valid Windows filename are accepted.
• PLC application (active only if Create downloadable target files is
checked): this field specifies the name of the PLC application binary file. The
default name is projectname.bin.
• Source code (active only if Create downloadable target files is checked):
this field specifies the name of the Source code binary file. The default name
is projectname._source.bin.
• Debug (active only if Create downloadable target files is checked): this
field specifies the name of the Debug symbol binary file. The default name is
projectname._debug.bin
Listing, reports etc section:
• Generate code listing file (.lst): if this option is checked the compiler
generates a listing file named as projectname.lst.
• Generate mapped variables export file (.exp): if this option is checked the
compiler generates an EXP file named as projectname.exp.
• Generate unused elements report (.unu .xml): if this option is checked the
compiler generates two reports of unused elements named as projectname.
unu and projectname.xml.
9MA10256.03 101
Project Options
Debug Tab
Overview
Debug tab of the Project options window:
Project options
OK Cancel Apply ?
Here user can edit some significant properties of the debug behavior:
• Polling period for debug function (ms): set the active sampling period of
the debug status.
• Number of displayed array elements without alert message: specifies the
maximum number of array elements to be added in the watch window without
being alerted.
• Polling period between more variables (ms): set the delay between
sampling of variables.
• Autosave watch list: if checked the watch list status is saved into a file when
the project is closed.
• Enable memory dump: enables the memory dump function for advanced
debugging.
• Watch internal variables of function blocks: allows user to view internal
variables of “VAR” class.
• Automatically dereference pointers and references in watch: if this option
is checked, when adding the pointer variable in the watch window, the pointed
value will be directly shown; if it is disabled, the watch window will show the
content of the pointer which need to be expanded to see the pointed value.
• Print debug informations: when compiling, additional information are shown
in the output window.
102 9MA10256.03
Project Options
Project options
Environment variables
PRJTITLE PRJPATH PRJBASENAME IMGNAME APPLPATH
TARGETDEFNAME FIRMWAREFILENAME PRJRELEASE
PRJVERSION PRJAUTHOR PRJCONN SIMUL
Post-build commands:
Pre-download commands:
Post-download commands:
OK Cancel Apply ?
Here you can specify commands that run before the build starts or after the build
finishes. You can also use a set of defined environment variables listed on the top
of the window.
The environment variables are:
• PRJTITLE: project name.
• PRJPATH: project folder.
• PRJBASENAME: project full path without extension.
• PRJFULLNAME: project full path.
• IMGNAME: .imgx image file name.
• TARGETDEFNAME: project target name.
• PRJRELEASE: project name as defined in General tab of Project options.
• PRJVERSION: project version as defined in General tab of Project options.
• PRJAUTHOR: project author as defined in General tab of Project options.
• PRJCONN: current communication settings.
• APPLPATH: full application path.
• SIMUL: if simulation mode 1, else 0.
9MA10256.03 103
Project Options
Project options
Generate cross-reference
Options
Trace TypeDefs
OK Cancel Apply ?
Here you can activate the Generate cross-reference function and set the related
options.
The cross-reference trace options can be set for:
• Global Vars: Global variables
• Local Vars: Local variables
• Programs: Programs
• Functions: Functions
• Function Blocks: Function blocks
• Tasks: Tasks
• Macros: Macros
• Structs: Structures
• Enums: Enumerations
• Subrs: Subranges
• TypeDefs: Typedefs, used to create an alias name for another data type.
The cross-reference trace options can be set in:
• Programs
• Functions
• Function Blocks
104 9MA10256.03
Project Options
Project options
OK Cancel Apply ?
These options allow the user to enable specific controls made at execution time.
The run-time check options can be set for:
• Run-time check of array bounds: if this option is checked some check code
is added to verify that array indexes are not out of bounds during run-time.
This option can be set depending on target device.
• Run-time check of pointers: this combo allows you to choose if and when
the pointer will be tested for their validity before their use.
◦ Selecting NONE, the check will never be done.
◦ Selecting ONLY IF NOT NULL, the check will verify that the pointer value
is not NULL; if it is NULL, it will return value zero but will not stop the
running application. So the PLC execution will never be interrupted due to
a NULL pointer, but you’ll never get an error notification.
◦ Selecting FULL, the check will verify that the pointer value is not NULL and
that the pointed address is within a validity range (this last control requires
the user-defined function checkptr on target; if it is not defined, only the
first control is executed). If one of this two controls fail, the PLC execution
is interrupted and an error message is raised.
• Run-time check of division by zero: if this option is checked some check
code is added to verify that divisions by zero are not performed on arrays
during run-time. This option can be set depending on target device.
• Run-time check of interfaces: if this option is checked, allows a references
validity check within a method call. This option can be set depending on
target device (Object Oriented supported)
• Run-time check of references: if this option is checked, allows a references
validity check; if a reference is dereferenced to null, a runtime error is
generated.
9MA10256.03 105
Project Options
Advanced Tab
Overview
Advanced tab of the Project options window:
Project options
OK Cancel Apply ?
These options allow the user to specify specific behaviors, suggested only for
expert users.
• LD evaluate edges on each network: this option allows the user to change
edges evaluation timing (high/low). If it is NOT checked, the edges of an LD2
program are evaluated only once, at the beginning of the program execution.
If it is checked, the edges of an LD2 program are evaluated at the beginning
of every LD network.
• External access to local vars of function blocks: if this option is NOT
checked, the local variables of a function block, are considered private and
accessible only inside the function block. (standard IEC behavior). If this
option is checked, the local variables of a function block are considered as IN/
OUT variables; so they are visible and accessible also from the caller of the
function block instance.
Library Manager
Overview
The library manager lists the libraries currently included in the project. It also
allows you to include or remove libraries.
To access the library manager, click Project > Library manager.
106 9MA10256.03
Project Options
Including a Library
The following procedure presents how to include a library in a project, which
results in the library’s objects becoming available to the current project.
Including a library means that a reference to the library’s .pll file is added to the
current project, and that a local copy of the library is made. You cannot edit the
elements of an included library, unlike imported objects.
To copy or move a project which includes one or more libraries, make sure that
references to those libraries are still valid in the new location:
Step Action
1 Click Project > Library manager, which opens the Library manager dialog box.
2 Click the Add button, which causes an explorer dialog box to appear, to let you select
the .pll file of the library you want to open.
3 When you have found the .pll file, open it either by double-clicking it or by clicking the
Open button. The name of the library and its absolute pathname are now displayed in a
new row at the bottom of the list.
4 Repeat step 1, 2, and 3 for the libraries you wish to include.
5 When you have finished including libraries, click the Close button.
Removing a Library
Removing a library does not delete the library itself, but removes the reference to
it in the project.
The following procedure presents how to remove an included library from the
current project:
Step Action
1 Click Project > Library manager menu of the Programming main window, which
opens the Library manager dialog box.
2 Select the library you wish to remove by clicking its name once. The Remove button is
now enabled.
3 Click the Remove button, which causes the reference to the selected library to be
deleted from the Project library list.
4 Repeat for the libraries you wish to remove. Alternatively, if you want to remove the
libraries, you can click the Remove all button.
5 When you have finished removing libraries, click the Close button.
9MA10256.03 107
Project Options
Exporting to a Library
Overview
You may export an object from the currently open project to a library in order to
make that object available to other projects.
The following procedure presents how to export objects to a library:
Step Action
1 Select the object you want to export in the tree structure of the project tab.
Code encryption
Version 1.0.0
Description
OK Cancel
3 Enter the destination library by specifying the location of its .pll file. You can do this by:
• Typing the full pathname in the text box.
NOTE: If you enter the name of a non-existing .pll file, FREE Studio Plus
creates a new library.
• Clicking the Browse button in order to open an explorer dialog box which
allows to browse your disk and the network.
4 You may optionally choose to encrypt the source code of the POU you are exporting in
order to protect your intellectual property.
You can also modify the version number and add a description.
Import Example
The following procedure presents how to import objects from a library:
108 9MA10256.03
Project Options
Step Action
1 Click Project > Import objects. This causes an explorer dialog box to appear, which
lets you select the .pll file of the library you want to open.
2 When you have found the .pll or .plclib file, open it either by double-clicking it or by
clicking the Open button.
Object browser
Objects filter
Name Type
Programs Operators AHUPlanModeStrategy Function blocks
Function Blocks AHUTempCntrlStrategy Function blocks
Functions Standard functions CompAlarmMgmt Function blocks
Variables Local variables CompAppLimit Function blocks
CompCntrl_OnOff Function blocks
User types Basic types
CompCntrl_Slider Function blocks
Check all Check none CompCntrl_VS Function blocks
CompMgmt Function blocks
CompMgmtVS Function blocks
Other filters COPCalculation Function blocks
Counter2Energy Function blocks
Name * OK DoubleInterpo_5x8 Function blocks
EcFanMgmt Function blocks
Location All
EnergyTrend Function blocks
Library FanMgmt Function blocks
Close Import objects Enable merge method Select all Select none
3 Select the objects you want to import. You can also make simple queries on the objects
by using Filters. However, only the Name filter currently applies to libraries. To use it,
enter the name of the desired objects, even using the * wildcard, if necessary.
4 Select the objects you want to import then click the Import objects button.
5 When you have finished importing objects, click indifferently OK or Cancel to close the
browser.
Merge Function
When you import objects in a project or insert a copied mapped variable, you may
encounter an overlapping address or duplicate naming error.
You can choose the behavior that FREE Studio Plus should keep when
encountering those problems by setting the corresponding environment options,
page 40.
The possible actions are:
If both variables -
Address If address -
behavior overlaps
9MA10256.03 109
Project Options
Copy/paste - -
mapped variable
Automatic: A valid name or address is automatically generated by FREE Studio Plus and assigned
to the imported object.
Take from library: The name or the address is taken from the imported object.
Do nothing: The name or the address of the objects in the project are not modified.
After importing objects, FREE Studio Plus generates a log file in the project folder
with detailed info.
Step Action
110 9MA10256.03
Managing Project Elements
Project Window
Overview
This chapter explains how to manage with the elements which compose a project,
namely: Program Organization Units (POUs), tasks, derived data types, and
variables.
The Project window allows you to:
• Manage the application code.
• Manage and define complex variables that you define.
• Manage the tasks.
Aux Variables - The shared global resources appear in the Project window
but are defined in the Resources window.
9MA10256.03 111
Managing Project Elements
Creating a Program
Description
To create a program:
Step Action
New program
Language
IL FBD LD ST SFC
Name
Task
Assign to -
OK Cancel
NOTE: If you do not select a task at this step, an alert icon appears below the
program icon to indicate that the program is not yet associated to a task.
Refer to Associating a Program to a Task, page 122 to assign the program to the
desired task.
5 Click the OK button to confirm.
Alternatively, you can create a new POU from the context menu by selecting a
folder or the root element of the project. For more information, refer to Custom
Workspace Operations, page 138.
112 9MA10256.03
Managing Project Elements
Step Action
For Function Block, click Project > New Object > New function.
For Function, click Project > New Object > New function block.
2
A dialog box is displayed:
New program
Language
IL FBD LD ST SFC
Name
OK Cancel
Editing POUs
Overview
To edit a POU, open it by double-clicking it from the project tree. The relative
editor opens and lets you modify the source code of the POU.
Duplicating a POU
Select a POU from the project tree, then click Project > Duplicate object.
Enter the name of the new duplicated POU and confirm the operation.
9MA10256.03 113
Managing Project Elements
Deleting POUs
Select a POU from the project tree, then click Project > Delete Object.
Confirm the operation to delete the POU.
Encrypting a POU
Select a POU from the project tree, right-click, then select Crypt in the context
menu
Double enter the password and confirm the operation.
Programming displays in the project tree a special marker icon that overlays the
standard POU icon in order to inform you that the POU is encrypted.
Decrypting a POU
Select a POU from the project tree, right-click, then select Decrypt in the context
menu
Variables
Overview
There are two classes of variables in Programming: global variables and local
variables.
This section presents how to add to the project, edit, and remove both global and
local variables.
114 9MA10256.03
Managing Project Elements
Global Variables
Description
Global variables can be seen and referenced by any POU of the project.
Step Action
1 In order to create a new global variable, you need to define at least one Global
variables group in your project. Afterward select it from the project tree then choose
the appropriate item of the menu Project > New Object > New variable. Refer to
Custom Workspace Operations, page 138.
New variable
Description
OK Cancel
2 Enter the name of the variable. The variable name must be a valid IEC 61131-3
identifier.
Valid variable names can consist of any combination of letters, numbers, and
underscores, though they cannot begin with a number.
9MA10256.03 115
Managing Project Elements
Step Action
3
Specify the type of the variable either by typing it or by selecting it from the list that
Object browser
Objects filter
Name Type Description
Programs Operators BOOL Basic types
Function Blocks BYTE Basic types
Functions Standard functions DINT Basic types
Variables Local variables DWORD Basic types
eCompTyp User Types Kind of values
User types Basic types
ePrtyMode User Types Priority Mode Enumeration
Check all Check none
eStage User Types Define of the Staging Methode
eType User Types
INT Basic types
Other filters MBMNODESTATUS User Types
REAL Basic types
Name * OK SINT Basic types
stAlrmCtrl User Types Alarm Control Structure
Location All
stAna User Types Real Value + Status
Library All stAuxPumpAlrm User Types Auxiliary Pump Alarm Status
stAuxPumpCom User Types Command Status
Vars type All
stAuxPumpCtrlInit User Types Structure of Auxiliary Pump Initialisa...
Vars group stAuxPumpCtrlSta User Types Auxiliary Pump Control Status
stAvai User Types Available status
stCavtAlrm User Types
Close OK
If you want to declare an array, you must specify its size by clicking the Browse
button next to the Array field:
Size of variable
Scalar
Array / Matrix
Dimensions 2,3,3
OK Cancel
Enter the length of the array. Use comma to separate the length of each dimension (up
to 3).
5
You may optionally assign the initial value to the variable or to the single elements of
the array by clicking the Browse button next to the Init values field:
[0,1,2,1]
OK Cancel
116 9MA10256.03
Managing Project Elements
Step Action
1 To create a newly global mapped variable, you need to define at least one Global
variables group in your project. Afterward select it from the project tree then choose
the menu Project > New Object > New variable > Mapped Variable.
Description
OK Cancel
2 Enter the name of the variable. The variable name must be a valid IEC 61131-3
identifier.
Valid variable names can consist of any combination of letters, numbers, and
underscores, though they cannot begin with a number.
3
Specify the type of the variable either by typing it or by selecting it from the list that
Object browser
Objects filter
Name Type Description
Programs Operators BOOL Basic types
Function Blocks BYTE Basic types
Functions Standard functions DINT Basic types
Variables Local variables DWORD Basic types
eCompTyp User Types Kind of values
User types Basic types
ePrtyMode User Types Priority Mode Enumeration
Check all Check none
eStage User Types Define of the Staging Methode
eType User Types
INT Basic types
Other filters MBMNODESTATUS User Types
REAL Basic types
Name * OK SINT Basic types
stAlrmCtrl User Types Alarm Control Structure
Location All
stAna User Types Real Value + Status
Library All stAuxPumpAlrm User Types Auxiliary Pump Alarm Status
stAuxPumpCom User Types Command Status
Vars type All
stAuxPumpCtrlInit User Types Structure of Auxiliary Pump Initialisa...
Vars group stAuxPumpCtrlSta User Types Auxiliary Pump Control Status
stAvai User Types Available status
stCavtAlrm User Types
Close OK
5 You are required to specify the address of the variable by doing one of the following
operations:
9MA10256.03 117
Managing Project Elements
Step Action
• Click the Data block browser button to open the editor of the address;
then enter the desired value:
Variable address
Automatic address
Size Location
Bit Input
Byte (8 bit) Output
Word (16 bit) Memory
Double word (32 bit)
OK
Data block Index
0 . 0 Cancel
Click OK.
• Select, from the Location list, the memory area you want to use: the tool
automatically calculates the address of the first free memory location of that area.
Depending on the selected location, you can specify its size by clicking the
Browse button next to the Size field:
Size of variable
Scalar
Array / Matrix
Dimensions 2,3,3
OK Cancel
Enter the length of the array. Use comma to separate the length of each dimension (up
to 3).
118 9MA10256.03
Managing Project Elements
Project
HMI samples
Function blocks
Elevator
Name Type Address
Loops
Elevator vars 1 hmiTargetPosition DINT %MB1.58
hmiAcceleration 2 hmiActualPosition DINT %MD1.62
hmiElevatorOn
hmiElevatorStanding
hmiSpeed
Local Variables
Description
Local variables are declared within a POU (either program, function, or function
block), the POU itself being the only project element which can refer to and access
them.
Local variables are listed in the project tree under the POU which declares them
(only when that POU is open for editing). The local variables are further classified
according to their class (for example, as input or output variables):
Function blocks
LinearProfileGen
Input variables
nomDec
stop
targPos
Local variables
actTargPos
decel
decSpace
Output variables
actAcc
actSpeed
enableOut
9MA10256.03 119
Managing Project Elements
In order to create, edit, and delete local variables, you have to open the POU for
editing and use the local variables editor. The project needs to be saved in order
to update the POU branch structure of the project tree, including the modifications
applied to the local variables.
For more information, refer to Opening a Local Variables Editor, page 164.
Click Variables > Insert command or click the Insert record icon in the
Project toolbar. You can also create multiple variables, page 121.
The variable appears in yellow in the Local variables window, and you can define
its characteristics by clicking the respective boxes.
Created variables can be displayed in table format by selecting the icon on the
upper right corner of the window:
Local variables
Name Type Address Array Init value Attribute
1 VAR1_OUT INT Auto No ...
2 VAR2_OUT INT Auto No ...
3 VAR3_OUT INT Auto No ...
4 VAR4_OUT INT Auto No ...
5 VAR5_OUT INT Auto No ...
6 VAR6_OUT INT Auto No ...
7 VAR7_OUT INT Auto No ...
8 VAR8_OUT INT Auto No ...
9 VAR9_OUT INT Auto No ...
10 VAR10_OUT INT Auto No ...
120 9MA10256.03
Managing Project Elements
Created variables can be displayed also in code format by selecting the second
icon on the upper right corner of the window:
Local variables
The local variables appear in the Project window, below the program folder,
identified by an icon.
NOTE: The local variables are reinitialized each time the POU is executed.
Step Action
Name
Prefix: VAR
Suffix: _OUT
Type
Attribute
Attribute: ...
Counter
OK Cancel
3 Specify the prefix and the suffix of the new variables names.
4 Specify the type of the variables either by typing it or by selecting it from the list that is
9MA10256.03 121
Managing Project Elements
Step Action
6 Insert the number of the variables you want to create specifying the start index, the end
index, and the step value.
You can see an example of the generated variable names at the bottom of the dialog.
Tasks
Associating a Program to a Task
Overview
For a program to run, it must be associated to a task.
The following types of task are available:
• Boot task is executed only once at PLC start up.
• Init task executed at each download of the application and on starting up the
system (after Boot).
NOTE: The associated program initializes slaves and messages
according to the configuration, with fixed values that are independent of
the run time.
WARNING
AUTOMATIC RESTART OF CONTROLLER
• Do not download your application without first accessing the state of
your machine or process.
• Do not download your application without first ascertaining that there is
no risk of injury to anyone in or around your machine or process.
Failure to follow these instructions can result in death, serious injury,
or equipment damage.
• Timed task runs at regular intervals which you can set. The default setting
depends on target type.
NOTE: Modbus messages do not interfere with this task.
• Background task runs with low priority after the execution of the Timed
tasks.
• Modbus task executed to implement Modbus Master, calling relative function
blocks, and to send messages (Only for FREE Smart).
122 9MA10256.03
Managing Project Elements
Step Action
1 Right-click on the task where you want to add the program from the project tree then
choose the Add program command.
2 Select the program you want to be executed by the task from the list which shows up
and confirm your choice.
3
The program has been assigned to the task:
Tasks
Timed
Elevator
Background
Boot
Init
Task Configuration
Description
Depending on the target device, it is possible to modify settings of the controller
tasks.
Task Configuration
To configure a task:
Step Action
9MA10256.03 123
Managing Project Elements
Step Action
Tasks configuration
ID Name Type Set period Period (ms) Description
0 Timed Cyclic No 100 Timed task - execution time can be configured between 20 and 100 ms
1 Background Cyclic No 0 Background task - executes continuously at low priority
2 Boot Single No 0 Boot task - executes once at system startup
3 Init Single No 0 Init task - executes once at every PLC full restart
OK Cancel
5 Click Ok to validate
NOTE: For all other targets than FREE Advance, the duration of timed task
can be set on Configuration, clicking the target name on the tree. There is a
checkbox Set execution time in the main window.
Typedefs
Description
The following paragraphs present how to manage TypeDef.
For more information about TypeDefs, refer to TypeDefs description, page 245.
124 9MA10256.03
Managing Project Elements
Step Action
New Typedef
Name
Description
OK Cancel
2 Enter the name of the TypeDef. The TypeDef name must be a valid IEC 61131-3
identifier.
Valid names can consist of any combination of letters, numbers, and underscores,
though they cannot begin with a number.
3 Specify the type of the TypeDef either by typing it or by selecting it from the list that is
If you want to declare an array, you must specify its size by clicking the Browse
button next to the Array field:
Size of variable
Scalar
Array / Matrix
Dimensions 2,3,3
OK Cancel
Enter the number of elements of the array. Use comma to separate the number of
elements of each dimension (up to 3 dimensions).
5
You may optionally assign the initial value to the variable or to the single elements of
the array by clicking the Browse button next to the Init values field:
[0,1,2,1]
OK Cancel
9MA10256.03 125
Managing Project Elements
Step Action
7 Click Ok to validate.
Editing a Typedef
To edit a TypeDef, double-click it from the Project window tree. The TypeDef is
displayed in the window where you can modify the values:
Deleting a Typedef
To delete an existing TypeDef, right-click it from the Project window tree and
select Delete.
Structures
Description
The following paragraphs present how to manage structures.
For more information about Structure, refer to Structures description, page 246.
126 9MA10256.03
Managing Project Elements
Step Action
New Structure
Name COMPLEX
Version 1.0.0
Description
Complex Number
OK Cancel
4 Click Ok to validate.
Editing a Structure
To edit an existing Structure, double-click it from the Project window tree.
Deleting a Structure
To delete an existing Structure, right-click it from the Project window tree and
select Delete.
9MA10256.03 127
Managing Project Elements
Enumerations
Description
The following paragraphs show you how to manage enumerations.
For more information about Enumeration, refer to Enumerated Data Types, page
245.
Step Action
New Enumeration
Name HYDROCARBON
Title
Description
OK Cancel
4 Click Ok to validate.
Editing an Enumeration
To edit an existing Enumeration, double-click it from the Project window tree.
128 9MA10256.03
Managing Project Elements
To directly modify the name of the Enumeration, click it in the Project window
tree then click it again to open the name field. Enter the new name and press
Enter to validate.
To display the properties of an existing Enumeration, right-click it from the
Project window tree and select View properties to open the associated
Properties Window.
Deleting an Enumeration
To delete an existing Enumeration, right-click it from the Project window tree and
select Delete.
Subranges
Description
The following paragraphs present how to manage subranges.
For more information about Subrange, refer to Subranges description, page 246.
Step Action
New Subrange
Name WATER_TEMPERATURE
Description Temperature
OK Cancel
3 Specify the type of the Subrange either by typing it or by selecting it from the list that is
9MA10256.03 129
Managing Project Elements
Step Action
6 Click Ok to validate.
Editing a Subrange
To edit an existing Subrange, double-click it from the Project window tree.
Deleting a Subrange
To delete an existing Subrange, right-click it from the Project window tree and
select Delete.
130 9MA10256.03
Managing Project Elements
Object Browser
Description
Programming provides a tool for browsing the objects of your project: the Object
Browser.
Object browser
Objects filter
Name Type
Programs Operators AHUPlanModeStrategy Function blocks
Function Blocks AHUTempCntrlStrategy Function blocks
Functions Standard functions CompAlarmMgmt Function blocks
Variables Local variables CompAppLimit Function blocks
CompCntrl_OnOff Function blocks
User types Basic types
CompCntrl_Slider Function blocks
Check all Check none CompCntrl_VS Function blocks
CompMgmt Function blocks
CompMgmtVS Function blocks
Other filters COPCalculation Function blocks
Counter2Energy Function blocks
Name * OK DoubleInterpo_5x8 Function blocks
EcFanMgmt Function blocks
Location All
EnergyTrend Function blocks
Library FanMgmt Function blocks
Close Import objects Enable merge method Select all Select none
This tool is context-dependent, this implies that the kind of selectable objects and
the available operations on objects depend on the context.
Object browser can be opened in the following ways:
• Browser mode:
In Programming, click the menu command Project > Object Browser.
• Import object mode:
Right-click the project name in the Project window and select Import
objects, the Object browser opens after opening the selected object.
• Select object mode:
For example, to add a program to a task, right-click a task item in the Project
window and select Add program command. It opens the Object browser
window.
User interaction with Object browser is similar for the three modes and is
presented in the next paragraph.
9MA10256.03 131
Managing Project Elements
Objects filter:
Objects filter
Programs Operators
Function Blocks
Functions Standard functions
Variables Local variables
User types Basic types
This is the main filter of the Object browser. You can select one of the available
(enabled) object items.
In this example, Programs, Function Blocks, Functions are selected, so objects
of this type are displayed in the object list. Variables and User types objects can
be selected, but objects of that type are not currently displayed in the object list.
You can also click the Check all button to select the available objects at one time
or can click the Check none button to deselect the objects at one time.
Other filters:
Other filters
Name * OK
Location All
Library
Vars type All
Vars group
Selected objects can be also filtered by name, symbol location, specific library,
type of variable, and group of variables.
Filters are all additive and are immediately applied after setting.
Name
Function Filters objects on the base of their name.
Use Type a string to display the specific object whose name matches the
string. Use the * wildcard if you want to display all the objects whose
name contains the string in the Name text box. Type * if you want to
disable this filter.
Press Enter when edit box is focused or click the OK button to apply
the filter.
Applies to All object types.
Symbol location
132 9MA10256.03
Managing Project Elements
Library
Function Filters objects contained in library. The value of this filter is relevant
only if the Symbol location filter is set to Library.
Vars Type
Function Filters global variables and system variables (also known as firmware
variables) according to their type.
Applies to Variables.
Vars Group
Applies to Variables.
Object list:
Object list shows all the filtered objects. The list can be ordered in ascending or
descending order by clicking the header of the column. It is possible to order items
by Name, Type, or Description.
Double-clicking an item allows you to perform the default associated operation
(the action is the same as the OK, Import object, or Open source button
actions).
When item multiselection is allowed, Select all and Select none buttons are
visible.
It is possible to select all objects by clicking the Select all button. Select none
deselects all objects.
If at least one item is selected on the list operation, buttons are enabled.
Resize:
Object browser window can be resized, the cursor changes along the border of
the window and allows you to resize it. When reopened, Object browser window
keeps the same size and position of the previous usage.
9MA10256.03 133
Managing Project Elements
• Function Blocks.
• Functions.
• Variables.
• User types.
These items can be checked or unchecked in the Objects filter section to show or
to hide the objects of the chosen type in the list.
Other types of objects (Operators, Standard functions, Local variables, Basic
types) cannot be browsed in this context, therefore they are unchecked and
disabled.
Available operations:
Function Opens the editor by which the selected object was created and
displays the relevant source code.
If the object is a variable, then this button opens the variable editor.
Select the object whose editor you want to open, then click the Open
source button.
Export to library
Use Select the objects you want to export, then click the Export to library
button.
Delete objects
Use Select the object you want to delete, then click the Delete object
button.
134 9MA10256.03
Managing Project Elements
Find in project
Cancel
Object type filters
Programs Functions Macros Variables
Function blocks Methods User Types
Find options
Step Action
1 In the Find what box, type the name of the object you want to search.
Otherwise, click the Browse button on the right of the box, and select the name
of the object from the list of all the existing items.
2 Select one of the values listed in the Location box to specify a constraint on the
location of the objects to be monitored.
3 The frame named Object type filters contains 7 check boxes, each of which, if ticked,
enables research of the string among the object it refers to.
9MA10256.03 135
Managing Project Elements
Step Action
4 Tick the relevant options check boxes in the Find options frame.
The results are displayed in the Find in project tab of the Output window.
Output
Pulse(7)- ST cnt
Pulse(14)- LD cnt
Pulse(16)- ST cnt
Pulse(18)- LD cnt
Pulse(26)- ST cnt
Pulse(LV)- cnt : UINT
136 9MA10256.03
Managing Project Elements
Project
MyProject Project
Counters and timers
LadderLogic
Counters and timers params
parCtDownPreset
parCtUpPreset
parPulseValue
parPulseWidth
parTimOnDelay
parTimOnValue
PID
Function Blocks
LowPassFilter
PidControl
PidModeSelector
PID hmi
hmiPidTest
hmiPIDThreshold
PID params
Aux Variables
Tasks
Timed
PidControl
PidModeSelector
Background
LadderLogic
Boot
Init
Workspaces Migration
Description
Whenever Custom Workspace feature is switched, Programming reorders the
workspace maintaining the user customization by this logic:
Static (old) workspace to custom (new)
Fixed logic units (for example function blocks folder) are converted into new
dynamic folders with the same names. Fixed global group units (for example:
Mapped variables) are converted into new global dynamic groups with the same
names. The global variables that do not belong to any group are grouped into a
new group called Ungrouped global vars.
Custom (new) workspace to static (old)
9MA10256.03 137
Managing Project Elements
The custom units are destroyed and the POUs and global variables are grouped
into the default fixed units (for example: function blocks folder and Mapped
Variables).
• Folder: this is an optional logical unit that can contain POUs, folders (you
can nest folders into another one), and global variables group.
• Global variables group: this is a mandatory logical unit that can only
contain global variables. In order to create a global variable, you need to have
almost one global variables group defined into your custom workspace.
Step Action
1 Delete all child elements too (this may impact the PLC).
2 Do not delete child elements, they are moved upwards following the project tree.
138 9MA10256.03
Managing Project Elements
To export all elements of a global variables group or a folder, select it, then right-
click and select Export all children to library.
This operation allows you to export recursively all child elements of the selected
item into a library. For more information about new library, refer to Exporting to a
Library, page 108.
Moving Unit:
You can simply drag units to a different location of the tree in order to organize
your project workspace. All children are moved if the parent item is moved,
following the original structure.
Moving variables is also possible both from project tree (single selection) and from
the variable grid (single and multiple selections). For more information about
variables editor, refer to Variables Editor, page 163.
9MA10256.03 139
Editing the Source Code
Overview
PLC Editors
Programming includes five source code editors, which support the whole range
of programming languages according to the IEC 61131-3 Standard:
• Instruction List (IL), page 140.
• Function Block Diagram (FBD), page 142.
• Ladder Diagram (LD), page 147.
• Structured Text (ST), page 156.
• Sequential Function Chart (SFC), page 158.
The editors, both graphical and text one, support tooltips. By enabling them, page
39, Programming shows some information about symbols on mouse-over.
Editing Functions
Description
The IL editor is endowed with functions common to most editors running on a
Windows platform, namely:
• Text selection.
140 9MA10256.03
Editing the Source Code
Bookmarks
Description
You can set bookmarks to mark frequently accessed lines in your source file. You
can remove a bookmark when you no longer need it.
Setting a Bookmark
Move the insertion point to the line where you want to set a bookmark, then press
Ctrl+F2.
The line is marked in the margin by a light-blue circle.
Bookmarks are managed in Edit > Bookmarks…. The available commands are:
• Add/toogle (Ctrl+F2)
• Next (F2)
• Prev (Shift+F2)
• Remove all
9MA10256.03 141
Editing the Source Code
Removing a Bookmark
Move the cursor to anywhere on the line containing the bookmark, then press Ctrl
+F2.
For more details, refer to Function Block Diagram language reference, page 270.
142 9MA10256.03
Editing the Source Code
Adding/Removing Networks
Description
Every POU coded in FBD consists of a sequence of networks. A network is
defined as a maximal set of interconnected graphic elements. The upper and
lower bounds of every network are fixed by two straight lines while each network is
delimited on the left by a gray area containing the network number:
Grid .
• To add a comment, click Scheme > Object > New > Comment.
Labeling Networks
Description
You can modify the usual order of execution of networks through a jump
statement, which transfers the program control to a labeled network.
To assign a label to a network:
Step Action
9MA10256.03 143
Editing the Source Code
Step Action
3
A dialog box appears, which lets you enter the label you want to associate with the selected
network:
0005
Network label
OK Cancel
0006
4 Click OK.
The label is displayed in the top left-hand corner of the selected network.
Inserting Blocks
Add a block to the blank network, by applying one of the following operations:
• Open the Object browser window, by applying one of the following
operations:
◦ In the menu, click Scheme > Object > New > Function Block.
Connecting Blocks
To connect blocks manually:
144 9MA10256.03
Editing the Source Code
Deleting Blocks
To delete a block, select it and press Delete key.
When you delete a block, its connections are not removed automatically, but they
become invalid and they are redrawn red. Click Scheme > Delete invalid
connection.
9MA10256.03 145
Editing the Source Code
Editing Networks
Description
The FBD editor is endowed with functions common to most graphic applications
running on a Windows platform, namely:
• Selection of a block.
• Selection of a set of blocks by pressing Shift+Left button and by drawing a
frame including the blocks to select.
• Edit > Cut , Edit > Copy , Edit > Paste operations of a single
block as well as of a set of blocks.
• Drag-and-drop.
• Click Scheme > Increment pins to increment the number of input pins
of some operators and embedded functions.
• Click Scheme > Enable EN/ENO pins to display the enable input and
output pins.
• Click Scheme > Object > Instance name or click Scheme > Object
properties to modify the name of an instance of a function block.
For more information, refer to Modifying Properties of Blocks, page 152 in Ladder
Diagram (LD) Editor section.
• Click Scheme > Object > Open source to open the source code of a
block.
• Click Scheme > Object properties to see properties and input/output pins of
the selected block.
146 9MA10256.03
Editing the Source Code
For more details, refer to Ladder Diagram language reference, page 274.
Adding/Removing Networks
Description
Each POU coded in LD consists of a sequence of networks. A network is defined
as the set of interconnected graphic elements. The upper and lower bounds of
every network are fixed by two straight lines while each network is delimited on the
left by a gray area containing the network number.
On each LD network, the right and the left power rail are represented, according to
the LD language indication.
On the new LD network, a horizontal line links the two power rails. It is called the
“power link”. On this link, all the LD elements (contacts, coils, and blocks) of the
network are placed.
9MA10256.03 147
Editing the Source Code
Grid .
• To add a comment, click Scheme > Object > New Comment or press
Shift+M.
Labeling Networks
Description
You can modify the usual order of execution of networks through a jump
statement, which transfers the program control to a labeled network.
To assign a label to a network:
Step Action
3
A dialog box appears, which lets you enter the label you want to associate with the selected
network:
OK Cancel
0002
4 Click OK.
The label is displayed in the top left-hand corner of the selected network:
Inserting Contacts
Description
To insert new contacts on the network, apply one of the following procedures:
• Drag a boolean variable to the desired place over an object. For example,
global variables can be taken from the Workspace window, whereas local
variables can be selected from the local variables editor. Contacts inserted
with drag and drop will always be inserted in series after the destination
object.
148 9MA10256.03
Editing the Source Code
• Select a contact, a block, a pin of block, or a connection point that acts as the
insertion point. Insert the new contact choosing between the connection type
(serial or parallel) and choosing the position (before or after the currently
selected object) by using the Scheme > Object > New.
For serial insertion, the new contact is inserted on the left or right side of the
selected contact/block or in the middle of the selected connection depending on
the element selected before the insertion. Examples of serial insertion:
For parallel insertions, several contacts can be selected before performing the
insertion; the new contact is inserted above or below the group of selected
contacts. Examples of parallel insertions
9MA10256.03 149
Editing the Source Code
Inserting Coils
Description
To insert new coils on the network, apply one of the following operations:
• Drag a boolean variable on the network, over an existing output of the
network (coil, return, jump). For example, global variables can be taken from
the Workspace window, whereas local variables can be selected from the
local variables editor.
150 9MA10256.03
Editing the Source Code
Inserting Blocks
Description
To insert blocks on the network, apply one of the following operations:
• Select a contact, connection, or block then click Scheme > Object >
New > Block, then the Browser object window appears. Choose one item
from the list.
• Drag the selected object (from the Workspace window, the Libraries window
or the local variables editor) over the desired connection.
If the object has at least one BOOL input and one BOOL output pins, they are
connected to the power link (and it will possible to add EN/ENO pins later with the
provided command); otherwise the EN/ENO pins are automatically added.
Operators, functions, and function blocks can only be inserted into an LD network
on the main power link, or on the power link of a branch (so they cannot be
inserted in parallel of a contact); it is also not possible to create a contact in
parallel of a block.
If a block has a BOOL input pin, it is possible to create another logical sub-
network of contacts and blocks before it; otherwise, you can connect only
variables, constants, or expressions (that nevertheless can be connected to
BOOL pins) to non-BOOL input pins.
LD object properties
Contact Coil
Normal Normal
Negate
Negate
Set
Positive Reset
Positive
Negative Negative
Name ...
OK Cancel
Otherwise, select the desired contact or coil, and modify its type using the six
provided buttons in the LD toolbar or the six commands in the Scheme menu.
9MA10256.03 151
Editing the Source Code
Editing Networks
Description
The LD editor is endowed with functions common to most graphic applications
running on a Windows platform, namely:
• Selection of a block.
• Selection of a set of adjacent contacts by pressing Ctrl+Left button on each
contact to select; if the selection spans across different parallel branches,
more contacts are automatically added in the selection.
• Edit > Cut , Edit > Copy , Edit > Paste operations of a single
block as well as of a set of blocks.
• Drag-and-drop of the selected object or group to move it inside or outside
the current network.
Adding, moving, deleting, or copy/pasting objects will automatically recalculate the
layout of the network objects; because of this, it is not possible to manually “draw”
connection lines or freely placing objects without connecting them to the network.
• Click Scheme > Increment pins to increment the number of input pins
of some operators and embedded functions.
• Click Scheme > Enable EN/ENO pins to display the enable input and
output pins.
EN/ENO pins can be removed only if the selected block has at least one
BOOL input and one BOOL output; otherwise, they are automatically added
when creating the block and it will not be possible to remove them (the
Enable EN/ENO pins command is disabled).
If a block has more than one BOOL output pin, it is possible to choose which
pin brings the signal out of the block and so continue the power link: select
the desired output pin and click the Scheme > Set output line menu
command.
152 9MA10256.03
Editing the Source Code
OK Cancel
• Click Scheme > Object > Open source to open the source code of a
block.
• Click Scheme > View PLC Object properties in the menu to see properties
and input/output pins of the selected block.
Inserting Variables
Description
To connect a variable to an input or output pin of a block, apply one of the
following procedures:
• Select the pin of a block, and then click the Scheme > Object > New >
Variable menu command; then double-click the new variable object (or
press Enter key) and enter the variable name.
• Drag the selected variable (from the Workspace window, the Libraries
window or the local variables editor) over the desired pin of a block.
9MA10256.03 153
Editing the Source Code
Inserting Constants
Description
To connect a numeric constant to an input pin of block, select the pin and click the
Scheme > Object > New > Constant menu command; then double-click the
new constant object (or press Enter key) and enter the numeric constant value.
Inserting Expression
Description
To connect a complex expression to an input pin of block, select the pin and click
the Scheme > Object > New > Expression menu command; then double-
click the new expression object (or press Enter key) and enter any ST expression.
For example:
(a+b)*c
TO_INT(n)
ADR(x)
Comments
Description
It is possible to insert two types of comments:
• Network comments: activate the network by clicking the header on the left or
inside the grid (but without selecting any object), and then click the
Scheme > Object > New > Comment menu command. The network
comment is displayed at the top of the network, and if necessary is expanded
to show all the text lines of the comment.
• Object comments: they are activated with the menu command in View >
Show comments for objects. Above any contact, function block, or coil, the
description of the associated PLC variable (if present) is initially displayed.
With the Comment command, you can modify it to enter a specific object
comment that overrides the PLC variable description.
154 9MA10256.03
Editing the Source Code
Branches
Description
The main power line can be branched to create sub-networks that can be further
branched themselves. To add a branch, select the object after you want to create
the branch and then click the Scheme > Object > New > Branch menu
command.
The start of the new branch is marked as a large dot on the source line; deleting
the objects on a branch deletes the branch itself.
Selecting an object on a branch effectively selects the branch, so for example
selecting a contact on a branch and then clicking the Scheme > Object >
New > Coil adds the coil on the branch instead of adding it on the main power
line.
9MA10256.03 155
Editing the Source Code
For more details, refer to Structured Text language reference, page 276.
Editing Functions
Description
The ST editor is endowed with functions common to most editors running on a
Windows platform, namely:
• Text selection.
156 9MA10256.03
Editing the Source Code
Bookmarks
Description
You can set bookmarks to mark frequently accessed lines in your source file.
Once a bookmark is set, you can use a keyboard command to move to it. You can
remove a bookmark when you no longer need it.
Setting a Bookmark
Move the insertion point to the line where you want to set a bookmark, then press
Ctrl+F2.
The line is marked in the margin by a light-blue circle:
Bookmarks are managed in Edit > Bookmarks…. The available commands are:
• Add/toogle (Ctrl+F2)
• Next (F2)
• Prev (Shift+F2)
• Remove all
9MA10256.03 157
Editing the Source Code
Removing a Bookmark
Move the cursor to anywhere on the line containing the bookmark, then press Ctrl
+F2.
for steps;
for transitions;
for jumps.
158 9MA10256.03
Editing the Source Code
• Click Edit > Connection mode, or simply press the space bar on your
keyboard. Click once the source pin, then move the mouse pointer to the
destination pin: the SFC editor draws a logical wire from the former to the
latter.
Languages
OK
IL
FBD Cancel
LD
ST
SFC
Name
Select one of the languages and type the name of the new action in the text box at
the bottom of the dialog box. Then either confirm by clicking OK, or quit by clicking
Cancel.
If you click OK, Programming opens automatically the editor associated with the
language you selected in the previous dialog box and you are ready to type the
code of the new action.
You are not allowed to declare new local variables, as the module you are now
editing is a component of the original SFC module, which is the POU where local
variables can be declared. The scope of local variables extends to all the actions
and transitions making up the SFC diagram.
9MA10256.03 159
Editing the Source Code
From the list displayed in the Code N box, select the name of the action you want
to execute if the step is active. You may also choose, from the list displayed in the
Code P (Pulse) box, the name of the action you want to execute each time the
step becomes active (that is, the action is executed only once per step activation,
regardless of the number of cycles the step remains active). Confirm the
assignments by clicking OK.
In the SFC schema, actions to step assignments are represented by letters on the
step block:
• Action N by letter N;
• Action P by letter P.
If later you need to edit the source code of the action, you can double-click these
letters. Alternatively, you can double-click the name of the action in the Actions
folder of the Workspace window.
160 9MA10256.03
Editing the Source Code
First of all, double-click the transition you want to assign a condition to. This
causes the following dialog box to appear:
Value
OK
Visible
True Cancel
False
Variable hmiPidTest ...
Expression
Select True if you want this transition to be constantly cleared, False if you want
the PLC program to keep executing the preceding block.
Instead, if you select Variable the transition depends on the value of a boolean
variable. Click the corresponding bullet to make the text box to its right available,
and to specify the name of the variable.
You can also make use of the objects browser, that you can invoke by clicking the
Browse button.
Click OK to confirm, or Cancel to quit without applying changes.
• Right-click on the name of the SFC POU in the Workspace window New
transition.
In either case, Programming displays a dialog box:
Languages
OK
IL
FBD Cancel
LD
ST
Name
9MA10256.03 161
Editing the Source Code
Select one of the languages and type the name of the new condition in the text
box at the bottom of the dialog box. Then either confirm by clicking OK, or quit by
clicking Cancel.
If you click the OK button, Programming opens automatically the editor
associated with the language you selected in the previous dialog box and you can
type the code of the new condition.
You are not allowed to declare new local variables, as the module you are now
editing is a component of the original SFC module, which is the POU where local
variables can be declared. The scope of local variables extends to all the actions
and transitions making up the SFC diagram.
point inpAutomatic
SFC Transition Properties
Auto_Phase _0 Value
OK
AutoModeInit Visible
Setpoint10Positive True Cancel
False
end_AutoPhase
Variable ...
Auto_Phase _1 Expression
Setpoint10Positive Code end_AutoPhase0
[No code]
end_Analog
end_Automatic
end_AutoPhase1 end_A end_AutoPhase0 testPhase1
end_AutoPhase1
end_Manual
Auto_Phase_0 Init end_TestPhase0
end_TestPhase1
end_TestPhase2
Select the name of the condition you want to assign to this step. Then confirm by
clicking OK.
If later you need to edit the source code of the condition, you can double-click the
name of the transition in the Transitions folder of the Workspace window.
Analog_setpoint OK
Auto_Phase_0
Auto_Phase_1 Cancel
Init
Manual_setpoint
Test_Phase_0
Test_Phase_1
Test_Phase_2
162 9MA10256.03
Editing the Source Code
• Edit > Cut , Edit > Copy , Edit > Paste operations of a single
block as well as of a set of blocks.
• Drag-and-drop.
Variables Editor
Overview
Description
Programming includes a graphical editor for both global and local variables that
supplies an interface for declaring and editing variables: the tool takes care of
translating the contents of these editors into syntactically correct IEC 61131-3
source code.
As an example, consider the contents of the Global variables editor represented in
the following figure:
Name Type Address Array Init value Attribute
1 gA BOOL Auto No TRUE ---
2 gB REAL Auto [0...4] ---
3 gC REAL %MD60.20 No 1.0 ---
4 gD INT Auto No -74 CONSTANT
9MA10256.03 163
Editing the Source Code
NOTE: If you use the customizable workspace, page 98, the global variables
NOTE: If you use the customizable workspace, page 98, the local variables
are accessible under the POU, in the Local variables group.
Editing Variables
Description
Follow this procedure to edit the declaration of a variable in a variables editor (the
following steps are optional and you will skip most of them when editing a
variable):
164 9MA10256.03
Editing the Source Code
Step Action
1
Edit the name of the variable by entering the new name in the corresponding cell:
2
Modify the variable type, either by editing the type name in the corresponding cell or by
clicking the button in that cell and select the desired type from the list that pops up:
3
Edit the address of the variable by clicking the button in the corresponding cell and
entering the required information in the window that shows up. In the case of global
variables, this operation may change the position of the variable in the project tree:
Variable address
Automatic address
Size Location
Bit Input
Byte (8 bit) Output
Word (16 bit) Memory
Double word (32 bit)
OK
Data block Index
60 . 20 Cancel
4
In the case of global variables, you can assign the variable to a group, by selecting it
from the list which opens when you click the corresponding cell. This operation changes
the position of the variable in the project tree:
5
Choose whether a variable is an array or not. If it is, edit the size of the variable:
9MA10256.03 165
Editing the Source Code
Step Action
Size of variable
Scalar
Array / Matrix
Dimensions 5
OK Cancel
6
Edit the initial values of the variable: click the button in the corresponding cell and enter
the values in the window that pops up:
[0,1,2,1,0]
OK Cancel
7
Assign an attribute to the variable (for example, CONSTANT or RETAIN), by selecting it
from the list which opens when you click the corresponding cell:
8
Type a description for the variable in the corresponding cell. In the case of global
variables, this operation may modify the position of the variable in the project tree:
9 Save the project to persist the changes you made to the declaration of the variable.
Deleting Variables
Description
In order to delete one or more variables, select them in the editor. You can use the
Ctrl or the Shift keys to select multiple elements:
Name Type Address Group Array Init value
1 G_I_iTe INT Auto Ungrouped_vars No
2 G_I_iSe INT Auto Ungrouped_vars No
3 G_I_iDi INT Auto Ungrouped_vars No 1
4 G_I_iC BOOL Auto Ungrouped_vars No
5 G_I_iAI BOOL Auto Ungrouped_vars No
6 gA BOOL Auto Ungrouped_vars No TRUE
7 gB REAL Auto Ungrouped_vars [0...4] [0,1,2,1,0]
8 gC REAL %MD60.20 MyMapped_vars No 1.0
9 gD INT Auto MyConstants_vars No -74
166 9MA10256.03
Editing the Source Code
Sorting Variables
Description
You can sort the variables in the editor by clicking the column header of the field
you want to use as the sorting criterion.
Copying Variables
Description
The variables editor allows you to copy and paste elements. You can either use
keyboard shortcuts or the Edit > Copy , Edit > Paste menu.
NOTE: Overlapping addresses problems may occur by copying mapped
variables. Programming can automatically assign available address to the
pasted variable and fix the overlap. In order to enable this functionality, refer to
Software Options, page 39 and Merge Function, page 109 for further details.
9MA10256.03 167
Compiling
Compiling
What’s in This Chapter
Overview .................................................................................................... 168
Compiling the Project................................................................................... 168
Compiler Output .......................................................................................... 169
Command-Line Compiler ............................................................................. 171
Overview
Description
Compilation consists of transforming the PLC source code into another
programming language (the target language) such as binary code, which can be
executed by the processor on the target device.
Tasks
Timed
Background
MyMain
Boot
Init
Output
0 warnings, 1 errors.
Build Find in project Debug Resources HMI Output
168 9MA10256.03
Compiling
Output
Compiler Output
Overview
Description
As the previous step is accomplished, the compiler performs the compilation, then
displays a report in the Output window. The last string of the report has the
following format:
m warnings, n errors
Condition Description
n>0 Compiler error(s). The PLC code contains one or more serious detected errors,
which require intervention. No executable code was generated.
n=0, m>0 Emission of warning(s). The PLC code contains one or more minor detected
errors, which the compiler automatically worked around. However, you are
informed that the PLC program may act differently from what you intend.
You should correct these minor errors by editing and recompiling the application
until no other messages are reported.
n=m=0 The compilation was successful in that no errors or warnings were detected.
9MA10256.03 169
Compiling
Compiler Errors
Description
When your application contains one or more errors, information is displayed in the
Output window for each of those detected errors.
Output
Preprocessing Global shared completed.
0 warnings, 0 errors.
Code generation ..
Preprocessing EmbeddedElements completed.
aborted.
MAIN(1) – error A4097: N1 => Object not found
0 warnings, 1 errors.
Build Find in project Debug Resources HMI Output
170 9MA10256.03
Compiling
If you double-click the error message in the Output window, Programming opens
the source code and highlights the line containing the detected error:
Project
MyProject Project
MyMain
Ungrouped_vars
Aux Variables
Tasks
0001
0002 cnt := cnt2 + 1;
0003
MyMain
Output
Preprocessing user defined data .. completed.
Compiling programs .. completed.
Compiling function blocks .. completed.
Compiling functions .. completed.
Preprocessing user defined data .. completed.
Code generation ..
Preprocessing EmbeddedElements completed.
aborted.
MYMAIN(2) – error A4097: CNT2 => Object not found
0 warnings, 1 errors.
Command-Line Compiler
Description
The compiler can be used independently from the integrated software
environment: in the directory of FREE Studio Plus, you can find an executable file,
EWc.exe, which can be invoked (for example, in a batch file) with a number of
options.
In order to get information about the syntax and the options of this command-line
tool, launch the executable without parameters.
9MA10256.03 171
Launching the Application
Overview
Description
In order to download and debug the application, you have to establish a
connection with the target device. This chapter focuses on the operations required
to connect to the target and to download the application. A separate chapter is
dedicated to Debugging, page 190.
Step Action
1
Click On-line > Set up communication... menu of the Programming tab. This causes
the following dialog box to appear.
172 9MA10256.03
Launching the Application
Step Action
6 Click OK button to apply the changes you made to the communication settings.
Now, you can establish communication with the target, page 177.
CAN
Select CAN in the case of CAN connection:
4 = 125 kbaud
5 = 125 kbaud
6 = 50 kbaud
Addr_CAN_OB On-board CAN serial 1…127 1 The address is determined by the sum of
address this value the value of the DIP switches
GDB
The GDB protocol is not implemented in the FREE Smart/FREE Evolution/FREE
Advance controllers.
The GDB protocol is reserved for internal software use.
Modbus
Select Modbus in the case of USB/RS485 connection:
2 = 38400 baud
3 = 57600 baud
4 = 76800 baud
5 = 115200 baud
Addr_RS485_OB On-board RS485 serial 1…255 1 The address is determined by the
address sum of this value the value of the DIP
switches
Proto_RS485_OB On-board RS485 protocol 2 = uNET 3 -
selection
3 = Modbus/RTU
4 = BACnet MS/TP
9MA10256.03 173
Launching the Application
2 = EVEN
Modbus TCP
Select the ModbusTCP protocol in the case of Ethernet connection, using the
relevant communication module if necessary.
In the protocol properties window:
• The IP or hostname box is for entering either an IP address (the default
setting for FREE Evolution/Advance is 10.0.0.100) or a host name on a local
network.
• The TCP/IP communication Port box is set by default to 502.
Connect the PC Ethernet cable to FREE Evolution/Advance.
Configure the TCP/IPv4 connection in the Ethernet port properties of your PC with
the address (10.0.0.101):
General
OK Cancel
174 9MA10256.03
Launching the Application
HMIList_current Current HMI 0 = Remote HMI 1 / 1 = Remote HMI 2 11 Local HMI is identified on
the display as network In
2 = Remote HMI 3 / 3 = Remote HMI 4 Connection as HMI
4 = Remote HMI 5 / 5 = Remote HMI 6 Remote HMI is identified
In Connection as
6 = Remote HMI 7 / 7 = Remote HMI 8 Remote HMI
8 = Remote HMI 9 / 9 = Remote HMI 10
10 = not used
11 = Local HMI
Ten remote menus are available. The first menu parameters are listed below. The
others are similar:
3 = CAN (CAN)
(IP part 2)
RS485:
HmiList_Addr_3 Remote HMI 1 navigation resource 0…255 0
address for TCP 1.38400.P81
(IP part 3)
9MA10256.03 175
Launching the Application
HmiList_File_1 Remote HMI navigation file 1 (DOS Alphanumeric string, 8 ******** The default name is
8.3 uppercase format) characters HMIREM.KBD
DMI
Select DMI in the case of connection with the FREE Smart with the DMI
programming cable.
FREE Smart has parameters in the CF folder in the controller for managing the
connection between the target and FREE Studio Plus.
If the target is “empty”, for example there is no controller application on the device,
FREE Smart displays the message F r E E . Otherwise, a controller application
exists on FREE Smart and the message PLC appears on the display.
Simultaneously press the UP and DOWN keys to view the message.
Follow this procedure to modify a parameter:
2 Press set key to open the Parameters The label of the first subfolder is displayed
menu. (CL).
4 Press set key to open the folder. The label of the first parameter is displayed.
6 Press set key to view the value of the The value of the parameter is displayed.
parameter.
The parameters values needed for correct connection between the FREE Smart
target and FREE Studio Plus:
176 9MA10256.03
Launching the Application
4 = 19200 baud
5 = 38400 baud
6 = 57600 baud
7 = 115200 baud
CF32 Modbus protocol 1 = EVEN 1 3
controller parity
2 = NONE
3 = ODD
(1) COM1 = The TTL port and the RS485 port cannot be used simultaneously.
For other parameters and to manage parameter visibility levels, refer to FREE
Smart Logic Controller - Hardware Guide.
Connect to a Device
Prerequisite
You have to set up the communication, page 172.
Procedure
To launch the connection to the physical device, perform one of the following
operations:
9MA10256.03 177
Launching the Application
Information Messages
Before establishing the connection, the software could display an information
message:
On-Line Status
Connection Status
Description
The state of communication is displayed in a box next to the right border of the
Status bar.
If you have not yet attempted to connect to the target, the state of communication
is set to Not connected.
NOT CONNECTED
When you connect to the target device, the state of communication becomes one
of the following:
•
ERROR
Error: the communication cannot be established. You should verify both the
physical link and the communication settings, page 172.
•
CONNECTED
Connected: the communication has been established.
Project Status
Description
Next to the communication status there is another box which indicates the status
of the project currently executing on the target device.
When the connection status is Connected, the project status takes on one of the
following values (depending on source code):
178 9MA10256.03
Launching the Application
•
NO CODE
No code: no project is executing on the target device.
•
DIFF. CODE
Diff. code: the project currently executing on the target device differs from the
one currently open in the software; moreover, no debug information
consistent with the running project is available: thus, the values displayed in
the watch window or in the oscilloscope are not reliable and the debug mode
cannot be activated.
•
DIFF. CODE (SYM)
Diff. code, Symbols OK: the project currently executing on the target device is
not the same as the one currently open in the software; however, some debug
information consistent with the running project is available (for example, the
project has been previously downloaded to the target device from the same
PC): the values displayed in the watch window or in the oscilloscope are
reliable, but the debug mode still cannot be activated.
•
SOURCE OK
Source OK: the project currently executing on the target device is the same
as the one currently open in the software: the debug mode can be activated.
Step Action
1 Connect the target device to the PC where FREE Studio Plus is running.
2
Click On-line > Download code.
Result:
Programming verifies whether the project has unsaved changes. If so, it automatically
starts the compilation of the application.
Then the downloaded code is executed by the processor on the target device.
WARNING
AUTOMATIC RESTART OF CONTROLLER
• Do not download your application without first accessing the state of your
machine or process.
• Do not download your application without first ascertaining that there is no
risk of injury to anyone in or around your machine or process.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
9MA10256.03 179
Launching the Application
WARNING
UNINTENDED MACHINE START-UP
• Conduct a thorough risk analysis to determine the effects, under all
conditions, of an unconditional start of the application.
• Verify the state of security of your machine or process environment before
applying power to the controller or starting the application with FREE Studio
Plus software.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
WARNING
UNINTENDED EQUIPMENT OPERATION
• Never assume that your controller is in a certain controller state before
commanding a change of state, configuring your controller options, or
modifying the physical configuration of the controller and its connected
equipment.
• Before performing any of these operations, consider the effect on all
connected equipment.
• Before acting on a controller, always positively confirm the controller state,
checking for the presence of output forcing, and reviewing the controller
status information via FREE Studio Plus.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Halt
You can stop the PLC execution by clicking On-line > Halt.
Cold Restart
The PLC application execution will be restarted and both retain and non-retain
variables will be reset.
You can cold restart the PLC execution by clicking On-line > Cold restart.
180 9MA10256.03
Launching the Application
Warm Restart
The PLC application execution will be restarted and only non-retain variables will
be reset.
You can warm restart the PLC execution by clicking On-line > Warm restart.
Hot Restart
The PLC application execution will be restarted and no variables will be reset.
You can hot restart the PLC execution by clicking On-line > Hot restart.
Reboot Target
You can reboot the target by clicking On-line > Reboot target.
9MA10256.03 181
Simulation
Simulation
What’s in This Chapter
Simulation Function ..................................................................................... 182
Simulation Operating Modes ........................................................................ 183
Simulation with FREE Studio Plus ................................................................ 184
Simulation Interface..................................................................................... 185
Simulation Function
Overview
Main Purpose
The main purpose of the simulation function is to execute PLC applications and
HMI pages simultaneously in a simulated environment.
Simulation can simulate execution of:
• PLC applications, IEC 61131-3 (made in Programming tab).
• HMI pages (made in Display tab).
The execution can thus take place on the same PC used for the development
process with the advantage of a faster and simpler testing and debugging phase
because the real final hardware is not necessary.
NOTE: The simulation is not intended as a substitute for real, empirical testing
during commissioning. It is a means for the programmer to submit its
application, or parts of application, to unit testing and verification. Only
empirical testing with live equipment in the complete application can be
considered a valid mechanism for validation.
WARNING
UNINTENDED EQUIPMENT OPERATION
Always empirically test your application during commissioning before placing
your application and associated equipment into service.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
182 9MA10256.03
Simulation
4
Project Local variables Library tree
My Project
Name Type Address Array Init value Attribute
main
Project librairies
Global_vars
Application
Tasks
basic
Communication
display
Pumping
Regul and Control
Watch
0001
0002 cnt := cnt + 1;
Symbol Value
0003
main
5
Output Operators and blocks Simulation - simESME11.WKSX
3
Analogue Outputs WIN32: QueryPerformanceFrequency returned 28359391
Impulse Counter ** Initializing PLC runtime 0 for 596p9
** Starting to read PLC code from C:\Users\My_Project
** Closing file simESME11_P1cCode0.bin
** Initializing PLC runtime 1 for 569p6
C:\Users\My Project\My Project.plcprj ** Starting to read PLC code from C:\Users\My_Project
** Closing file simESME11_P1cCode1.bin
Machine Expert - HVAC ** PLC run-time #0> Starting to load PLC application
** Starting to load PLC for runtime 0 (type0fStart
** PLC loaded into memory
Configuration Programming Display Commissioning
** Application release info: PLC 0.1
File Edit View Project Page Window Help ** PLC run-time #0> PLC application successfully load
** Starting to load PLC for runtime 1 (type0fStart
** Starting to load PLC for runtime 1 (type0fStart
** Application release info: PLCM172 0.0
** ManualSystemStart, system not started yet
HMI Actions
7 6
Output HMI Vars and Parameters
Preprocessing Regul and Control completed. Enter Edit
Preprocessing Application completed. Up PrevField
Preprocessing Communication completed. sysBacklight sysTimer
Preprocessing Pumping completed. Down NextField
sysCurrentSelectedPosition sysVer
Preprocessing display completed.
sysKeyPressed
0 warnings, 0 errors sysLangID
sysLocalLeds
sysMSK
Build Find in project Debug Resources HMI Output Target vars LocalParameters
Ready EDIT MODE .... NOT CONNECTED
Item Description
6 Target file (TGSX) Catalog components that define the targets to simulate. These
files have TGSX extension.
7 Workspace file (WKSX) User file with WKSX extension that contains the elements of a
working session of the simulator (I/O panels, source PLC, HMI
project, and so on). The project can have multiple simulation
workspace files, and you can manage them.
9MA10256.03 183
Simulation
• The simulated target can have some parts implemented in C and/or IEC to
implement the real target behavior and characteristics to react to PLC
application as the real target would do.
• Use of the I/O panels, that you can configure to view and/or modify the
simulated status and I/O variables of the target.
Step Action
2
Click to compile the project and to check the correctness of the code.
4
You can choose to open a recently used simulator workspace (WKSX) or create a new
one if it is the first simulation session with this project. The last used workspace is then
proposed as the default choice. The list of the used workspaces is saved inside the
project itself.
Choose workspace
Name:
Directory: D:\HVAC_Projects\ESME_Thermostat_M172
simESME11.WKSX
OK Cancel
Click OK.
NOTE: FREE Studio Plus can activate the simulation status that is similar to
the normal connection to a physical target device, with a different connection
status indicator. While in simulation status, the project will be built for the x86
processor and the connection will take place using the GDB protocol over
TCP/IP on the local host (127.0.0.1).
184 9MA10256.03
Simulation
If not, you must correct any anomalies present in the project before its actual
commissioning.
To test your project, you can:
• Simulate local I/O and work on pages (with mouse and keyboard) in the target
panel (if there is one).
• Modify the values of the application parameters with the I/O panels.
For more details, refer to Simulator Interface, page 185.
NOTE: You can debug with the Programming debugging features, page 190,
independently of the real target.
Simulation Interface
Simulation Interface Overview
Overview
Simulation is dialog-based Windows program that is one or more independent
windows that can be moved and placed on the screen.
The following pictures show the main windows:
Simulation - simESME11.WKSX
Analogue Inputs
File Help
AIL1 0
AIL2 0
Workspace: simESME11.WKSX AIL3 0
Target name: M172 Performance 596.9 AIL4 0
PLC project: D:\HVAC_Projects\ESME_Thermostat_M172\Thermsotat_M172.plcprj AIL5 0
HMI project: D:\HVAC_Projects\ESME_Thermostat_M172\HMIRemote\Thermsotat_M172.pajx AIL6 0
9MA10256.03 185
Simulation
Impulse Counter
FDI1_counter 0
FDI1_frequency 0
FDI1_value
FDI2_counter 0
FDI2_frequency 0
FDI2_value
Control Panel
Overview
This is the main window of the simulator. When you launch the simulator, the
control panel is shown in a compacted form, with 5 main buttons and no menu bar.
When you click the Expand button, it is expanded to show:
• The menu bar with the standard new/load/save/exit commands.
• A central panel showing the main characteristics of the current workspace.
• An output window showing execution logs.
• The I/O panels list.
With the control panel, you can control and monitor the state of the simulated PLC
runtime, choose which other windows to show or hide (and their topmost
behavior), and manage I/O panels.
2 3 4 5 Simulation - simESME11.WKSX
File Help
1 Stop PLC code ** PLC run-time #0> Starting to load PLC application
** Starting to load PLC for runtime 0 (type0fStart
** PLC loaded into memory
** Application release info: PLC 0.1
** PLC run-time #0> PLC application successfully load
2 Run PLC code ** Starting to load PLC for runtime 1 (type0fStart
** PLC loaded into memory
** Application release info: PLCM172 0.0
** ManualSystemStart, system not started yet
Target Panel
Overview
This is a floating window that shows a visual representation of the simulated
physical target. Its presence and layout is defined inside the target definition file
(TGSX).
This panel has an image of the real target, with some sensible areas that show
simulated inputs or outputs (for example LEDs for digital outputs) and a simulated
LCD graphic display where the HMI pages are drawn.
186 9MA10256.03
Simulation
You can interact with this panel with the mouse or with the PC keyboard that
emulates the real device keys.
You can right-click on it and select:
• Topmost: place the panel in foreground (it stays always above any other
window).
• Locked: you can no more move the panel on your screen.
• Close: close the panel.
4
2 1
3
1 Simulated buttons
2 Simulated LEDs
3 Simulated LCD screen
4 Simulated I/Os
I/O Panels
Overview
These small floating windows lets you monitor and modify the values of the
various I/O and status variables of the simulated target; the only requirement is
that the object to watch is allocated on data-block.
You can create as many I/O Panels as you want. You can also decide which
objects to put on each panel freely. They are complementary to the target panel
because with them you can watch and edit the I/O modules that are not already
visible there.
The I/O panels can be put in Topmost mode (always above the visible windows).
This is useful for example while debugging with Programming at full screen. The
configuration is then saved inside the workspace file.
9MA10256.03 187
Simulation
Analogue Inputs
AIL1 0
AIL2 0
Tasks
AIL3 0
AIL4 0
Project Local variables AIL5 0
Programs AIL6 0
ATC_Control Name Type Address Array Init value Attribute
AIL7 0
Local variables AIL8 0
P EVE_Comm AIL9 0
P Thermostat AIL10 0
Aux Variables AIL11 0
Global shared
AIL12 0
Alarms
EEPROM_Param Analogue Outputs
IO_Mapping
AOL1 0
AI1_E
AOL2 0
AIarm
DI1_E AOL3 0
DI2_E AOL4 0
DO1_E AOL5 0
DO2_E AOL6 0
NTC_Probe
Output_Heat Impulse Counter
main
FDI1_counter 0
FDI1_frequency 0
Output Operators and blocks
FDI1_value
Loading target image .. completed ABS ATAN2 EQ FDI2_counter 0
File PLCFREEADVANCE.imgx.simul updated ACOS CEIL EXP FDI2_frequency 0
Loading target image .. completed ADD CONCAT FIND
FDI2_value
File PLCFREEADVANCE.imgx.simul updated ADR COS FLOOR
DO1_E
AND COSH GE
ASIN DELETE GT
ATAN DIV IMOVE
Build Find in project Debug Resources HMI Output Operator and standard blocks Target variables Target blocks
Ready EDIT MODE NOT RUNNING CONNECTED
Depending on the type of the source variables, an analog (slider or progress bar)
or digital (LED or button) control is generated, and associated with the original
signal.
It is possible to add only PLC variables that reside on a DataBlock, with an explicit
address (for example %MW1.0); you cannot add to an I/O panel automatic, local,
or global variables.
188 9MA10256.03
Simulation
Indexes 5 Move up
Min. value
Max. value
Remove OK Cancel
9MA10256.03 189
Debugging
Debugging
What’s in This Chapter
Overview .................................................................................................... 190
Watch Window ............................................................................................ 190
Oscilloscope ............................................................................................... 196
Edit and Debug Mode .................................................................................. 207
Live Debug ................................................................................................. 208
Triggers ...................................................................................................... 211
Graphic Triggers ......................................................................................... 226
Overview
Description
Programming provides several debugging tools, which help you to verify whether
the application behaves as intended.
All these debugging tools basically allow you to watch the value of selected
variables while the PLC application is running.
Programming debugging tools can be gathered in two classes:
• Asynchronous debuggers. They read the values of the variables you selected
with successive queries issued to the target device. Both the manager of the
debugging tool (that runs on the PC) and, potentially, the task which is
responsible to answer those queries (on the target device) run independently
from the PLC application. The values of two distinct variables being sampled
in the same moment are not necessarily in concordance with each other with
respect to the PLC application execution (one or more cycles may have
occurred). For the same reason, the evolution of the value of a single variable
is not consistent with its actual value in the controller memory, especially
when it is updated rapidly within the application.
• Synchronous debuggers. They require the definition of a trigger in the PLC
code. They refresh simultaneously all the variables they have been assigned
every time the processor reaches the trigger, as no further instruction can be
executed until the value of all the variables is refreshed. As a result,
synchronous debuggers obviate the limitations affecting asynchronous ones.
This chapter presents how to debug your application using both asynchronous
and synchronous tools.
Watch Window
Overview
Description
The Watch window allows you to monitor the values of a set of variables. Being an
asynchronous tool, the Watch window does not establish synchronization of
values. Values of the variables in the Watch window may refer to different
execution cycles of the corresponding task.
The Watch window contains an item for each variable that you added to it. The
information displayed in the Watch window includes the name of the variable, its
value, its type, and its location in the PLC application.
190 9MA10256.03
Debugging
Watch
Step Action
2
Drag the selected variable in the Watch window:
Watch
9MA10256.03 191
Debugging
Step Action
1
Click Edit > Watch mode.
2 Click the variable to display in the Watch window.
Local variables
Name Type Address Array
1 start1 BOOL AUTO NO
2 start2 BOOL AUTO NO
3 ready BOOL AUTO NO
4 run BOOL AUTO NO
5 x BOOL AUTO NO
3 A dialog box appears listing all the currently existing instances of debug windows, and asking you which one is to receive
the object you have just clicked.
Symbol to add:
start1
Debug windows
Watch
Oscilloscope
OK Cancel
To add the variable in the Watch window, select Watch and click OK.
4
Once you have added to the Watch window all the variables you want to display, click Edit > Insert/Move mode, the
mouse cursor turns to its original shape.
192 9MA10256.03
Debugging
To add a variable to the Watch window, click Insert new item in the Watch
window toolbar.
You shall type (or select by browsing the project symbols) the name of the variable
and its location (where it has been declared).
Location Browse
OK Cancel
Removing a Variable
Description
If you want to remove a variable from the Watch window, select it by clicking its
name once, then press the Delete key.
Refreshment of Values
Normal Operation
The watch window manager reads periodically from memory the value of the
variables.
Watch
However, this action is carried out asynchronously. It may happen that a higher-
priority task modifies the value of some of the variables while they are being read.
Thus, at the end of a refreshment process, the values displayed in the window
may refer to different execution states of the PLC code.
9MA10256.03 193
Debugging
Target Disconnected
If the target device is disconnected, the Value column contains three dots.
Watch
Value format
Format
OK
Signed
Unsigned Cancel
Float
Binary
Octal
Hexadecimal
ASCII string
UTF-8 string
Float format
Number of decimal 3
194 9MA10256.03
Debugging
Step Action
1
Click the Save watch list button in the Watch window toolbar.
2 Enter the file name and choose its destination in the file system.
You can load a watch list from file, removing the opened one, following this
procedure:
Step Action
1
Click the Load (no appends) watch list button in the Watch window toolbar.
2 Browse the file system and select the watch list file.
The set of symbols in the watch list is added to the Watch window.
You can load a watch list from file, appending to the opened one, following this
procedure:
Step Action
1
Click the Load watch list button in the Watch window toolbar.
2 Browse the file system and select the watch list file.
The set of symbols in the watch list is added to the Watch window.
You can clear the current opened watch list by clicking the Remove all items
from the watch list button.
You can modify the place of a selected item in the current open watch list by
clicking the Move up item into the list button or the Move down item into
the list button.
9MA10256.03 195
Debugging
Oscilloscope
Overview
Description
The Oscilloscope allows you to plot the evolution of the values of a set of
variables. Being an asynchronous tool, the Oscilloscope cannot establish
synchronization of samples.
Oscilloscope window is an interface for accessing the debugging functions that
the Oscilloscope makes available:
Oscilloscope
ms/div : 3761.33
1983.22 39596.5
196 9MA10256.03
Debugging
• The lower section of the Oscilloscope is a table consisting of a row for each
variable.
To open, close the Oscilloscope, click View > Tool windows >
Oscilloscope.
Closing the Oscilloscope means simply hiding it, not resetting it. If you open again
the Oscilloscope after closing it, you will see that plotting of the curve of all the
variables you added to it starts again.
1983.98
Track Um
@TIMED:LOOPS.HMISIN...
@TIMED:LOOPS.HMISTEP
@TIMED:LOOPS.X
The same procedure applies to all the variables you wish to monitor.
9MA10256.03 197
Debugging
Step Action
1
Click Edit > Watch mode.
2
Click the block representing the variable you wish to trace in the Oscilloscope:
aoActuator 1023
371042
Track
@FAST:PIDCONTROL.PI...
3
A dialog box appears listing all the currently existing instances of debug windows, and
asking you which one is to receive the object you have just clicked:
Symbol to add:
start1
Debug windows
Watch
Oscilloscope
OK Cancel
Select Oscilloscope, then click OK. The name of the variable is now displayed in the
Track column.
The same procedure applies to all the variables you wish to monitor.
Once you have added to the Oscilloscope all the variables you want to observe,
you should click Edit > Insert/Move mode: the mouse cursor turns to its
original shape.
Local variables
Class Pin Name Type Array Init value Attribute
1 VAR absSpeed REAL NO ..
2 VAR T REAL NO ..
3 VAR remSpace DINT NO ..
4 VAR T2 REAL NO ..
5 VAR sign REAL NO ..
6 VAR prevSpeed REAL NO ..
198 9MA10256.03
Debugging
or press the F10 key and choose Oscilloscope from the list of debug windows
which pops up.
or press the F10 key and choose Oscilloscope from the list of debug windows
which pops up.
Removing a Variable
Description
If you want to remove a variable from the Oscilloscope, select it by clicking its
name once, then press the Delete key.
Variables Sampling
Normal Operation
The Oscilloscope manager periodically reads from memory the value of the
variables.
However, this action is carried out asynchronously. It may happen that a higher-
priority task modifies the value of some of the variables while they are being read.
At the end of a sampling process, data associated with the same value of the x-
axis may refer to different execution states of the PLC code.
9MA10256.03 199
Debugging
Target Disconnected
If the target device is disconnected, the curves of the dragged-in variables are
frozen until communication is restored.
In this case, when you click Restart acquisition, the plot is reset and restarts
with the actual value of the variable.
200 9MA10256.03
Debugging
Step Action
1
Open the Oscilloscope settings by clicking the Graph properties button in the
toolbar.
2
Set the scale of the horizontal axis, which is common to all the tracks:
Oscilloscope settings
Tracks list
Name Unit Value/div Offset Hide
@TIMED:SR_PUMPCNTRL. 0.2 0
OK Apply Cancel
3
For each variable, you may specify a distinct scale for the vertical axis:
Oscilloscope settings
Tracks list
@TIMED:SR_PUMPCNTRL. 100 0
OK Apply Cancel
4 Confirm your settings. The graph adapts to reflect the new scale.
You can also zoom in and out with respect to both the horizontal and the vertical
axes:
Finally, you may also adapt the scale of the horizontal axis, the vertical axis, or
both to include all the samples, by clicking the corresponding item of the toolbar:
9MA10256.03 201
Debugging
Vertical Split
When you are watching the evolution of two or more variables, you may want to
split the respective tracks. For this purpose, click the Vertical split item in the
Oscilloscope toolbar:
202 9MA10256.03
Debugging
Viewing Samples
If you click the Show samples item in the Oscilloscope toolbar, the tool
highlights the single values detected during data acquisition:
You can click the same item again in order to go back to the default view mode.
Taking Measures
The Oscilloscope includes two measure bars, which can be exploited to take
some measures on the chart. In order to show and hide them, click the Show
measure bars item in the Oscilloscope toolbar.
If you want to measure a time interval between two events, you have to move one
bar to the point in the graph that corresponds to the first event and the other to the
point that corresponds to the second one:
9MA10256.03 203
Debugging
The time interval between the two bars is displayed in the top left corner of the
chart:
You can use a measure bar also to read the value of all the variables in the
Oscilloscope at a particular moment: move the bar to the point in the graph which
corresponds to the instant you want to observe:
In the following table (below the graphic), you can now read the values of all the
variables at that particular moment:
ms
204 9MA10256.03
Debugging
Oscilloscope Settings
You can further customize the appearance of the Oscilloscope by clicking the
Graph properties item in the toolbar.
In the window that pops up you can choose whether to display or not the
Background grid, the Time slide bar, and the Track list:
Oscilloscope settings
Show grid
Show time bar
Show tracks list
Step Action
1
Click the Graph properties item in the toolbar.
2
In the window that pops up, edit the Sampling polling rate:
Oscilloscope settings
The rate depends on the performance of the target device (in particular, on the
performance of its communication task). You can read the rate in the
Oscilloscope settings window.
9MA10256.03 205
Debugging
Step Action
1
Stop the acquisition before saving data to a file.
2
Click the Save tracks data into file in the Oscilloscope toolbar.
4 Choose a file name and a destination directory, then confirm the operation.
206 9MA10256.03
Debugging
Step Action
1
Either suspend or stop the acquisition.
2
Move the time slide bar and adjust the zoom in order to include in the view the elements
you want to print:
Oscilloscope
ms/div : 500.00
5.10443e+006 5.10943e+006
3
Click the Print graph item.
9MA10256.03 207
Debugging
You cannot enter the debug mode if the connection status differs from Connected
and the application in the software and the controller are the same as indicated by
SOURCE OK.
Live Debug
Overview
Description
Programming can display meaningful animation of the current and changing
state of execution over time of a Program Organization Unit (POU) coded in any
IEC 61131-3 programming language.
To enable and disable the live debug mode, you may click Debug > Live
debug mode.
The controller allows you to force the state of selected outputs and variables to a
defined value for the purposes of system testing, commissioning, and
maintenance. You can force the value of an output and/or variable while your
controller is connected to FREE Studio Plus.
WARNING
UNINTENDED EQUIPMENT OPERATION
• You must have a thorough understanding of how forcing will affect the
outputs relative to the tasks being executed.
• Do not attempt to force I/O that is contained in tasks that you are not certain
will be executed in a timely manner, unless your intent is for the forcing to
take affect at the next execution of the task whenever that may be.
• If you force an output and there is no apparent affect on the physical output,
do not exit FREE Studio Plus without removing the forcing.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
SFC Simulation
Description
As explained in the relevant section of the language reference, an SFC POU is
structured in a set of steps, each of which is either active or inactive at any given
moment. Once started up, this SFC-specific debugging tool animates the SFC
documents by highlighting the active steps.
208 9MA10256.03
Debugging
A portion of an SFC network is displayed, The same portion of network is displayed The same portion of network is displayed
diagram animation being off. when the live debug mode is active. The with steps S1 and S3 that are currently
picture shows that steps S1 and S3 are active but in hold status.
currently active, whereas Init, S2, and S4
are inactive. This may occur in SFC blocks when they
are children of a parent in inactive status.
The SFC animation manager tests periodically the state of all steps, you are not
allowed to edit the sampling period. A step may remain active too briefly to be
displayed. The fact that a step is never highlighted does not imply that its action is
not executed. It may simply mean that the sampling rate is too slow to detect the
execution.
LD Simulation
Description
In live debug mode, Ladder Diagram schemes are animated by highlighting the contacts and coils whose value is
true (in the example, i1 and i2):
The LD animation manager tests periodically the state of all the elements. It may
happen that an element remains true too briefly to be displayed. The fact that an
element is never highlighted does not imply that its value never becomes true (the
sampling rate may be too slow).
9MA10256.03 209
Debugging
FBD Simulation
Description
In live debug mode, Programming displays the values of all the visible variables directly in the graphical source
code editor:
IL and ST Simulation
Description
The live debug mode also applies to textual source code editors (the ones for IL
and ST). You can watch the values of a variable by hovering with the mouse over
it:
210 9MA10256.03
Debugging
Triggers
Trigger Window
Description
The Trigger window tool allows you to select a set of variables and to have them
updated synchronously in a special pop-up window.
Add/remove text To start a trigger window, select the point of the PLC code where to
trigger insert the relative trigger and then click this button. The same
procedure applies to trigger window removal: in order to definitely
close a debug window, click once the instruction/block where the
trigger was inserted, then click this button again.
Add/remove
graphic trigger
This button operates exactly as the Add/remove text
trigger, except for that it opens a graphic trigger window. It can be
used likewise also to remove a graphic trigger window.
9MA10256.03 211
Debugging
Remove all triggers Clicking this button causes all the existing trigger windows and the
graphic trigger window to be removed simultaneously.
Trigger list
This button opens a dialog listing all the existing trigger windows:
Trigger list
G System -1 Remove
T RMS -1
T Fast 14 Remove all
T Init -1
T Slow -1
OK
Each record refers to a trigger window, either graphic or textual. The following
table explains the meaning of each field.
Field Description
Module Name of the program, function, or function block where the trigger is placed. If the
module is a function block, this field contains its name, not the name of its instance
where you put the trigger.
Line For the textual languages (IL, ST) indicates the line in which the trigger is placed.
For the other languages, the value is always -1.
Condition ...
None
Trigger For events
After
Caption bar
The Caption bar of the pop-up window shows information on the location of the
trigger which causes the refresh of the Variables window, when reached by the
processor.
The text in the Caption bar has the following format:
Trigger n° X at ModuleName#Location
212 9MA10256.03
Debugging
where
X Trigger identifier.
ModuleName Name of the program, function, or function block where the trigger was
placed.
N1
N2$BT:BID
where:
N2 = network number
Controls section
This dialog box allows you to control the refresh of the trigger window to get more
information on the code under scope. A detailed description of the function of each
control is given in the Trigger window controls section. Refer to Using Controls
description, page 223.
All controls are not accessible until at least one variable is dragged into the debug
window.
The Variables section
This lower section of the Debug window is a table consisting of a row for each
variable that you dragged in. Each row has several fields: the name of the
variable, its value, its type, its location (@task:ModuleName), and its description
read from memory during the last refresh:
Condition ...
None
Trigger For events
After
9MA10256.03 213
Debugging
The value of variables is refreshed every time the window manager is triggered
that is every time the processor executes the instruction marked by the green
arrowhead. However, you can set controls in order to have variables refreshed
only when triggers satisfy the more limiting conditions you define.
Condition ...
None
Trigger For events
After
The value of the variables in column Symbol is read from memory just before the
marked instruction (in this case: the instruction at line 5) and immediately after the
previous instruction (the one at line 4) has been performed.
Thus, in the previous example the second ST statement has not been executed
yet when the new value of a is read from memory and displayed in the trigger
window. Thus the result of the second ST a is 1.
Set step Trigger This control is used to execute a single step trigger. It is enabled
only when there is no active triggering session and None is
selected. The defined condition specified then is active. After the
single step trigger is done, triggering session automatically stops.
214 9MA10256.03
Debugging
Trigger counter
A read-only control Cnt counts how many times the debug window manager has
been triggered since the window was installed.
The window manager automatically resets this counter every time a new triggering
session is started.
Trigger state
This read-only control displays the state of the Debug window. It can assume the
following values.
System is not triggering. It has been stopped by you or a halt condition has been
reached.
Communication with target interrupted, the state of the trigger window cannot be
determined.
User-defined condition
If you define a condition by using this control, the values in the Debug window are
refreshed every time the window manager is triggered and the user-defined
condition is true.
After you have entered a condition, the control displays its simplified expression:
Counters
These controls allow you to define conditions on the trigger counter:
None
Trigger For events
After
9MA10256.03 215
Debugging
You want to know the value of b, d, and k, just before the ST k instruction is
executed.
To do so, move the cursor to line 12:
216 9MA10256.03
Debugging
Trigger n° 0 at F_CALCFREQSETPERC#2
Condition ...
None
Trigger For events
After
The same procedure applies to all the variables you wish to monitor.
You want to know the values of C, D, and K, just before the ST k instruction is
executed.
Provided that you can never place a trigger in a block representing a variable such
as you must select the first available block preceding the selected
variable. In the example of the previous figure, you must move the cursor to
network 3, and click the ADD block.
9MA10256.03 217
Debugging
In both cases, the color of the selected block turns to green, a white circle with a
number inside appears in the middle of the block, and the related trigger window
pops up:
218 9MA10256.03
Debugging
A dialog box appears listing all the currently existing instances of debug windows,
and asking you which one is to receive the object you have just clicked:
Symbol to add:
k
Debug windows
Watch
Oscilloscope
Graphic trace
OK Cancel
In order to display the variable k in the trigger window, select its reference in the
Debug windows column, then click OK. The name of the variable is now
displayed in the Symbol column:
Condition ...
None
Trigger For events
After
The same procedure applies to all the variables you wish to monitor:
Once you have added to the Graphic watch window all the variables you want to
observe, you can click Edit > Insert/Move mode, to let the cursor take back
its original shape.
9MA10256.03 219
Debugging
In this case, the same rules apply as to insert a trigger in an FBD module on a
contact or a coil .
In this case, follow the SE instructions. Let also assume that you want to know the
value of some variables every time the processor reaches network number 1.
First you must click one of the items making up network number 1. Now you can
220 9MA10256.03
Debugging
Condition ...
None
Trigger For events
After
Unlike the other languages supported by Programming, LD does not allow you to
insert a trigger into a single contact or coil, as it lets you select only an entire
network. Thus the variables in the trigger window will be refreshed every time the
processor reaches the beginning of the selected network.
Symbol to add:
b
Debug windows
Watch
Oscilloscope
Trigger n°0 at TRIGGERS#1$
OK Cancel
To display variable B in the trigger window, select its reference in the Debug
window column, then click OK.
9MA10256.03 221
Debugging
Condition ...
None
Trigger For events
After
The same procedure applies to all the variables you wish to monitor.
Let us also assume that you want to know the value of e, d, and f, just before the
instruction
f := f+ SHR( d, 16#04 )
is executed. To do so, move the cursor to line 6.
222 9MA10256.03
Debugging
Condition ...
None
Trigger For events
After
Not all the ST instructions support triggers. For example, it is not possible to place
a trigger on a line containing a terminator such as END_IF, END_FOR, END_
WHILE, and so on.
Condition ...
None
Trigger For events
After
The same procedure applies to all the variables you wish to monitor.
Using Controls
Trigger windows controls allow you to supervise the working of this debugging
tool. The main purpose of trigger window controls is to let you define more limiting
conditions so that variables in the Variables window are refreshed when the
processor reaches the trigger location and these conditions are satisfied. If you do
not use controls, variables are refreshed every time the processor reaches the
relative trigger.
9MA10256.03 223
Debugging
Enabling controls
When you set a trigger, all the elements in the Control window are disabled:
Cnt: 0 Stop
Condition ...
None
Trigger For events
After
You cannot access any of the controls until at least one variable is dragged into
the Debug window. When you do triggering automatically starts and the Controls
window changes as follows:
Cnt: 0 Stop
Condition ...
None
Trigger For events
After
Trigger condition
LD a
GT 100
OK
Once you have finished writing the condition code, click the OK button to install it,
or press the Esc key to cancel. If you choose to install it, the values in the debug
224 9MA10256.03
Debugging
window are refreshed every time the window manager is triggered and the user-
defined condition is true.
A simplified expression of the condition now appears in the control:
Trigger list
G System -1 Remove
T RMS -1
T Fast 14 Remove all
T Init -1
T Slow -1
OK
9MA10256.03 225
Debugging
Alternatively, you can remove all the existing triggers at once, regardless for which
Graphic Triggers
Graphic Trigger Window
Description
The graphic trigger window tool allows you to select a set of variables, to have
them sampled synchronously, and to have their curve displayed in a special pop-
up window.
Sampling of the dragged-in variables occurs every time the processor reaches the
position (that is, the instruction - if IL, ST - or the block - if FBD, LD) where you
placed the trigger.
F2C_PROBE_CONVERTER#5
` Cnt: 0 Stop
-5000 0
4 3
226 9MA10256.03
Debugging
1. Caption bar
2. Controls bar
3. Chart area
4. Variables window
ModuleName Name of program, function, or function block where the trigger was placed.
N1
N2$BT:BID
N2 = network number
9MA10256.03 227
Debugging
This lower section of the Debug window is a table consisting of a row for each
variable that you dragged in. Each row has several fields, as presented in the
following table:
Field Description
Value/Div How many engineering units are represented by a unit of the y-axis (that is, the
space between two ticks on the vertical axis).
V blue curs Value of the variable at the intersection with the line identified by the vertical blue
cursor.
V red curs Value of the variable at the intersection with the line identified by the vertical red
cursor.
H blue curs Value of the variable at the intersection with the line identified by the horizontal
blue cursor.
H red curs Value of the variable at the intersection with the line identified by the horizontal
red cursor.
You can drag into the graphic trigger window only variables local to the module
where you placed the relative trigger, or global variables, or parameters. You
cannot drag variables declared in another program, function, or function block.
Sampling of Variables
The value of the variables is sampled every time the graphic trigger window
manager is triggered, that is every time the processor executes the instruction
marked by the green arrowhead. However, you can set controls in order to have
variables sampled when triggers also satisfy further limiting conditions that you
define.
The value of the variables in the column Track is read from memory just before
the marked instruction and immediately after the previous instruction.
228 9MA10256.03
Debugging
Start graphic trace When you click this button, the acquisition starts. If acquisition is running and you click the
button again, you stop the sample collection process, and you reset all the data you have
acquired so far.
Show measure bars The two cursors (red cursor, blue cursor) may be seen and moved along their axis as long
as this button is clicked. Click the button again if you want to hide all the cursors.
Show samples This control is used to put in evidence the exact point in which the variables are triggered
at each sample.
Vertical split When clicked, this control splits the y-axis into as many segments as the dragged-in
variables, so that the diagram of each variable is drawn in a separate band.
Show all values It is used to fill in the graph window all the values sampled for the selected variables in the
current record set.
Horizontal zoom + Zooming in is an operation that makes the curves in the Chart area appear larger on the
screen, so that greater detail may be viewed. Zooming out is an operation that makes the
and curves appear smaller on the screen so that it may be viewed in its entirety.
Horizontal zoom - Horizontal zoom acts only on the horizontal axis.
Horizontal show all This control is used to horizontally center record set samples. So first sample is placed on
the left margin, and last is placed on the right margin of the graphic window.
Vertical zoom + Zooming in is an operation that makes the curves in the Chart area appear larger on the
screen so that greater detail may be viewed. Zooming out is an operation that makes the
and curves appear smaller on the screen so that it may be viewed in its entirety.
Vertical zoom - Vertical Zoom acts only on the vertical axis.
Vertical show all This control is used to vertically center record set samples. So max value sample is placed
near top margin and low value sample is placed on the bottom margin of the graphic
window.
Stop acquisition This control is used to stop the acquisition.
Graph properties Clicking this button causes a tabbed dialog box to appear, which allows you to set general
user options affecting the action of the graphic trigger window. For more information, refer
to Graphic Trigger Window Properties, page 230.
Print chart Click this button to print both the Chart area and the Variables window.
Trigger counter
This read-only control displays two numbers with the following format: Cnt: X/Y.
• X indicates how many times the debug window manager has been triggered
since the graphic trigger was installed.
• Y represents the number of samples the graphic window has to collect before
stopping data acquisition and drawing the curves.
Trigger state
This read-only control displays the state of the Debug window. It can assume the
following values:
No sample(s) taken, as the trigger has not occurred during the current task
Ready execution.
Sample(s) collected, as the trigger has occurred during the current task
Triggered execution.
9MA10256.03 229
Debugging
Stop The trigger counter indicates that a number of samples has been collected
satisfying the user request or memory constraints, thus the acquisition
process is stopped.
Communication with target interrupted; the state of the trigger window cannot
Error be determined.
Tracks list
Name Unit Value/div Offset Hide
F2C_PROBE_CONVERTER 1 0
OK Apply Cancel
Control
Control Description
Show grid Select this control to display a grid in the Chart area background.
Show time bar The scroll bar at the bottom of the Chart area is available as long as this box
is selected.
Show tracks list The Variables window is displayed as long as this box is selected, otherwise
the Chart area extends to the bottom of the graphic trigger window.
Values
Control Description
Horizontal scale Number of samples per unit of the x-axis. The unit x-axis is the space
between two vertical lines of the background grid.
Buffer size Number of samples to acquire. When you open the Synchronous
oscilloscope settings window, after having previously dragged-in all the
variables you want to watch, a default number appears in this field,
representing the maximum number of samples you can collect for each
variable.
User-defined condition
If you define a condition by using this control, the sampling process does not start
until that condition is satisfied. Unlike trigger windows, once data acquisition
begins, samples are taken every time the window manager is triggered,
regardless whether the condition continues to be true.
230 9MA10256.03
Debugging
After you enter a condition, the control displays its simplified expression:
Tracks list
This section allows you to define some graphic properties of the plot of each
variable. To select a variable, click its name in the Name column:
Control Description
Value/div Values per unit of the y-axis. The unit y-axis is the space between two
horizontal lines of the background grid.
Hide Select this flag to hide the selected track on the graph.
Click Apply to make your changes effective, or click OK to apply your changes
and to close the Synchronous oscilloscope settings window.
Further, assume that you want to know the value of b, d, and k, just before the ST
k instruction is executed. To do so, move the cursor to line 12:
9MA10256.03 231
Debugging
A green arrowhead appears next to the line number, and the graphic trigger
window pops up:
Not all the IL instructions support triggers. For example, it is not possible to place
a trigger at the beginning of a line containing a JMP statement.
The same procedure applies to all the variables you wish to monitor.
Once the first variable is dropped into a graphic trace, the Graphic properties
window is automatically displayed and allows you to setup sampling and
visualization properties.
232 9MA10256.03
Debugging
Further, assume that you want to know the values of c, d, and k, just before the ST
k instruction is executed.
9MA10256.03 233
Debugging
SR_DISPLAY#14
Cnt: 0 Stop
-5000 0
When preprocessing the FBD source code, the compiler translates it into IL
instructions. The ADD instruction in network 3 is expanded to:
LD k
ADD c
ST k
When you add a trigger to an FBD block, you place the trigger before the first
statement of its IL equivalent code.
234 9MA10256.03
Debugging
A dialog box appears listing all the currently existing instances of debug windows,
and asking you which one is to receive the object you have just clicked:
Symbol to add:
k
Debug windows
Watch
Oscilloscope
Graphic trace
OK Cancel
In order to plot the curve of variable k, select Graphic Trace in the Debug
windows column, then click OK. The name of the variable is now displayed in the
Track column:
The same procedure applies to all the variables you wish to monitor.
Once you have added to the Graphic watch window all the variables you want to
monitor, you can click Edit > Insert/Move mode in order to restore the
original cursor.
Once the first variable is dropped into a graphic trace, the Graphic properties
window is automatically displayed and allows you to setup sampling and
visualization properties.
9MA10256.03 235
Debugging
In this case, the same rules apply as to insert the graphic trigger in an FBD
module.
Further, assume that you want to know the value of some variables every time the
processor reaches network number 1.
Click one of the items making up network number 1, then click Debug > Add/
remove graphic trigger
This causes the gray area containing the network number to turn to green, a white
circle with a number inside to appear in the middle of the area,
236 9MA10256.03
Debugging
SR_DISPLAY#14
Cnt: 0 Stop
-5000 0
9MA10256.03 237
Debugging
In order to plot the curve of variable b, select Graphic trace in the Debug
windows column, then click OK. The name of the variable is now displayed in the
Track column:
Symbol to add:
b
Debug windows
Watch
Oscilloscope
Graphic trace
OK Cancel
The same procedure applies to all the variables you wish to monitor.
Once you have added to the Graphic watch window all the variables you want to
monitor, you can click Edit > Insert/Move mode to restore the original shape
of the cursor.
Once the first variable is dropped into a graphic trace, the Graphic properties
window is automatically displayed and allows you to setup sampling and
visualization properties.
This example assumes that you want to know the value of e, d, and f, just before
the instruction
f := f+ SHR( d, 16#04 )
is executed. To do so, move the cursor to line 6.
238 9MA10256.03
Debugging
SR_DISPLAY#14
Cnt: 0 Stop
-5000 0
Not all the ST instructions support triggers. For example, it is not possible to place
a trigger on a line containing a terminator such as END_IF, END_FOR, END_
WHILE, and so on.
9MA10256.03 239
Debugging
SR_DISPLAY#14
5
samples/div : 500.00
4
-1
-2
-3
-4
-5
0 0
The same procedure applies to all the variables you wish to monitor.
Once the first variable is dropped into a graphic trace, the Graphic properties
window is automatically displayed and allows you to setup sampling and
visualization properties:
Tracks list
Name Unit Value/div Offset Hide
F 1 0
OK Apply Cancel
240 9MA10256.03
Debugging
Using Controls
Graphic trigger window controls allow you to supervise the working of this
debugging tool and to get more information on the application.
Enabling controls
When you set a trigger, all the elements in the Control bar are enabled. You can
start data acquisition by clicking the Start graphic trace button.
If you defined a user condition, which is currently false, data acquisition does not
start.
On the contrary, once the condition becomes true, data acquisition starts and
continues until the Start graphic trace button is released, regardless for the
condition being or not still true.
If you release the Start graphic trace button before all the required samples
have been acquired, the acquisition process stops and all the collected data get
lost.
Defining a condition
This control enables you to set a condition on when to start acquisition. By default,
this condition is set to true, and acquisition begins as soon as you click the
Enable/Disable acquisition button. From that moment on, the value of the
variables in the Debug window is sampled every time the trigger occurs.
In order to specify a condition, open the Condition tab of the Options dialog box,
Trigger condition
LD a
GT 100
OK
Once you have finished writing the condition code, click OK to install it, or press
the Esc key to cancel. The collection of samples will not start until the Start
graphic trace button is clicked and the user-defined condition is true. A simplified
expression of the condition now appears in the control:
9MA10256.03 241
Debugging
are out of scope if they have not been dragged into the Debug window. Also, no
new variables can be declared in the condition window.
Setting the scale of axes
• x-axis
When acquisition is completed, Programming plots the curve of the dragged-in
variables adjusting the x-axis so that all the data fit in the Chart window. If you
want to apply a different scale, open the General tab of the Graph properties
dialog box, type a number in the horizontal scale edit box, then confirm by clicking
Apply.
• y-axis
You can change the scale of the plot of each variable through the Tracks list tab
of the Graph properties dialog box. Otherwise, if you do not need to specify
exactly a scale, you can use the Zoom In and Zoom Out controls.
which records are selected, by clicking the Remove all triggers button.
242 9MA10256.03
Language Reference
Language Reference
What’s in This Chapter
Common Elements...................................................................................... 243
Instruction List (IL)....................................................................................... 267
Function Block Diagram (FBD) ..................................................................... 270
Ladder Diagram (LD) ................................................................................... 274
Structured Text (ST) .................................................................................... 276
IFDEF Statement to Exclude a Portion of Code.............................................. 283
Sequential Function Chart (SFC) .................................................................. 285
FREE Studio Plus Language Extensions....................................................... 295
Description
FREE Studio Plus languages are IEC 61131-3 standard-compliant:
• Common elements
• Instruction list (IL)
• Function block diagram (FBD)
• Ladder diagram (LD)
• Structured text (ST)
• Sequential Function Chart (SFC)
Moreover, FREE Studio Plus implements some extensions:
• Pointers
• Macros
Common Elements
Overview
Description
Common elements are textual and graphic elements shared by all the
programmable controller programming languages specified by IEC 61131-3
standard.
NOTE: The definition and editing of most of the common elements (variables,
structured elements, function blocks definitions, and so on) are managed by
FREE Studio Plus through specific editors, forms, and tables. FREE Studio
Plus does not allow you to edit directly the source code related to these
common elements.
NOTE: The following information was derived directly from the copyrighted
IEC standards.
Basic Elements
Character Set
Textual documents and textual elements of graphic languages are written by using
the standard ASCII character set.
9MA10256.03 243
Language Reference
Comments
User comments are delimited at the beginning and end by the special character
combinations “(*” and “*)”, respectively. Comments are allowed anywhere in the
program, and they have no syntactic or semantic significance in any of the
languages defined in this standard.
The use of nested comments, for example (* (* NESTED *) *), is treated as an
error.
244 9MA10256.03
Language Reference
(1) The implementation of the BOOL data type depends on the processor of the target device, for
example, it is 1 bit long for devices that have a bit-addressable area.
Typedefs
The purpose of typedefs is to assign alternative names to existing types. There
are not any differences between a typedef and its parent type, except the name.
Typedefs can be declared using the following syntax:
TYPE
<enumerated data type name> : <parent type name>;
END_TYPE
For example, consider the following declaration, mapping the name LONGWORD
to the IEC 61131-3 standard type DWORD:
TYPE
LONGWORD : DWORD;
END_TYPE
9MA10256.03 245
Language Reference
);
enum2: (
k := -11,
i := 0,
j, (* the value of j is ( i + 1 ) = 1 *)
l := 5
);
END_TYPE
Different enumerated data types may use the same identifiers for enumerated
values. To be uniquely identified when used in a particular context, enumerated
literals may be qualified by a prefix consisting of their associated data type name
and the # sign.
Subranges
A subrange declaration specifies that the value of any data element of that type is
restricted between and including the specified upper and lower limits.
Subranges can be declared using the following syntax:
TYPE
<subrange name> : <parent type name> ( <lower limit>..
<upper limit> );
END_TYPE
For example, consider the following declaration:
TYPE
int_0_to_100 : INT (0..100);
END_TYPE
Structures
A STRUCT declaration specifies that data elements of that type shall contain
subelements of specified types which can be accessed by the specified names.
Structures can be declared using the following syntax:
TYPE
<structured type name> : STRUCT
<declaration of structurestructure elements>
END_STRUCT;
END_TYPE
For example, consider the following declaration:
TYPE
structure1 : STRUCT
elem1 : USINT;
elem2 : USINT;
elem3 : INT;
elem3 : REAL;
END_STRUCT;
END_TYPE
Literals
Numeric Literals
External representation of data in the various programmable controller
programming languages consists of numeric literals.
There are two classes of numeric literals: integer literals and real literals. A
numeric literal is defined as a decimal number or a based number.
Decimal literals are represented in conventional decimal notation. Real literals are
distinguished by the presence of a decimal point. An exponent indicates the
246 9MA10256.03
Language Reference
123
+986
Real literals -12.0
0.0
0.4560
Real literals with exponents -1.34E-12 or -1.34e-12
1.0E+6 or 1.0e+6
1.234E6 or 1.234e6
Base 2 literals 2#11111111 (256 decimal)
TRUE
For more details, refer to Two-character strings, page 248.
Example Explanation
'$'' String of length one containing the single quote character (1)
(2) The three-character combination of the dollar sign ($) followed by two hexadecimal digits shall
be interpreted as the hexadecimal representation of the ASCII eight-bit character code.
9MA10256.03 247
Language Reference
Two-character Combinations
Two-character combinations beginning with the dollar sign shall be interpreted as
presented in the following table when they occur in character strings:
$$ Dollar sign
$L or $1 Line feed
$N or $n Newline
$R or $r Carriage return
$T or $t Tab
Variables
Foreword
Variables provide a means of identifying data objects whose contents may
change, for example, data associated with the inputs, outputs, or memory of the
programmable controller. A variable must be declared to be one of the elementary
types. Variables can be represented symbolically, or alternatively in a manner
which directly represents the association of the data element with physical or
logical locations in the programmable controller’s input, output, or memory
structure.
Each program organization unit (POU) (program, function, or function block)
contains at its beginning at least one declaration part. This declaration part
consists of one or more structuring elements, which specify the types (and, if
necessary, the physical or logical location) of the variables used in the
organization unit. This declaration part has the textual form of one of the keywords
VAR, VAR_INPUT, or VAR_OUTPUT as defined in the keywords section, followed
in the case of VAR by zero or one occurrence of the qualifiers RETAIN, NON_
RETAIN or the qualifier CONSTANT, and in the case of VAR_INPUT or VAR_
OUTPUT by zero or one occurrence of the qualifier RETAIN or NON_RETAIN,
followed by one or more declarations separated by semicolons and terminated by
the keyword END_VAR. A declaration may also specify an initialization for the
declared variable when a programmable controller supports the declaration by the
user of initial values for variables.
Structuring Element
The declaration of a variable must be performed within the following program
structuring element:
KEYWORD [RETAIN] [CONSTANT]
Declaration 1
Declaration 2
...
Declaration N
END_VAR
248 9MA10256.03
Language Reference
Qualifiers
Qualifier Description
CONST The attribute CONST indicates that the variables within the structuring
elements are constants, that is, they have a constant value, which cannot be
modified once the PLC project has been compiled.
RETAIN The attribute RETAIN indicates that the variables within the structuring
elements are retentive, that is, they keep their value even after the target
device is reset or switched off.
Declaration Syntax
Variables must be declared within structuring elements, using the following syntax:
VarName1 : Typename1 [ := InitialVal1 ];
VarName2 AT Location2 : Typename2 [ := InitialVal2 ];
VarName3 : ARRAY [ 0..N ] OF Typename3;
9MA10256.03 249
Language Reference
Where:
Keyword Description
TypenameX Data type of the variable, selected from elementary data types.
InitialValX The value the variable assumes after reset of the target.
Location
Variables can be represented symbolically, that is, accessed through their
identifier, or alternatively in a manner which directly represents the association of
the data element with physical or logical locations in the input, output, or memory
structure of the programmable controller.
Direct representation of a single-element variable is provided by a special symbol
formed by the concatenation of the percent sign “%”, a location prefix and a size
prefix, and one or two unsigned integers, separated by periods (.).
%location.size.index.index
1) location
The location prefix may be one of the following:
I Input location
Q Output location
M Memory location
2) size
The size prefix may be one of the following:
3) index.index
This sequence of unsigned integers, separated by dots, specifies the position of
the variable in the area specified by the location prefix.
Example:
%MW4.6 Word starting from the first byte of the seventh element of memory
data block 4.
%IX0.4 First bit of the first byte of the fifth element of input set 0.
The absolute position depends on the size of the data block elements, not on the
size prefix. %MW4.6 and %MD4.6 begin from the same byte in memory, but the
former points to an area which is 16 bits shorter than the latter.
250 9MA10256.03
Language Reference
For advanced users only: if the index consists of one integer only (no dots), then it
loses any reference to data blocks, and it points directly to the byte in memory
having the index value as its absolute address.
%MW4.6 Word starting from the first byte of the seventh element of datablock
4 in memory.
Example:
VAR [RETAIN] [CONSTANT]
XQuote : DINT;
Enabling : BOOL := FALSE;
TorqueCurrent AT %MW4.32 : INT;
Counters : ARRAY [ 0 .. 9 ] OF UINT;
Limits: ARRAY [0..3, 0..9]
END_VAR
• Variable XQuote is 32 bits long, and it is automatically allocated by the FREE
Studio Plus compiler.
• Variable Enabling is initialized to FALSE after target reset.
• Variable TorqueCurrent is allocated in the memory area of the target device,
and it takes 16 bits starting from the first byte of the 33rd element of data
block 4.
• Variable Counters is an array of 10 independent variables of type unsigned
integer.
Functions
Introduction
For the purposes of programmable controller programming languages, a function
is defined as a program organization unit (POU) which, when executed, yields
exactly one data element, which is considered to be the function result.
Functions contain no internal state information, that is, invocation of a function
with the same arguments (input variables VAR_INPUT and in-out variables VAR_
IN_OUT) always yields the same values (output variables VAR_OUTPUT, in-out
variables VAR_IN_OUT, and function result).
Declaration syntax
9MA10256.03 251
Language Reference
Keyword Description
VAR_EXTERNAL . . A function can access global variables only if they are listed in a VAR_
END_VAR EXTERNAL structuring element. Variables passed to the FB via a VAR_
EXTERNAL construct can be modified from within the FB.
Function body Specifies the operations to be performed upon the input variables in order to
assign values dependent on the function’s semantics to a variable with the
same name as the function, which represents the function result. It can be
written in any of the languages supported by FREE Studio Plus.
Declaring functions
Whatever the PLC language you are using, FREE Studio Plus allows you to
disregard the previous syntax, as it supplies a friendly interface for using
functions.
Function Blocks
Introduction
For the purposes of programmable controller programming languages, a function
block is a program organization unit which, when executed, yields one or more
values. Multiple, named instances (copies) of a function block can be created.
Each instance has an associated identifier (the instance name), and a data
structure containing its input, output, and internal variables. All the values of the
output variables and the necessary internal variables of this data structure persist
from one execution of the function block to the next. Invocation of a function block
with the same arguments (input variables) does not always yield the same output
values.
Only the input and output variables are accessible outside of an instance of a
function block, that is, the function block’s internal variables are hidden from the
user of the function block.
In order to execute its operations, a function block needs to be started by another
POU. Invocation depends on the specific language of the module calling the
function block.
The scope of an instance of a function block is local to the program organization
unit in which it is instantiated.
Declaration syntax
The declaration of a function must be performed as follows:
FUNCTION_BLOCK FunctionBlockName
VAR_INPUT
declaration of input variables (see the relevant
section)
END_VAR
252 9MA10256.03
Language Reference
VAR_OUTPUT
declaration of output variables
END_VAR
VAR_EXTERNAL
declaration of external variables
END_VAR
VAR
declaration of local variables
END_VAR
Function block body
END_FUNCTION_BLOCK
Keyword Description
FunctionBlockName Name of the function block being declared (note: name of the
template, not of its instances).
VAR_EXTERNAL .. END_VAR A function block can access global variables only if they are listed
in a VAR_EXTERNAL structuring element. Variables passed to
the FB via a VAR_EXTERNAL construct can be modified from
within the FB.
Function block body Specifies the operations to be performed upon the input variables
in order to assign values to the output variables - dependent on
the function block’s semantics and on the value of the internal
variables. It can be written in any of the languages supported by
FREE Studio Plus.
Declaring functions
Whatever the PLC language you are using, FREE Studio Plus allows you to
disregard the previous syntax, as it supplies a friendly interface for using function
blocks.
Programs
Introduction
A program is defined in IEC 61131-1 as a “logical assembly of all the programming
language elements and constructs necessary for the intended signal processing
required for the control of a machine or process by a programmable controller
system”.
Declaration syntax
The declaration of a program must be performed as follows:
PROGRAM < program name>
Declaration of variables (see the relevant section)
Program body
END_PROGRAM
Keyword Description
Program body Specifies the operations to be performed to get the intended signal
processing. It can be written in any of the languages supported by FREE
Studio Plus.
Writing programs
Whatever the PLC language you are using, FREE Studio Plus allows you to
disregard the previous syntax, as it supplies a friendly interface for writing
programs.
9MA10256.03 253
Language Reference
Number of operands 1
ACOS
Description Arc cosine. Computes the principal arc cosine of input #0; result is
expressed in radians
Number of operands 1
ADD
Description Arithmetic addition. Computes the sum of the two inputs.
Number of operands 2
ASIN
Description Arc sine. Computes the principal arc sine of input #0; result is
expressed in radians
Number of operands 1
254 9MA10256.03
Language Reference
ASIN
Output data type LREAL where available, REAL otherwise
ATAN
Description Arc tangent. Computes the principal arc tangent of input #0; result is
expressed in radians
Number of operands 1
ATAN2*
Description Arc tangent (with two parameters). Computes the principal arc tangent
of Y/X; result is expressed in radians
Number of operands 2
CEIL*
Description Rounding up to integer. Returns the smallest integer that is greater
than or equal to input #0
Number of operands 1
COS
Description Cosine. Computes the cosine function of input #0 expressed in radians
Number of operands 1
COSH*
Description Hyperbolic cosine. Computes the hyperbolic cosine function of input
#0
Number of operands 1
9MA10256.03 255
Language Reference
DIV
Description Arithmetic division. Divides input #0 by input #1
Number of operands 2
EXP
Description Natural exponential. Computes the exponential function of input #0
Number of operands 1
FLOOR*
Description Rounding down to integer. Returns the largest integer that is less than
or equal to input #0
Number of operands 1
LN
Description Natural logarithm. Computes the logarithm with base e of input #0
Number of operands 1
LOG
Description Common logarithm. Computes the logarithm with base 10 of input #0
Number of operands 1
MOD
Description Module. Computes input #0 module input #1
Number of operands 2
MUL
Description Arithmetic multiplication. Multiplies the two inputs.
Number of operands 2
256 9MA10256.03
Language Reference
MUL
Input data type Any numerical type
POW
Description Exponentiation. Raises Base to the power Expo
Number of operands 2
SIN
Description Sine. Computes the sine function of input #0 expressed in radians
Number of operands 1
SINH*
Description Hyperbolic sine. Computes the hyperbolic sine function of input #0
Number of operands 1
SQRT
Number of operands 1
SUB
Description Arithmetic subtraction. Subtracts input #1 from input #0
Number of operands 2
TAN
Description Tangent. Computes the tangent function of input #0 expressed in
radians
Number of operands 1
9MA10256.03 257
Language Reference
TAN
Output data type LREAL where available, REAL otherwise
TANH*
Description Hyperbolic tangent. Computes the hyperbolic tangent function of input
#0
Number of operands 1
Bistable Operators
R
Description Boolean reset.
Number of operands 1
Examples LD x
R y
ST z
S
Description Boolean set.
Number of operands 1
Examples LD x
S y
ST z
Number of operands 2
ROR
Description Input #0 right-shifted of Input #1 bits, circular.
Number of operands 2
258 9MA10256.03
Language Reference
ROR
Output data type Same as Input #0
SHL
Description Input#0 left-shifted of Input #1 bits, zero filled on the right.
Number of operands 2
SHR
Description Input #0 right-shifted of Input #1 bits, zero filled on the left.
Number of operands 2
Comparison Operators
Comparison operators can be also used to compare strings if this feature is
supported by the target device.
EQ
Description Equal to. Returns TRUE if Input #0 = Input #1, otherwise FALSE.
Number of operands 2
GE
Description Greater than or equal to. Returns TRUE if Input #0 >= Input #1,
otherwise FALSE.
Number of operands 2
GT
Description Greater than. Returns TRUE if Input #0 > Input #1, otherwise FALSE.
Number of operands 2
9MA10256.03 259
Language Reference
LE
Description Less than or equal to. Returns TRUE if Input #0 <= Input #1, otherwise
FALSE.
Number of operands 2
LT
Description Less than. Returns TRUE if Input #0 < Input #1, otherwise FALSE.
Number of operands 2
NE
Description Not equal to. Returns TRUE if Input #0!= Input #1, otherwise FALSE.
Number of operands 2
Conversion Functions
According to the IEC 61131-3 standard, type conversion functions shall have the
form *_TO_**, where “*” is the type of the input variable, and “**” the type of the
output variable (for example, INT_TO_REAL). FREE Studio Plus provides a more
convenient set of overloaded type conversion functions, relieving you to specify
the input variable type.
TO_BOOL
Number of operands 1
TO_BYTE
Number of operands 1
260 9MA10256.03
Language Reference
TO_DINT
Number of operands 1
TO_DWORD
Number of operands 1
TO_INT
Number of operands 1
TO_LREAL
Number of operands 1
TO_REAL
Number of operands 1
TO_SINT
Number of operands 1
9MA10256.03 261
Language Reference
TO_STRING
Number of operands 1
TO_STRINGFORMAT
Number of operands 2
TO_UDINT
Number of operands 1
TO_UINT
Number of operands 1
TO_USINT
Number of operands 1
TO_WORD
Number of operands 1
262 9MA10256.03
Language Reference
Logic Functions
AND
Description Logical AND if both Input #0 and Input #1 are BOOL, otherwise bitwise
AND.
Number of operands 2
NOT
Description Logical NOT if Input is BOOL, otherwise bitwise NOT.
Number of operands 1
OR
Description Logical OR if both Input #0 and Input #1 are BOOL, otherwise bitwise
OR.
Number of operands 2
XOR
Description Logical XOR if both Input #0 and Input #1 are BOOL, otherwise bitwise
XOR.
Number of operands 2
Selection Functions
LIMIT
Description Limits Input #0 to be equal or more than Input#1, and equal or less
than Input #2.
Number of operands 3
9MA10256.03 263
Language Reference
MAX
Description Maximum value selection
MIN
Description Minimum value selection
MUX
Description Multiplexer. Selects one of N inputs depending on input K
SEL
Description Binary selection
Number of operands 3
Standard Operators
ADR
Description Address of
Number of operands 1
IMOVE
Description Query interface
Number of operands 1
264 9MA10256.03
Language Reference
JMP
Description Jump (conditioned/negated)
Number of operands 0
MOVE
Description Move
Number of operands 1
Examples MOVE x, y;
REF
Description Reference to
Number of operands 0
RET
Description Return (conditioned/negated)
Number of operands 0
Examples RET;
SIZEOF
Description Size of
Number of operands 1
String Functions
CONCAT
Description Character string concatenation
Number of operands 2
9MA10256.03 265
Language Reference
DELETE
Description Delete L characters of IN, beginning at the P-th character position
Number of operands 3
FIND
Description Find the character position of the beginning of the first occurrence of
IN2 in IN1. If no occurrence of IN2 is found, then OUT := 0.
Number of operands 2
INSERT
Description Insert IN2 into IN1 after the P-th character position
Number of operands 3
LEFT
Description Leftmost L characters of IN
Number of operands 2
LEN
Description String length function
Number of operands 1
MID
Description L characters of IN, beginning at the P-th
Number of operands 3
266 9MA10256.03
Language Reference
REPLACE
Description Replace L characters of IN1 by IN2, starting at the P-th character
position
Number of operands 4
RIGHT
Description Rightmost L characters of IN
Number of operands 2
9MA10256.03 267
Language Reference
Semantics of IL Instructions
• Accumulator
Accumulator is a register that contains the value of the current result.
• Operators
Unless otherwise specified, the semantics of the operators is:
accumulator := accumulator OP operand
That is, the value of the accumulator is replaced by the result yielded by
operation OP applied to the current value of the accumulator itself, with
respect to the operand.
For instance, the instruction “AND %IX1” is interpreted as:
accumulator := accumulator AND %IX1
The instruction “GT %IW10” will have the boolean result TRUE if the current
value of the accumulator is greater than the value of input word 10, and the
boolean result FALSE otherwise:
accumulator := accumulator GT %IW10
• Modifiers
The modifier “N” indicates bitwise negation of the operand.
The modifier “C” indicates that the associated instruction can be performed
only if the value of the currently evaluated result is boolean 1 (or boolean 0 if
the operator is combined with the “N” modifier).
The left parenthesis modifier “(” indicates that evaluation of the operator must
be deferred until a right parenthesis operator “)” is encountered. The form of a
parenthesized sequence of instructions is presented below, referred to the
instruction:
accumulator := accumulator AND (%MX1.3 OR %MX1.4)
Standard Operators
Description
Standard operators with their allowed modifiers and operands are as listed below:
268 9MA10256.03
Language Reference
9MA10256.03 269
Language Reference
FBInstanceName.IO_var
where
Keyword Description
Feature Example
Lines
No storage of data or association with data elements can be associated with the
use of connectors; hence, to avoid ambiguity, connectors cannot be given any
identifier.
270 9MA10256.03
Language Reference
Evaluation of Networks
Order of Evaluation of Networks
The order in which networks and their elements are evaluated is not necessarily
the same as the order in which they are labeled or displayed. When the body of a
program organization unit (POU) consists of one or more networks, the results of
network evaluation within the aforesaid body are functionally equivalent to the
observance of the following rules:
• No element of a network is evaluated until the states of all of its inputs have
been evaluated.
• The evaluation of a network element is not complete until the states of all of
its outputs have been evaluated.
• As stated when describing the FBD editor, a network number is automatically
assigned to every network. Within a program organization unit (POU),
networks are evaluated according to the sequence of their number: network N
is evaluated before network N+1, unless otherwise specified by using the
execution control elements.
Combination of Elements
Elements of the FBD language must be interconnected by signal flow lines.
Outputs of blocks shall not be connected together. In particular, the “wired-OR”
construct of the LD language is not allowed, as an explicit boolean “OR” block is
required.
Feedback
A feedback path is said to exist in a network when the output of a function or
function block is used as the input to a function or function block which precedes it
in the network; the associated variable is called a feedback variable.
Feedback paths can be utilized subject to the following rules:
• Feedback variables must be initialized, and the initial value is used during the
first evaluation of the network. Look at the global variables editor, the local
variables editor, or the parameters editor to know how to initialize the
respective item.
• Once the element with a feedback variable as output has been evaluated, the
new value of the feedback variable is used until the next evaluation of the
element.
For instance, the boolean variable RUN is the feedback variable in the following
example:
9MA10256.03 271
Language Reference
Explicit loop:
Implicit loop:
EN ENO
VAR_INPUT VAR_OUTPUT
EN: BOOL := 1; ENO: BOOL;
END_VAR END_VAR
Refer to the Modifying properties of blocks section, page 146 to know how to add
these pins to a block:
When these variables are used, the execution of the operations defined by the
block are controlled according to the following rules:
• If the value of EN is FALSE when the block is invoked, the operations defined
by the function body are not executed and the value of ENO is reset to FALSE
by the programmable controller system.
• Otherwise, the value of ENO is set to TRUE by the programmable controller
system, and the operations defined by the block body are executed.
272 9MA10256.03
Language Reference
Jumps
Jumps are represented by a boolean signal line terminated in a double arrowhead.
The signal line for a jump condition originates at a boolean variable, or at a
boolean output of a function or function block. A transfer of program control to the
designated network label occurs when the boolean value of the signal line is
TRUE; thus, the unconditional jump is a special case of the conditional jump.
The target of a jump is a network label within the program organization unit within
which the jump occurs.
Unconditional Jump
Conditional Jump
Example:
Conditional Returns
• Conditional returns from functions and function blocks are implemented using
a RETURN construction as presented in the following table. Program
execution is transferred back to the invoking entity when the boolean input is
TRUE, and continues in the normal fashion when the boolean input is FALSE.
• Unconditional returns are provided by the physical end of the function or
function block.
Conditional Return
Example:
9MA10256.03 273
Language Reference
Power Rails
Description
The LD network is delimited on the left side by a vertical line known as the left
power rail, and on the right side by a vertical line known as the right power rail.
The right power rail may be explicit in the FREE Studio Plus implementation and it
is always displayed.
The two power rails are always connected with a horizontal line named signal link.
The LD elements must be placed and connected to the signal link.
Description Symbol
274 9MA10256.03
Language Reference
• The state of the vertical link is copied to all of the attached horizontal links on
its right.
• The state of the vertical link is not copied to any of the attached horizontal
links on its left.
Description Symbol
Contacts
Description
A contact is an element which imparts a state to the horizontal link on its right side
which is equal to the boolean AND of the state of the horizontal link at its left side
with an appropriate function of an associated boolean input, output, or memory
variable.
A contact does not modify the value of the associated boolean variable. Standard
contact symbols are given in the following table:
Normally open The state of the left link is copied to the right link if the
contact state of the associated boolean variable is ON.
Otherwise, the state of the right link is OFF.
Normally closed The state of the left link is copied to the right link if the
contact state of the associated boolean variable is OFF.
Otherwise, the state of the right link is OFF.
Positive transition- The state of the right link is ON from one evaluation of
sensing contact this element to the next when a transition of the
associated variable from OFF to ON is sensed at the
same time that the state of the left link is ON. The state
of the right link shall be OFF at all other times.
Negative transition- The state of the right link is ON from one evaluation of
sensing contact this element to the next when a transition of the
associated variable from ON to OFF is sensed at the
same time that the state of the left link is ON. The state
of the right link shall be OFF at all other times.
Coils
Description
A coil copies the state of the link on its left side to the link on its right side without
modification, and stores an appropriate function of the state or transition of the left
link into the associated boolean variable.
Standard coil symbols are presented in the following table:
9MA10256.03 275
Language Reference
Negated coil The inverse of the state of the left link is copied to the
associated boolean variable, that is, if the state of
the left link is OFF, then the state of the associated
variable is ON, and vice versa.
RESET (unlatch) coil The associated boolean variable is reset to the OFF
state when the left link is in the ON state, and
remains reset until set by a SET coil.
276 9MA10256.03
Language Reference
Expressions
Description
An expression is a construct which, when evaluated, yields a value corresponding
to one of the data types listed in the elementary data types table, page 244. FREE
Studio Plus does not set any constraint on the maximum length of expressions.
Expressions are composed of operators, operands, and/or assignments. An
operand can be a constant, a variable, a function call, or another expression.
Operands
An operand can be a literal, a variable, a function invocation, or another
expression.
Operators
Open the table of operators to see the list of all the operators supported by ST.
The evaluation of an expression consists of applying the operators to the
operands in a sequence defined by the operator precedence rules.
9MA10256.03 277
Language Reference
Negation Complement - .
NOT
.
Exponentiation **
.
Multiply Divide Modulo *
/ .
MOD
.
Add Subtract +
- .
Comparison <, >, <=, >= .
Equality Inequality = .
<>
.
Boolean AND AND
.
Boolean Exclusive OR XOR
Boolean OR OR .
LOWEST
Statements in ST
Description
All statements comply with the following rules:
• they are terminated by semicolons;
• unlike IL, a carriage return or new line character is treated the same as a
space character;
• FREE Studio Plus does not set any constraint on the maximum length of
statements.
ST statements can be divided into classes, according to their semantics.
Assignments
Semantics
The assignment statement replaces the current value of a single or multi-element
variable by the result of evaluating an expression.
The assignment statement is also used to assign the value to be returned by a
function, by placing the function name to the left of an assignment operator in the
body of the function declaration. The value returned by the function is the result of
the most recent evaluation of such an assignment.
Syntax
An assignment statement consists of a variable reference on the left-hand side,
followed by the assignment operator “:=”, followed by the expression to be
evaluated. For instance, the statement
A := B ;
278 9MA10256.03
Language Reference
would be used to replace the single data value of variable A by the current value of
variable B if both were of type INT.
Examples
Assignment:
a := b ;
Assignment:
pCV := pCV + 1 ;
Assignment with function invocation:
c := SIN( x );
Assigning the output value to a function:
FUNCTION SIMPLE_FUN : REAL
variables declaration
...
function body
...
SIMPLE_FUN := a * b - c ;
END_FUNCTION
Syntax
Function:
dst_var := function_name( arg1, arg2 , ... , argN );
Function block with formal argument list:
instance_name(var_in1 := arg1 ,
var_in2 := arg2 ,
... ,
var_inN := argN );
Function block with assignment of arguments:
instance_name.var_in1 := arg1;
...
instance_name.var_inN := argN;
instance_name();
Function and function block control statement:
RETURN;
9MA10256.03 279
Language Reference
Examples
FB invocation with formal argument list:
CMD_TMR( IN := %IX5,PT:= 300 ) ;
FB invocation with assignment of arguments:
IN := %IX5 ;
PT:= 300 ;
CMD_TMR() ;
FB output usage:
a := CMD_TMR.Q;
Early exit from function or function block:
RETURN ;
Selection Statements
Semantics
Selection statements include the IF and CASE statements. A selection statement
selects one (or a group) of its component statements for execution based on a
specified condition.
• IF: the IF statement specifies that a group of statements is to be executed
only if the associated boolean expression evaluates to the value TRUE. If the
condition is false, then either no statement is to be executed, or the statement
group following the ELSE keyword (or the ELSIF keyword if its associated
boolean condition is true) is executed.
• CASE: the CASE statement consists of an expression which evaluates to a
variable of type DINT (the “selector”), and a list of statement groups, each
group being labeled by one or more integer or ranges of integer values, as
applicable. It specifies that the first group of statements, one of whose ranges
contains the computed value of the selector, is to be executed. If the value of
the selector does not occur in a range of any case, the statement sequence
following the keyword ELSE (if it occurs in the CASE statement) is executed.
Otherwise, none of the statement sequences is executed.
FREE Studio Plus does not set any constraint on the maximum allowed number of
selections in CASE statements.
Syntax
Square brackets include optional code while braces include repeatable portions of
code.
IF:
IF expression1 THEN
stat_list
[ { ELSIF expression2 THEN
stat_list } ]
ELSE
stat_list
END_IF ;
CASE:
CASE expression1 OF
intv [ {, intv } ] :
stat_list
{ intv [ {, intv } ] :
stat_list }
[ ELSE
stat_list ]
END_CASE ;
280 9MA10256.03
Language Reference
Examples
IF statement:
IF d < 0.0 THEN
nRoots := 0 ;
ELSIF d = 0.0 THEN
nRoots := 1 ;
x1 := -b / (2.0 * a) ;
ELSE
nRoots := 2 ;
x1 := (-b + SQRT(d)) / (2.0 * a) ;
x2 := (-b - SQRT(d)) / (2.0 * a) ;
END_IF ;
CASE statement:
CASE tw OF
1, 5:
display := oven_temp ;
2:
display := motor_speed ;
3:
display := gross_tare;
4, 6..10:
display := status(tw - 4) ;
ELSE
display := 0;
tw_error := 1;
END_CASE ;
Iteration Statements
Semantics
Iteration statements specify that the group of associated statements are executed
repeatedly. The FOR statement is used if the number of iterations can be
determined in advance; otherwise, the WHILE or REPEAT constructs are used.
• FOR: the FOR statement indicates that a statement sequence is repeatedly
executed, up to the END_FOR keyword, while a progression of values is
assigned to the FOR loop control variable. The control variable, initial value,
and final value are expressions of the same integer type (for example, SINT,
INT, or DINT) and cannot be altered by any of the repeated statements. The
FOR statement increments the control variable up or down from an initial
value to a final value in increments determined by the value of an expression.
The default increment value is 1. The test for the termination condition is
made at the beginning of each iteration so that the statement sequence is not
executed if the initial value exceeds the final value.
• WHILE: the WHILE statement causes the sequence of statements up to the
END_WHILE keyword to be executed repeatedly until the associated boolean
expression is false. If the expression is initially false, then the group of
statements is not executed at all.
• REPEAT: the REPEAT statement causes the sequence of statements up to
the UNTIL keyword to be executed repeatedly (and at least once) until the
associated boolean condition is true.
• EXIT: the EXIT statement is used to terminate iterations before the
termination condition is satisfied. When the EXIT statement is located within
nested iterative constructs, exit is from the innermost loop in which the EXIT
is located, that is, control passes to the next statement after the first loop
terminator (END_FOR, END_WHILE, or END_REPEAT) following the EXIT
statement.
9MA10256.03 281
Language Reference
Syntax
Square brackets include optional code while braces include repeatable portions of
code. If the terminating condition is not correct, it can cause an endless loop.
NOTICE
UNINTENDED EQUIPMENT OPERATION
• Ensure that the variable used in FOR instructions is of a sufficient capacity
(has a great upper limit) to account for the <END_VALUE> + 1.
• Ensure that the WHILE loop will be terminated within the instructions of the
loop by creating a FALSE condition of the boolean expression.
• Ensure that the REPEAT loop will be terminated within the instructions of the
loop by creating a TRUE condition of the boolean expression.
Failure to follow these instructions can result in equipment damage.
FOR:
FOR control_var := init_val TO end_val [ BY increm_val ] DO
stat_list
END_FOR ;
WHILE:
WHILE expression DO
stat_list
END_WHILE ;
REPEAT:
REPEAT
stat_list
UNTIL expression
END_REPEAT ;
Examples
FOR statement:
j := 101 ;
FOR i := 1 TO 100 BY 2 DO
IF arrvals[i] = 57 THEN
j := i ;
EXIT ;
END_IF ;
END_FOR ;
WHILE statement:
j := 1 ;
WHILE j <=100 AND arrvals[i] <> 57 DO
j := j + 2 ;
END_WHILE ;
REPEAT statement:
j := -1 ;
REPEAT
j := j + 2 ;
UNTIL j = 101 AND arrvals[i] = 57
END_REPEAT ;
282 9MA10256.03
Language Reference
{ IFDEF : checkSymbol }
loopsValue := 0;
for I := 0 to 15 do
bit := (y + 0.9) > (0.125*TO_REAL(i));
if bit then
loopsValue := loopsValue or RotateBit(i);
end_if;
end_for;
{ ENDIF }
9MA10256.03 283
Language Reference
284 9MA10256.03
Language Reference
9MA10256.03 285
Language Reference
the languages defined in this standard, for performing sequential control functions.
The definitions in this section are derived from IEC 848, with the necessary
changes to convert the representations from a standard documentation to a set of
execution control elements for a PLC program organization unit.
Since SFC elements require storage of state information, the only program
organization units which can be structured using these elements are function
blocks and programs.
If any part of a program organization unit is partitioned into SFC elements, the
entire program organization unit is so partitioned. If no SFC partitioning is given for
a program organization unit, the entire program organization unit is considered to
be a single action which executes under the control of the invoking entity.
SFC elements
The SFC elements provide a means of partitioning a PLC program organization
unit into a set of steps and transitions interconnected by directed links. Associated
with each step is a set of actions, and with each transition is associated a
transition condition.
Steps
Definition
A step represents a situation where the behavior of a program organization unit
(POU) with respect to its inputs and outputs follows a set of rules defined by the
associated actions of the step. A step is either active or inactive. At any given
moment, the state of the program organization unit is defined by the set of active
steps and the values of its internal and output variables.
A step is represented graphically by a block containing a step name in the form of
an identifier. The directed links into the step can be represented graphically by a
vertical line attached to the top of the step. The directed links out of the step can
be represented by a vertical line attached to the bottom of the step.
Representation Description
Step
FREE Studio Plus does not set any constraint on the maximum number of steps
per SFC within the bounds of the available memory.
Step flag
The step flag (active or inactive state of a step) can be represented by the logic
value of a boolean variable ***_x, where *** is the step name. This boolean
variable has the value TRUE when the corresponding step is active, and FALSE
when it is inactive. The scope of step names and step flags is local to the program
organization unit where the steps appear.
Representation Description
286 9MA10256.03
Language Reference
Initial Step
The initial state of the program organization unit is represented by the initial values
of its internal and output variables, and by its set of initial steps, that is, the steps
which are initially active. Each SFC network, or its textual equivalent, has exactly
one initial step. An initial step can be drawn graphically with double lines for the
borders, as presented below. For system initialization, the default initial state is
FALSE for ordinary steps and TRUE for initial steps.
FREE Studio Plus cannot compile an SFC network not containing exactly one
initial step.
Representation Description
Initial step
Actions
An action can be:
• A collection of instructions in the IL language;
• A collection of networks in the FBD language;
• A collection of rungs in the LD language;
• A collection of statements in the ST language;
• A sequential function chart (SFC) organized as defined in this section.
Zero or more actions can be associated with each step. Actions are declared via
one of the textual structuring elements listed in the following table:
Such a structuring element exists in the lsc file for every step having at least one
associated action.
Action Qualifiers
The time when an action associated to a step is executed depends on its action
qualifier.
FREE Studio Plus implements the following action qualifiers:
9MA10256.03 287
Language Reference
Jumps
Direct links flow only downwards. To return to an upper step from a lower one, you
cannot draw a logical wire from the latter to the former. A special type of block
exists, called Jump, which lets you implement such a transition.
A Jump block is logically equivalent to a step, as they have to always be
separated by a transition. The only effect of a Jump is to activate the step flag of
the preceding step and to activate the flag of the step it points to.
Representation Description
Jump
Transitions
Definition
A transition represents the condition whereby control passes from one or more
steps preceding the transition to one or more successor steps along the
corresponding directed link. The transition is represented by a small gray square
across the vertical directed link.
The direction of evolution following the directed links is from the bottom of the
predecessor steps to the top of the successor steps.
Transition Condition
Each transition has an associated transition condition which is the result of the
evaluation of a single boolean expression. A transition condition which is always
true is represented by the keyword TRUE, whereas a transition condition always
false is symbolized by the keyword FALSE.
A transition condition can be associated with a transition by one of the following
means:
Representation Description
The scope of a transition name is local to the program organization unit (POU)
where the transition is located.
288 9MA10256.03
Language Reference
Rules of Evolution
Introduction
The initial situation of an SFC network is characterized by the initial step which is
in the active state upon initialization of the program or function block containing
the network.
Evolutions of the active states of steps take place along the directed links when
caused by the clearing of one or more transitions.
A transition is enabled when all the preceding steps, connected to the
corresponding transition symbol by directed links, are active. The clearing of a
transition occurs when the transition is enabled and when the associated
transition condition is true.
The clearing of a transition causes the deactivation (or “resetting”) of all the
immediately preceding steps connected to the corresponding transition symbol by
directed links, followed by the activation of all the immediately following steps.
The alternation Step/Transition and Transition/Step are always maintained in SFC
element connections, that is:
• Two steps are never directly linked; they are always separated by a transition;
• Two transitions are never directly linked; they are always separated by a step.
When the clearing of a transition leads to the activation of several steps at the
same time, the sequences which these steps belong to are called simultaneous
sequences. After their simultaneous activation, the evolution of each of these
sequences becomes independent. In order to emphasize the special nature of
such constructs, the divergence and convergence of simultaneous sequences is
indicated by a double horizontal line.
The clearing time of a transition may theoretically be considered as short as one
may wish, but it can never be zero. In practice, the clearing time is imposed by the
PLC implementation: several transitions which can be cleared simultaneously are
cleared simultaneously, within the timing constraints of the particular PLC
implementation and the priority constraints defined in the sequence evolution
table. For the same reason, the duration of a step activity can never be considered
to be zero. Testing of the successor transition conditions of an active step shall not
be performed until the effects of the step activation have propagated throughout
the program organization unit where the step is declared.
9MA10256.03 289
Language Reference
Example Rule
Normal transition:
Divergent transition:
Convergent transition:
290 9MA10256.03
Language Reference
Example Rule
9MA10256.03 291
Language Reference
Examples
Invalid scheme Equivalent allowed scheme Note
Expected behavior: an
evolution takes place from
S30 to S33 if a is FALSE and
d is TRUE.
Expected behavior: an
evolution takes place from
S32 to S31 if c is FALSE and
d is TRUE.
292 9MA10256.03
Language Reference
Where <POU name> means the name of the SFC POU (program or function
block).
For example, if the SFC POU is named Main, the control flags are named Main_
HOLD_SFC and Main_RESET_SFC.
Another couple of actions is available for every SFC action, which also are
contained in an SFC POU.
For example, if the program Main contains an SFC action named Execute, the
control flags of this action are Main_Execute_HOLD_SFC and Main_Execute_
RESET_SFC.
Hold Flag
Following the main characteristics of the <POU name>_HOLD_SFC flag:
• the default value is FALSE;
• When set to TRUE, the SFC block, which is referred to (the one with the
same name as <POU name>), it is kept in the current status (hold) and no
code is executed;
• When the flag is set back to FALSE, the SFC block execution is recovered
from exactly the same point in which was set to hold, trough <POU name>_
HOLD_SFC := TRUE.
Reset Flag
Following the main characteristics of the <POU name>_RESET_SFC flag:
• The default value is FALSE;
• When set to TRUE, the SFC block, which is referred to (the one with the
same name as <POU name>), it is brought back to the initial state, that is the
execution state of the init action.
• This is an auto-reset flag, which means that if it is set to TRUE its own state
becomes FALSE after its reset action has been executed. It is not necessary
to bring the <POU name>_RESET_SFC value back to FALSE.
Flags Visibility
The <POU name>_HOLD_SFC and <POU name>_RESET_SFC flags are
automatically generated from the code compiler and they belong to the local
variables of the POU which are referred to.
FREE Studio Plus does not show this flags in the variables list of the POU; they
are hidden but in any case they can be used everywhere within the code.
9MA10256.03 293
Language Reference
• If the SFC POU is a program, the user has the possibility to declare, as VAR_
GLOBAL and type BOOL, both flags having the name of the SFC POU
control flags.
• In both previous cases, FREE Studio Plus compiler uses the variables
declared among the VAR_INPUT or VAR_GLOBAL ones and not those
automatically generated (therefore they are not generated).
Using these techniques, user then can manage the working state of the SFC POU
from other POU using the INPUT variables of the SFC POU.
Example
FUNCTION_BLOCK test
VAR_INPUT
...
test_RESET_SFC : BOOL; (* Control flag explicitly
declared *)
END_VAR
...
END_FUNCTION_BLOCK
PROGRAM Main
VAR
...
block : test; (* SFC block instance *)
END_VAR
...
(* Reset SFC block state *)
block.test_RESET_SFC := TRUE;
...
END_PROGRAM
294 9MA10256.03
Language Reference
Macros
Description
FREE Studio Plus implements macros in the same way a C programming
language pre-processor does.
Macros can be defined using the following syntax:
MACRO <macro name>
PAR_MACRO
<parameter list>
END_PAR
<macro body>
END_MACRO
The parameter list may be empty, thus distinguishing between object-like macros,
which do not take parameters, and function-like macros, which take parameters.
A concrete example of macro definition is the following, which takes two bytes and
composes a 16-bit word:
MACRO MAKEWORD
PAR_MACRO
lobyte;
hibyte;
END_PAR
{ CODE:ST }
lobyte + SHL( TO_UINT( hibyte ), 8 )
END_MACRO
Whenever the macro name appears in the source code, it is replaced (along with
the current parameter list, in case of function-like macros) with the macro body.
For example, given the definition of the macro MAKEWORD and the following
Structured Text code fragment:
w := MAKEWORD( b1, b2 );
the macro pre-processor expands it to
w := b1 + SHL( TO_UINT( b2 ), 8 );
Pointers
Description
Pointers are special variables which act as a reference to another variable (the
pointed variable). The value of a pointer is, in fact, the address of the pointed
variable; in order to access the data stored at the address pointed to, pointers can
be dereferenced.
Pointer declaration requires the same syntax used in variable declaration, where
the type name is the type name of the pointed variable preceded by a @ sign:
VAR
<pointer name> : @<pointed variable type name>;
END_VAR
9MA10256.03 295
Language Reference
CAUTION
INVALID POINTER
• Verify the validity of the pointers when using pointers on addresses before
they are applied.
• Always initialize pointers with a valid memory address.
Failure to follow these instructions can result in injury or equipment
damage.
Waiting Statement
Description
FREE Studio Plus implements a WAITING statement that can be used in ST code
as following example:
...
WAITING <condition> DO
<code to be executed waiting for condition becomes true>
END_WAITING;
...
Until the condition is not verified, the code is executed (not as in a loop cycle but
returning to caller in every execution).
The WAITING statement can be used only if the associated project option is
enabled. For more details, refer to Code Generation, page 99.
296 9MA10256.03
Errors Reference
Compile Time Error Messages
Error code Short description Explanation
A4097 Object not found The object indicated (variable or function block) has not been defined in the
application.
A4098 Unsupported data type The size (in bits) requested by the indicated data type is not supported by
the target system.
A4099 Auto vars space exhausted The total allocation space requested by all local variables exceeds the space
available on the target system.
A4100 Retentive vars space exhausted The total allocation space requested by all local retentive variables exceeds
the space available on the target system.
A4101 Bit vars space exhausted The total allocation space requested by all local bit (boolean) variables
exceeds the space available on the target system.
A4102 Invalid ++ in data block The variable indicated is associated with an index that is not available in the
relative data block.
A4103 Data block not found The variable indicated is associated with a data block that does not exist (is
not defined) in the target system.
A4104 Code space exhausted The total size of code used for POU (programs, functions, and function
blocks) exceed the space available on the target system.
A4105 Invalid bit offset The variable indicated is associated with a bit index that is not available in
the relative data block.
A4106 Image variable requested Error code superseded.
A4107 Target function not found The function indicated is not available on the target system.
A4108 Base object not found The indicated instance refers to a function block definition non defined.
A4109 Invalid base object type The indicated variable is associated with a data type (including function
block definition) that is not defined.
A4110 Invalid data type The data type used in the variable definition does not exist.
A4111 Invalid operand type The operand type is not allowed for the current operator.
A4112 Function block shares global data and is used The indicated function block is called by more than one task but uses global
by more tasks variables with process image. For this reason, the compiler is not able to
refer to the proper image variable for each instance of the function block.
9MA10256.03 297
Error code Short description Explanation
A4145 To be implemented -
B0001 Data block not found The variable indicated is associated with a data block that does not exist (is
not defined) in the target system.
B0002 Error on create file The indicated file cannot be created due to a file system error or to a missing
source file.
C0001 Parser not initialized Internal compiler error.
C0002 Invalid token Invalid word for the current language syntax
C0004 Cannot open file The indicated file cannot be opened due to a file system error or to a missing
source file.
C0005 Parser table error Internal compiler error.
C0007 Unexpected end of file The indicated file is truncated or the syntax is incomplete.
C0009 Reserved keyword The indicated word cannot be used for declaration purposes because is a
keyword of the language.
C0010 Invalid element The indicated word is not a valid one for the language syntax.
C4097 Invalid variable type The data type indicated is not allowed.
C4098 Invalid location prefix The address string of the indicated variable is not correct, '%' missing.
298 9MA10256.03
Error code Short description Explanation
C4099 Invalid location specification The address string of the indicated variable is not correct, the data access
type indication isn't 'I', 'Q' or 'M'.
C4100 Invalid location type The address string of the indicated variable is not correct, the data type
indication isn't 'X', 'B', 'W', 'D', 'R' or 'L'.
C4101 Invalid location index specification The address string of the indicated variable is not correct, the index is not
correct.
C4102 Duplicate variable name The name of the indicated variable has already been used for some other
project object.
C4103 Only 0 admitted here The compiler uses only arrays zero-index based
C4104 Invalid array dimension The dimension of the array is not indicated in the correct way (for example:
contains invalid characters, negative numbers and so on).
C4105 Constant not initialized Every constant need to have an initial value.
C4353 Duplicate label The indicated label has already been defined in the current POU (program,
function, or function block).
C4354 Constant not admitted The operation indicated does not allow to use constants (typically store or
assign operations).
C4609 Invalid binary constant A constant value with 2# prefix must contain only binary digits (0 or 1).
C4610 Invalid octal constant A constant value with 8# prefix must contain only octal digits (between 0 and
7).
C4611 Invalid hexadecimal constant A constant value with 16# prefix must contain only hexadecimal digits
(between 0 and 9 and between A and F).
C4612 Invalid decimal constant A decimal constant must contain only digits between 0 and 9, a leading sign
+ or -, a decimal separator '.' Or a exponent indicator 'e' or 'E'.
C4613 Invalid time constant A constant value with t# prefix must contain a time indication in decimal
notation and a time unit between 'ms, 's' or 'm'.
C4864 Duplicate function name The indicated function name has already been used for another application
object.
C4865 Invalid function type The data type returned by the indicated function is not correct.
C5120 Duplicate program name The indicated program name has already been used for another application
object.
C5376 Duplicate function block name The indicated function block name has already been used for another
application object.
9MA10256.03 299
Error code Short description Explanation
D12289 Cannot allocate database The memory space needed for a parameter database exceeds the space
available on the target system. If possible, remove unused parameter
records, menus and so on.
D12290 Cannot allocate database record The memory space needed for a parameter database exceeds the space
available on the target system. If possible, remove unused parameter
records, menus and so on.
D12292 Invalid expression or expression syntax error The database expression that has the result indicated is not correct,
contains syntax errors or invalid operators.
D12293 Invalid parameter reference in expression The database expression that has the result indicated contains a parameter
(as operand) that is not the same to which the expression refers to. The
expression can use only PLC variables (including the variables associated
with parameters) and the value of the parameter that is exchanged at the
moment. For example: pDELTA = DELTA / pRATIO + pOFFSET is correct
because the parameter exchanged is DELTA and it is the only parameter
value used in the expression. The expression: pDELTA = DELTA / pRATIO +
OFFSET is not correct because the parameter OFFSET used in the
expression is not exchanged.
D12294 Recursive expression The database expression that has the result indicated calls itself by using
some operand used that contains the current expression result.
D12295 Unresolved variable in expression The database expression that has the result indicated uses an operand that
is not defined in the whole PLC project.
D12297 Invalid result type for expression The parameter that is the result of the expression has a data type invalid
(such as enumerative) or not defined.
D12298 Invalid operand in expression The database expression that has the result indicated uses an invalid
operand.
D12299 Invalid variable type for expression The variable that is the result of the expression has a data type invalid (such
as enumerative) or not defined.
D12301 Cannot allocate database code The code space needed for the expression is exhausted. Is necessary to
remove some expressions from the parameter's database.
D12302 Invalid operation in expression The database expression that has the result indicated uses an invalid
operand.
F1025 Invalid network The indicated FBD or LD network contains a connection error (the errors are
normally indicated by red connections).
F1026 Unconnected pin The indicated block (operator, function, contact, or coil) has an unconnected
pin.
F1028 More than one network per block The network indicated contains more networks of blocks and variables not
connected between them.
F1029 Ambiguous network evaluation The compiler is not able to find a univocal way to establish the order of
blocks execution.
F1030 Temporary variables allocation error Internal compiler error.
F1031 Inconsistent network The network indicated does not have input or output variables.
300 9MA10256.03
Error code Short description Explanation
G0001 Invalid operand number The number of operands is not correct for the operand or the function
indicated.
G0002 Variable not defined The variable has not been defined in the local or global context.
G0003 Label not defined The label indicated for the JMP operand is not defined in the current POU
(program, function, or function block).
G0004 Function block not defined The indicated instance refers to a function block not defined in the whole
project.
G0005 Reference to object not defined The indicated instance refers to an object not defined in the whole project.
G0006 Constant not admitted The operation indicated does not allow to use constants (typically store or
assign operations).
G0007 Code buffer overflow The total size of code used for POU (programs, functions, and function
blocks) exceed the space available on the target system.
G0008 Invalid access to variable The access made to the indicated variable is not allowed. An attempt to write
a read-only variable or to read a write-only variable has been made.
G0009 Program not found The indicated program does not exist in the current project.
G0010 Program already assigned to a task The indicated program has been assigned to more than one task of the
target system.
G0011 Cannot allocate code buffer There is not enough memory on the PC to create the image of the code of
the target system.
G0012 Function not defined The indicated function does not exist in the current project.
G0013 Cyclic declaration of function blocks The indicated function block call itself directly or by using other functions.
G0014 Incompatible external declaration The external variable declaration of the current function block does not
match with the global variable definition it refers to (the one with the same
name). Typically is the case of a type mismatch.
G0016 External variable not found The external variable does not refer to any of the global variables of the
project (for example: there is not a global variable with the same name).
G0017 Program is not assigned to a task The indicated program has not been assigned to a task in the target system.
G0018 Task not found in resources The indicated task is not defined in the target system.
G0019 No task defined for the application There are not task definitions for the target system. The target definition file
(*.TAR) is missing or incomplete. Contact the target system vendor.
G0020 Far data allowed only for load/store Huge memory access is not allowed for function blocks, only for programs
operations in PROGRAMs (error code valid only for some target system with NEAR/FAR data access).
G0021 Invalid processor type The processor indicated into the target definition file (*.TAR) is not correct or
is not supported by the compiler.
9MA10256.03 301
Error code Short description Explanation
G0052 To be implemented -
302 9MA10256.03
Error code Short description Explanation
G0513 Invalid operator The operator indicated is not allowed for the indicated operation.
G0514 Operation not implemented The operator indicated is not supported by the target system.
G0515 Real data not supported The target system in use does not support floating point operations.
G0516 Destination may be too small to store current The variable destination of the store/assignment operation has a data type
result smaller than the one of the accumulators. Data may be lost in the operation.
For example, if the accumulator contains 340 and the destination operand is
of SINT type, the assignment operation will lose data. If the operation is
under the programmer's control an appropriate type conversion function
(TO_SINT, TO_INT, TO_DINT and so on) can be used to eliminate the
advisory message.
G0517 Long data not supported The target system in use does not support long data operations.
G0518 Accumulator extension The variable destination of the store/assignment operation has a data type
bigger than the one of the accumulators. An extension operation has been
performed automatically by the compiler. To eliminate this advisory
message, use the appropriate type conversion function (TO_SINT, TO_INT,
TO_DINT and so on).
G0520 Negation allowed only on boolean The 'N' modifier used for some IL operators (LDN, STN, ANDN and so on)
cannot be used with operators having type other than boolean.
G0521 Operation allowed with boolean types The IL operator indicated (typically 'S' or 'R') cannot be used when the
accumulator has a type other than BOOL.
G0522 Instruction has constant result The indicated operation has a result that is constant (for example multiply by
0, AND with FALSE).
9MA10256.03 303
Error code Short description Explanation
G0523 Instruction is a NOP The operation indicated has no influence on the value of the accumulator
(for example multiply by 1, AND with TRUE).
G0524 Unbalanced parentheses The number of opened parentheses does not match with the number of the
closed parentheses in the indicated code block.
G0525 Operation not allowed on boolean The indicated operation cannot be performed on boolean operands (for
example the arithmetic operations).
G0526 Cannot perform modulo with long values The current target system does not allow the modulo operation with long
data types.
G0527 Division by 0 The indicated division operation has the constant value 0 as denominator.
G0528 Negation without condition The indicated operation (JMP or RET) has the negation modifier 'N' without
the conditional evaluation modifier 'C'. Use JMPCN instead of JMPN or
RETCN instead of RETN.
G0529 Initial value not defined Internal compiler error.
G0530 Invalid initial value The initial value of the variable is not indicated correctly.
G0531 Invalid accumulator type The accumulator has a data type not allowed for the indicated operation (for
example MUX operator with REAL accumulator).
G0533 Invalid operator value The operator has a value not acceptable for the indicated operation (for
example SHL with constant value bigger than 32).
G0534 Accumulator undefined The operation is performed without a previously loaded value into the
accumulator.
G0535 Invalid index The constant index value used in the indicated expression is too big for the
array dimension. See the array declaration string.
G0536 Only constant index allowed The use of variable as index for the indicated array is not supported by the
compiler. This error is typically issued with boolean (bit) arrays.
G0537 Indexing of boolean constants not allowed The use of variable as index for the indicated array is not supported by the
compiler. This error is typically issued with boolean (bit) arrays.
G0538 Return not allowed from programs The RET operator is not allowed in PROGRAM blocks.
G0539 Function block must be instantiated A function block cannot be invoked directly with a CAL instruction. It must be
instantiated before its use for example, must be a variable with data type
corresponding to the function block instead.
G0540 Operation not allowed with real types The indicated operation cannot be executed on REAL data types.
Instructions of this kind are logical and bitwise operations.
G0541 Accumulator conversion This advisory message informs that the data type of the accumulator has
been automatically converted by the compiler. This operation is typically
executed when the accumulator and the operand used in an arithmetic
operation have different data types.
G0542 Real accumulator must be reloaded Some target-specific implementations with software floating point emulation
require that each store operation shall be preceded by a new load operation
or an arithmetic sequence.
G0543 Real accumulator not stored Some target-specific implementations with software floating point emulation
require that when the floating point stack has been loaded, the same shall
be unloaded at the end of arithmetic sequence.
G0544 Long real data not supported The long real data type LREAL is not supported by the compiler.
G0769 Invalid operator The operator indicated is not allowed for the indicated operation.
G0770 Operation not implemented The operator indicated is not supported by the current target system.
G0772 Long real data not supported The long real data type LREAL is not supported by the compiler.
G0773 Long data not supported The long data type LINT is not supported by the compiler.
G0774 Negation of a non-boolean parameter The negation modifier 'N' cannot be used in operations with data types
different than boolean.
G0775 Operation not allowed on boolean The indicated operation cannot be performed on boolean operands (for
example the arithmetic operations).
G0776 Accumulator extension The variable destination of the store/assignment operation has a data type
bigger than the one of the accumulators. An extension operation has been
performed automatically by the compiler. To eliminate this advisory
304 9MA10256.03
Error code Short description Explanation
G0777 Accumulator undefined The operation is performed without a previously loaded value into the
accumulator.
G0778 Destination may be too small to store current The variable destination of the store/assignment operation has a data type
result smaller than the one of the accumulators. Data may be lost in the operation.
For example, if the accumulator contains 340 and the destination operand is
of SINT type, the assignment operation will lose data. If the operation is
under the programmer's control an appropriate type conversion function
(TO_SINT, TO_INT, TO_DINT and so on) can be used to eliminate the
advisory message.
G0779 Division by zero The indicated division operation has the constant value 0 as denominator.
G0780 Operation allowed on real parameters only The indicated operation cannot be executed on REAL data types.
Instructions of this kind are logical and bitwise operations.
G0781 Illegal comparison The indicated comparison operation is executed between non-
homogeneous data types.
G0782 Negation without condition The indicated operation (JMP or RET) has the negation modifier 'N' without
the conditional evaluation modifier 'C'. Use JMPCN instead of JMPN or
RETCN instead of RETN.
G0783 Boolean parameter required The IL operator indicated (typically 'S' or 'R') cannot be used when the
accumulator has a type other than BOOL.
G0784 Operand extension The data type of the operand has been extended to the data type of the
accumulator. Then the operation is executed. The operand extension take
place whenever the operand data type is smaller than the accumulator data
type.
G0785 Does not support float accumulator The accumulator has REAL data type and it is not allowed for the indicated
operation (typically MUX operation).
G0786 Does not support boolean accumulator The accumulator has boolean data type and is not allowed for the indicated
operation (for example MUX operator).
G0787 Comparison of unsigned type and signed type The compare operation indicated is performed using operators that have
signed and unsigned data type. Undesired or uncontrolled result may be
possible.
G0789 Conversion may result in loss or corruption of Error code not used.
data
G0790 Illegal negation of a real parameter Error code not used.
G0791 Writing a real value into an integer var / The parameter passed to the function is of REAL type instead of an integer
param data type as required by the function input variables definition.
G0792 Writing an integer value into a real var / The parameter passed to the function is of an integer data type instead of
param the REAL type as required by the function input variables definition.
G0793 Writing a signed value into an unsigned var / The assignment operation is performed on an unsigned data type variable
param but the accumulator data type has a signed data type. Undesired result may
be possible.
G0794 Writing an unsigned value into a signed var / The assignment operation is performed on an unsigned data type variable
param but the accumulator data type has a signed data type. Undesired result may
be possible.
G0795 Unbalanced parentheses The number of opened parentheses does not match with the number of the
closed parentheses in the indicated code block.
G0797 Invalid index The constant index value used in the indicated expression is too big for the
array dimension. See the array declaration string.
G0798 Using a boolean index to access an element The indicated array access is incorrect because the index variable used has
of array a boolean data type.
G0799 Return not allowed from programs The RET operator is not allowed in PROGRAM blocks.
G0800 Boolean accumulator required The indicated SEL operator requires that the accumulator has the boolean
data type.
G0801 Operators have mismatching type The selection performed by MUX and SEL operators shall be done between
elements that have homogeneous data types.
9MA10256.03 305
Error code Short description Explanation
G0802 Function block must be instantiated A function block cannot be invoked directly with a CAL instruction. It must be
instantiated before its use for example, must be a variable with data type
corresponding to the function block instead.
P2048 Cannot open parameters file The source file for parameters (with PPC extension) cannot be opened
because of is missing or is locked by the PC's file system.
P2049 Symbol table file not created The symbol allocation file (with SYM extension) cannot be written because
of disk write protection or insufficient disk space.
P2050 Cannot create parameters file The parameters file (with PAR extension) cannot be written because of disk
write protection or insufficient disk space.
P2051 Cannot create directory The directory for the new project cannot be created. The problem arises
when there is a disk write protection or when the new directory indicated for
the project is more than one level deep from an existing disk directory. The
compiler creates only one new directory level (the one with the name of the
project) starting from an existing directory.
P2052 Cannot open source project The source project indicated for creating the new project does not exist, is
incomplete, or is locked by the file system.
306 9MA10256.03
Error code Short description Explanation
P2053 Save project error The new project cannot be saved due to disk write protection, non-existing
destination directory, or file system lock.
P2054 Generic file error A non-specific error occurred during file operations.
P2055 Cannot copy file The indicated file cannot be copied because of missing source file, disk write
protection or destination file existing and protected.
P2056 Cannot save file The indicated file cannot be saved because of disk write protection or
destination file existing and protected.
P2057 Object already exist in project The indicated object (variable, function, function block, or program) is
contained in the last loaded library but there is already another object with
the same name in the current project.
P2058 Cannot open library file The indicated library file does not exits or cannot be opened due to file
system locking.
9MA10256.03 307
Error code Short description Explanation
S1287 Missing; -
308 9MA10256.03
Error code Short description Explanation
T8193 Communication timeout The communication with the target system was unsuccessful because there
is no answer from the system itself. More common causes of this problem
are incorrect cable connection, invalid target address in communication
settings, invalid settings of communication parameters (such as baud rate),
or inoperable target system.
T8195 Invalid code file The target system image file (with IMG extension) is invalid or corrupted. Try
to upload and create new version of the image file using the
"Communication Upload image file" menu option.
T8196 Invalid data block index The image file (with IMG extension) contains a data block that has an index
greater than the largest index supported by the target system. Try to upload
and create new version of the image file using the "Communication Upload
image file" menu option. If the Any numerical type problem persist, contact
the target system vendor.
T8198 Flash erase failure The target system was not able to complete the flash erasure procedure.
Contact the target system vendor for details.
T8199 Code write failure The target system was not able to complete the flash programming
procedure. Contact the target system vendor for details.
T8200 Communication device unavailable The compiler tried to communicate with the target system but the
communication channel is not available. If the problem persists and there
are other applications that communicate with the target system, deactivate
the communication on the other applications and try again.
T8202 Invalid database information address The address of the parameter's database memory area of the target system
is not correct or valid. Try to upload and create new version of the image file
using the "Communication Upload image file" menu option.
9MA10256.03 309
Display
What’s in This Part
The Display Tab .......................................................................................... 311
Managing Display Elements.......................................................................... 319
File for Target Description ............................................................................. 372
Functions and Function Blocks for HMI .......................................................... 377
310 9MA10256.03
The Display Tab
Display Layout
The following illustration presents the default Display window:
1 2 3
C:\My Project\My Project.plcprj
Free Studio Plus
Configuration Programming Display Commissioning
HMI Actions
Build Find in project Debug Resources HMI Output Target vars LocalParameters
Ready EDIT MODE .... NOT CONNECTED
4 5 6 7
Item Description
2 Editor window This window allows you to edit the content of the current selection in HMI Project window.
3 HMI Properties window Shows the properties and events of the selected object:
9MA10256.03 311
The Display Tab
Item Description
• Properties: the properties of the selected page or control are displayed in the form of
a table and can be modified in the right column.
• Events: the events of the currently selected object are displayed in the form of a table
and each event can be associated with local or variable procedures in the right
column.
• Doc: the description of the currently selected object is displayed in the form of a table
and it can be modified (or created if it does not exist) in the right column.
5 Output window This tool window shows the messages relating to the development of the project.
7 HMI Actions window This window shows in tabular form the actions associated with the buttons of the target
device (either according to the page currently displayed or according to the pages). Actions
can be changed in the right columns.
Set of Controls
Each page may contain an arbitrary number of defined graphic controls.
There are two classes of graphic controls:
• Static controls: drawing tools such as lines, rectangles, and figures.
• Dynamic controls: multi-layered objects, which enable data, image display,
and user interaction (strings, boxes, buttons, progress, custom controls,
charts, and trends).
Display is an open system allowing the implementation of custom controls which
may be included in the target device system.
312 9MA10256.03
The Display Tab
Multi-pages Structure
Display supports the definition of an arbitrary number of pages. Each page may
contain links to other pages so that the whole project takes a tree structure:
HMI Project
My Project
Properties
Pages
Alarms
AnalogInputs
AnalogOutputs
BiosCfg485
BiosCfgETH
Circuit1
Circuit2
ComprCir1
ComprCir2
Dayly_Consumptions
DefrostCir1
DefrostCir2
DigitalInputs
DigitalOutputs
FansCir1
FansCir2
Resources Management
The properties of the controls in the page are not statically defined in the project
code, but they can be managed separately as resources.
Resources include for example:
• Bitmaps, page 368
• Enumeratives, page 370
• Fonts, page 368
• Sets, page 370
• String table, page 369
HMI Project
My Project
Properties
Pages
Messages
Global variables
Global procedures
Resources [BaseLanguage]
Bitmaps
Enumeratives
Expressions
Font styles
Fonts
Image lists
Sets
String table
Display allows you to import bitmap files directly from the Windows-formatted file
(*.bmp, *.gif, *.emf, *.jpg, *.ico, and so on).
For more information about Resources, refer to Resources, page 368.
9MA10256.03 313
The Display Tab
Example of variables:
Example of procedures:
0001
0002 InsertedPassword := 0;
0003
0004 IF (PageAccessHandshake = PAGE_ACCESS_REQUESTED) THEN (* Calling page is requesting a permission access
0005 *) IF (PermLevelCurr >= PermLevelReq) THEN
0006 PageAccessHandshake := PAGE_ACCESS_GAINED; (* Permission gained *)
0007 END_IF;
0008 ELSE (* No permission request; user manually selected login page *)
0009 PageAccessHandshake := PAGE_ACCESS_DENIED;
0010 END_IF;
0011
0012 retUINT := Video_GetParam( 0, ADDR_PSW1, 0, ?AccessLevelPasswords[1], tyUINT);
0013 retUINT := Video_GetParam( 0, ADDR_PSW2, 0, ?AccessLevelPasswords[1], tyUINT);
0014 retUINT := Video_GetParam( 0, ADDR_PSW3, 0, ?AccessLevelPasswords[1], tyUINT);
0015
0016
0017
0018
0019
Run-time Functionalities
Overview of the run-time functionalities:
• Managing asynchronous messages: Display supports the issue of
asynchronous messages whatever their complexity. You can customize
management of issue messages by typing a ST procedure.
For more information about managing asynchronous messages, refer to
Asynchronous Messages, page 319.
• Multilingual support: Display allows you to modify strings, resources, and
enumerations language without recompiling nor reloading the application.
For more information about Multilingual support, refer to Language Selection,
page 330.
• Events management: Display applications are structured in events; you may
seize the available events and manage them through ST-coded procedures.
For more information about events management, Events, page 365.
Menu Bar
Overview
The menu bar of Display tab is composed of these menus:
• File, page 28
• Edit, page 27
314 9MA10256.03
The Display Tab
• View, page 33
• Project, page 30
• Page, page 29
• Variables, page 32
• Window, page 34
• Help, page 28
Toolbar
Introduction
The toolbar appears at the top of the FREE Studio Plus window to provide access
to frequently used functions.
For generalities of toolbars, refer to Toolbars description, page 34.
Icon Description
Grid
Zoom In
Zoom Out
Insert static
Reserved
Reserved
Insert line
Insert rectangle
Insert image
Insert animation
9MA10256.03 315
The Display Tab
Icon Description
Reserved
Reserved
Reserved
Align left
Align right
Align top
Align bottom
Space across
Space down
Send to back
Send to back
Bring to front
Bring to front
316 9MA10256.03
The Display Tab
Icon Description
New record
Remove record
Move up
Move down
Parameters management
Parameters management
Refresh parameters
Refresh parameters
Template management
Template management
New page
New event
New action
Simulation mode
Simulation mode
Generate RSM
Generate Doc.
9MA10256.03 317
The Display Tab
Icon Description
- Current profile
Configure profiles
318 9MA10256.03
Managing Display Elements
Managing Pages
Pages Overview
Navigating between Pages
Display manages the creation of pages for a specific application.
It is composed of several pages where you can arbitrarily arrange the controls.
You have to specify the start page, page 325 which is displayed at the start of the
target device. Other pages have at least a parent page from which they are
invoked and may have a child page to invoke. The invoking/invoked relations
implicitly give to the whole project a tree structure.
A child page may be invoked in two ways:
• Through an action associated to a key: associate an OpenPage action with a
physical key (if there is a keyboard) or with a virtual key (whose pressure is
an event raised by software).
• Through an action associated to a key: associate an OpenPage action with a
physical key (if there is a keyboard) or with a virtual key (whose pressure is
an event raised by software).
Pages
There are two main types of pages in Display:
• Child pages, page 320 (which are called Frame in FREE Studio Plus).
• Pop-up pages, page 322.
Asynchronous Messages
Asynchronous messages are similar to standard pages, except the following
features:
• They have an additional property, that is the identifier of the associated
message (Msg ID).
• They can not contain invocations to child pages.
• They have no defined parent page nor a tree structure, but they can be
invoked from any other standard page.
An asynchronous message can not be explicitly invoked. The system displays it
whatever the active page when it intercepts a message containing the
corresponding Msg ID. This message may be launched either by the firmware or
by a procedure through the Video_SendMessage function by using the following
syntax: Video_SendEvent (kWM_MSG, Msg ID).
When an asynchronous message is active, the controls of the Frameset (see
Frameset, page 331) are automatically disabled.
9MA10256.03 319
Managing Display Elements
Child Pages
Create a Child Page
Step Action
1 Right-click on the Pages item of the project tree and click Insert page:
HMI Project
My Project
Properties
Pages
Page1
Messa
Page properties...
Global
Global Frameset
Resources Insert page
Paste page
Import page...
Import page from template...
Import page from project...
Import var/procedures...
Export var/procedures...
2
The New page dialog box appears and you have to specify the name of the new page
and whether the page is a pop-up one or not.
New page
Pop-up
OK Cancel
NOTE: If you do not select the Pop-up check box when creating the new page, the
page is called “Child Page”. Its main feature is that it fits the whole area. So you
cannot define position and size of a child page because they are automatically set
depending on the area and on an eventual frame set.
320 9MA10256.03
Managing Display Elements
Step Action
3 Choose to create a child page and if you want to call it “Page2” for example: type the
name Page2 in the apposite field and press OK to confirm your choice.
HMI Project
My Project
Properties
Pages
Page1
Page2
Messages
Global variables
Global procedures
Resources [BaseLanguage]
4
Double-click the Page2 item to open the document with this page preview, which is
blank:
Page2*
9MA10256.03 321
Managing Display Elements
Pop-up Pages
Create a Pop-up Page
Step Action
3 Write the name of this page (for example Page3) in the dialog box which appears and
select the pop-up property.
New page
Pop-up
OK Cancel
HMI Project
My Project
Properties
Pages
Page1
Page2
Page3
Messages
Global variables
Global procedures
Resources [BaseLanguage]
Modal Property
When a pop-up page opens:
• If Modal property is set to Yes, the controls are inactive. It means that the
parent page objects are disabled.
• If Modal property is set to No, the controls are disabled. It means that the
parent page objects are enabled if they are completely visible.
322 9MA10256.03
Managing Display Elements
Page2
HMI Properties
Properties Events Doc All
CharDimX 6
CharDimY 8
Font EWP2_6x8
Background color
Text color
Title bar
Page border
Caption
Appearance Flat
9MA10256.03 323
Managing Display Elements
The different fonts available appear. Choose the one which suits you the best:
HMI Properties
Properties Events Doc All
CharDimX 6
CharDimY 8
Font EWP2_6x8
Background color EWP2_6x8
EWP2_8x16
Text color
Title bar No
Page border No
Caption
Appearance Flat
NOTE: EWP2_6x8 and EWP2_8x16 are the same font but with a different
size (the second font is larger).
EWP2_6x8
EWP2_8x16
Pages properties
Font EWP2_8x16
Text color
Back color
OK Annuler Aide
324 9MA10256.03
Managing Display Elements
Before the procedure described above After the procedure described above
Page2 Page2
Pages properties
Page1 Hierachical
Page2
Page3 Flat
Screen size
Widht: 128
Height: 64
OK Annuler Aide
You can also indicate the start page by right-clicking a page in the project tree and
clicking Set as start page.
9MA10256.03 325
Managing Display Elements
Pages
Page1
Page2
NOTE: The pop-up pages can not be set as starting page.
Rename Pages
To rename a page, right-click on the page to rename and click Rename command.
This allows you to modify the name of the page.
326 9MA10256.03
Managing Display Elements
NOTE: This operation modify only the name of the page, project references to
the renamed page are not automatically updated.
Messa Open
Global Rename
Global
Resources Copy page
Import var/procedures...
Export page...
Export page as template...
Export var/procedures...
Insert procedure...
Remove page
Page type
A library file with *.petx extension (new or already existing) is indicated. Template
is appended to the existing templates and a name for the library is requested. If
the template is already available in the library, a message asks you if you want to
rewrite the existing template or not.
Page is exported as template into the specified library with its element but without
any referenced variable.
Scripts and local variables are exported without modifications. References to
variables contained in the scripts are not modified.
Child pages, popup, and asynchronous messages can be treated as templates.
9MA10256.03 327
Managing Display Elements
Template list
Add
Remove
Re-Export
Edit
Remove all
Close
Template list
template Add
Remove
Re-Export
Edit
Remove all
Close
Template library has been included to the project. Then, click the Close button.
HMI Templates window shows a tab for each library imported in current project.
Each tab shows the list of templates of the corresponding library:
HMI Templates
Page1
template
NOTE: If HMI Templates window is not displayed, click View > Tool windows
> HMI Templates.
328 9MA10256.03
Managing Display Elements
Using a Template
Once a template library has been added, you can use its elements by dragging the
chosen one from the HMI Templates window and by dropping it on the project
tree in the HMI Project window.
Once the item has been dropped, application asks you to write the name of the
new page created (based on the template).
Commands
Edit
Import page into project
Delete page
Remove all
Close
Close
Parameters management
1 Frigo Modbus
Remove Device
Close
9MA10256.03 329
Managing Display Elements
Project Properties
Overview
Display manages the creation of pages for a specific application.
It is composed of several pages where you can arbitrarily arrange the controls.
You have to specify the start page which is displayed at the start of the target
device. Other pages have at least a parent page from which they are invoked and
may have a child page to invoke. The invoking/invoked relations implicitly give to
the whole project a tree structure.
Pages properties
General System options Language selection Global On Timer Resources
Screen size
Widht: 128
Height: 64
OK Annuler Aide
• General,
• System options,
• Language selection,
• Global On Timer,
• Resources.
General
It allows to select the start page among the implemented pages.
The Page model area allows you to select the type of page model in case of a
page calls another page. If the model is Hierarchical, then a child page can not
recall a parent page. If the model is Flat, all the pages can call the others without
limitations.
System Options
It allows you to customize the title bar features of the window: the font, the text
color and the background color.
Language Selection
Strings and enumerated data types are structured as to ease the multilingual
device. Moreover Display provides a function to export/import the above
330 9MA10256.03
Managing Display Elements
mentioned elements to/from a text file in order to simplify the translation from a
language to another.
ID Caption ID Caption
IDS_Title_InsPW INSERT PASSWORD IDS_Title_InsPW INSERER LE MOT DE PASSE
IDS_Title_Alarms ALARMS IDS_Title_Alarms ALARMES
IDS_ChilledTemp OUT IDS_ChilledTemp OUT
IDS_HotTemp INT IDS_HotTemp INT
IDS_OutdoorAlrTemp OAT IDS_OutdoorAlrTemp OAT
IDS_CurrentWaterSet SET IDS_CurrentWaterSet SET
IDS_Circuit1 C1 IDS_Circuit1 C1
IDS_LP LP IDS_LP LP
IDS_HP HP IDS_HP HP
IDS_CondTemp CnT IDS_CondTemp CnT
IDS_CondTempSet SET IDS_CondTempSet SET
IDS_CondOutTemp COT IDS_CondOutTemp COT
IDS_EvanTemp EvT IDS_EvanTemp EvT
String table (BaseLanguage) String table (BaseLanguage)
It allows you to add, remove, export, import, and select the resources languages
(for more information, refer to Strings Table, page 369 and Enumeratives, page
370). The label: sysLangID Value indicates the value which the sysLangID target
variables must take to display the pages in the selected language.
To add a language (for example Chinese), follow the procedure below:
Step Action
1 Export the language supported by the translator, select BaseLanguage (or any other valid
translation).
3 It opens a window requiring the destination folder for the selected language file.
4 At the end of the exportation, the file is composed of the resources of the project which
have to be translated: stings and enumeratives.
5 Translate the exported file and replace the text under the LANGUAGE tag with the one of
the new language (for example, in this case change it into “Chinese”).
6 Then, in the Language selection area, click Import ... button and select the translated file.
Frameset
Overview
Display allows you to define areas which are called frames and are placed on the
sides of the screen and are always active.
9MA10256.03 331
Managing Display Elements
My Project
ALARM HELP
You can set these dimensions of the frames and insert some controls which are
active whatever the currently loaded page. Consequently, frames are useful to
host the objects which have to appear in the whole project. In this way you do not
need to duplicate them in each page.
There are two exceptions:
• The pop-up pages, page 322 when the Modal property is set to Yes in HMI
Properties window.
• All the asynchronous messages, page 319.
When these pages are active, the controls of the frameset are automatically
disabled.
332 9MA10256.03
Managing Display Elements
Position index is used to indicate the order in which elements are shown in case of
more than one element in the same page.
A page contains one or more controls based on one (or more) set. At runtime, the
page is replied in order to show all the elements contained in the set. In the last
page, if any control can not be filled with element value, that control is hidden.
We created before a set of five elements named BIOSParameters, now we can
associate #BIOSParemeters(0) to the first edit box and #BIOSParemeters
(1) to the second. So there are three pages: first page with the first two elements
of the set, second page with elements 2 and 3 and third page showing the last
element of the set. In the last page, the second edit box is not visible.
Pages Numbering
Display defines two variables related to pages numbering:
• $PagIndex: current index of the page containing controls based on a set,
• $PagNumber: number of pages that complete the visualization of the whole
elements of the set.
These variables can be used in the page to show the numeration of the pages.
They can be used as variables associated to edit box controls in this way:
HMI Properties
Properties Events Doc All
Format %d
Alignment Right
Access RW
Selection order 2
Page of
Variable $PagNumber ..
Data type UINT
Low limit *
High limit *
Refresh TRUE
Visible TRUE
Selectable TRUE
Page1 Page2 Label
Automatic Documentation
Overview
During project development, it is usually necessary to write comments for each
page in order to explain how the page works.
Display integrates into its development environment the automatic documentation
feature. It consists in the generation of a graphical report with all the previously
inserted comments followed by the pages they refer to.
9MA10256.03 333
Managing Display Elements
Comments related to controls and pages should be inserted in the Doc tab of the
HMI Properties window.
HMI Properties
Properties Events Doc All
Description Write here how the page works ..
Description
OK Cancel
Insertion of Controls
Controls
Overview
A control is a display element (textual or graphical) contained in a HMI page. It can
be used to present information. Control content can be fix or can modifiable with
variables or parameters through HMI application. Display supports the following
controls:
• Static, page 335
• Edit Box, page 340
• Text Box, page 348
• Combo Box, page 337
• Graphic, page 335
• Image, page 337
• Animation, page 339
• Button, page 345
• Check Box, page 336
• Progress Bar, page 349
To insert a control on a page, you can do the following:
• In the HMI Page toolbar, click the icon of the control to be inserted. Then,
click at the place on the page where this control should be displayed.
• In the Page menu, click the icon of the control to inserted. Then, click at the
place on the page where this control should be displayed.
334 9MA10256.03
Managing Display Elements
• From the HMI Vars and Parameters window, drag and drop a variable or a
parameter into a page. The Insert object window appears and lets you
choose which control to use to display this variable or parameter.
Static
Static controls display a fixed string whose contents cannot be edited when
executing. You must specify the text of the string directly or by the association of
the ID of a string defined as resource to support multi-language management. For
project resources and multi-language support, refer to Resources, page 368.
To insert a static control, click Insert static icon in HMI Page toolbar. Then, click in
the editor window the point where you want to insert the control.
You can also drag a variable from the HMI Project window and drop it into the
editor window. In the Insert object window, select Static control and click OK
button.
For more information about properties and events of the static control, refer to
Static Properties, page 355.
Graphic
Overview
Graphic controls are objects which are drawn when you open the page. They do
not change until the page is active.
They display a static line or rectangle. Their properties cannot be edited when
executing.
Inserting a Line
To insert a line, click Insert line icon in HMI Page toolbar.
Then, move the mouse to the active area of the page. A + cross shows the
insertion point of the object. Click-left to insert the object in the grid.
The inserted line has a default size and horizontal alignment:
You can resize it by dragging one of the two ends of the line:
9MA10256.03 335
Managing Display Elements
You can edit the color and the thickness of the line in the HMI Properties window.
HMI Properties
Properties Events Doc All
XPos 42
YPos 16
X2Pos 84
Y2Pos 56
Name Line_1
Thickness points 5
Border color
page1*
Inserting a Rectangle
To insert a line, click Insert rectangle icon in HMI Page toolbar.
Then, move the mouse to the active area of the page. A + cross shows the
insertion point of the object. Click-left to insert the object in the grid.
The inserted rectangle has a default size:
You can customize the inserted rectangle by modifying its parameters in the HMI
Properties window.
For example, you can modify the thickness of the borders, the color of the borders
or the background or make the background transparent.
HMI Properties
Properties Events Doc All
XPos 48
YPos 16
XDim 32
YDim 32
Name Rect_1
Border points 5
Border color
Background color
Check Box
Check box control displays a check box that allows you to select a true or false
condition identified by a variable.
To insert a check box control, click Insert new combo box icon in HMI Page
toobar. Then, either click in the editor window the point where you want to insert
the control or drag a variable from the project tree or from the library window.
336 9MA10256.03
Managing Display Elements
You can also drag a variable from the HMI Project window and drop it into the
editor window. In the Insert object window, select Checkbox control and click
OK button.
Combo Box
Combo box control shows a list of strings connected to a variable with an
enumerator element.
To insert a combo box control, click Insert new combo box icon in HMI Page
toobar. Then, either click in the editor window the point where you want to insert
the control or drag a variable from the project tree or from the library window.
You can also drag a variable from the HMI Project window and drop it into the
editor window. In the Insert object window, select Combobox control and click
OK button.
Image
Overview
Image control displays a bitmap image.
Static images are different from:
• Animations, page 339: which are images which may change dynamically,
even though they have fixed position and dimensions.
• Floating images: which are images which move in the page.
9MA10256.03 337
Managing Display Elements
In the Import bitmap into project window, click Browse button. You can navigate
in the computer resources and select the desired image. In this case, the image
file is BulbOn.jpg, which represents a lighted bulb:
Import bitmap into project
In the Bmp Name field, you can assign the bitmap name which appears in the
Resources [BaseLanguage] tree structure. The default name is the file name
without extension and preceded by the Bmp prefix.
The Transparency color field allows you to specify a transparency color. This
color is not drawn but lets the elements appear through the bitmap background.
You can customize the transparency color by taking the desired one with the
mouse from the Converted bitmap box.
RGB indicates the transparency color components. If the values are n/a, it means
that no transparency color has been selected. The Reset Transp. button allows
you to cancel the last selected transparency color.
At last, you can confirm the operation by clicking the Import button. The imported
bitmap appears as a new item in the Resources [BaseLanguage] tree structure:
Resources [BaseLanguage]
Bitmaps
BmpBulbOn
Enumeratives
Expressions
Font styles
Fonts
Image lists
Sets
String table
338 9MA10256.03
Managing Display Elements
Animation
Overview
An animation control allows you to associate each variation in the value of a
variable with the display of a different image.
It displays a bitmap image which you select from a list of images depending on the
value of an associated selection variable.
Inserting an Animation
In order to create an animation, you must first create a list of images. This list of
images includes the images that the variable can display. Each image is
associated with a value or a range of values that the variable can take. To know
how to import an image, refer to Importing a Bitmap in the Project.
To create a list of images, right-click Image lists inResources [BaseLanguage]
item and click Add new command.
Then, right-click on the newly created list and click Rename command. Write the
name of your choice and press the Enter key.
Resources [BaseLanguage]
Bitmaps
Enumeratives
Expressions
Font styles
Fonts
Image lists
Folders
Sets
String table
To add images to the list, click the New Record icon in the HMI Project toolbar. A
line appears in the editor window and must be completed like this:
• Init value: indicate the start of range value,
• End Value: indicate the end of range value,
• Bitmap: select the image to display for the specified value range from the list.
Repeat the operation until the list is complete:
1 1 BmpSettings32x32
2 2 BmpMonitor32x32
3 3 BmpOnOff32x32
4 4 Bmplo32x32
5 5 BmpPassword32x32
Once the list of images is established, you have to create an animation. To do so,
select the desired page and click Insert new animation icon in HMI Page toolbar.
Then, move the mouse to the active area of the page. A + cross shows the
insertion point of the object. Click-left to insert the object in the grid.
You can also drag a variable from the HMI Project window and drop it into the
editor window. In the Insert object window, select Animation control and click
OK button.
9MA10256.03 339
Managing Display Elements
A new blank frame appears in the page. Select it and fill in the following
parameters in HMI Properties window as follows:
• Image list: indicate the list of images to use with the variable,
• Animation variable: indicate the animation variable,
• Data type: indicate the type of the variable (filled in automatically after
selecting the variable).
The creation of the animation is finished. If you want, you can also edit the other
parameters present in the HMI Properties window.
HMI Properties
Properties Events Doc All
XPos 48
YPos 16
XDim 32
YDim 32
Name Animation_1
Appearance Flat
Border points 1
Border color
Image list Folders
Animation variable uiNbFansCir1
Data type UINT
page1* Visible TRUE
Edit Box
Overview
An edit box control is a text frame which lets you display and edit an associated
variable or parameter.
It displays the contents of an associated variable.
340 9MA10256.03
Managing Display Elements
XPos 42
YPos 24
Name Edit_1
Appearance Flat
Font EWP2_6x8
Background color
Text color
Sel. background
Sel. foreground
Border points 1
Border color
Number of chars 3
Format %d
Alignment Center
Access RW
Selection order 1
Variable sysVER
Data type UINT
Low limit *
High limit *
Refresh TRUE
Visible TRUE
Selectable TRUE
Label
9MA10256.03 341
Managing Display Elements
Integer format
Integers (1-31) 1
Decimals (1-7) 1
Enumerative
OK Cancel
342 9MA10256.03
Managing Display Elements
Real format
Integers (1-31) 1
Decimals (1-7) 1
Password
Target metric
OK Cancel
String format
Password
OK Cancel
9MA10256.03 343
Managing Display Elements
Then, enter the name of the desired variable. If you do not know its name, click the
.. button to open the Property definition window.
Property definition
Variable Selection
@LocalParameters.Addr_CAN_OB @LocalParameter
@LocalParameters.Addr_CAN_PI @LocalParameter
@LocalParameters.Addr_RS232_PI @LocalParameter
@LocalParameters.Addr_RS485_OB @LocalParameter
@LocalParameters.Addr_RS485_OB1 @LocalParameter
@LocalParameters.Addr_RS485_PI @LocalParameter
@LocalParameters.AIL1 @LocalParameter
@LocalParameters.AIL10 @LocalParameter
@LocalParameters.AIL11 @LocalParameter
@LocalParameters.AIL12 @LocalParameter
@LocalParameters.AIL2 @LocalParameter
@LocalParameters.AIL3 @LocalParameter
@LocalParameters.AIL4 @LocalParameter
@LocalParameters.AIL5 @LocalParameter
@LocalParameters.AIL6 @LocalParameter
Filter:
Value selection
None
Variable
OK Cancel
The Property definition window allows you to find the desired variable.
You can use the Filter field to search for a variable according to its type:
• Page locals
• Global procedures
• Target (variables which allow the interaction between user interface and
system)
• PLC application
• Parameters (for more information about how to name a parameter, refer to
Edit Box to a Parameter, page 344)
• PLC libraries
Once found, select the desired variable and click OK.
Now the edit box control shows the value of the selected variable constantly
refreshed.
344 9MA10256.03
Managing Display Elements
Button
Overview
Buttons are controls which allow you to interact with the system, particularly in
case of touchscreen systems without keyboard.
There are four kinds of button control:
• LED button: to view an associated state of a boolean variable.
• Status button: to modify the state of a boolean variable.
• Opening button: to open an other page.
• Activation button: to start the execution of a customized procedure.
Inserting a Button
To insert a new button, click Insert new button icon in HMI Page toolbar.
Then, move the mouse to the active area of the page. A + cross shows the
insertion point of the object. Click-left to insert the object in the grid.
You can also drag a variable from the HMI Project window and drop it into the
editor window. In the Insert object window, select Button control and click OK
button.
A new button control appears. It has a default size. You can change the
dimensions of the button by dragging one side with the mouse.
9MA10256.03 345
Managing Display Elements
HMI Properties
Properties Events Doc All
Selection text/img
Font EWP2_6x8
Appearance Flat
Border points 1
Border color
Background color
Selection border
Sel. background
Selection order 1
Visible TRUE
Then, you must associate the LED button with a boolean variable through the
Variable field. This property defines the state of the button and can be associated
with:
• A constant value:
◦ FALSE: the control is always inactive.
◦ TRUE: the control is always selected.
• A boolean variable whose value defines dynamically the selection state.
To declare a boolean variable and associate it with the button control, write its
name in Variable field or select it through the button.
HMI Properties
Properties Events Doc All
Press YDim 33
Name Button_1
Text/img Press
Selection text/img
Font EWP2_6x8
Appearance Flat
Page2*
Then, you must associate the status button with a boolean variable through the
Press variable field. In this case, the value of the boolean variable corresponds to
the pressure state of the status button.
346 9MA10256.03
Managing Display Elements
This allows you for example to display the LED button in green at runtime and to
display it in red as soon as you press the Press button (and therefore as soon as
you modify the value of the boolean variable).
HMI Properties
Properties Events Doc All
Page2*
In the New procedure window, write the name of the procedure and click OK
button.
9MA10256.03 347
Managing Display Elements
New procedure
prclncrem I Cancel
Double-click the local variable which has been declared and appears under Local
procedures item. The ST language editor opens and lets you either implement or
edit the selected code of the procedure.
Write a procedure that applies a unit increment to the “n” variable. Then, close the
document.
0001 n := n + 1;
prclncrem - [Page1]*
Insert a new button control (which corresponds to the activation button) beside the
edit box associated with the “n” variable and write the character “+” in the Text
property.
0 +
Take the example of the execution of the prcIncrem procedure by clicking the +
button. In HMI Properties window, select Call action in the Action field. Then,
write the name of the procedure in the Action par field.
Every time you press the + button when executing the HMI, n increases by one
and the edit box shows the up-to-date value.
Text Box
Overview
Text boxes are not part of static controls because they have some properties
which let them modify themselves in a page through time. Visibility, selection, and
refresh may be assigned to variables, which may modify their value at any time.
Text box displays the contents of an associated string variable. It supports the
formatting on several lines of the text which is contained in the string.
348 9MA10256.03
Managing Display Elements
Then, move the mouse to the active area of the page. A + cross shows the
insertion point of the object. Click-left to insert the object in the grid.
You can also drag a variable from the HMI Project window and drop it into the
editor window. In the Insert object window, select Textbox control and click OK
button.
A new text string control appears. It has a default text which can me modified
through the HMI Properties window by editing the Text field.
str
This is the basic use of a text string. You can also assign text strings by taking
them from the resources (refer to Stings Table, page 368).
Progress Bar
Overview
A progress bar control allows you to display the variations in the value of a
variable in the form of a progress bar.
It represents the progress of an operation by showing a stained bar in a horizontal
or vertical rectangle. The length of the bar shows the percentage of the completed
operation.
The orientation as well as the parameters of the progress bar can be modified
through the HMI Page window.
You must associate a variable with the progress bar. To do so, select the desired
variable in the Progress variable field of the HMI Properties window. The Data
type field is automatically updated.
Then, define the minimum value that the variable can reach in the Low limit field
and the maximum value that the variable can reach in the High limit field. When
9MA10256.03 349
Managing Display Elements
the value of the variable is at the minimum, the progress bar is empty. When the
value of the variable has reached its maximum, the progress bar is full.
Visibility Property
Most controls have the Visibility property, which determines whether the object is
visible or not.
This property can be associated either with:
• A constant value:
◦ TRUE: the field is always displayed,
◦ FALSE: the field is always hidden.
• A boolean variable: whose value dynamically establishes the visibility state.
It is possible to condition the visibility of a variable. For example, in case you want
to display a variable when its value is even and hide it when its value is odd.
For the purposes of the demonstration, take the detailed case in Inserting a Button
to Launch a Procedure, page 345. Suppose that you want to display the text string
when the value of the variable n is even and hide it when this value is odd.
For this purpose, it is necessary to declare a new boolean local variable which
indicates whether currently n is even.
0001 n := n + 1
0002
0003 even := (n MOD 2) = 0;
0004
0005
In order to associate the visibility of the string state with the even boolean
variable, select the text string and click button in the Visibility property of HMI
Properties window.
350 9MA10256.03
Managing Display Elements
In the Value selectionarea, click Variable and select Page locals in the Filter list.
Then, click the local boolean variable even.
Property definition
Variable Selection
even
Filter:
Value selection
Variable
Expression
True
False
OK Cancel
Click OK button. The text string is only visible when the variable n is even.
Refresh Property
When available, the Refresh property determines if the associated object has to
be drawn once (when opening the page or coming back from a child page) or if it
needs to be constantly refreshed.
For example, this property distinguishes the edit box and the text box.
With regard to the edit box, the refresh property has to be set when compiling and
it can not be edited at runtime. If you assign Refresh = TRUE, the associated
value of the variable value is constantly read and refreshed. Otherwise (Refresh =
FALSE), the value is read and refreshed only when you open the page or when
you come back from a child page.
There is another option about text boxes: you can associate a boolean variable
that is used as trigger for refresh. When the trigger variable becomes TRUE, the
contents of the controls are refreshed. Then, it is automatically reset by Display to
FALSE.
9MA10256.03 351
Managing Display Elements
The univoque ID associated to • You can use PLC Result type of all expressions
the expressions, you can not variables, target should be always BOOL.
use special characters. This is variables, global
the ID that would be indicated variables. You can use
in the page controls visibility/ simple variables,
selectable field. elements of array or
structure field.
• Define your expression in
ST code, do not enter “=”
at the beginning or “;” at
the end of the
expression.
Expression code should be
something like this:
• TRUE
• sysTimer > 10000
• sysAlarm = TRUE
• (COND[0] OR COND[1])
AND S.RUN
You can use expressions to set the visibility property of static, edit box, image,
animation, button, check box, and progress bar controls.
You can use expressions to set the Selectable property of a static, edit box, and
check box controls.
In HMI Properties window, click Visible or Selectable field of the control. Then,
open the Property definition window by clicking button. In Value selection
area, select Expression box and the list of the defined expressions appears.
From the Expression Selection area, double-click the defined expression you
want to associate to the control. Property field assume the value: EXPR:
yourExpressionID.
You can also use expression for visibility and selectable properties of a set. From
a set definition grid, click the set item you want to modify. Then, in the Visible
field, click the button and apply the method previously described.
The defined expressions are evaluated:
• After the execution of the GlobalOnTimer page event (if specified),
• Before the execution of the OnTimer page event (if specified),
• Before the refresh of the controls of the page.
Font Name found in Resources Default font used when inserting new objects in page.
Background Color ... Background color selectable from palette. In addition this color
is also set when inserting new objects in the frame.
352 9MA10256.03
Managing Display Elements
Text Color ... Foreground color selectable from palette. This color is set
when inserting new objects in the frame.
Title bar Yes, No Title bar, settings can be found in System options dialog:
• Yes: page has title,
• No: page has not title.
Caption Text otherwise Resource ID Text on title bar or Resource ID. This property is not sensible if
Title Bar field is set to No.
System menu Yes, No If Yes denotes that there is a button with ‘X’ image on it and
the behaviour is similar to Windows Dialog:
• Yes: page has close button,
• No: page has not close button.
Child Page
Properties
Font Name found inResources Default font used when inserting new objects in page.
Background Color … Background color selectable from palette. In addition this color
is also set when inserting new objects in the frame.
Text Color … Foreground color selectable from palette. This color is set
when inserting new objects in the frame.
Title bar Yes, No Title bar, settings can be found in System options dialog:
• Yes: page has title,
• No: page has not title.
Caption Text otherwise Resource ID Text on title bar or Resource ID. This property is not sensible if
Title Bar field is set to No.
System menu Yes, No If Yes denotes that there is a button with ‘X’ image on it and
the behavior is similar to Windows Dialog:
• Yes: page has close button,
• No: page has not close button.
Events
Events Description
OnLoad On loading this page, i.e. when calling from parent page.
OnUnload On closing this page, when the page returns and the parent page is restored.
OnDeactivate On calling a child page and the current page is no more active. This event does not exist in main page.
9MA10256.03 353
Managing Display Elements
Events Description
OnActivate When the previous opened child page is closed. This event does not appear in leaf page, that is, in the
pages which do not call child pages.
OnDraw When the page starts drawing all the objects. The page has just drawn border, background, and title.
OnTimer Asynchronous event. You can link a procedure which is executed cyclically.
Pop-Up Page
Properties
Font Name found in Resources Default font used when inserting new objects in page.
Background Color ... Background color selectable from palette. In addition this color
is also set when inserting new objects in the frame.
Text Color ... Foreground color selectable from palette. This color is set
when inserting new objects in the frame.
Title bar Yes, No Title bar, the settings can be found in System options dialog:
• Yes: page has title,
• No: page has not title.
Caption Text otherwise Resource ID Text on title bar or Resource ID. This property is not sensible if
the Title Bar field is set to No.
System menu Yes, No If Yes denotes that there is a button with X image on it and the
behaviour is similar to Windows Dialog:
• Yes: page has close button;
• No: page has not close button.
Events
Events Description
OnLoad On loading this page, i.e. when calling from parent page.
OnUnload On closing this page, when the page returns and the parent page is restored.
OnDeactivate On calling a child page and the current page is no more active. This event does not exist in main page.
OnActivate When the previous opened child page is closed. This event does not appear in leaf page, that is, in the
pages which do not call child pages.
OnDraw When the page starts drawing all the objects. The page has just drawn border, background, and title.
OnTimer Asynchronous event. You can link a procedure which is executed cyclically.
354 9MA10256.03
Managing Display Elements
Static
Properties
Font Name found in Resources Font used for drawing the text in object.
Sel. Background ... Background color selectable from palette when the object is
chosen. This property is not available if the Select field is
constant FALSE.
Sel. Foreground ... Text color selectable from palette when the object is chosen.
This property is not available if the Select field is constant
FALSE.
Appearance Flat, Raised, Sunken • Flat
• Raised
• Sunken
Border points ≥0 Border thickness (#pixel). This property is available only if
Appearance is set to Flat.
Border color ... Border color selectable from palette. This property is available
only if Appearance is set to Flat.
Number of Chars ≥0 Number of chars that this object can show. If the value is 0 the
object shows the complete text. Otherwise with another value
it can be truncated or extended.
Alignment Right, Center, Left Text alignment in the object.
Select TRUE, FALSE, var_name Selected status of the object. It can be constant (TRUE or
FALSE) or linked with a boolean variable var_name: if var_
name is TRUE the object is selected and so it shows the
colors Select Back, Select Fore.
Visible TRUE, FALSE, var_name Visible status of the object. It can be constant (TRUE or
FALSE) or linked with a boolean variable var_name: if var_
name is TRUE the object is visible, otherwise it is hidden.
Events
Events Description
9MA10256.03 355
Managing Display Elements
Line
Properties
Rectangle
Properties
Background Color ... Background color selectable from palette. This property is
available only if Transparent is set to TRUE.
Edit Box
Properties
Appearance Flat, Raised, Sunken • Flat: plain with use of Border pts and Border col,
• Raised
• Sunken
Font Name found in Resources Font used for drawing the text in object.
Sel. Background ... Background color selectable from palette when the object is
chosen. This property is not available if the Selectable field is
constant FALSE.
356 9MA10256.03
Managing Display Elements
Sel. Foreground ... Text color selectable from palette when the object is chosen.
This property is not available if the Selectable field is constant
FALSE.
Border points ≥0 Border thickness (#pixel). This property is available only if
Appearance is set to Flat.
Border color ... Border color selectable from palette. This property is available
only if Appearance is set to Flat.
Number of Chars >0 Chars visible in the object. Width of entire object is calculated
among this value and the size of Font. If NumChar are less
than the value, the object shows this error string: #####.
Format String as printf or enum_name The format can be numeric, to define as printf of C language
(refer to Format Specification - Printf, page 358), numerative, if
in this field there is enum_name defined in Resources (refer
to Resources, page 368).
Variable Not empty Name of the variable that can be shown and edited with this
object. It can be any variable of the project, (local, global,
imported from PLC or target - refer to Edit Box and Display
Variable Association, page 343), a parameter (refer toEdit Box
and Display Variable Association, page 343) or an element of
a set (refer to Multiple Pages Management, page 332).
Data type UNDEF, BOOL, SINT, USINT, BYTE, Type of Assoc var. If it is a variable, the type is defined
INT, UINT, WORD, DINT, UDINT, automatically. This property is available if Assoc var is an
DWORD, REAL, STRING explicit parameter.
Low limit CONSTANT, var_name Name of variable or numeric constant. This is the least number
that the object can show. It can be any variable of the project,
(local, global, imported from PLC or target - refer to Edit Box
and Display Variable Association, page 343). This object
shows an error string (!!!!!!!) if condition does not holds. The *
symbol means that there is no low limit.
High limit CONSTANT, var_name Name of the variable or numeric constant. This is the
maximum number that the object can show. It can be any
variable of the project, (local, global, imported from PLC or
target - refer to Edit Box and Display Variable Association,
page 343). This object views an error string (!!!!!!!) if condition
does not hold. The * symbol means that there is no high limit.
Refresh TRUE, FALSE Enables continuous update of the value:FALSE: the Assoc
var value is read from memory and updated only when open
page or when a child page is closed,TRUE: the Assoc var
value is read from memory and always updated.
Visible TRUE, FALSE, var_name Visible status of the object. It can be constant (TRUE or
FALSE) or linked with a boolean variable var_name: if var_
name is TRUE the object is visible, otherwise hidden.
Selectable TRUE, FALSE, var_name Selected status of the object. It can be constant (TRUE or
FALSE) or linked with a boolean variable var_name: if var_
name is TRUE the object is selected and so it shows the
colors Select Back, Select Fore. If this field is FALSE the
Access property is not available.
Events
Events Description
9MA10256.03 357
Managing Display Elements
Events Description
OnEnter Whenever the object is selected and receives the command for entering in edit-mode.
OnClick Whenever HMI receives a pressure on the object, valid only for touchscreen systems.
OnChange Whenever you confirm the modifications and the value is different from start.
flags • + prints always the sign, even if This char is an option for chars order, print sign, number of
the number is positive. decimal digit. This field may have more than one flag.
• 0 prints zeros in head until width
(if specified) or NumChar.
width > 0, ≤NumChar Maximum chars can be printed. Allows to view values that do
not fill NumChar fully.
precision ≥0 Decimal digits after the point. If the field is an integer and there
is a precision the object shows a decimal point. E.g. the value
is 102 integer, and precision is 2, with %.2d, the number is
shown as 1.02
type • %d: Integer with sign. Mandatory field.
• %f: Real.
• %x: Hexadecimal with lowercase
chars.
• %x: Hexadecimal with uppercase
chars.
• %s: String.
• %@sdf: Password.
• [%d,u,f,x]: Custom measure unit
format.
Image
Properties
YPos const ≥0, variable Top-left ‘y coordinate’ edge relative to page. It is possible to
assign a variable only if Style is set to Floating.
Appearence Flat, Raised, Sunken • Flat: plain with use of Border pts and Border col,
• Raised,
• Sunken.
358 9MA10256.03
Managing Display Elements
Border color ... Border color selectable from palette. This property is available
only if Appearance is set to Flat.
Bitmap Name found in Resources Bitmap used for drawing the image in object.
Background image Image object in the page Name of another object that is redrawn when Style is set to
Floating. It is available only if it is overlapped with this image.
Visible TRUE, FALSE, var_name Visible status of the object. It can be constant (TRUE or
FALSE) or linked with a boolean variable var_name: if var_
name is TRUE the object is visible, otherwise it is hidden.
Animation
Properties
Appearance Flat, Raised, Sunken • Flat: plain with use of Border pts and Border col,
• Raised,
• Sunken.
Border points ≥0 Border thickness (#pixel). This property is available only if
Appearance is set to Flat.
Border color ... Border color selectable from palette. This property is available
only if Appearance is set to Flat.
Image list Name found in Resources It contains the images that the object can view and the value
range.
Animation variable var_name Name of the variable that is compared with value range in
Image list.
Data type SINT, USINT, BYTE, INT, UINT, WORD, Type of Animation var. If it is a variable, the type is
DINT, UDINT, DWORD automatically defined.
Visible TRUE, FALSE, var_name Visible status of the object. It can be constant (TRUE or
FALSE) or linked with a boolean variable var_name: if var_
name is TRUE the object is visible, otherwise hidden.
Events
Events Description
9MA10256.03 359
Managing Display Elements
Button
Properties
Text/Img Empty or explicit text or Resource ID or Text or image to view in the button:
Bitmap • string,
• Resource ID,
• bitmap.
Selection Text/Img Empty or explicit text or Resource ID or Text or image to view in the button when it is selected:
Bitmap • string,
• Resource ID,
• bitmap.
Font Name found in Resources Font used for drawing the text in object. This field is not
available if it shows a bitmap.
Appearance Flat, Raised, Sunken • Flat: plain with use of Border pts and Border col,
• Raised,
• Sunken.
Border points ≥0 Border thickness (#pixel). This property is available only if
Appearance is set to Flat.
Border color ... Border color selectable from palette. This property is available
only if Appearance is set to Flat or Text is not empty.
Background color ... Background color selectable from palette. This property is
available only if Transparent is set to TRUE.
Selection border ... Border color when the object is selected. This property is not
available if Selection var is FALSE fixed.
Sel. background ... Background color when the object is selected. This property is
not available if Selection var is FALSE fixed.
Selection order ≥0 Selection order on which the object can be selected with the
pressure of a key or with a procedure. In this case the
selection moves from the current object to the previous or next
Sel. Order object.
Visible TRUE, FALSE, var_name Visible status of the object. It can be constant (TRUE or
FALSE) or linked with a boolean variable var_name: if var_
name is TRUE the object is visible, otherwise it is hidden.
Transparent TRUE, FALSE, var_name Transparency. It can be constant (TRUE or FALSE) or linked
with a boolean variable var_name: if var_name is TRUE the
object is transparent.
Press variable Empty or var_name When the button is pressed var_name is set to TRUE. When
the button is not pressed, var_name is set to FALSE.
Selection variable TRUE, FALSE, var_name Selected status of the object. It can be constant (TRUE or
FALSE) or linked with a boolean variable var_name. If var_
name is TRUE the object is selected and so it shows the
colors Select Back, SelectBord. If this field is FALSE,
SelectBordand Select Back properties are not available.
Action par page_name proc_name Parameter associated with the action executed on button
pressure. It is available only if Action is OpenPage (Action
par = name of the page to open) or Call (Action par = name
of the procedure to execute).
360 9MA10256.03
Managing Display Elements
Events
Events Description
OnClick Whenever HMI receives a pressure on the object, valid only for touchscreen systems.
OnRelease Whenever HMI releases the pressure on the object, valid only for touchscreen systems.
Progress Bar
Properties
Appearance Flat, Raised, Sunken • Flat: plain with use of Border pts and Border col,
• Raised,
• Sunken.
Border points ≥0 Border thickness (#pixel). This property is available only if
Appearance is set to Flat.
Border color ... Border color selectable from palette. This property is available
only if Appearance is set to Flat or Text is not empty.
Visible TRUE, FALSE, var_name Visible status of the object. It can be constant (TRUE or
FALSE) or linked with a boolean variable var_name: if var_
name is TRUE the object is visible, otherwise it is hidden.
Progress variable Not empty Step variable. This is the filling percentage of bar in relation
with the range assigned by Lo limit and Hi limit. It can be any
string variable of the project (local, global, imported from PLC
or target) or a parameter (Edit Box and Display Variable
Association, page 343).
Data type UNDEF, BOOL, SINT, USINT, BYTE, Type of Progress var. If it is a variable, the type is
INT, UINT, WORD, DINT, UDINT, automatically defined. This property is available if Progress
DWORD, LWORD, REAL, LREAL, var is an explicit parameter.
STRING
Low limit Constant or var_name Name of the variable or numeric constant. This is the least
value for step bar. It can be any variable of the project, (local,
global, imported from PLC or target) with type specified by
Data type.
High limit Constant or var_name Name of the variable or numeric constant. This is the
maximum value for step bar. It can be any variable of the
project, (local, global, imported from PLC or target) with type
specified by Data type.
9MA10256.03 361
Managing Display Elements
Events
Events Description
Declaration of Variables
Types of Variables
Overview
In a Display project, there are four different classes of variables.
Local Variables
Local variables are accessible via the page from which they were declared.
They are listed in the project tree, under the Local variables folder. Local
variables can be used to carry out operations on PLC (for example to apply a
different scale or to add an offset) or system variables, or to implement local
procedures.
Global Variables
Global variables are declared in Display and they are accessible from every page
of the project. Global variables are listed in the Global variables folder in the
project tree. The function of the global variables is similar to the one of the local
variable but the different visibility scope makes them unusable for the
implementation of global procedures or for the parameters passing between
distinct pages.
System Variables
The interaction between Display and target is enabled by system variables which
the software publishes outside in a *.tgt file.
You may access system variables in read/write or in read-only mode. If you try to
access a read-only variable in write mode, an error occurs during compilation.
Data Management
Overview
It is possible to distinguish the data in local variables (visible in the page scope
only) and global variables (visible from every page). For some controls it is
possible to use parameters and sets.
362 9MA10256.03
Managing Display Elements
In the pages tree, under the Init page item, double-click the Local variables item.
The local variables editor window opens. It is blank at present.
Click New record icon in the HMI Project toolbar.
A dialog window opens requesting to specify the basic features of the new
variable. For example, you can declare “n” as a new 16 bit unsigned integer
variable.
Variable
Name nI
Array
Attribute ...
OK
Parameters management
Remove Device
Close
9MA10256.03 363
Managing Display Elements
Through the Add Device button you can add a new object linked to the target on
the fieldbus.
The selection window appears. Then you have to take from your PC a *.parx file
(for more information, refer to Description of Parameter File, page 364).
A device called ”Frigo” has been inserted. In order to see the relevant parameters,
click the Close button.
Parameters management
1 Frigo Modbus
Remove Device
Close
In HMI Vars and Parameters window, you can see the device and its parameters.
When you need to update the list of parameters, if the *.parx file has not been
moved to another directory, it is not necessary to repeat the above mentioned
procedure, but it is enough to press the button.
364 9MA10256.03
Managing Display Elements
9MA10256.03 365
Managing Display Elements
all available events for each Display object (page or control) is reported in Page
and Object Properties, page 352.
366 9MA10256.03
Managing Display Elements
Here follow the description of the syntax to get the properties of a control from a
procedure; similarly to C language printf it is:
“fb%s%s.%s”, page_name, ctrl_name, prop_name
Where:
• page_name is the name of the page that has the control,
• ctrl_name is the name of the control,
• prop_name is the name of the property of the control.
So if you want to get the property Foreground color of the Static named
String_26 in Main page, we have to write:fbMainString_26.foreCol.
NOTE: The name of the property to use in the scripts of the procedures is the
name of the functional block exported by the software of the target, not the
name in the properties window, page 311.
HMI Actions
9MA10256.03 367
Managing Display Elements
• Local actions: local associations, valid only for the page currently open in the
editor of the pages.
• Global actions: global associations, valid in any point of the project.
If the system has the touchscreen feature, normal interaction with you is made by
the pressure of sensible area on the screen. However this table does not loss its
meaning because allows you to define virtual keys and to control their pressure by
software causing in this way the dynamic execution of specific actions.
NOTE: If the same action is defined both at local and at global level, system
does not give errors nor warnings because local declaration precedes global
one.
Resources
Overview
A resource is an interface element. You can get informations from resources or
can use them to do actions.
Display supports different categories of resources that are managed by
Resources item in HMI Project window, page 311.
Fonts
Fonts are the different kinds of characters supported for the output of text strings
on the screen. Fonts had been managed by FREE Studio Plus old versions as text
files with *.plf extension and structured with the same syntax of the initialization
definition of an array variable in IEC. Now, images are saved and loaded in binary
format to optimize loading time on images of big size.
At project opening time, if FREE Studio Plus finds this declaration, it searches in
project folder for a file named “font_name.plk” and loads it in memory.
Bitmaps
Bitmaps are pictures to associate to image controls, page 337. The images are
saved and loaded in binary format to optimize loading time on images of big size.
At project opening time, if Display finds this declaration, it searches in project
folder for a file named “bitmap_name.plk” and loads it in memory.
368 9MA10256.03
Managing Display Elements
Bmp Name
R: n/a G: n/a B: n/a Cancel
Click Browse button to navigate in computer resources and select the desired
source file.
In Bmp Name field, you can personalize bitmap name that is shown on resource
tree. Bitmap name is constituted by file name without extension and with “Bmp”
prefix by default.
Transparency color field allows you to specify transparency color. So a color that
is not really drawn on the screen but a transparent color zone that does not cover
elements previously drawn.
Transparency color can be personalized by choosing it by mouse from Converted
bitmap window.
RGB indicates transparency color Red, Green, Blue components. n/a value
indicates that no transparency color has been selected.
Reset Transp. button allows you to undo last selected transparency color.
Once finished these operations it is possible to confirm bitmap importation by
clicking Import button.
Strings Table
It is possible to explicitly write the text to show on a text string or on a title of the
page. It is also possible to refer to one of the strings of the resources specifying its
ID. For more information, refer to Language Selection, page 330.
In first case, text is always the same. In second case, the text that correspond to
the active language is shown.
So, English language string table contains the following record.
IDS_State State
IDS_State Etat
If you refer to the identifier ID_GDB_RXNAK from a page control or from a page:
• If current active language is English, “Bad RX packets” is shown.
• If current active language is French, “Paquets RX défectueux” is shown
instead.
9MA10256.03 369
Managing Display Elements
Enumeratives
An enumerative is a data type defined by you, it is a set of constants that you
named. Each element of an enumerative is treated as a constant and can be
translated in the available languages of the project.
For example: create an enumerative called “SettingsTouch”.
Enumerative records are shown by double-clicking SettingsTouch node.
Then, introduce an edit box control, page 340 and insert the name of the
enumerative “SettingsTouch” in its Formatproperty in HMI Properties window.
Control shows the string associated to the value as it is in the table above, not the
numeric value of the variable associated to the control.
If the numeric value of the variable does not match with any record of the
enumerative table, an error string ######## is shown instead.
Even enumerative are supported by multi-language feature. It is possible to
personalize the name and the record values of the enumerative.
Value Description
0 Awaiting settings ...
1 Saving settings ...
2 Touch screen set up
Image Lists
An images list is very similar to an enumerative but with the following differences:
• Intervals of constants are supported (not only simple values),
• Each value has an image associated,
• A list of images determines the content shown by an animation control, while
an enumerative can be associated to an edit box.
For example: if you have an images list “ListBulbs” that is shown under
Resources.
It is possible to see all the records of the list by double-clicking the node.
HMI Project Init value End Value Bitmap
Enumeratives 1 1 BmpBulbOn
Expressions 2 2 BmpBulbOn2
Font styles
3 3 BmpBulbOn3
Fonts
Image lists
ListBulbs
Sets
String table
Introduce an animation control, page 339 in the page, and select “ListBulbs” in
Image list property in HMI Properties window. The control shows the image
whose specified interval includes the value of a variable associated to the control.
If the numeric value of the associated variable does not match any record in the
list, a default image (with init and end value set to *) is shown if it is. If no default
image is specified, no image is drawn.
Sets
Sets are ensemble of global variable even of distinct type.
In particular there are two types of set:
• Variable/parameter sets even of not equal type (VARIANT),
370 9MA10256.03
Managing Display Elements
9MA10256.03 371
File for Target Description
Target Properties
Description
This section consist of five records, which support one or more parameters. Each
record is on new line and the elements must be separated with spaces or tabs.
Record Structure
Header Param. 1 Param. Description
2
SCREEN dimX dimY Screen dimension of target measured in pixel:
• DimX: width,
• DimY: height.
JOYPAD 0/1 — Target board has a joypad that can be used for
moving among elements of page and can be
connected to actions.
INIT 0/1 — If set to 1 says that HMI run-time has Video_
InitHMI(), invoked on target start-up.
Typically it is used for custom commands on
start-up.
Object Version
The graphical objects (edit box, text box, static, bitmap, and so on) can have a
version, or can not exist. The syntax is:
CTRL “Name” “Version”
Where:
372 9MA10256.03
File for Target Description
System Enumeratives
Enumeratives of *.def file are maps for binding among numeric values and strings,
or other numeric values.
Each enumerative has an identifier, that specifies a function in the map with this
syntax:
ENUM id en_key en_val
Where:
• id: enumerative identifier,
• en_key: value-key of record (must be a number),
• en_val: value of value-key (can be a number or string).
Descriptions
This paragraph describes the values for system enumeratives.
• Enumerative 100
With this key you can define new buttons (the names are shown in the Key
field of actions table in HMI Actions window (refer toActions that Can Be
Associated to Key Pressure, page 367).
The number of lines is not limited. But you must define at least the elements of
102 enumerative.
• id: 100,
• en_key: key encoding (one byte),
• en_val: string with key name.
• Enumerative 101
With this key you can define new actions (the names are shown in Action
field of actions table in HMI Actions window (refer toActions that Can Be
Associated to Key Pressure, page 367.
• id: 101,
• en_key: action identifier,
• en_val: string with action name.
This enumerative has a well defined number of lines. The following table presents
the corresponding actions:
en_key Action
9MA10256.03 373
File for Target Description
en_key Action
• Enumerative 103
Define a color palette, the encoding is RGB:
• id: 103,
• en_key: index of the color inside palette,
• en_val: RGB color encoding.
RGB encoding represents 24 bit of colors: 0x00bbggrr where bb (1 byte)
intensity of blue, gg (1 byte) the green and rr (1 byte) the red. The intensity is at
least 0 and at most 0xff.
The number of lines is not limited. You can define which colors he wants.
• Enumerative 104
Names of object styles (shown on Appearance in HMI Properties window):
• id: 104,
• en_key: style,
• en_val: string with the name of style.
This enumerative contains at most 3 records, supported by Display.
en_key Style
0 Flat, plane.
1 Raised.
2 Sunken.
Example
;
;Target properties
;
SCREEN 128 64
SAVESCREEN 1
374 9MA10256.03
File for Target Description
REFRESH 50
FONT_FORMAT "VH"
JOYPAD 1
INIT 1
BMPFULL 1
UNICODE 1
;
;Versions of controls
;
CTRL "Static" 1
CTRL "EditBox" 1
CTRL "TextBox" -1
CTRL "Button" 2
CTRL "Progress" 0
CTRL "Animation" 0
CTRL "Image" 0
CTRL "CustomCtrl"-1
CTRL "Chart" -1
CTRL "Trend" -1
;
;Enumeratives
; ENUM 100: key codes
;
ENUM 10013"Enter"
ENUM 1008"Left"
ENUM 10012"Right"
ENUM 10011"Up"
ENUM 10010"Down"
ENUM 10019"LongEnter"
ENUM 10015"LongLeft"
ENUM 10016"LongRight"
ENUM 10017"LongUp"
ENUM 10018"LongDown"
ENUM 10030"VK_F1"
ENUM 10031"VK_F2"
ENUM 10032"VK_F3"
ENUM 10033"VK_F4"
ENUM 10034"VK_F5"
ENUM 10035"VK_F6"
ENUM 10036"VK_F7"
ENUM 10037"VK_F8"
ENUM 10038"VK_F9"
ENUM 10039"VK_F10"
;
; ENUM 101: key-related actions
;
ENUM 1010"Call"
ENUM 1011"OpenPage"
ENUM 1012"Close"
ENUM 1013"NextField"
ENUM 1014"PrevField"
ENUM 1019"Edit"
;
; ENUM 102: editing-mode keys
;
ENUM 1020"Enter"
ENUM 1021"LongLeft"
ENUM 1023"Left"
ENUM 1024"Right"
ENUM 1025"Up"
ENUM 1026"Down"
;
; ENUM 103: color codes
; BBGGRR
ENUM 1030"0x00000000" ; Bianco
9MA10256.03 375
File for Target Description
376 9MA10256.03
Functions and Function Blocks for HMI
Overview
Here is the lists of the functions that HMI run-time exports to Display. You can use
them into script and procedures.
These functions are divided into several categories which are shown in details in
the following paragraphs.
Video_Switch (on)
Video_LCDContrast (more)
Display contrast
Input x1 unsigned short Top-left 'x coordinate' edge relative to full page.
9MA10256.03 377
Functions and Function Blocks for HMI
Input x1 unsigned short Not sensible (saved area has the original coordinates).
y1 unsigned short Not sensible (saved area has the original coordinates).
x2 unsigned short Not sensible (saved area has the original coordinates).
y2 unsigned short Not sensible (saved area has the original coordinates).
Video_Lock (res)
Output Video_Lock unsigned char Not sensible (return input parameter res).
Video_Unlock (res)
Output Video_Unlock unsigned char Not sensible (return input parameter res).
Video_Sleep (msec)
Input pFont unsigned long Address of font for printing text in title bar (the font must be added with
Video_AddFont function).
378 9MA10256.03
Functions and Function Blocks for HMI
Input id unsigned char Identifier of editing function (see. Enumerative table, page 373).
offs unsigned long Byte offset of a font that starts with ASCII 0x00 (subset of characters).
Input pResStrings unsigned long Address of first resources string for current language.
pEnums unsigned long Address of first resources string for current language.
Video_DrawFrames (left, top, right, bottom, colBack, fBar, pTitle, fResStr, fSysBtn, style)
9MA10256.03 379
Functions and Function Blocks for HMI
Video_DrawFrames (left, top, right, bottom, colBack, fBar, pTitle, fResStr, fSysBtn, style)
1: Raised
2: Sunken
Output Video_ unsigned char Not sensible (always TRUE).
DrawFrames
pTitle unsigned long Address of Text of title bar. NULL: no text in title bar.
bit 0...7:
• 0: flat
• 1: raised
• 2: sunken
bit 8:
• 0: no title bar
• 1: shows title bar
bit 9:
• 0: pTitle is an address of constant string
• 1: pTitle is a resource string
bit 10:
• 0: no system button
• 1: shows system button
bit 11:
• 0: window not modal
• 1: modal window (sensible only for pop-ups windows)
380 9MA10256.03
Functions and Function Blocks for HMI
Video_ClrScreen ()
Delete entire display area and fill with background color defined with Video_SetPage-Colors
Delete only a portion of display and fill with background color defined with Video_Set-PageColors
Input x1 unsigned short Top-left 'x coordinate' edge relative to full page.
Video_SetFont (fontPtr)
Load a font as current font for drawing objects. To correctly execute this function, the font must be declared with Video_
AddFont
I/O Name Type Description
Video_ResetMaps (res)
Delete the maps saved for every object. The maps are created adding an object at once, with access mode kACS_INIT
Output Video_ResetMaps unsigned char Not sensible (return input parameter res).
Input fRWOnly unsigned char Limit for selecting the next edit-box: FALSE: next edit-box must be
selectable.
9MA10256.03 381
Functions and Function Blocks for HMI
Video_PrevEdit (fRWOnly)
Input fRWOnly unsigned char Limit for selecting the next edit-box:
• FALSE: the next edit-box must be selectable.
• TRUE: the next edit-box must be selectable and writable.
Output Video_PrevEdit unsigned char Handle of selected objects; if -1 the function has an error.
Video_EnterEdit (wHnd)
Enter edit-mode of an Edit Box otherwise execute the action for a button. The object holds the task until exits from edit-mode.
Input wHnd unsigned short Handle of object that must be edited or execute his action.
Output Video_EnterEdit unsigned char Return pressed key code for exiting edit-mode. If return -1 is an error
only if the object is an edit-box.
Select object or enter edit-mode of an Edit box otherwise execute the action for a button. The object holds the task until exit from
edit-mode.
I/O Name Type Description
Input wHnd unsigned short Handle of object that must be edited or execute his action.
Output Video_ unsigned char Return pressed key code for exiting edit-mode. If return -1 is an error
EnterEditSel only if the object is an edit-box.
Video_PushButton (wHnd)
Enter press-mode for buttons. The object holds the task until exit from press-mode. This function is sensible only for
touchscreen systems.
Output Video_ unsigned char • TRUE: last pressure event was in button area.
PushButton
• FALSE: last pressure event was outside button area. -1: error.
Input rwReq unsigned char Boolean parameter. It indicates if the function checks for the objects that
have read-write access mode.
last unsigned char • TRUE: last selectable object.
• FALSE: first selectable object.
Output Video_ short Handle of the object; -1 if errors or do not exist selectable objects.
FirstLastEdit
Drawing Functions
Video_Line (x1, y1, x2, y2, pts, color)
Draw a line
I/O Name Type Description
Input x1 unsigned short Top-left 'x coordinate' edge relative to full page.
382 9MA10256.03
Functions and Function Blocks for HMI
Draw a line
I/O Name Type Description
Draw a rectangle
Input x1 unsigned short Top-left 'x coordinate' edge relative to full page.
fillCol unsigned long Fill color. The value is not sensible if transp is TRUE.
Delete a border outside the rectangle area. The color of fill is the page color assigned with Video_SetPageColors
Input y1 unsigned short Top-left 'y coordinate' edge relative to full page.
Input x2 unsigned short Bottom-down 'x coordinate' edge relative to full page.
9MA10256.03 383
Functions and Function Blocks for HMI
Input y2 unsigned short Bottom-down 'y coordinate' edge relative to full page.
Input pts unsigned char Border thickness It's sensible only if style = 0
Video_PrintBitmap (ptrBmp, x, y)
Video_DelBitmap (ptrBmp, x, y)
Delete a bitmap where it is not transparent, coded with run-time HMI format
Input x unsigned short Top-left 'x coordinate' edge relative to full page.
Input y unsigned short Top-left 'y coordinate' edge relative to full page.
Delete a bitmap where it is not transparent, coded with run-time HMI format
Input x1 unsigned short Top-left 'x coordinate' edge relative to full page.
Input y1 unsigned short Top-left 'y coordinate' edge relative to full page.
Input x2 unsigned short Bottom-down 'x coordinate' edge relative to full page.
Input y2 unsigned short Bottom-down 'y coordinate' edge relative to full page.
Restore original device context and copy the area from invisible context to display context
Input x1 unsigned short Top-left 'x coordinate' edge relative to full page.
Input y1 unsigned short Top-left 'y coordinate' edge relative to full page.
Input x2 unsigned short Bottom-down 'x coordinate' edge relative to full page.
Input y2 unsigned short Bottom-down 'y coordinate' edge relative to full page.
Print a string using the current font set with SetFont and current colors set with Set-Colors()
384 9MA10256.03
Functions and Function Blocks for HMI
Video_PrintResStr(idRes, x, y)
Print a resources string using the current font set with SetFont and current colors set with SetColors()
Print at most nChar characters of a string, using the current font set with SetFont and current colors set with SetColors(). It uses also
a format for drawing the text. If nChar is less than string length, it truncates the string; otherwise apply the alignment.
accMode unsigned char kACS_PRINT: print with colForeTxt and colBackTxt colors.
format unsigned long Alignment of text. It is sensible only if nChar > length of str:
• 0x08 = right alignment;
• 0x10 = center alignment;
• 0x20 = left alignment.
Read a variable at address idxParam from Modbus idxDevice and put the result to variable addressed by pointer pVal
pVal unsigned long Address of variable that contains the read value.
type unsigned char Parameter type. Available values: tyBool, tySInt, tyUSInt,
tyByte, tyInt, tyUInt, tyWord, tyDInt, tyUDInt, tyDWord,
tyReal,tyString.
9MA10256.03 385
Functions and Function Blocks for HMI
Write the value of a variable addressed by pointer pVal to the variable of address idxParam of Modbus idxDevice
pVal unsigned long Address of variable that contains the value to write.
type unsigned char Parameter type. Available values: tyBool, tySInt, tyUSInt,
tyByte, tyInt, tyUInt, tyWord, tyDInt, tyUDInt, tyDWord,
tyReal, tyString.
wParam unsigned short Event parameter. It has a different meaning according to msgID:
For the key a constant value exists. The syntax is: kKEY_<key> Ex.
LongLeft -> kKEY_LongLeft
386 9MA10256.03
Functions and Function Blocks for HMI
Video_GetEvent(dmy)
Output Video_GetEvent unsigned short Double word with inside the encoding.
Local variables — — —
Input variables — — —
9MA10256.03 387
Functions and Function Blocks for HMI
Static01
Text strings with variable visibility
Input variables wHnd word16 Handle of the object. Must be unique among static objects.
pFont word32 Address of font for drawing text. The font must be initialized with
Video_AddFont.
bordCol word32 Border color. It is sensible when style = 0 bordPts > 0 and not
pSelVar = 1 fixed.
selBackCol word32 Background color when object is selected. It is not sensible if pSelVar
= 0 fixed.
selForeCol word32 Text color when selected. It is not sensible if pSelVar = 0 fixed.
pSelVar word32 Selection flag for the object. Suggest if the object must uses
{‘selBackCol’ } and {‘selForeCol’}. Available values:
• FALSE = object is never selected;
• TRUE = object is always selected;
• var_addr = address of boolean variable.
numChars word16 Number of max characters. 0 indicates that the string is drawn with the
entire value of pString.
Output variables — — —
388 9MA10256.03
Functions and Function Blocks for HMI
Image
Image object
Input variables wHnd word16 Handle of the object. Must be unique among image objects.
px1 word32 Address of variable for moving image on X-Axis. It is sensible only if
floating = TRUE
py1 word32 Address of variable for moving image on Y-Axis. It is sensible only if
floating = TRUE
type_x byte Type for px1. Available values: tySInt; tyUSInt; tyByte; tyInt;
tyUInt; tyWord; tyDInt; tyUDInt; tyDWord. It is sensible only if
floating = TRUE and px1 <> NULL
type_y byte Type for py1. Available values: tySInt; tyUSInt; tyByte; tyInt;
tyUInt; tyWord; tyDInt; tyUDInt; tyDWord. It is sensible only if
floating = TRUE and py1 <> NULL
bordCol word32 Border color. It is sensible when style = 0 bordPts > 0 and not
pSelVar = 1 fixed.
bordSelCol word32 Border color for selected object. It is sensible when style = 0 and
bordPts > 0 and not pSelVar = 0 fixed
pBmp word32 Address of first byte of bitmap to view. It is not sensible if pSelBmp = 1
fixed.
pSelBmp word32 Address of first byte of bitmap to view when selected. It is not sensible
if pSelBmp = 0 fixed.
pSelVar word32 Selection flag for the object. Suggest if the object must uses
{‘bordCol’, ‘pBmp’} or {‘bordSelCol’, ‘pSelBmp’}.
Available values:
• FALSE = object is never selected
• TRUE = object is always selected
• var_addr = address of boolean variable
Output variables reqRefr byte Request refresh, updated when the object is called with accMode =
kACS_QUERY or accMode = kACS_BCKQUERY.
9MA10256.03 389
Functions and Function Blocks for HMI
Image
Image object
abs_x1 word16 Top-left 'x coordinate' edge relative to full page obtained with the sum
among ‘x1’ and px1’. The value is updated when the object is called
with accMode = kACS_INIT or accMode = kACS_QUERY.
abs_y1 word16 Top-left 'y coordinate' edge relative to full page obtained with the sum
among ‘y1’ and ‘py1’. The value is updated when the object is called
with accMode = kACS_INIT or accMode = kACS_QUERY.
mem_x1 word16 Value read from abs_x1 when the object is called with accMode =
kACS_INIT or accMode = kACS_PRINT.
mem_y1 word16 Value read from abs_y1 when the object is called with accMode =
kACS_INIT or accMode = kACS_PRINT.
Animation
Animation object
Input variables wHnd word16 Handle of the object. Must be unique among animation objects.
bordCol word32 Border color. It is sensible when style = 0 bordPts > 0 and not
pSelVar = 1 fixed
Output variables — — —
Button02
Button object
390 9MA10256.03
Functions and Function Blocks for HMI
Button02
Button object
Input variables wHnd word16 Handle of the object. Must be unique among buttons objects.
pText word32 Text to draw on the button. It has different meaning according to
fResStr. If this field is NULL, no text is drawn.
pFont word32 Address of font for drawing text. The font must be initialized with
Video_AddFont.
bordCol word32 Border color and text color. It is sensible only if style = 0 and bordPts
> 0, or pString different as NULL, and not pSelVar = 1 fixed.
fillCol word32 Color of button area. It is sensible only if pTransp different as 1 fixed,
and not pSelVar = 1 fixed.
bordSelCol word32 Border color and text color when selected. It is sensible only if style = 0
and bordPts > 0, or pString different as NULL, and not pSelVar =
0 fixed.
fillSelCol word32 Color of button area when selected. It is sensible only if pTransp
different as 1 fixed, and not pSelVar = 0 fixed.
9MA10256.03 391
Functions and Function Blocks for HMI
Button02
Button object
Output variables — — —
EditBox01
Edit object
wHnd word16 Handle of the object. Must be unique among edit-box objects.
Input variables y1 word16 Top-left 'y coordinate' edge relative to full page.
pFont word32 Address of font for drawing text. The font must be initialized with
Video_AddFont.
foreSelCol word32 Text color when selected. It is sensible only if pCanSel is not 0 fixed.
bckSelCol word32 Background color when selected. It is sensible only if pCanSel is not 0
constant.
bordPts byte Border thickness. It is sensible only if style = 0
pVarMin word32 Min value for edit-box variable. If bit 16...17 (LSB) of field format
contains 0 the limit is not set, if contains 1 is a constant limit, if contains
2 it is a variable limit.
pVarMax word32 Max value for edit-box variable. If bit 14...15 (LSB) of field format
contains 0 the limit is not set, if contains 1 is a constant limit, if contains
2 it’s a variable limit.
enumId int16 Identifier of enumerative. If 0 no enumerative associated with this field
exists.
392 9MA10256.03
Functions and Function Blocks for HMI
EditBox01
Edit object
9MA10256.03 393
Functions and Function Blocks for HMI
TextBox
Text box object
Input variables wHnd word16 Handle of the object. Must be unique among textbox objects.
pFont word32 Address of font for drawing text. The font must be initialized with
Video_AddFont.
dispCurs byte • TRUE= the cursor is always visible even if it is not enabled
editing mode
• FALSE= the cursor is visible only if it is enabled editing mode
dispRow byte • TRUE= the row selection is always visible even if it is not enabled
editing mode
• FALSE= the row selection is visible only if it is enabled editing
mode
bckSelCol word32 Future developments.
394 9MA10256.03
Functions and Function Blocks for HMI
TextBox
Text box object
Progress
Input variables wHnd word16 Handle of the object. Must be unique among progress objects.
pVar word32 Step variable. This is the filling percentage of bar in relation with the
range assigned by pMin and pMax.
type byte Type of pVar. Assigned values: tyBool; tySInt; tyUSInt; tyByte;
tyInt; tyUInt; tyWord; tyDInt; tyUDInt; tyDWord
pMin word32 Min value for edit-box variable. If bit 0 (LSB) of field format contain 0 is
a constant limit, if contain 1 it is a variable limit.
pMax word32 Min value for edit-box variable. If bit 1 (LSB) of field format contain 0 is
a constant limit, if contain 1 it is a variable limit.
Output variables — — —
9MA10256.03 395
Functions and Function Blocks for HMI
CustomCtrl
Progress bar object
wParam word16 16 bit data without sign, used for custom purpose
lParam int32 32 bit data with sign, used for custom purpose
rParam float 32 bit real data with sign, used for custom purpose
Output variable — — —
396 9MA10256.03
Commissioning
What’s in This Part
The Commissioning Tab ............................................................................. 398
Managing Commissioning Elements .............................................................. 401
Debugging ................................................................................................... 408
9MA10256.03 397
The Commissioning Tab
1 2 3 4 5
C:\My Project\My Project.plcprj
Free Studio Plus
Configuration Programming Display Commissioning
6
Item Description
2 Commissioning This window shows the configurable BIOS parameters of the target device.
window
For more information, refer to Content of the Commissioning Window, page 401.
3 Editor window This window allows you to edit the content of the current selection in Commissioning window.
4 Commissioning This window enables you to manage variables debugging by displaying their status in numerical
Watch window format when the application is running and connected to the target device.
For more information about how to use the Commissioning Watch window, refer to Commissioning
Watch Window, page 408
398 9MA10256.03
The Commissioning Tab
Item Description
5 Commissioning This window enables you to plot the evolution of the values of a set of variables. Being an
Oscilloscope asynchronous tool, the Oscilloscope cannot establish synchronization of samples.
window
For more information about how to use the Commissioning Oscilloscope window, refer to
Commissioning Oscilloscope Window, page 409
6 Output window This window shows the messages relating to the development of the project (file opening, reading/
writing detected faults, status of connection to device, and so on).
NOTE: The connection to the device is also visible in the status bar, page 35.
Menu Bar
Overview
The menu bar of Commissioning tab is composed of these menus:
• File, page 28
• View, page 33
• Parameters, page 30
• Recipes, page 31
• Target, page 32
• Options, page 29
• Help, page 28
Toolbar
Introduction
The toolbar appears at the top of the FREE Studio Plus window to provide access
to frequently used functions.
For generalities of toolbars, refer to Toolbars description, page 34.
Commissioning Toolbar
The Commissioning toolbar has the following buttons:
Refresh page -
Select all the parameters from the currently displayed parameter table.
9MA10256.03 399
The Commissioning Tab
400 9MA10256.03
Managing Commissioning Elements
Overview
Commissioning Window
Overview
Once the target device is connected, the Commissioning window allows you to:
• Read and write one or more BIOS parameters,
• Modify and restore the BIOS parameters to default,
• Read the current value of application variables (but not modify them).
NOTE: These variables can be displayed by dragging them to the Watch
and Oscilloscope windows.
Target device Shows the picture of the target device and allows you to configure some settings.
NOTE: For more information, refer to Target Device, page 404.
BIOS parameters Shows the list of BIOS settings that you can modify.
9MA10256.03 401
Managing Commissioning Elements
WARNING
UNINTENDED EQUIPMENT OPERATION
Update the configuration of your program each time you add or delete any type
of I/O expansions on your I/O bus, or you add or delete any devices on your
field bus.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Expansion Bus
You must monitor within your application the state of the bus and the error state of
the module(s) on the bus, and to take the appropriate action necessary given your
particular application.
WARNING
UNINTENDED EQUIPMENT OPERATION
• Include in your risk assessment the possibility of unsuccessful
communication between the logic controller and any I/O expansion modules.
• Monitor the state of the I/O expansion bus using the dedicated %SW system
words and take appropriate actions as determined by your risk assessment.
Failure to follow these instructions can result in death, serious injury, or
equipment damage.
Read Parameters
From the target device, you can read the parameters.
To read a parameter, select it and click the R icon.
402 9MA10256.03
Managing Commissioning Elements
To read the parameters, click Parameters > Read all. The operation takes a few
seconds.
C:\My Project\My Project.plcprj
Free Studio Plus
Configuration Programming Display Commissioning
Commissioning
Commissioning COMPRESSORSCIR2
FreeAdvance
BIOS parameters Address Name Value Um Default
All parameters 9492 xComp1Cir2 False False
I/O Values
9435 iComp1Cir2 0.0 %
Led & Backlight Values
9462 xAlarmComp1Cir2 False False
System Clock Values
9466 xOilPressSwitchComp1Cir2 False False
Protection Password
USB-Host and microSD 9509 xCmdOpHoursResetComp1Cir2 False False
Battery Handling 9519 uiElapsedOnTimeComp1Cir2 0 s 0
Ethernet 9527 uiElapsedOffTimeComp1Cir2 0 s 0
Application 9535 uiElapsedCycleTimeComp1Cir2 Reading parameters...
My Project 16464 E2_udiOpHoursComp1Cir2 0
General 16480 E2_udiNbStarsComp1Cir2 0
Pumps 336 / 1410 Cancel
9493 xComp2Cir2 False
Circuit1
9436 iComp2Cir2 0.0
CompressorsCir1
9463 xAlarmComp2Cir2 False False
FansCir1
EEVCir1 9467 xOilPressSwitchComp2Cir2 False False
Circuit2 9510 xCmdOpHoursResetComp2Cir2 False False
CompressorsCir2 9520 uiElapsedOnTimeComp2Cir2 0 s 0
FansCir2 9528 uiElapsedOffTimeComp2Cir2 0 s 0
EEVCir2
Alarms Resources*
Ready READ ONLY DIFF. CODE CONNECTED
The default value of the analog inputs and outputs is 0.0. The digital inputs and
outputs are set to FALSE.
Write Parameters
You can download the parameters to the target device, either with their default
values or with modified values inserted by you.
To write a parameter, select it and click the W icon.
To download the parameters (local BIOS), click Parameters > Select all or click
Select all parameters icon. The parameters are highlighted in yellow. Then, click
Parameters > Write selected or click the Write parameter icon. The
parameters are downloaded to the target device.
Downloading the parameters by clicking Parameters > Write all replaces the
values present on the target device with the values listed in the Value column.
If you select Parameters > Write all default values, the default values including I/
O is downloaded to the target device.
Blue Default Default column value different from value in value Target already read
column
Red Value Value NOT aligned with default Device just opened value
changed by you
Green Name Parameters not visible on target display (only for See visibility table
FREE Smart)
9MA10256.03 403
Managing Commissioning Elements
Target Device
Overview
Description
In the Commissioning window, double-click the title of the project to display the
editor window.
The editor window presents the graphic of the target device and lets you access
some settings.
These settings may differ depending on the target device chosen for the project.
General
Overview
The General box displays the name of the project target device and the version
number of its excepted firmware.
General FreeAdvance
Name:
File
596.11
version:
Communication
Overview
The Communication box displays information about the communication between
the PC and the target device (protocol, address, port, and baud rate).
Address: 1
Port: COM:4
Communication Settings
To modify the communication settings, click the Settings button or click Target >
Communication settings.
404 9MA10256.03
Managing Commissioning Elements
Communication
Port COM4
Baudrate 38400
RS-422 mode
Protocol
Modbus Address 1
Jbus
Server name
Dial number
OK Cancel
Information
Overview
The Information box displays the information of the device connected to the PC
(firmware version, current device application, and model).
NOTE: Make sure the firmware version installed on the target device matches
the firmware version used by the project. For more informations, refer to Other
Operations, page 406.
9MA10256.03 405
Managing Commissioning Elements
Download Settings
Overview
The Download settings box displays where data is downloaded.
NOR SD
PLC
HMI
HMI Remote
Cfg files
Web site
To modify the data download location, select from the drop-down list Use manual
settings and choose:
• NOR: to download to internal memory,
• SD: to download to SD card.
Two additional options are available:
• Reset binding configuration: remove the bindings defined in the installer,
• Align Target RTC: align controller clock with PC clock.
Other Operations
Overview
The Other operations box allows you to perform the following actions:
Action Goal
BIOS download Update the BIOS of the target device using a *.bin file.
Open file browser Explore the storage space of the device through a Windows
Explorer.
Generate XIF file Create a *.xif file which needs to be manually transferred to
the target device.
NOTE: The XIF is a text-based file that defines the
network image of the device to a network management
tool (for example, Niagara, LonMaker, and so on). The
XIF along with files termed device resource files (DRFs)
are used by the management tools to work with the LON
device.
Generate parameters files Create parameters files Param.dat, Param.raw and Param.
csv.
Generate USB files on target Force target controller to generate Param.dat and Param.bin
directly in an USB memory key connected to the port.
NOTE: The controller must be powered to allow for this
feature.
406 9MA10256.03
Managing Commissioning Elements
Action Goal
Import parameters files Allows to import a pre-generated parameters file in the target
controller.
NOTE: After import procedure the software asks to
generate a recipe in the project.
Create USB programming files Create a backup of the project for later restore.
CAUTION
UNINTENDED EQUIPMENT OPERATION
Verify that the firmware to be downloaded into your device corresponds to the
connected device.
Failure to follow these instructions can result in injury or equipment
damage.
9MA10256.03 407
Debugging
Debugging
What’s in This Chapter
Overview .................................................................................................... 408
Commissioning Watch Window .................................................................... 408
Commissioning Oscilloscope Window........................................................... 409
Overview
Description
FREE Studio Plus provides several debugging tools, which help you to verify
whether the application behaves as intended.
These debugging tools basically allow you to watch the value of selected variables
while the PLC application is running.
Commissioning debugging tools are asynchronous debuggers. They read the
values of the variables you selected with successive queries issued to the target
device. Both the manager of the debugging tool (that runs on the PC) and,
potentially, the task which is responsible to answer those queries (on the target
device) run independently from the PLC application. The values of two distinct
variables being sampled in the same moment are not necessarily in concordance
with each other with respect to the PLC application execution (one or more cycles
may have occurred). For the same reason, the evolution of the value of a single
variable is not consistent with its actual value in the controller memory, especially
when it is updated rapidly within the application.
This chapter presents how to debug your application using debugging tools.
For more information about the Commissioning Watch window, refer to Watch
Window, page 190.
NOTE: The functions available in the Programming Watch window are only
available for variables with Modbus address (EEPROM Parameters, Status
variables, and BIOS Parameters).
408 9MA10256.03
Debugging
9MA10256.03 409
Appendices
What’s in This Part
Installer Pro Project ...................................................................................... 411
Televis Driver Generation.............................................................................. 426
410 9MA10256.03
Installer Pro Project
Overview
Installer Pro Project is an additional feature which implements new functionalities
in Free Studio Plus.
Installer Pro Project is activated in the Configuration page by clicking on Project >
Options > Installer Pro Project in the menu toolbar.
Configuration options
OK
Compatibility Range
Installer Pro Project is compatible with the following products:
Reference Description
EWCM 9000 PRO (HF) EWCM 9000 PRO (HF) Logic Controller
Reference Description
NOTE: All the I/O Expansions must be of the same type, otherwise a compilation error is
generated.
9MA10256.03 411
Installer Pro Project
1 Label In the Label column can be filled the Label code, without spaces or special characters. If the cell is left
empty the values will automatically be overwritten with the value in Name column.
2 Unit par Folder These columns allow to organize parameters in easier viewing folders which has been previously
created.
3 Unit par Sub
Folder Refer to PLC Parameters Navigation Tree, page 413
4 I/O Type This column defines the type of input/output related to the selected parameter; it can be AI, AO, DI or
DO. This definition is useful for the new feature I/O Definition
Refer to I/O Definition, page 413 for more information on the I/O Definition.
5 Softscope This column enables the related parameter to be recorded and viewed with the Softscope
commissioning tool.
Label Unit par Folder Unit par Sub Folder IO Type Softscope
01.002-Sbp SYSTEM GENERAL False
01.003-LFr SYSTEM GENERAL False
01.004-Ert SYSTEM GENERAL False
01.005-rot SYSTEM GENERAL False
01.006-rSE SYSTEM GENERAL True
01.007-rdi SYSTEM GENERAL False
01.008-ECS SYSTEM GENERAL False
01.009-ECd SYSTEM GENERAL True
01.010-Att SYSTEM GENERAL False
01.011-En SYSTEM CONFIGURATION False
01.013-tr1 SYSTEM CONFIGURATION False
01.014-Sr1 SYSTEM CONFIGURATION False
01.015-dr1 SYSTEM CONFIGURATION True
Button Description
Add I/O Adds an input/output variable. A couple of parameters with consecutive address
are created.
Fix I/O Allows to modify an existing input/output variable. The couple of parameters
related to the variable must be selected in order to modify the variable.
Translate The Translate button translates the Description column into the selected software
language, where it is possible.
EEPROM PARAMETERS
Add Add Multiple Remove Recalc Add I/O Fix I/O Fix Codes Fix Description language
412 9MA10256.03
Installer Pro Project
# Name
1 SYSTEM
2 L1
3 L2
4 L3
5 HP
6 GC
7 HR1
8 HR2
9 RECEIVER
10 HE
I/O Definition
I/O Definition is a tool implemented to simplify the assignment of machine inputs
and outputs.
I/O Definition can be correctly used only if the allocation parameters have been
previously declared.
9MA10256.03 413
Installer Pro Project
Parameter description...
C91011
DO12-
DO12
DO11
DO10
DO9
C12
Upper Board
DO4
DO3
DO2
DO1
C34
DO7
C567
C2
C1
DO8
DO6
DO5
DO8-
C8
7 13.007-07P General purpose re AI
8 13.010-08P General purpose re AI
9 13.013-09P General purpose re AI
10 13.016-10P General purpose re AI
11 13.019-11P General purpose re AI
12 13.022-12P L1 line suction pre AI
13 13.025-13P L1 line suction pre AI
14 13.028-14P L1 line suction pre AI
15 13.029-15P L1 line suction pre AI
16 13.032-16P L1 line discharge t AI
COM-DI
COM-DI
CN1 CN2 CN3 CN4 CN5
24Vdc
5Vdc
GND
GND
RS485-2
AO1
AO2
AO3
AO4
DI1
DI2
DI3
DI5
DI6
DI7
DI8
DI4
AI1
AI2
AI3
AI4
AI5
AI6
AI7
AI8
17 13.033-17P L2 line suction pre AI
GS
Base Board
COM-DI
CN11 CN12 CN13
24Vdc
20 13.040-20P L2 line discherge t AI
5Vdc
GND
GND
DI10
DI12
AI10
AI12
DI11
AO5
AO6
AI11
Upper Board
DI9
AI9
21 13.043-21P L2 line discherge t AI
CN5
New Project
In case of a new project use the Add I/O button to add an input/output parameter.
A couple of parameters will be created with consecutive address and I/O Type
selected, for example:
• Par_Alloc1_Exp
• Par_Alloc1_Num
Add I/O parameters EEPROM PARAMETERS
Add Add Multiple Remove Recalc Add I/O Fix I/O Fix Codes Fix description language
Name: Par_Alloc1
Label: Parametro Allocazione # Address Name Installer type IEC ype Size
1 18061 par_UINT_StopH Unsigned 16-bit UINT
I/O type: Analog Input
2 18062 par_UINT_StopM Unsigned 16-bit UINT
3 18063 par_UINT_Aux1_Prof YesNo UINT
4 18064 par_UINT_Aux2_Prof YesNo UINT
5 18065 par_UINT_Aux3_Prof YesNo UINT
OK Cancel par_UINT_Aux4_Prof YesNo UINT
6 18066
7 18067 par_INT_MinParTemp Signed 16-bit INT
8 18068 par_INT_MaxParTemp Signed 16-bit INT
9 18069 par_Alloc1_Exp Signed 16-bit INT
10 18070 par_Alloc1_Num Signed 16-bit INT
Fill in the empty fields in the parameter grid to correctly define parameters and
compile the project.
After compiling the project the newly created logic I/O is added to the I/O
Definition tool.
I/O DEFINITION EWCM9000PRO 644
I/O PARAMETERS CPU SUMMARY
Parameter description...
DO12
DO11
DO10
DO9
C12
Upper Board
DO3
DO2
DO1
C34
DO7
C567
C2
C1
DO8
DO6
DO5
DO8-
C8
COM-DI
GND
RS485-2
AO1
AO2
AO3
AO4
DI1
DI2
DI3
DI5
DI6
DI7
DI8
DI4
AI1
AI2
AI3
AI4
AI5
AI6
AI7
AI8
Base Board
GND
DI10
DI12
AI10
AI12
DI11
AO5
AO6
AI11
Upper Board
DI9
AI9
Existing Project
In case of an existing project to change a input/output variable it must be used the
Fix I/O button.
414 9MA10256.03
Installer Pro Project
Select the couple of parameters ( one ending with _Exp and one ending with
_Num) and press the Fix I/O button. In the triggered window select the I/O type.
The selected type of I/O will be associated with the couple of parameters and it will
be automatically filled the I/O Type column value.
OK Cancel
Fill in the blank fields in the parameters grid, then recompile the project.
After compiling the project the modified logic I/O will be updated into the I/O
Definition tool.
I/O DEFINITION EWCM9000PRO 644
I/O PARAMETERS CPU SUMMARY
Parameter description...
C91011
DO12-
DO12
DO11
DO10
DO9
C12
Upper Board
DO4
DO3
DO2
DO1
C34
DO7
C567
C2
C1
DO8
DO6
DO5
DO8-
C8
COM-DI
24Vdc
5Vdc
GND
GND
RS485-2
AO1
AO2
AO3
AO4
DI1
DI2
DI3
DI5
DI6
DI7
DI8
DI4
AI1
AI2
AI3
AI4
AI5
AI6
AI7
AI8
17 13.033-17P L2 line suction pressure AI
GS
Base Board
GND
DI10
DI12
AI10
AI12
DI11
AO5
AO6
AI11
Upper Board
DI9
AI9
Allocation of IOs
To allocate I/O parameters drag the logical I/O from the left grid onto the desired
connector screw.
The tooltip indicates that the assignment has been done.
9MA10256.03 415
Installer Pro Project
Parameter description...
C91011
DO12-
DO12
DO11
DO10
DO9
C12
Upper Board
DO4
DO3
DO2
DO1
C34
DO7
C567
C2
C1
DO8
DO6
DO5
DO8-
C8
7 13.007-07P General purpose regulator AI
8 13.010-08P General purpose regulator AI
9 13.013-09P General purpose regulatore AI
10 13.016-10P General purpose regulator AI
11 13.019-11P General purpose regulator AI
12 13.022-12P L1 line suction pressure AI
13 13.025-13P L1 line suction pressure AI
14 13.028-14P L1 line suction pressure AI
15 13.029-15P L1 line suction pressure AI
16 13.032-16P L1 line discharge temperature AI
COM-DI
COM-DI
CN1 CN2 CN3 CN4 CN5
24Vdc
5Vdc
GND
GND
RS485-2
AO1
AO2
AO3
AO4
DI1
DI2
DI3
DI5
DI6
DI7
DI8
DI4
AI1
AI2
AI3
AI4
AI5
AI6
AI7
AI8
17 13.033-17P L2 line suction pressure AI
GS
Base Board
COM-DI
CN11 CN12 CN13
24Vdc
20 13.040-20P L2 line discharge temperature AI
5Vdc
GND
GND
DI10
DI12
AI10
AI12
DI11
AO5
AO6
AI11
Upper Board
DI9
AI9
21 13.043-21P General purpose regulator AI AI3 (2=NTC(103AT))
CN5
Engine room
temperature probe
Limitations
The I/O Definitions has the following limitations:
• It is necessary to drag an I/O logic from the grid to the screw in
correspondence with an I/O of the same type. For example, you cannot drag
an I/O declared DO onto a DI position.
• It is possible drag a DI to an AI if the corresponding BIOS parameter
configures it as a DI.
• An AI can be dragged onto a screw corresponding to an AI as long as the AI
is not configured as DI. For example, you can allocate a temperature probe
even if the AI = 4-20 mA.
I/O DEFINITION EWCM9000PRO 644
I/O PARAMETERS CPU SUMMARY
Parameter description...
DO12
DO11
DO10
DO9
C12
Upper Board
DO3
DO2
DO1
C34
DO7
C567
C2
C1
DO8
DO6
DO5
DO8-
C8
COM-DI
GND
RS485-2
AO1
AO2
AO3
AO4
DI1
DI2
DI3
DI5
DI6
DI7
DI8
DI4
AI1
AI2
AI3
AI4
AI5
AI6
AI7
AI8
Base Board
GND
DI10
DI12
AI10
AI12
DI11
AO5
AO6
AI11
Upper Board
DI9
AI9
416 9MA10256.03
Installer Pro Project
Parameter description...
C91011
DO12-
DO12
DO11
DO10
DO9
C12
Upper Board
DO4
DO3
DO2
DO1
C34
DO7
C567
C2
C1
DO8
DO6
DO5
DO8-
C8
7 13.007-07P General purpose regulator AI
8 13.010-08P General purpose regulator AI
9 13.013-09P General purpose regulatore AI
10 13.016-10P General purpose regulator AI
11 13.019-11P General purpose regulator AI
12 13.022-12P L1 line suction pressure AI
13 13.025-13P L1 line suction pressure AI
14 13.028-14P L1 line suction pressure AI
15 13.029-15P L1 line suction pressure AI
16 13.032-16P L1 line discharge temperature AI
COM-DI
COM-DI
CN1 CN2 CN3 CN4 CN5
24Vdc
5Vdc
GND
GND
RS485-2
AO1
AO2
AO3
AO4
DI1
DI2
DI3
DI5
DI6
DI7
DI8
DI4
AI1
AI2
AI3
AI4
AI5
AI6
AI7
AI8
17 13.033-17P L2 line suction pressure AI
GS
Base Board
COM-DI
CN11 CN12 CN13
24Vdc
20 13.040-20P L2 line discharge temperature AI
5Vdc
GND
GND
DI10
DI12
AI10
AI12
DI11
AO5
AO6
AI11
Upper Board
DI9
AI9
21 13.043-21P General purpose regulator AI
CN5
If more logical outputs are assigned to the same DO, an error condition is
signaled.
DO12
DO11
DO10
DO9
C12
Upper Board
DO3
DO2
DO1
C34
DO7
C567
C2
C1
DO8
DO6
DO5
DO8-
C8
COM-DI
GND
RS485-2
AO1
AO2
AO3
AO4
DI1
DI2
DI3
DI5
DI6
DI7
DI8
DI4
AI1
AI2
AI3
AI4
AI5
AI6
AI7
AI8
Base Board
GND
DI10
DI12
AI10
AI12
DI11
AO5
AO6
AI11
Upper Board
DI9
AI9
If more logical inputs (AI or DI) are assigned to the same physical input, a warning
condition is signaled.
Parameter description...
DO12
DO11
DO10
DO9
C12
Upper Board
DO3
DO2
DO1
C34
DO7
C567
C2
C1
DO8
DO6
DO5
DO8-
C8
COM-DI
GND
RS485-2
AO1
AO2
AO3
AO4
DI1
DI2
DI3
DI5
DI6
DI7
DI8
DI4
AI1
AI2
AI3
AI4
AI5
AI6
AI7
AI8
Base Board
GND
DI10
DI12
AI10
AI12
DI11
Engine room
AO5
AO6
AI11
Upper Board
DI9
AI9
temperature probe,
21 13.043-21P General purpose regulator AI
Electrical
CN5 cabinet
temperature probe
9MA10256.03 417
Installer Pro Project
Another error condition can occur if user double-clicks a screw to modify the
corresponding BIOS parameter in the parameter grid with an incompatible I/O
type. For example an AI, previously configured as NTC, is changed into DI, when
getting back to I/O Definition page it will be triggered an error message, shown by
a red screw, and the tooltip highlights an incompatible pin configuration.
SEARCH RESULT
Address Name Value Um Default
15726 Cfg_AI1 1=DI num 2=NTC(103AT)
Parameter description...
C91011
DO12-
DO12
DO11
DO10
DO9
C12
Upper Board
DO4
DO3
DO2
DO1
C34
DO7
C567
C2
C1
DO8
DO6
DO5
DO8-
C8
7 13.007-07P General purpose regulator AI
8 13.010-08P General purpose regulator AI
9 13.013-09P General purpose regulatore AI
10 13.016-10P General purpose regulator AI
11 13.019-11P General purpose regulator AI
12 13.022-12P L1 line suction pressure AI
13 13.025-13P L1 line suction pressure AI
14 13.028-14P L1 line suction pressure AI
15 13.029-15P L1 line suction pressure AI
16 13.032-16P L1 line discharge temperature AI
COM-DI
COM-DI
CN1 CN2 CN3 CN4 CN5
24Vdc
5Vdc
GND
GND
RS485-2
AO1
AO2
AO3
AO4
DI1
DI2
DI3
DI5
DI6
DI7
DI8
DI4
AI1
AI2
AI3
AI4
AI5
AI6
AI7
AI8
17 13.033-17P L2 line suction pressure AI
GS
24Vdc
20 13.040-20P L2 line discharge temperature AI
5Vdc
GND
GND
DI10
DI12
AI10
AI12
DI11
AO5
AO6
AI9
AI1 (1=DI):
21 13.043-21P General purpose regulator AI Engine room
CN5
temperature probe
To delete an allocation:
• Double click on the Delete button corresponding to the I/O to be de-allocated.
• The screw automatically turns white.
• This operation must be done for each single I/O.
418 9MA10256.03
Installer Pro Project
Parameter description...
Print
# Label Description Type Allocation Delete
1 13.001-01P Engine room temperature AI AI1 (Board) Delete
2 13.002-02P Electrical cabinet temperature AI AI3 (Board) Delete
3 13.003-03P General purpose regulator AI EWCM9000PRO 644
4 13.004-04P General purpose reglator AI
5 13.005-05P General purpose regulator AI Electrical cabinet temperature probe AI3
6 13.006-06P General purpose regulator AI
Engine room temperature probe AI2
7 13.007-07P General purpose regulator AI
8 13.010-08P General purpose regulator AI
9 13.013-09P General purpose regulatore AI
10 13.016-10P General purpose regulator AI
11 13.019-11P General purpose regulator AI
12 13.022-12P L1 line suction pressure AI
13 13.025-13P L1 line suction pressure AI
14 13.028-14P L1 line suction pressure AI
15 13.029-15P L1 line suction pressure AI
16 13.032-16P L1 line discharge temperature AI
17 13.033-17P L2 line suction pressure AI
18 13.036-18P L2 line suction pressure AI
19 13.039-19P L2 line suction temperature AI
20 13.040-20P L2 line discharge temperature AI
21 13.043-21P General purpose regulator AI
Softscope
This function is available only for BIOS version 644, Installer Pro Project flag
enables the use of the Softscope tool.
9MA10256.03 419
Installer Pro Project
SOFTSCOPE
+
STATUS: RT ACQUIRE +
Sampling period (s) 1
13/11/2018-19:36:40·····13/11/2018-19:38:09·····13/11/2018-19:39:38·····13/11/2018-19:41:08·····13/11/2018-19:42:38·····13/11/2018-19:44:07·····13/11/2018-19:45:36·····13/11/2018-19:47:06·····13/11/2018-19:48:35·····13/11/2018-19:50:04·····13/11/2018-19:51:34
The Softscope tool allows to plot and record the evolution of the selected set of
variables in real time for a period (maximum 48 hours). While the Oscilloscope
tool reads the quantities asynchronously, Softscope reads the selected quantities
with a set frequency, up to 10 tracks, at the same instant.
Recorded data can be saved as graphs and analyzed later, when the controller is
offline.
GENERAL 2
3
4
SYSTEM
SYSTEM
SYSTEM
GENERAL
GENERAL
GENERAL
False
False
False
True
5 SYSTEM GENERAL True
6 SYSTEM GENERAL False
GENERAL 7
8
9
SYSTEM
SYSTEM
SYSTEM
GENERAL
GENERAL
GENERAL
True
False
False
False
10 SYSTEM CONFIGURATION False
GENERAL True
GENERAL False
GENERAL False
CONFIGURATION False
The Softscope consists of three elements:
420 9MA10256.03
Installer Pro Project
Button Function
Start/stop data recording on the controller.
+ + Zooming functions
Status Description
Quick Start
To start using the Softscope it is necessary to:
1. Connect to the target.
2. Add an available track by clicking .
3. Define the sample period and start recording the acquisition.
NOTE: The target records the tracks autonomously in his own memory.
9MA10256.03 421
Installer Pro Project
4. Press to view the tracks in real time. Press to suspend the tracks in real
time. Press to start/stop recording data.
5. Save these settings to reuse the same set of measures in the next recording
session.
It is possible to keep an acquisition running just by leaving the target in RT_
ACQUIRE. Then it is possible to close Free Studio Plus application for the
necessary amount of time. While restarting Free Studio Plus and opening the
initial project, the system remembers the activation of RT_ACQUIRE and it is
possible to resume the tracks by pressing .
NOTE: Tracks can be saved into files (with *.OSCX extension); saved traces
can be viewed with Offline Graph Viewer feature in Free Studio Plus.
NOTE: The storage capacity is 432.000 samples, that means 10 tracks every
second for 12 hours, as well as 1 track every second for 5 days.
Baud rate
500 Kb/s
250 Kb/s
125 Kb/s
50 Kb/s
Master Settings
Node ID (1...122,125): 125 ?
422 9MA10256.03
Installer Pro Project
In the new DIGITAL I/O tab are showed the field variables relating to DI and DO
generated variables.
DΙ1 xExp002Di01
DΙ2 xExp002Di02
DΙ3 xExp002Di03
DΙ4 xExp002Di04
DΙ1 xExp002Do01
DΙ2 xExp002Do02
DΙ3 xExp002Do03
DΙ4 xExp002Do04
9MA10256.03 423
Installer Pro Project
A01 ixExp002Ao01
A02 ixExp002Ao02
PLC Var
Al1 ixExp002Ai01
Calibration 0
Sub
3 = Low Pass Filter enabled, analog value converted
Configuration
PLC Var
AΙ2 iExp002Ai02
Calibration 0
Default values are assigned to Name, Description and Label fields of auto-
generated CFG_AIx and CFG_AOx parameters, while the auto-generated code is
not visible.
EEPROM PARAMETERS
Add Add Multiple Remove Recalc Add I/O Fix I/O Fix Codes Fix description language
424 9MA10256.03
Installer Pro Project
NOTE:
• Removing an expansion removes alto auto-generated parameters and
codes.
• All the expansions must be of the same type, otherwise a compilation
error will be triggered.
• When one or more expansions are removed from the physical CAN
network, the system asks to limit, if necessary, the PLC parameter that
indicates the number of expansions.
• The Installer Pro Project flag cannot be changed if there are expansions
in the CAN network. In order to disable or enable the Installer Pro
Project flag it is first necessary to remove all the expansions.
Application
OK
9MA10256.03 425
Televis Driver Generation
Overview
With the activation of the Televis Driver Generation it is possible create the
drivers required by supervisors, Televis Go and Televis Air, to automatically read
the parameters.
To create the drivers Developer > Build Televis Driver.
Televis Driver Generation is activated in the Configuration page by clicking on
Project > Options > Televis Driver Generation in the menu toolbar.
Configuration options
OK
Column Description
1 Progressive In the Description column some strings have the symbol {0}. If one of these descriptions is chosen,
the symbol is replaced by the supervisors with the number written in the Progressive column.
2 Description Code The Code Description column cannot be changed. It represents the identification code of the string in
the Description column.
3 Label In the Label column can be filled the Label code, without spaces or special characters. If the cell is left
empty the values will automatically be overwritten with the value in Name column.
4 Groups The Groups column allows to insert groups to which the parameter belongs. It is accessed via a
modal window. One or more groups can be entered and they can be selected from the groups of the
Eliwell dictionary and from the strings of the custom dictionary (refer to Custom Dictionaries, page
432).
5 Groups Code The Groups Code column cannot be changed. It represents the identification code of the string in the
Groups column.
6 Measurement Unit Values in the Measurement Unit column can only be filled by the related modal window. It can be a
fixed unit of measure that can be chosen between the units of measure in the Eliwell dictionary and
between the strings of the custom dictionary, or it can be a variable unit of measure conditional on the
value of another variable. If the the value in the column is left empty it will automatically be overwritten
by Unit column value, if present, otherwise it will just be “num”.
7 Measurement Unit The Measurement Unit Code cannot be changed. It represents the identification code of the string in
Code Measurement unit column.
8 Visibility Values in the Visibility column can be True or False. If True, the parameter is exported to the Televis
driver, otherwise if False, the parameter is not exported to the Televis driver.
426 9MA10256.03
Televis Driver Generation
# Progressive Description Code Label Groups Groups Code Meausement Unit Meausement Unit Code Visibility
1 INO00184 01.002-SbP Impianto;Impianto - funzion PGR00166;PGR00196 num FIX(VMU00020) True
2 STA00400 01.003-LFr Impianto;Impianto - funzion PGR00166;PGR00196 HZ FIX(VMU00010) True
3 1 STA40196 01.004-Ert Impianto;Impianto - funzion PGR00166;PGR00196 num FIX(VMU00020) True
4 AIM00430 01.005-rot Impianto;Impianto - funzion PGR00166;PGR00196 num FIX(VMU00020) True
5 INO00181 01.006-rSE Impianto;Impianto - funzion PGR00166;PGR00196 INT(VMU00000,{1 INT(VMU00000,{1=VMU00 True
6 STI00314 01.007-rdi Impianto;Impianto - funzion PGR00166;PGR00196 INT(VMU00000,{1 INT(VMU00000,{1=VMU00 True
7 STA20124 01.008-ECS Impianto;Impianto - funzion PGR00166;PGR00196 INT(VMU00000,{1 INT(VMU00000,{1=VMU00 True
8 AIS00421 01.009-ECd Impianto;Impianto - funzion PGR00166;PGR00196 INT(VMU00000,{1 INT(VMU00000,{1=VMU00 True
9 AFE00178 01.010-Att Impianto;Impianto - funzion PGR00166;PGR00196 flag FIX(VMU00021) True
10 INA00159 01.011-En Impianto;Impianto - funzion PGR00166;PGR00196 num FIX(VMU00020) True
Button Description
EEPROM PARAMETERS
Add Add Multiple Remove Recalc Add I/O Fix I/O Fix Codes Fix Description language
Resources
Configuration EWCM9000PRO CONFIGURATION
EWCM9000PRO
Modbus objects
EEPROM Parameters
Status variables
1
C91011
DO12-
DO12
DO11
DO10
Enums
DO9
C12
2 Upper Board
CN14 CN15
1
2 PressUM
1
2 CoolHeat
DO4
DO3
DO2
C34
DO1
DO7
C567
C2
C1
DO8
DO6
DO5
DO8-
C8
1
2 AbsReal Data export Export
1
2 PIDtype
1
2 YesNo
1
2 GCSmode Televis driver generation
1
2 DisableEnable Identification Parameter
1
2 AlarmMode
1
2 AlarmPriority Add
COM-DI
COM-DI
GND
2 RS485-2
AO1
AO2
AO3
AO4
DI1
DI2
DI3
DI5
DI4
DI6
DI7
DI8
AI1
AI2
AI3
AI4
AI5
AI6
AI7
AI8
GS
Base Board
BIOS Parameters
Menus and pages Model Name
COM-DI
GND
DI10
DI12
AI10
AI12
DI11
AO5
AO6
AI11
Upper Board
DI9
AI9
I/O Mapping
CN5
Local
Field
Custom dictionaries Mask (12100 - 12999)
Description
Groups 12100
Measurement Unit
! Alarms
Web Site Baud Rate
BAC
net BACnet Objects 9600
Device 19200
Analog Value Objects 38400
Binary Value Objects
Calendar Objects
Multi State Value Objects
Schedule Objects
Notification Class Objects
LON Profile
CAN CAN Exp bus
Expansion EVE 4200_1
RS485-1
RS485-2
Ethernet
Plugins
Televis command configuration
Unit parameters Folder
Unit parameters Sub Folder
9MA10256.03 427
Televis Driver Generation
EEPROM Parameters
On the node EEPROM Parameters it is possible to fill in the information of each
parameter.
In the Description column must be entered the description of the parameter. It can
be inserted by writing in the cell or by opening the modal window that allows you to
choose between the strings of the Eliwell dictionary and the strings of the custom
dictionary (refer to Custom Dictionaries, page 432). If the string is inserted by the
custom dictionary, the description will be translated into various languages,
otherwise if the string is inserted by writing the description will always be fixed as it
is inserted.
EEPROM PARAMETERS
Add Multiple Remove Recalc Add I/O Fix I/O Fix Codes Fix description language
OK Cancel
# Scale Offset Unit Format Installer access Level Description Progressive Description Code Label
1 1 0 Always visible Unit of pressure measurements PLA00155 01.002-SbP
The Fix Codes button allows to regenerate the description code of an inserted
description if it is present in the Eliwell dictionary or in the custom dictionary
(Custom Dictionaries, page 432).
Application
OK
428 9MA10256.03
Televis Driver Generation
Application
OK
Usually the default language is set in English and so are Description, Groups
and Measurement Unit columns, but in compatible controllers it is possible to
change these columns language.
To change the parameter description language: File > Options > Language; once
selected the language flag the Accept box to enable the selection.
NOTE: To make the language change effective it is necessary to close and
reopen the project.
Program options
General Graphic Editor Text Editors Language Custom tools Merge
CH-CH - Chinese
de-DE - German(Parameters)
en-GB - English(Default) Select the program language
es-ES - Spanish(Parameters)
fr-FR - French(Parameters) You need to restart the program
it-IT - Italian(Parameters) for the change to take effect
ja-JP - Japanese
nl-NL - Dutch(Parameters)
pl-PL - Polish(Parameters)
pt-PT - Portuguese(Parameters) Select
ru-RU - Russian(Parameters)
tr-TR - Turkish(Parameters)
Accept
OK Annulla ?
NOTE: The languages that have the specification “(Parameters)” indicate that
the software will not be translated into language but will be by default in
English, only the Descriptions, Groups and Measurement Units of
parameters and variables will be translated.
Status Variable
On the node Status Variable it is possible to fill in the information of each
variable.
In the Description column must be entered the description of the variable. It can
be inserted by writing in the cell or by opening the modal window that allows you to
choose between the strings of the Eliwell dictionary and the strings of the custom
dictionary (refer to Custom Dictionaries, page 432). If the string is inserted by the
custom dictionary, the description will be translated into various languages,
otherwise if the string is inserted by writing the description will always be fixed as it
is inserted.
9MA10256.03 429
Televis Driver Generation
In the Description column some strings have the symbol {0}. If one of these
descriptions is chosen, the symbol is replaced by the supervisors with the number
written in the Progressive column .
Description Progressive
Active AUX {0} Output 1
Description Code
INP00184 Description
CUS40000
Custom
Defined
OK Cancel
In the Label column there are mandatory cells. These cells cannot contain
spaces or special characters.
STATUS VARIABLES
Add Add Multiple Remove Recalc Fix Codes Fix Description language Installer PRO columns Televis columns
# Installer accessLevel Description Progressive Description Code Label Groups Groups Code
1 Always visible Engine room temperature probe INP00184 AI001
2 Always visible High pressure digital input 107 STA00400 DI001
3 Always visible Uscita AUX {0} attiva 1 STA40196 DO001
4 Always visible High pressure alarm 107 bar ALM00420 AL001
5 Always visible CUS40000 TelevisIdentificationPar
The Groups column allows you to insert groups to which the variable belongs. It is
accessed via a modal window. One or more groups can be entered and they can
be selected from the groups of the Eliwell dictionary and from the strings of the
custom dictionary (refer to Custom Dictionaries, page 432).
The Groups Code column cannot be changed. It represents the identification
code of the string in the Groups column.
430 9MA10256.03
Televis Driver Generation
STATUS VARIABLES
Remove Recalc Add I/O Fix I/O Fix Codes Fix description language
Description Code Label Groups Groups Code Meausement Unit Meausement Unit Code Visibility
01.002-SbP num FIX(VMU00020) True
01.003-LFr HZ FIX(VMU00010) True
01.004-Ert num FIX(VMU00020) True
01.005-rot num FIX(VMU00020) True
Groups
01.006-rSE INT(VMU00000,{1 INT(VMU00000,{1=VMU00 True
Search in: ENGLISH
Add group
OK Cancel
# Progressive Description Code Label Groups Groups Code Meausement Unit Meausement Unit Code Visibility Type Write Sequence SoftScope
1 INO00184 01.002-SbP INT(VMU00000,{1 INT(VMU00000,{1=VMU00 False Analog input True
2 STA00400 01.003-LFr HZ
Measurement Unit FIX(VMU00010) True True
3 1 STA40196 01.004-Ert num FIX(VMU00020) True True
4 AIM00430 01.005-rot Fixed num FIX(VMU00020) True False
5 INO00181 01.006-rSE INT(VMU00000,{1 INT(VMU00000,{1=VMU00 True False
Search in: ENGLISH
Custom
Add option
OK Cancel
Values in the Visibility column can be True or False. If True, the variable is
exported to the Televis drivers, otherwise if False, the variable is not exported to
the Televis drivers.
The Type column defines the type of the variable.
The Write Sequence column allows to enter a series of commands taken from
the Televis Command Configuration node.
STATUS VARIABLES
Add Add Multiple Remove Recalc Add I/O Fix I/O Fix Codes Fix description language installer PRO columns Televis columns
# Progressive Description Code Label Groups Groups Code Meausement Unit Meausement Unit Code Visibility Type Write Sequence SoftScope
1 INO00184 01.002-SbP INT(VMU00000,{1 INT(VMU00000,{1=VMU00 False Analog input True
2 STA00400 01.003-LFr flag FIX(VMU00010) False Digital input True
3 1 STA40196 01.004-Ert flag FIX(VMU00020) False Status True
4 AIM00430 01.005-rot flag FIX(VMU00020) False Alarm False
5 TelevisIdentification TelevisIdentificationPar TelevisIdentificationPar num FIX(VMU00020) False Support False
The Fix Codes button allows you to regenerate the description code of an
inserted description if it is present in the Eliwell dictionary or in the custom
dictionary (Custom Dictionaries, page 432).
9MA10256.03 431
Televis Driver Generation
Application
OK
Application
OK
BIOS Parameters
Add/Remove to Televis button defines if the BIOS parameter is exported or not in
the Televis driver. The export to the driver is useful for being able to modify this
parameter in real time by the supervisors.
BIOS PARAMETERS
Add to Televis Remove to Televis
Custom Dictionaries
The Custom Dictionary page allows you to enter a series of custom strings to be
used as description, groups or measurement unit. Each string is added with the
Add button and must include at least one language. To remove a string use the
Remove button.
Import button allows to import a custom dictionary.
Export button allows to export a custom dictionary.
432 9MA10256.03
Televis Driver Generation
Resources
Configuration DESCRIPTION CUSTOM DICTIONARY
EWCM9000PRO
Modbus objects Add Remove Import Export
EEPROM Parameters
Status variables
1
# English Italian French Spanish German Russian
2 Enums
1
BIOS Parameters
Menus and pages
I/O Mapping
Local
Field
Custom dictionaries
Description
Groups
Measurement Unit
! Alarms
Web Site
BAC
net BACnet Objects
Device
Projects Outputs
At each compilation of the driver, from menu Developer > Build Televis Driver,
the following files are created in the "Televis Driver" folder in the Project
directory:
• TelevisGo driver as TCDF[Mask].bin
• TelevisAir driver as TCDF[Mask].xml
• P0435_Msk[Masknumber]_[Target]_[Version].xsl as hidden file
• Custom dictionaries, that can be imported into TelevisGo as .txt file for each
language
Name
CompilerOutput.xml
LastDriverBuild.dat
P04354_Msk012123_04_04.xls
TCDF12123.bin
TCDF12123.bin.zip
TCDF12123.NetworkNaming.xml
TCDF12123.xml
9MA10256.03 433
Glossary
A
%:
According to the IEC standard, % is a prefix that identifies internal memory
addresses in the logic controller to store the value of program variables,
constants, I/O, and so on.
analog input:
Converts received voltage or current levels into numerical values. You can store
and process these values within the logic controller.
analog output:
Converts numerical values within the logic controller and sends out proportional
voltage or current levels.
application:
A program including configuration data, symbols, and documentation.
ARRAY:
The systematic arrangement of data objects of a single type in the form of a table
defined in logic controller memory. The syntax is as follows: ARRAY
[<dimension>] OF <Type>
Example 1: ARRAY [1..2] OF BOOL is a 1-dimensional table with 2 elements of
type BOOL.
Example 2: ARRAY [1..10, 1..20] OF INT is a 2-dimensional table with 10 x
20 elements of type INT.
ASCII:
(American standard code for Information Interchange) A protocol for representing
alphanumeric characters (letters, numbers, certain graphics, and control
characters).
assigned variable:
A variable is assigned if its location in the logic controller memory is known.
For example, the Water_pressure variable is said to be assigned through its
association with memory location %MW102.
B
BOOL:
(boolean) A basic data type in computing. A BOOL variable can have one of these
values: 0 (FALSE), 1 (TRUE). A bit that is extracted from a word is of type BOOL;
for example, %MW10.4 is a fifth bit of memory word number 10.
Boot application:
(boot application) The binary file that contains the application. Usually, it is stored
in the controller and allows the controller to boot on the application that the user
has generated.
byte:
A type that is encoded in an 8-bit format, ranging from 00 hex to FF hex.
9MA10256.03 435
C
conditional element:
Allows to implement conditions in the program in offline mode.
configuration:
The arrangement and interconnection of hardware components within a system
and the hardware and software parameters that determine the operating
characteristics of the system.
controller:
Automates industrial processes (also known as programmable logic controller or
programmable controller).
D
digital I/O:
(digital input/output) An individual circuit connection at the electronic module that
corresponds directly to a data table bit. The data table bit holds the value of the
signal at the I/O circuit. It gives the control logic digital access to I/O values.
DINT:
(double integer type) Encoded in 32-bit format.
DWORD:
(double word) Encoded in 32-bit format.
E
EDS:
(electronic data sheet) A file for fieldbus device description that contains, for
example, the properties of a device such as parameters and settings.
EEPROM:
(electrically erasable programmable read-only memory) A type of non-volatile
memory to store required data even when power is removed.
NOTE:
Ethernet:
A physical and data link layer technology for LANs, also known as IEEE 802.3.
F
FBD:
(function block diagram) One of 5 languages for logic or control supported by the
standard IEC 61131-3 for control systems. Function block diagram is a graphically
oriented programming language. It works with a list of networks, where each
network contains a graphical structure of boxes and connection lines, which
represents either a logical or arithmetic expression, the call of a function block, a
jump, or a return instruction.
436 9MA10256.03
FB:
(function block) A convenient programming mechanism that consolidates a group
of programming instructions to perform a specific and normalized action, such as
speed control, interval control, or counting. A function block may comprise
configuration data, a set of internal or external operating parameters and usually
1 or more data inputs and outputs.
function block:
A programming unit that has 1 or more inputs and returns 1 or more outputs. FBs
are called through an instance (function block copy with dedicated name and
variables) and each instance has a persistent state (outputs and internal
variables) from 1 call to the other.
Examples: timers, counters
function:
A programming unit that has 1 input and returns 1 immediate result. However,
unlike FBs, it is directly called with its name (as opposed to through an instance),
has no persistent state from one call to the next and can be used as an operand
in other programming expressions.
Examples: boolean (AND) operators, calculations, conversions (BYTE_TO_INT)
H
hex:
(hexadecimal)
I
I/O:
(input/output)
%I:
According to the IEC standard, %I represents an input bit (for example, a
language object of type digital IN).
IEC 61131-3:
Part 3 of a 3-part IEC standard for industrial automation equipment. IEC 61131-3
is concerned with controller programming languages and defines 2 graphical and
2 textual programming language standards. The graphical programming
languages are ladder diagram and function block diagram. The textual
programming languages include structured text and instruction list.
IL:
(instruction list) A program written in the language that is composed of a series of
text-based instructions executed sequentially by the controller. Each instruction
includes a line number, an instruction code, and an operand (refer to IEC 61131-
3).
9MA10256.03 437
IP:
(Internet protocol Part of the TCP/IP protocol family that tracks the Internet
addresses of devices, routes outgoing messages, and recognizes incoming
messages.
%IW:
According to the IEC standard, %IW represents an input word register (for
example, a language object of type analog IN).
L
ladder diagram language:
A graphical representation of the instructions of a controller program with symbols
for contacts, coils, and blocks in a series of rungs executed sequentially by a
controller (see IEC 61131-3).
LED:
(light emitting diode) An indicator that illuminates under a low-level electrical
charge.
M
machine:
Consists of several functions and/or equipment.
master/slave:
The single direction of control in a network that implements the master/slave
mode.
Modbus:
The protocol that allows communications between many devices connected to the
same network.
%MW:
According to the IEC standard, %MW represents a memory word register (for
example, a language object of type memory word).
N
node:
An addressable device on a communication network.
P
PDO:
(process data object) An unconfirmed broadcast message or sent from a
producer device to a consumer device in a CAN-based network. The transmit
PDO from the producer device has a specific identifier that corresponds to the
receive PDO of the consumer devices.
PLC:
(programmable logic controller) An industrial computer used to automate
manufacturing, industrial, and other electromechanical processes. PLCs are
different from common computers in that they are designed to have multiple input
and output arrays and adhere to more robust specifications for shock, vibration,
temperature, and electrical interference among other things.
438 9MA10256.03
POU:
(program organization unit) A variable declaration in source code and a
corresponding instruction set. POUs facilitate the modular re-use of software
programs, functions, and function blocks. Once declared, POUs are available to
one another.
program:
The component of an application that consists of compiled source code capable
of being installed in the memory of a logic controller.
protocol:
A convention or standard definition that controls or enables the connection,
communication, and data transfer between 2 computing system and devices.
Q
%Q:
According to the IEC standard, %Q represents an output bit (for example, a
language object of type digital OUT).
R
RJ45:
A standard type of 8-pin connector for network cables defined for Ethernet.
RPDO:
(receive process data object) An unconfirmed broadcast message or sent from a
producer device to a consumer device in a CAN-based network. The transmit
PDO from the producer device has a specific identifier that corresponds to the
receive PDO of the consumer devices.
RS-232:
A standard type of serial communication bus, based on 3 wires (also known as
EIA RS-232C or V.24).
RS-485:
A standard type of serial communication bus, based on 2 wires (also known as
EIA RS-485).
RTU:
(remote terminal unit ) A device that interfaces with objects in the physical world
to a distributed control system or SCADA system by transmitting telemetry data to
the system and/or altering the state of connected objects based on control
messages received from the system.
S
SFC:
(sequential function chart) A language that is composed of steps with associated
actions, transitions with associated logic condition, and directed links between
steps and transitions. (The SFC standard is defined in IEC 848. It is IEC 61131-3
compliant.)
SINT:
(signed integer) A 15-bit value plus sign.
string:
A variable that is a series of ASCII characters.
9MA10256.03 439
ST:
(structured text) A language that includes complex statements and nested
instructions (such as iteration loops, conditional executions, or functions). ST is
compliant with IEC 61131-3.
symbol:
A string of a maximum of 32 alphanumeric characters, of which the first character
is alphabetic. It allows you to personalize a controller object to facilitate the
maintainability of the application.
T
TCP:
(transmission control protocol) A connection-based transport layer protocol that
provides a simultaneous bi-directional transmission of data. TCP is part of the
TCP/IP protocol suite.
terminal block:
(terminal block) The component that mounts in an electronic module and provides
electrical connections between the controller and the field devices.
TPDO:
(transmit process data object) An unconfirmed broadcast message or sent from a
producer device to a consumer device in a CAN-based network. The transmit
PDO from the producer device has a specific identifier that corresponds to the
receive PDO of the consumer devices.
U
UDINT:
(unsigned double integer) Encoded in 32 bits.
UINT:
(unsigned integer) Encoded in 16 bits.
W
WORD:
A type encoded in a 16-bit format.
440 9MA10256.03
Index F
FBD
create ............................................................. 142
A editor .............................................................. 142
Function .. 251, 254, 258, 260, 263, 265, 269, 276, 279
Action edit ..........................................................140, 156
assign to a step................................................ 159
Application
definition of........................................................21 G
Global variable
B edit ................................................................. 118
Block
information ...............................................146, 153 I
properties .................................................146, 152
Bookmark ........................................................... 157 IL
IL .................................................................... 141 bookmark ........................................................ 141
Branches editor .............................................................. 140
insert............................................................... 155
J
C Jump .................................................................. 162
Coil
insert............................................................... 150
Comments L
insert............................................................... 154
Contact LD
insert............................................................... 148 Coil / Contact Properties ................................... 151
Custom workspace create ............................................................. 147
basic unit......................................................... 138 editor .............................................................. 147
elements ......................................................... 139 insert coil......................................................... 150
enable............................................................. 137 insert contact ................................................... 148
operation......................................................... 138 Library
export ............................................................. 108
import from ...................................................... 108
include ............................................................ 107
D remove............................................................ 107
Developing programs, stages of .............................22 undo import from.............................................. 109
update............................................................. 110
E
Edit
M
enumeration .................................................... 128 Menu
function ....................................................140, 156 debug ...............................................................26
network ............................................ 146, 152, 163 developer ..........................................................27
ST .................................................................. 156 edit ...................................................................27
structure.......................................................... 127 file ....................................................................28
subrange......................................................... 130 help ..................................................................28
typedef............................................................ 126 on-line...............................................................29
Editor options ..............................................................29
Adding a Variable......................................197–198 parameters ........................................................30
FBD ................................................................ 142 prg ....................................................................61
global variable ................................................. 118 project...............................................................30
Graphic .............................................................39 recipes ..............................................................31
IL .................................................................... 140 resources, visibility of .........................................61
LD .................................................................. 147 scheme .............................................................31
PLC ................................................................ 140 set ....................................................................61
POU ............................................................... 113 target .......................................................... 32, 60
SFC ................................................................ 158 tools..................................................................32
ST .................................................................. 156 variables ..................................................... 29, 32
Text...................................................................39 view ..................................................................33
variable ........................................................... 164 window........................................................ 34, 38
Enumerator Minimum system requirements ...............................17
create ............................................................. 128
delete.............................................................. 129
edit ................................................................. 128 N
Expression
insert............................................................... 154 Network
9MA10256.03 441
add / remove ............................................143, 147 T
connect block .................................................. 144
edit .................................................. 146, 152, 163 Task
assign a program at creation time...................... 112
insert block ...............................................144, 151
associate a program......................................... 122
label.........................................................143, 148
Non-program data .................................................21 configuration.................................................... 123
managing program........................................... 123
Overview......................................................... 122
Tool window
O management .....................................................37
Operating modes Toolbar ....................................53, 211, 228, 315, 399
offline ................................................................22 buttons..............................................................92
online................................................................22 commissioning................................................. 399
simulation..........................................................22 configuration......................................................53
Operator ........................ 254, 258–259, 264, 276–278 debug ...............................................................94
display .....................................................315–317
FBD ..................................................................94
P LD ....................................................................96
main .................................................................92
POU network .............................................................96
editor .............................................................. 113 project...............................................................93
Program SFC ..................................................................95
associate to a task ........................................... 122 Transition
compiling...........................................................92 condition of...................................................... 160
definition of........................................................21 conditional code............................................... 161
manage into task.............................................. 123 Trigger window.................................................... 211
Program development, stages of ............................22 graphic................226, 228, 230–234, 236–240, 242
Project text .....................212–214, 216–218, 220–223, 225
close .................................................................46 Typedef
creating .............................................................21 create ............................................................. 124
custom workspace ........................................... 137 delete.............................................................. 126
definition of........................................................21 edit ................................................................. 126
distribute ...........................................................46
download ..........................................................48
edit ...................................................................45 V
find in .............................................................. 135
menu ................................................................30 Variable
new...................................................................43 copy................................................................ 167
open .................................................................45 create ............................................................. 164
print ..................................................................43 delete.............................................................. 166
save..................................................................44 Edit ................................................................. 164
save as .............................................................44 editor .............................................................. 164
toolbar...............................................................93 global.............................................................. 115
window, content of ........................................... 111 insert............................................................... 153
local ................................................................ 119
Sampling......................................................... 199
R sort ................................................................. 167
Registering FREE Studio Plus software ..................17
W
S Watch list............................................................ 195
autosave ......................................................... 195
SFC Watch window
connect elements............................................. 159 add item .......................................................... 191
create ............................................................. 158 data format ...................................................... 194
editor .............................................................. 158 refresh ............................................................ 193
insert element .................................................. 158 remove item .................................................... 193
ST watch list ......................................................... 195
create ............................................................. 156 Workspace
editor .............................................................. 156 custom ............................................................ 137
Structure migration ......................................................... 137
create ............................................................. 126
delete.............................................................. 127
edit ................................................................. 127
Subrange
create ............................................................. 129
delete.............................................................. 130
edit ................................................................. 130
System requirements.............................................17
442 9MA10256.03
Eliwell Controls s.r.l.
Via dell’Industria, 15 • Z.I. Paludi
32016 Alpago (BL)
Italy
+39 0437 986 111 (Operator)
+39 0437 986 100 (Italy)
www.eliwell.com