advertisement
ISaGRAF
Software release 5.2
July 2009
ISaGRAF
Printing History 1 st
printing — November 1, 2001
2 nd
printing — May 31, 2002
3 rd
printing — October 31, 2002
4 th
5
6 th th
printing — July 31, 2002
printing — December 15, 2002
7
8 th th
printing — January, 2005
printing — November, 2005
9 th
printing — February, 2006
10
printing — October, 2006 th
printing — February, 2007
11 th
printing — May, 2007
12 th
13
14
15
16 th th
printing — January, 2009
printing — March, 2009 th
printing — April, 2009 th
printing — June, 2009
printing — July, 2009
© Copyright 1999-2009:
ICS Triplex ISaGRAF
.
All rights reserved. No portion of this work may be reproduced in any form or by any means, without the prior written permission of
ICS Triplex ISaGRAF
.
Table of Contents
Workbench _______________________________________ 1
Window Buttons Toolbar.........................................................................19
Version Source Control Toolbar..............................................................20
Importing and Exporting Workbench Elements .................................................. 47
Uploading Workbench Elements from Targets ................................................... 50
Resource Window Workspace.................................................................54
ISaGRAF 5.2
- Workbench i
ii
Renaming Resources ...............................................................................55
Resource Network Parameters.................................................................67
Custom Resource Parameters ..................................................................68
Resource Access Control.........................................................................69
Linking Resources .............................................................................79
Deleting Resource Links....................................................................81
Viewing the Internal Bindings Defined for Resources ......................82
Hiding and Showing Resource Links ................................................83
Defining Internal Variable Bindings..................................................83
Editing Internal Variable Bindings ....................................................86
Deleting Internal Variable Bindings ..................................................86
Defining Producer Variable Groups .................................................89
Editing Producer Variable Groups.....................................................91
Deleting Producer Variable Groups...................................................91
Linking Resources for External Bindings .........................................92
Editing External Resource Links .......................................................93
Defining External Variable Bindings.................................................94
Editing External Variable Bindings ...................................................95
Deleting External Variable Bindings .................................................95
Creating Variable Groups ........................................................................97
Opening Variable Groups ........................................................................98
Importing or Exporting Variables and Defined Words ................................ 99
Importing or Exporting Target Definitions ................................................ 103
ISaGRAF
3 Projects................................................................... 105
ISaGRAF 5.2
- Table of Contents
POUs (Program Organization Units).......................................................... 111
Manipulating POUs ...............................................................................115
Creating FC Sub-programs ....................................................................117
Creating SFC Child POUs .....................................................................117
Changing Hierarchy Level.....................................................................118
Controlling Access to POUs ..................................................................119
Generating Debug and Monitoring Information ....................................122
Editing a POU Description ....................................................................124
Creating Configurations.........................................................................126
Deleting Configurations.........................................................................128
Moving Configurations..........................................................................128
Moving Resources Between Configurations .........................................130
Configuration Identification...................................................................132
Configuration Target Definitions...........................................................133
Target Access Control............................................................................134
Configuration Description .....................................................................136
Creating Connections.............................................................................141
Deleting Connections.............................................................................142
Renaming Structures..............................................................................148
ISaGRAF 5.2
- Workbench iii
iv
Selecting Rows and Elements................................................................151
Editing the Contents of the Grid............................................................152
Adding or Inserting Rows......................................................................153
Expanding or Collapsing Grid Components..........................................154
Cutting, Copying, and Deleting Elements .............................................155
Finding and Replacing Elements ...........................................................156
Renumbering Addresses ........................................................................159
Row-level Validation.............................................................................169
Database-level Validation......................................................................170
Working with the I/O Wiring Tool............................................................. 175
Deleting Devices and Conversions........................................................178
Setting the Real or Virtual Attribute......................................................179
ISaGRAF 5.2
- Table of Contents
Standard Toolbar ........................................................................202
Options Toolbar..........................................................................203
Debug Toolbar............................................................................204
SFC Breakpoints Toolbar...........................................................206
SFC Tools...................................................................................207
Flow Chart Tools........................................................................209
ST Tools .....................................................................................210
IL Tools ......................................................................................211
LD Tools.....................................................................................212
FBD Tools ..................................................................................213
Workspace........................................................................................215
Contextual Menus ............................................................................217
Output Window................................................................................218
Opening the Dictionary..........................................................................223
Opening Another POU...........................................................................224
Finding and Replacing in POUs ............................................................225
Working with the Editor ........................................................................232
SFC Elements...................................................................................233
Initial Step ..................................................................................233
Step.............................................................................................234
Transition....................................................................................235
Divergence/Convergence ...........................................................236
Creating New Branches ........................................................237
Deleting Branches.................................................................238
ISaGRAF 5.2
- Workbench v
vi
Link ............................................................................................239
Jump ...........................................................................................240
Managing Elements .........................................................................242
Select ..........................................................................................242
Rename.......................................................................................243
Move ..........................................................................................244
Copy ...........................................................................................245
Paste ...........................................................................................245
Delete .........................................................................................246
Goto............................................................................................246
Coding Action Blocks for Steps.................................................248
Coding Conditions for Transitions.............................................250
Moving Action Blocks Up or Down ..........................................251
Deleting an Action Block...........................................................252
Renumbering Charts ........................................................................253
Working with Flow Charts ....................................................................260
Flow Chart Elements........................................................................261
Action.........................................................................................261
Test.............................................................................................262
IF-THEN-ELSE .........................................................................262
DO-WHILE................................................................................263
WHILE-DO................................................................................264
Flow............................................................................................264
Connector ...................................................................................266
I/O Specific ................................................................................267
Comment ....................................................................................267
Sub-Program ..............................................................................268
Managing Elements .........................................................................269
Select ..........................................................................................269
Copy ...........................................................................................270
Paste ...........................................................................................271
Delete .........................................................................................271
Move ..........................................................................................272
ISaGRAF 5.2
- Table of Contents
GoTo...........................................................................................272
Renumber ...................................................................................273
Level 2 Window .........................................................................275
Edit the Level 2 ..........................................................................276
Multi-Language Elements......................................................................284
ST/IL Elements ................................................................................284
LD Elements.....................................................................................285
Contact on the Left ....................................................................285
Contact on the Right ..................................................................285
Parallel Contact .........................................................................286
Coil ............................................................................................286
Block on the Left .......................................................................286
Block on the Right .....................................................................286
Parallel Block ............................................................................286
Jump ..........................................................................................286
Label...........................................................................................287
Return ........................................................................................287
Change Coil/Contact Type ........................................................287
Insert New Rung ........................................................................288
Other Operations .......................................................................288
FBD Elements ..................................................................................289
Variable ......................................................................................291
Function Block ...........................................................................292
Link ...........................................................................................293
Corner ........................................................................................293
Jump ..........................................................................................293
Label ..........................................................................................294
Return .........................................................................................294
LD Elements...............................................................................295
Left Power Bar ....................................................................295
Contacts ..............................................................................295
LD Vertical "OR" Connection ............................................295
ISaGRAF 5.2
- Workbench vii
viii
Coils.....................................................................................296
Right Power Bar .................................................................296
Comment ....................................................................................297
Managing Elements ...............................................................................298
Undo/Redo .......................................................................................299
Find Matching Name .......................................................................303
Find Matching Coil ..........................................................................304
Display/Hide Comments..................................................................305
Composite IEC 61499 Editor ..................................................................... 307
Standard Toolbar..............................................................................313
Options Toolbar ...............................................................................315
Debug Toolbar .................................................................................315
IEC61499 Tools ...............................................................................317
IEC 61499 Elements ........................................................................318
Variable ......................................................................................319
Function Block ...........................................................................320
Link ............................................................................................320
Corner.........................................................................................320
Comment ....................................................................................320
Managing Elements ...............................................................................321
Undo/Redo .......................................................................................322
ISaGRAF 5.2
- Table of Contents
Resource Execution Mode .....................................................................342
Real-time Mode................................................................................342
Cycle-to-cycle Mode........................................................................343
Step-by-step Mode ...........................................................................344
Setting Breakpoints ....................................................................346
Removing Breakpoints ...............................................................346
Stepping in POUs .......................................................................348
Breakpoint on Step Activation .........................................................360
Breakpoint on Step Deactivation .....................................................361
Breakpoint on Transition..................................................................362
Transition Clearing Forcing .............................................................363
Adding Variables to the Spy List .....................................................364
Selecting Variables in the Spy List ..................................................366
Removing Variables from the Spy List............................................366
Rearranging the Spy List..................................................................367
Saving a Spy List .............................................................................367
Opening an Existing Spy List ..........................................................367
Forcing / Locking / Unlocking the Value of a Spy List Variable ....368
ISaGRAF 5.2
- Workbench ix
x
Contextual Menu..............................................................................374
Displaying I/O Device Window Headers ........................................374
Moving or Hiding the Browser ........................................................375
Declared Variables...........................................................................380
Function Block Instances.................................................................381
Compiler Allocated Hidden Variables.............................................381
Memory Requirements ..........................................................................382
Miscellaneous Limitations.....................................................................383
Debug Function Block Instances................................................................ 386
Building Resources / Projects................................................................400
Browsing the POUs of a Project................................................................. 411
Performing a Check in of a Workbench Element....................................... 417
Viewing the History of Workbench Elements ........................................... 418
Getting a Previous Version....................................................................419
Comparing Current and Previous Versions ...........................................420
ISaGRAF 5.2
- Table of Contents
Accessing Details for a Previous Version..............................................420
Creating a History Report ......................................................................421
Language Reference______________________________ 423
Cyclic and Sequential Operations............................................................... 426
Standard IEC 61131-3 Types.................................................................435
User Types: Structures...........................................................................438
Boolean Constant Expressions...............................................................439
Short Integer Constant Expressions .......................................................440
Unsigned Short Integer and BYTE Constant Expressions ....................441
Integer Constant Expressions.................................................................442
Unsigned Integer and WORD Constant Expressions ............................443
Double Integer Constant Expressions....................................................444
Unsigned Double Integer and Double Word Constant Expressions......445
Long Integer Constant Expressions .......................................................446
Unsigned Long Integer and Long Word Constant Expressions.............447
Real Constant Expressions.....................................................................448
Long Real Constant Expressions ...........................................................449
Timer Constant Expressions ..................................................................450
Date Constant Expressions ....................................................................451
String Constant Expressions ..................................................................451
Reserved Keywords ...............................................................................453
Directly Represented Variables .............................................................455
Information on Variables .......................................................................457
Boolean Variables (BOOL) ...................................................................458
ISaGRAF 5.2
- Workbench xi
xii
Short Integer Variables (SINT) .............................................................458
Unsigned Short Integer (USINT) or BYTE Variables ..........................458
Integer Variables (INT) .........................................................................459
Unsigned Integer (UINT) or WORD Variables.....................................459
Double Integer Variables (DINT)..........................................................460
Unsigned Double Integer (UDINT) or Double Word (DWORD) Variables460
Long Integer Variables (LINT) .............................................................461
Unsigned Long Integer (ULINT) or Long Word (LWORD) Variables 461
Real Variables (REAL)..........................................................................462
Long Real Variables (LREAL)..............................................................462
Timer Variables (TIME)........................................................................463
Date Variables (DATE) .........................................................................463
String Variables (STRING) ...................................................................463
Divergences and Convergences.................................................................. 472
Single Divergences (OR).......................................................................472
Double Divergences (AND) ..................................................................474
Calling Functions and Function Blocks.................................................481
Conditions Attached to Transitions ............................................................ 482
Condition Programmed in ST................................................................482
Condition Programmed in LD ...............................................................483
Calling Functions from a Transition......................................................483
Calling Function Blocks from a Transition ...........................................484
ISaGRAF 5.2
- Table of Contents
FC I/O Specific Actions.........................................................................495
FC Complex Structure Examples...........................................................497
FBD Diagram Main Format........................................................................ 501
Calling Functions and Function Blocks...................................................... 506
Power Rails and Connection Lines............................................................. 508
Contact with Rising Edge Detection......................................................513
Contact with Falling Edge Detection.....................................................514
Coil with Rising Edge Detection ...........................................................519
Coil with Falling Edge Detection ..........................................................520
ISaGRAF 5.2
- Workbench xiii
xiv
IEC 61499 Program Main Format.............................................................. 526
Basic IEC 61499 Function Block Format .................................................. 529
Composite IEC 61499 Function Block Format.......................................... 531
IEC 61499 Function Block Main Format................................................... 532
Implementation of the WITH Qualifier...................................................... 534
Execution Control Chart Cycles................................................................. 535
Cycle Execution Time in IEC 61499 Programs ......................................... 536
Functions or Function Block Calls ............................................................. 540
Calling Function Blocks ........................................................................542
Assignment ......................................................................................543
RETURN Statement ..............................................................................544
IF-THEN-ELSIF-ELSE Statement........................................................545
WHILE Statement .................................................................................547
REPEAT Statement ...............................................................................548
GSTART Statement in SFC Action.......................................................552
GKILL Statement in SFC Action ..........................................................553
GFREEZE Statement in SFC Action.....................................................554
GRST Statement in SFC Action............................................................555
GSTATUS Statement in SFC Action ....................................................556
ISaGRAF 5.2
- Table of Contents
Calling Function Blocks: CAL Operator ...............................................569
ANY_TO_DWORD ................................................................................... 600
ANY_TO_LWORD.................................................................................... 605
ISaGRAF 5.2
- Workbench xv
xvi
CURRENT_ISA_DATE ............................................................................ 664
ISaGRAF 5.2
- Table of Contents
GET_TIME_STRING ................................................................................ 694
ISA_SERIAL_CLOSE ............................................................................... 698
ISA_SERIAL_CONNECT ......................................................................... 699
ISA_SERIAL_DISCONNECT................................................................... 701
ISA_SERIAL_RECEIVE ........................................................................... 703
ISA_SERIAL_STATUS............................................................................. 708
ISaGRAF 5.2
- Workbench xvii
xviii
FC_GET_STAT.................................................................................... 772
GET_TIME_STRUCT ......................................................................... 776
ISaGRAF 5.2
- Table of Contents
NEW_MATRIX.................................................................................... 841
FREE_MATRIX ................................................................................... 843
GET_I_MATRIX.................................................................................. 844
PUT_I_MATRIX.................................................................................. 845
GET_F_MATRIX................................................................................. 847
PUT_F_MATRIX ................................................................................. 848
DUP_MATRIX..................................................................................... 849
COPY_MATRIX .................................................................................. 851
COPY_ROW_MATRIX....................................................................... 852
COPY_COL_MATRIX ........................................................................ 854
TYPE_MATRIX................................................................................... 856
ROWS_MATRIX ................................................................................. 857
COLS_MATRIX................................................................................... 858
TRANSPOSE_MATRIX...................................................................... 859
INVERT_MATRIX .............................................................................. 861
ADD_MATRIX .................................................................................... 863
SUBTRACT_MATRIX........................................................................ 865
MULTIPLY_MATRIX......................................................................... 867
SCALAR_I_MATRIX.......................................................................... 869
SCALAR_F_MATRIX......................................................................... 871
PRINT_MATRIX ................................................................................. 873
ISaGRAF 5.2
- Workbench xix
xx
E_TABLE_CTRL................................................................................. 898
ISaGRAF 5.2
- Table of Contents
Workbench
The Workbench is the environment in which you develop multi-process control projects made up of virtual machines running on hardware components, called target nodes. The development
process consists of creating projects made up of configurations, representing, individual target
nodes, on which one or more instances of resources, i.e., virtual machines, are downloaded. At
runtime, the virtual machines run on these target nodes.
Projects can be developed using any of the five languages of the IEC 61131-3 standard: SFC:
Sequential Function Chart (or Grafcet), FBD: Function Block Diagram, LD: Ladder Diagram,
ST: Structured Text, and IL: Instruction List. You can also use the Flow Chart language.
Furthermore, using the IEC 61499 language, i.e., distribution method, enables the distribution
of function blocks across multiple resources. When building, resources are compiled to produce very fast "target independent code" (TIC) or "C" code.
Within resources, you can declare variables using standard IEC 61131-3 data types (i.e.,
Boolean, integer, real, etc.) or user-defined types such as arrays or structures. For defined variables, you can set up alarms, events, and trending. Furthermore, field communications
allow you to connect variables to field equipment. Resources can share variables using internal
bindings or external bindings. Internal bindings are between resources within the same project.
External bindings are between resources belonging to different projects. For IEC 61499 programs, bindings between function blocks declared in different resources are automatically created.
ISaGRAF 5.2
- Workbench 1
You develop projects on a Windows development platform, in the Workbench and language
Libraries made up of configurations and resources enable you to define functions and function
blocks for reuse throughout projects.
Individual resources, from the configurations making up a project, are downloaded, using the
ETCP or ISARSI (serial link) network, onto target nodes running real-time operating systems.
Communication between configurations can be implemented using the TCP\IP network. You can choose to implement any other network.
You can choose to simulate the running of a project, after building a project, using high-level
debugging tools, before actually downloading the resources making up configurations to the
target nodes.
You can set four levels of access control in a Workbench application:
password protection and read-only mode for a complete project
password protection and read-only mode for individual resources
password protection for individual POUs
password protection for a target
2
ISaGRAF 5.2
- User Guide
Appearance
ISaGRAF 5.2
- Workbench 3
Title Bar
For help locating the Title Bar, see the Appearance diagram. The Title Bar displays the
application name and the filename of the active project, if any are open, along with the current
view (Hardware Architecture, Link Architecture, Dictionary or I/O Wiring).
Control Icon
At the left end of the Title Bar is the Control Icon, which is used to access the Control Menu
(see following section). Double-clicking on the Control Icon closes the Workbench.
Control Menu
Clicking on the Control icon opens the Control Menu. The Control Menu is used to position the Main Window or to exit.
Window Buttons
The standard window buttons appear at the right end of the Title Bar. Use these to resize or close the Window.
4
ISaGRAF 5.2
- User Guide
Menu Bar
The options available from the menu bar differ slightly for the hardware architecture and link architecture views of a project. Some options are available as keyboard commands.
File New Project/Library Ctrl+N
creates a new project or library
Edit
Open Project/Library
Save Project/Library
Rename Project/Library
Project Properties
Import
Export
Exit
Open
Edit (Cont) Undo
Redo
Ctrl+O
Ctrl+S
Ctrl+P
Ctrl+Q
Alt+N
Ctrl+Z
Ctrl+Y
opens an existing project or library saves the current project or library
renames the current project or
imports types of information:
- PLC definitions using text files generated with the Target Definition
Builder
- Workbench elements (projects, configurations, resources, and
POUs). For resources, you can choose to import the following: the resource, properties, wired variables.
- variables exports Workbench elements
(projects, configurations, resources, and POUs).For resources, you can choose to import the following: the resource, properties, wired variables.
variables
accesses the Document Generator
leaves the Workbench opens the item selected from a resource. This option is only
available in the link architecture view.
cancels the last action restores the last cancelled action
ISaGRAF 5.2
- Workbench 5
Insert
Cut
Copy
Paste
Delete
Find / Replace in POUs
Select All
Properties
Move to lower level
Move to upper level
Configuration
Ctrl+X
Ctrl+C
Ctrl+V
DEL
Ctrl+F
Ctrl+A removes the selected item and places it on clipboard takes a copy of the selected item and places it on the clipboard. For the
link architecture view, this option
appears as Copy Program where it
copies an entire selected program.
inserts the contents of the clipboard into the selected item removes the selected item from the selected item
finds and replaces text in a project, a
configuration, a resource, or a POU selects all items in the active view accesses the properties for the selected item
sets the selected FC or SFC program
as a sub-program of the next
program in the resource. This option
is only available in the link architecture view.
sets the selected FC or SFC program
as a parent program of the previous program in the resource. This option
is only available in the link architecture view.
inserts a configuration in the
workspace. This option is only
available in the hardware architecture view.
6
ISaGRAF 5.2
- User Guide
Insert
(Cont)
Project
Resource
Network
Add Variable Group
Add Program
Add SFC Sub-program
Types
Variables
Function /Function Block
Parameters
Ctrl+3
Ctrl+G
inserts a resource. For the hardware
architecture view of a project, you
insert resources in selected
configurations. For the link architecture view, you insert
inserts a network in the workspace.
This option is only available in the
adds a variable group to the selected
available in the link architecture view.
adds a program to the selected
available in the link architecture view.
adds an SFC sub-program to the
program is selected, adds an FC sub-program. This option is only
available in the link architecture view.
accesses the Types Tree of the
accesses the Variables Tree of the
accesses the Parameters Tree of the
Dictionary view. This option is only
available in the link architecture view.
ISaGRAF 5.2
- Workbench 7
Project
(Cont)
External Binding List
Internal Binding List
Project
(Cont)
Defined Words
I/O Wiring
Build Project/Library
Rebuild Project/Library
Clean Project/Library
Build/Download/Debug
Build/Simulate
Build Resource
Rebuild Resouce
Clean Resource
Build Program
Stop Build
Ctrl+0
Ctrl+1
Ctrl+2 accesses the External Binding list window where you can define
external variable bindings between
producer variables of a source resource in a given project with consumer variables of a destination resource in a different project accesses the Binding List window for the selected binding. This option
is only available in the link architecture view.
accesses the Defined Words Tree of
compiles the current project or
recompiles the complete current project removes files created during the last
build of the current project or library
compliles the project, downloads the project onto selected target and starts the project in debug mode compliles the project and starts simulation mode
compiles the selected resource
recompiles the selected resource removes files created during the last
build of the selected resource
compiles the selected program. This
option is only available in the link architecture view.
8
ISaGRAF 5.2
- User Guide
Tools
Tools
(Cont)
Run Time Settings
Build Settings
Compact Database
Edit Project Description
Edit Description
Unlock Resource
Add/Remove Dependencies
Browser
Events Viewer
ISaVIEW Screen Builder
Ctrl+K
Ctrl+B accesses the selected resource’s
accesses the selected resource’s
optimizes the current project’s database accesses the description editor for
the current project or library
accesses the description editor for the selected item unlocks a resource currently locked by another user. This option is only
available when editing a project in
normal mode and one or more resources of the project are opened in single-resource editing mode by other users.
accesses the Add/Remove
Dependencies window where you
define the libraries used by a project
accesses the cross references browser listing and localizing all
instances of global variables (cross references) and I/Os declared in a project
launches the ISaVIEW screen builder for use while debugging applications
ISaGRAF 5.2
- Workbench 9
Debug
Check-in
View History
Download
On-line Change: Download
On-line Change: Update
Start
Stop
Start from code saved on
Target
Save Code on target
Clean Stored Code
Ctrl+M
Alt+F6
Alt+F7
Checks in a project, configuration, resource, or POU definition into a version source control repository
Views the history of a project, configuration, resource, or POU that has been checked into a version source control repository accesses the Download editor from
where you download resources onto
target nodes starts the project in debug mode starts the project in simulation mode
downloads only the changes made
since the last download for the
selected running resource. The
download includes the symbol table
(complete or reduced as selected in
the resource’s compilation options).
updates a resource running on a target to use the latest on-line change download code. For use when you chose to update the resource code later.
starts the selected resource, while in
run mode
stops the selected resource, while in
run mode
restarts the selected resource using
the code saved on the target node saves the code of the running
removes code previously saved on a target
10
ISaGRAF 5.2
- User Guide
Debug
(Cont)
Options
Diagnosis
Refresh Status
Real Time / Cycle to Cycle
Execute one cycle
Change Cycle timing
Step
Step Into
Show Current Step
Layout
Customize
Hide Bitmaps
displaying general and status
information for the selected resource
updates the resource status information, appearing in the title
bar, for all resources switches between real time and cycle to cycle mode for the selected
Alt+F10 executes one cycle at a time, while in cycle to cycle mode
Alt+F8
Alt+F9 accesses the Cycle Time editor
where you set the cycle time for the
Ctrl+U accesses the Layout editor where you specify which toolbars to display and the magnification of the
accesses the customization properties for Workbench views and editors
enables the hiding or showing of the bitmap images assigned to each configuration. This option is only available in the hardware architecture view.
ISaGRAF 5.2
- Workbench 11
Options
(cont)
Window
Help
Hide Links
Cascade
Tile
Show Spy List
Show Project Tree View
Show Output Window
Clear Output Window
Contents
Search Help On...
Get News From ISaGRAF
Ctrl+4
F1
About enables hiding or showing of the different types of binding links
(user-defined and IEC 61499) between resources. This option is only available in the link architecture view.
sets the different views of the project to appear in a cascading manner sets the different views of the project to appear in a tiled manner accesses the Spy List window where you specify variables whose values
are displayed while in test mode
displays the project structure and enables accessing aspects of the currently opened project
displays the output window below
clears the contents of the output window
accesses the online help not currently supported accesses the current news about
ISaGRAF on the ICS Triplex
ISaGRAF website displays product and version information
Note:
When no projects are open, only the File and Help menus are visible.
12
ISaGRAF 5.2
- User Guide
Using the Menus:
1.
Open a menu by clicking on it, or by pressing (
Alt
) plus the letter that is underlined in the menu's title. For example, to open the File Menu, you press (
Alt
) + (
F
) (shown in this User's Guide as (
ALT+F
)).
2.
Choose a menu selection by clicking on it, by pressing its underlined letter, or by using the cursor keys to highlight it and then pressing (
Enter
). Menu selections that appear in grey are not currently available.
Control Icon
When a project is open and not displayed in Cascade or Tile mode, the menu bar has a Control
Icon on the left. This icon indicates the current view.
Control Menu
Clicking on the Control Icon opens the Control Menu. The Control Menu is used to position
the Window or to alternate between views (see Window Buttons Toolbar).
Window Buttons
The standard window buttons appear at the right end of the menu bar.
ISaGRAF 5.2
- Workbench 13
Toolbars
Many toolbars performing different tasks are available for use in the hardware and link architecture views:
Version Source Control Toolbar
While performing I/O wiring tasks in the I/O Wiring view, the I/O Wiring toolbar becomes
available.
To show or hide toolbars
You can choose to show as many toolbars as required.
1.
From the Options menu, choose
Layout
.
The Layout editor appears.
2.
To show toolbars, check the required toolbars then click
OK
.
3.
To hide toolbars, uncheck the toolbars then click
OK
.
To move a toolbar
Toolbars can be placed anywhere on the screen, their position is retained until the next change.
1.
Point the cursor at the toolbar's title bar or main panel. Do not point at the control icon or one of the window's buttons.
14
ISaGRAF 5.2
- User Guide
2.
Press and hold the left mouse-button.
3.
Drag the toolbar by moving the mouse.
4.
Release the mouse-button.
Docking toolbars
Dock a toolbar to a side of the Workspace by positioning it at the Workspace's edge.
Switch back and forth between a toolbar's floating and docked states.
Standard Toolbar
Cuts the selection and places it on the clipboard
Copies the selection and places it on the clipboard
Pastes the contents of the clipboard
Undoes the last operation
Redoes the previously undone operation
ISaGRAF 5.2
- Workbench 15
16
Moves to upper level on currently selected SFC or FC program
Moves to lower level on currently selected SFC or FC program
Accesses the document generator where you can print different parts of a
project
Builds the current project/library
Rebuilds the current project/library
Downloads resource code to targets
Switches an application to debug mode
Switches an application to simulation mode
Performs an Online Change: Download
ISaGRAF 5.2
- User Guide
Accesses the web site
Debug Toolbar
The Debug toolbar is accessible when you run a project in either Debug or simulation mode.
Cleans all stored code
Switches an application to real-time mode
Switches an application to cycle-to-cycle mode
line of code or
rung
ISaGRAF 5.2
- Workbench 17
18
line of code or
rung
Sets or removes a breakpoint. For LD programs only
Removes breakpoints. For LD programs only
Shows/Hides output values. For FBD programs only
Displays the spy variable list
Stops the debug/simulation mode
Refreshes the status of resources
Displays the ISaVIEW screen builder
ISaGRAF 5.2
- User Guide
Window Buttons Toolbar
Switches the Workbench to the Hardware Architecture view
Switches the Workbench to the Link Architecture view
Switches the Workbench to the Dictionary view
Accesses the Binding window where you can create data links between
resources and define the variable bindings using these links
project with consumer variables of a destination resource in a different project
Accesses the cross references browser
Launches the ISaVIEW screen builder for use while debugging applications
ISaGRAF 5.2
- Workbench 19
Layers Toolbar
Toggles between the link architecture view and the
Sets the project layer to display. The available layers are Base
Layer (link architecture view or hardware architecture) and 1499
Version Source Control Toolbar
Checks in a project, configuration, resource, or POU definition into a version source control repository
Views the history of a project, configuration, resource, or POU that has been checked into a version source control repository
Options Toolbar
Shows or hides the data links between resources
Sets the magnification factor for the workspace
20
ISaGRAF 5.2
- User Guide
I/O Wiring Toolbar
Opens a device
Saves the I/O Wiring
Accesses the document generator
Undoes the last operation
Redoes the last operation
Maps logical and physical channels
Accesses help on selected I/O device in Tree view
ISaGRAF 5.2
- Workbench 21
Moves the selected device up within the Tree view
Moves the selected device down within the Tree view
22
ISaGRAF 5.2
- User Guide
Workspace
The Workspace can be split into a maximum of four simultaneous views:
Note:
Sub-windows are zoomed independently.
ISaGRAF 5.2
- Workbench 23
To split the workspace
Drag and drop the handles to the required positions:
Zoom
You can adjust the magnification factor, i.e., zoom, for the workspace. Elements appear with more detail as the zoom level increases. You can set the zoom from the Options toolbar or in the Layout editor. You access the Layout editor by choosing
Layout
from the Options menu.
When editing SFC, FC, LD, and FBD POUs, you can also adjust the magnification factor for the language editor’s workspace.
To adjust the zoom level
1.
On the Options toolbar, click the arrow of the magnification window
2.
Choose a magnification factor from the list.
The workspace is displayed using the new magnification factor.
.
24
ISaGRAF 5.2
- User Guide
Output Window
The output window displays information resulting from builds of projects, resources, and programs. It also displays Workbench run-time errors. When building a program, the output window is automatically displayed. The Output window is also available from the language editors.
You can copy to the clipboard the information displayed in the output window.
To view the Output Window
"
From the Window menu, choose
Show Output Window
.
To clear the contents of the output window
"
From the Window menu, choose
Clear Output Window
.
ISaGRAF 5.2
- Workbench 25
Contextual Menus
Contextual menus are displayed by right-clicking in the workspace of the various tools and
applications. From the Hardware Architecture view, you can access a contextual menu for configurations or resources. For configurations, you access it by right-clicking a configuration's title bars. For resources, you access it by clicking a resource’s name in the configuration window. From the Link Architecture view, you can access a contextual menu for resources by right-clicking a resource’s title bar.
Example
26
ISaGRAF 5.2
- User Guide
Status Bar
A status bar appears at the bottom of the main window displaying information about commands, operations, and projects.
To show or hide the status bar
1.
From the Options menu, choose
Layout
.
The Layout editor appears.
2.
To show the status bar, check
Status Bar
then click
OK
.
3.
To hide the status bar, uncheck
Status Bar
then click
OK
.
ISaGRAF 5.2
- Workbench 27
Customization
You can choose to customize the colors and fonts for many aspects of the Workbench as well as set working preferences. You can customize the colors and fonts for the following items:
For the dictionary, you can set the font and the colors used for text, scope, and instances
For the ST and IL editors, you can set the font and the colors used for background and text (basic syntax)
For the FBD editor (includes Basic IEC 61499 and Composite IEC 61499), you can set the font and the colors used for background, text, connection and element outline lines, line shadows, and selected elements as well as the fill for main elements
For the LD, FC, and SFC editors, you can set the font and the colors used for background and text as well as the fill for main elements
For the FBD and LD editors, you can set the color for comments and for Boolean values
(TRUE and FALSE) displayed while in debug mode.
You can also set the colors for resource data links used with bindings.
You can set the following working preferences:
The number of recent project files to display in the File menu
Reload the last project at startup
Always prompt before saving changes to the project
28
ISaGRAF 5.2
- User Guide
To customize colors and fonts
Resetting the default for an item restores the colors and fonts to those when the Workbench was installed.
1.
From the Options menu, choose
Customize
.
2.
On the Customize editor, select the Colors and Fonts tab, then select the item to modify.
3.
To change the font used, select a font and size. You can choose to bold the font.
4.
To change the foreground or background colors, click the respective button, then from the color editor, choose a pre-defined color or specify a custom color.
ISaGRAF 5.2
- Workbench 29
To set working preferences
1.
From the Options menu, choose
Customize
.
2.
On the Customize editor, select the Preferences tab.
3.
Make the desired changes.
30
ISaGRAF 5.2
- User Guide
Directory Structure
The installation process creates three directory structures each holding different read/write properties. The read-only program files are installed in the Program Files directory:
ICS Triplex ISaGRAF
ISaGRAF
Bin
5.2
Root directory for all ICS
Triplex ISaGRAF products
ISaGRAF Workbench files
Executable files
Isa3
Shared
Projects
Simul
Error Reporting
Help
Lang
5.2
ISaGRAF Products Uninstaller
Licensing
Sentinel
ISaGRAF compiler program files
Directory holding sub-directories of resource files for each language
Simulator target files
Common files shared by
ICS Triplex ISaGRAF products
Solobug files for use when reporting errors on ICS
Triplex ISaGRAF products
Online help files for ICS
Triplex ISaGRAF products
ISaGRAF program for uninstalling
License manager program files
Sentinel driver files for use with hardware keys
(third-party)
ICS Triplex ISaGRAF projects
ISaGRAF 5.2
- Workbench 31
ISaGRAF
5.2
Prj
ISaGRAF Workbench projects
Projects
<project>
<configuration>
Individual Project
Directories
A directory per hardware configuration
A directory per resource <resource
<Data_IEC61499> A directory per project holding defined IEC 61499 programs
The read/write project, template, and license files are installed in the following directory structure in the Windows' All Users/Shared Documents folder:
ICS Triplex ISaGRAF
ISaGRAF
Prj
5.2
Bitmaps
Root directory for all ICS
Triplex ISaGRAF projects, templates, and license files
ISaGRAF Workbench projects
Sample images provided for application usage
Projects
<project>
Tpl
<configuration>
<resource
<Data_IEC61499>
Individual Project
Directories
A directory per hardware configuration
A directory per resource
A directory per project holding defined IEC 61499 programs
ISaGRAF templates
32
ISaGRAF 5.2
- User Guide
ISaGRAF 5.2
- Workbench
EmptyLibmonoresource
<configuration>
<resource>
EmptyLibmultiresource
<configuration>
<resource>
EmptyPrjmonoresource
<configuration>
<resource>
EmptyPrjmultiresource
<configuration>
<resource>
Libmonoresource
<configuration>
<resource>
Libmultiresource
<configuration>
<resource>
Prjmonoresource
EmptyLibmonoresource templates
A directory per hardware configuration
A directory per resource
EmptyLibmultiresource templates
A directory per hardware configuration
A directory per resource
EmptyPrjmonoresource templates
A directory per hardware configuration
A directory per resource
EmptyPrjmultiresource templates
A directory per hardware configuration
A directory per resource
Libmonoresource templates
A directory per hardware configuration
A directory per resource
Libmultiresource templates
A directory per hardware configuration
A directory per resource
Prjmonoresource templates
33
<configuration>
<resource>
Prjmultiresource
<configuration>
<resource>
A directory per hardware configuration
A directory per resource
Prjmultiresource templates
A directory per hardware configuration
A directory per resource
The read/write program files are installed in the following directory structure in the hidden
Windows' All Users/Application Data folder:
ICS Triplex ISaGRAF
ISaGRAF
Bin
5.2
Root directory for all ICS
Triplex ISaGRAF read/write program files
ISaGRAF Workbench files
Simul
Tmp
User
Isa3
Workbench initialization and log files
ISaGRAF 3 initialization and log files
Simulator target initialization and log files
Temporary Workbench files
User-specific initialization files
Projects are stored in the Projects directory, as MS-Access database (.MDB) files:
<drive>:Documents and Settings/All Users/Documents/ICS Triplex
ISaGRAF/Projects/ISaGRAF
5.2
/Prj/<project name>/PRJLIBRARY.MDB
For details on the project architecture, see page 424.
Note:
Existing projects can be manually moved or copied to the "Tpl" directory to create new project templates.
34
ISaGRAF 5.2
- User Guide
Example
The
panel
resource in the
main
configuration within the
proj1
project is stored in the directory:
<drive>:Documents and Settings/All Users/Documents/ICS Triplex
ISaGRAF/Projects/ISaGRAF
5.2
/Prj/proj1/main/panel/
ISaGRAF 5.2
- Workbench 35
Working with Projects
You can work with
ISaGRAF
projects in one of two project editing modes:
Normal
Single-resource
The normal mode provides access for a single user to all resources and POUs making up a project. While in the normal mode, no other users can access the project or its resources. Before opening a project in normal mode, multiple users can access the individual resources of the project for editing purposes, i.e., single-resource editing mode. The single-resource mode limits access for an individual user to one resource and its POUs. Other users can access other resources of the same project.
Note:
Make sure to build the complete project in normal mode before editing single resources.
Otherwise, a build while in single-resource mode may generate errors.
Only one user can access a resource at any given time; while in use, a resource remains locked to all other users. For instance, when editing a project in normal mode, all resources making up the project are automatically locked for your use except for those resources currently open in single-resource mode. The currently open resources are displayed in the workspace but remain locked. Locked resources appear gray with a lock symbol in their title bar.
36
ISaGRAF 5.2
- User Guide
You can unlock resources currently open in single-resource mode by another user by selecting the resource, then choosing
Unlock Resource
from the Tools menu.
Warning:
The Unlock Resource option should only be used when necessary. When unlocking resources currently opened by another user, make sure the remote Workbench is no longer running.
The Workbench automatically assigns a user name to a project, when running on a network.
The user name is displayed in the status bar and in the access control properties of the
resources. The assigned user name depends on the editing mode:
In normal mode, the user name is always
Username
.
Administrator
In single-resource mode, the user name is the Windows login user name of the user editing the resource
ISaGRAF 5.2
- Workbench 37
Resources currently opened by another user hold the name of that user in their properties.
In single-resource mode, a project is displayed in the link architecture view with the project
and resource identification in the title bar of the single resource. The hardware architecture
view and binding list are not available. In the dictionary view and the I/O wiring view, only the
variables and wiring defined for the resource are displayed. Variables bound to other resources as well as types and defined words are in read-only mode. While in single-resource mode, you
can switch a project to debug or simulation mode.
While in normal mode, you can perform the following tasks:
While in the normal or single-resource project editing mode, you can perform the following tasks with limitations depending on the mode:
You can also control access to projects.
38
ISaGRAF 5.2
- User Guide
Creating Projects
When you create projects, you use one of four templates:
Prjmonoresource, containing one resource in one configuration
Prjmultiresource, containing two resources in two different configurations linked by an
ethernet network. This template is not available for use with non-networked versions of the Workbench.
EmptyPrjmonoresource, containing one resource in one configuration
EmptyPrjmultiresource, containing two resources in two different configurations linked
by an ethernet network
The Prjmonoresource and Prjmultiresource templates are available for use with all pre-defined target platforms. Whereas, the EmptyPrjmonoresource and EmptyPrjmultiresource templates are available for use with the simulator or custom targets, networks, and other elements defined using the Target Definition Builder. The Libmonoresource, Libmultiresource,
EmptyLibmonoresource, and EmptyLibmultiresource templates are available for use with
To create a new project
1.
From the File menu, choose
New Project
<Ctrl+N>
The New Project dialog box is displayed:
2.
Enter a project name (max 128 characters) and comments (optional).
ISaGRAF 5.2
- Workbench 39
3.
Choose a template.
4.
Click
OK
.
The project is created using the chosen
template
and the link architecture view is displayed.
You can only open one project at any given time. When changes have been made to an open
project, you will automatically be prompted to save the changes before creating a new one.
Opening and Closing Projects
In the Workbench, you can only open one project at any given time. If changes have been made
to an open project, the system automatically prompts you to save changes before closing a
project or opening another. You can open projects in one of two project editing modes: normal
and single-resource.
Project filenames are always PRJLIBRARY.MDB, the project directory name represents the
given project name. When you open a project or create a new project, the hardware architecture
view and the link architecture view are cleared. When a project has been relocated, you need
to redefine its links within the Workbench before opening it.
When opening a project in single-resource editing mode, you need to select the project, then
choose a resource from the list of resources defined for the project. In the list of resources,
resources appear with icons indicating their security state or non-availability:
Resource unavailable, currently open by another user
When the advanced options are installed on your computer, you can choose to open a project without the advanced options features such as alarms and events, trends, and field communications.
40
ISaGRAF 5.2
- User Guide
To open an existing project
1.
From the File menu, choose
Open
.
The
Open Project
dialog box is displayed:
2.
Do one of the following:
To open the project in normal editing mode, click
Open
.
The project is open in the normal editing mode having access to all resources and POUs.
To open the project in single-resource editing mode, check
Open in single-resource mode
, then click
Open
.
The Resource Selection window is displayed with all project resources showing their security states or non-availability.
ISaGRAF 5.2
- Workbench 41
3.
From the list of available resources, select the resource to open, then click
OK
.
The project is open in the single-resource editing mode where only the selected resource
is editable.
To open a project using a command line
You can open projects in single-resource editing mode or in read-only mode using a
command line.
"
To open the project in single-resource editing mode from a command line, use the following syntax:
DPM.exe
project_path
-res
resource_name
Note:
For command lines, resource names are case sensitive. You can also use the resource number to identify the resource.
When manually starting the Workbench, you may need to provide the location of the
Workbench project. The Workbench needs to be started in it's location directory. For example:
"C:\Program Files\ICS Triplex ISaGRAF\ISaGRAF\Bin\DPM.exe" "C:\ICS Triplex
ISaGRAF/Projects/ISaGRAF/Prj/Project1" -res Lead
"
To open the project in read-only mode from a command line, use the following syntax:
DPM.exe
project_path
-readonly
When manually starting the Workbench, you may need to provide the location of the
Workbench project. The Workbench needs to be started in it's location directory. For example:
"C:\Program Files\ICS Triplex ISaGRAF\ISaGRAF\Bin\DPM.exe" "C:\ICS Triplex
ISaGRAF/Projects/ISaGRAF/Prj/Project1" -readonly
42
ISaGRAF 5.2
- User Guide
Saving Projects
The project name is used to create a unique directory structure. Saving the project saves it in
the MS-Access database of the project root directory. Other files related to the project are also
updated in this directory structure. When editing a project in single-resource mode, changes are
only saved for the edited resource.
To save a project
"
From the File menu, choose
Save Project
.
Note:
When a project is saved, the undo/redo history is cleared.
Renaming Projects
You can rename projects and edit their comments. You cannot rename projects while in
single-resource editing mode. Before renaming projects, make sure to close all Workbench
windows such as language editors and browsing tools.
To rename a project
1.
From the File menu, choose
Rename Project
.
The Rename Project dialog box appears:
2.
Change the name and comment as required.
3.
Click
OK
.
The directory structure containing the project is renamed when you save changes to the project.
ISaGRAF 5.2
- Workbench 43
Adding a Project Description
You can include a text description for a project.
To edit the project description
"
From the Tools menu, choose
Edit Project Description
.
Printing Projects
To print the current Project
"
From the File menu, choose
.
The document generator appears with a standard list of elements to be printed for a complete project.
44
ISaGRAF 5.2
- User Guide
Project Access Control
For project security, you can control access using a password. You can also apply the read-only mode to the entire project. In read-only mode, users not having the password will have read-only access to the project. When opening a project in read-only mode, all resources and
POUs making up the project are set to read-only mode. However, individual resources and
POUs making up projects can have their own access control. For instance, a resource having its own password without the read-only option remains locked and cannot be viewed without its password. While in read-only mode, you cannot build a project. When importing and exporting projects having access control, password definitions are retained.
To set access control for a project
When a password is set for a project, you can choose to enable users not having the password to open the project in read-only mode. The read-only mode for a project is applied to all resources and POUs making up the project. However, individual resources and POUs may have their own access control.
1.
From the File menu, choose
Project Properties
.
The Project Properties Security editor is displayed.
2.
In the New field, enter the password for the project.
ISaGRAF 5.2
- Workbench 45
3.
In the Confirm New field, reenter the password.
4.
To enable users not having the password to open the project in read-only mode, check
Read Only
.
46
ISaGRAF 5.2
- User Guide
Importing and Exporting Workbench
Elements
You can import and export Workbench elements, i.e., projects, configurations, resources,
POUs, and defined words from one project to another. For resources, you can import and
export the following parts: properties, device instances, global variables, wired variables, and external bindings. When importing sub-elements of resources, these elements are appended within the project, i.e., unique elements remain intact, duplicate elements are replaced, and new elements are added. For POUs, these can be added or replaced. For projects, you can also export defined words. When exporting an element, the element is copied from the project and compressed into an exchange file (.PXF) holding all data except for spy lists and step-by-step debug information. Therefore, enabling you to copy and paste elements from one project to another. When importing and exporting elements having access control, password definitions are retained.
To export a Workbench element
1.
Depending on the element type, do one of the following steps:
For projects, from the File menu, choose
Export
, then
Project
, then
Entire Project
.
For configurations, resources, and POUs, select the element (either from the link
architecture or hardware architecture view), from the File menu, choose
Export
, then the element type.
For resource parts, from the File menu, choose
Export
, then
Resource
, then the specific part.
For defined words, from the File menu, choose
Export
, then
Project
, then
Defined Words
.
2.
In the Export window, select a directory in which to store the compressed exchange file, then click
Start
.
3.
To close the window when the export is complete, click
Close
.
ISaGRAF 5.2
- Workbench 47
To import a Workbench element
You can only import Workbench elements that have previously been exported and stored as compressed exchange files. You cannot import elements having the same name as those in a project. Before importing an element, you can choose to create an automatic backup of your project.
1.
From the File menu, choose
Import
, then
Exchange File
.
2.
In the Import Exchange File window, select the
Import from file
option, then click
Next
.
3.
Click
Browse
to locate the compressed exchange file (.PXF file), then click
Next
.
4.
In the list at the top of the window, select the file name, then click
Next
.
5.
From the contents of the exchange file, select the element to import. For resources and
POUs, you also need to select the import destination.
6.
Click
Next
.
7.
Assign a name to the new element that will be created. For POUs, you need to indicate whether to replace the existing POUs or rename these as a copy.
Note:
Before importing elements, you should make a back-up copy of your project so that you
could restore it if the resulting import is unsatisfactory.
48
ISaGRAF 5.2
- User Guide
8.
To create a backup copy of the project, check
Create a backup copy of the project before importing element
.
The <prjlibrary.BAK> file is created in the project folder. If the results of the import are
unsatisfactory, you can choose to restore the project.
9.
Click
Next
.
The element import begins.
10.
When the import is complete, do one of the following:
To import another element from the exchange file, click
Next
.
To exit the dialog, click
Close
.
To restore a project from a backup
1.
Close the workbench.
2.
Replace PrjLibrary.mdb with PrjLibrary.bak.
3.
Remove (or rename) the <
element_name
> directory.
4.
Rename <
element_name.BAK
> directory into <
element_name
> directory.
ISaGRAF 5.2
- Workbench 49
Uploading Workbench Elements from
Targets
You can upload Workbench elements from any project into another when the resources’ code
has been stored on the target (if non-volatile storage exists for the platform). The element
source file is compressed and contains all data for the element. The file is in the same format,
Before uploading an element’s source file, you need to download its source code onto the
target. Furthermore, when setting up the resource’s Compilation Options properties, you need
to check the
Embed Zip Source
option and select the element type.
To upload an element from sources on a target
The element upload process consists of uploading the source file containing the element from the target onto the local computer for access, then importing the element into the project from the source file. Before importing an element from an uploaded source file, you can choose to
create an automatic backup for your project.
1.
In the project, make sure that the configuration (in which to upload the element) is
connected to the correct network with the correct connection parameters (IP Address for ETCP).
2.
From the File menu, choose
Import
, then
Exchange File
.
3.
In the Import Exchange File window, select the
Upload from target
option, then click
Next
.
4.
From the list of available configurations, select the configuration where the required sources are located, then click
Next
.
5.
From the list of available sources, select the one to upload, then click
Next
.
6.
When the upload is complete, click
Next
.
50
ISaGRAF 5.2
- User Guide
7.
From the contents of the exchange file, select the element to import (for resources and
POUs, you also need to select the import destination), then click
Next
.
8.
Assign a name to the new element that will be created.
Note:
Before importing elements, you should make a back-up copy of your project so that you
could restore it if the resulting import is unsatisfactory.
9.
To create a backup copy of the project, check
Create a backup copy of the project before importing element
.
The <prjlibrary.BAK> file is created in the project folder. If the results of the import are
unsatisfactory, you can choose to restore the project.
10.
Click
Next
.
The element import begins.
11.
When the import is complete, do one of the following:
To import another element from the exchange file, click
Next
.
To exit the dialog, click
Close
.
ISaGRAF 5.2
- Workbench 51
Link Architecture View
The
link architecture
view graphically displays the resources of a Project and the
resource data links between them. This is the default view of the Workbench providing a main
entry point to all editors. In the link architecture view, you manage many aspects of a project:
linking resources (data links for bindings between resources)
creating and manipulating POUs (Program Organization Units)
To access the link architecture view
"
From the Window menu, choose
project_name
-
Link Architecture
.
52
ISaGRAF 5.2
- User Guide
Resources
Each resource is displayed as a separate
window
within the link architecture view. The
resource window title bar includes:
An icon indicating the operative state and security state of the resource
The resource name and comment
A Windows control button to maximize or restore the resource window
A Data Link button enabling you to graphically create data links between resources
The operative state of a resource is indicated by the color of the upper triangle in the resource icon:
Blue. The resource is in editing mode.
Green. The resource is in real-time mode (running), debug mode, or simulation mode.
You can access the contextual menu from a resource by right-clicking in its title bar.
Double-clicking the title bar minimizes/restores a resource window.
You can also resize resource windows by placing the cursor over an edge or corner until it shows double arrows and dragging:
ISaGRAF 5.2
- Workbench 53
Resource Window Workspace
The
Workspace
displays a graphical representation of the various components of each
+
To expand / collapse any branch of the hierarchy
"
Click '+' ('-' to collapse).
Note:
Selecting one of the components changes the menu items available on the menus of the
Workbench. For example, if a function is selected, the Insert menu includes the Add Function
option. The contextual menus are also affected by selections within the resource window.
Creating Resources
When you create resources in the link architecture view, these resources are automatically
assigned to the first configuration. You can also choose to create, i.e., insert resources directly
in configurations while in the hardware architecture view. After having created resources, you
can move them. For details on moving resources, see page 130.
To create a new resource
You can create resources using the main menu or a contextual menu, accessed by right-clicking
the empty area of the link architecture view’s workspace.
"
From the Insert menu, choose
Resource
.
54
ISaGRAF 5.2
- User Guide
Renaming Resources
You can rename an existing resource by editing its properties. When a resource is selected, the
Properties option is available from the main menu or a contextual menu. From the resource’s
Properties window, you can also edit the comments for the resource.
To rename a resource
1.
Select the resource.
2.
From the Edit menu, choose
Properties
.
The Resource Properties dialog box appears - on the General Tab.
3.
Edit the resource name as required.
4.
Edit the comment as required.
5.
Click
OK
.
Copying Resources
You can copy a resource and place it on the clipboard. When copying resources, password
definitions are copied, whereas, step-by-step debug information is not copied. When copying resources having The copy command is available from the main menu, the
Ctrl+C
keyboard
command, the main toolbar, or a contextual menu.
Note:
Before copying, click in a blank area inside the resource window to deselect individual
To copy a resource from the link architecture view
You can access the contextual menu by right-clicking the title bar of the resource.
1.
Click on the title bar of the resource.
2.
From the Edit menu, choose
Copy
.
ISaGRAF 5.2
- Workbench 55
To copy a resource from the hardware architecture view
You can access the contextual menu by right-clicking the resource in the configuration
window.
1.
Select the resource.
2.
From the Edit menu, choose
Copy
.
Pasting Resources
You can paste a resource into the workspace of the link architecture view or into a
configuration, in the hardware architecture view. When pasting resources, password
definitions are also pasted, whereas, step-by-step debug information is not pasted. The paste resources using the main menu, the
Ctrl+V
keyboard command, the main toolbar, or a
To paste a resource in the link architecture view
You can access the contextual menu by right-clicking the title bar of the resource.
1.
Click on an empty area of the link architecture view.
2.
From the Edit menu, choose
Paste Resource
.
To paste a resource in the hardware architecture view
You can access the contextual menu by right-clicking the resource in the configuration window.
1.
Select a configuration to paste the resource into.
2.
From the Edit menu, choose
Paste Resource
.
Note:
Links coming from or arriving to a resource are not copied and pasted.
56
ISaGRAF 5.2
- User Guide
Deleting Resources
You can delete a resource from the workspace of the link architecture view or from a
configuration, in the hardware architecture view. The delete command is available from the
main menu, the
Delete
keyboard command, the main toolbar, or a contextual menu.
Note:
Before deleting, click in a blank area inside the resource window to deselect individual
To delete a resource
You can access the contextual menu by right-clicking the resource title bar.
1.
Select the resource.
2.
From the Edit menu, choose
Delete
.
ISaGRAF 5.2
- Workbench 57
Editing Resource Properties
You need to define several properties at the resource level, intimately linked to targets (and
their implementation). These properties determine the behavior of the programs and hardware
such as the type of code generated, the timing, and Hardware specific properties.
To access the Resource Properties window
1.
From the Window menu, choose
project_name
-
Link Architecture
.
2.
3.
From the Edit menu, choose
Properties
.
The Resource Properties window is displayed.
58
ISaGRAF 5.2
- User Guide
Resource Identification
The resource identification properties of a resource include its name, comments, and a resource
identification number. The resource number is automatically assigned. You can choose to change this number. However, when changing this number, you need to assign a number that
is unique within the project. The resource number identifies the Virtual Machine that will run
the resource code. Comments appear in the resource’s title bar, next to its name.
You define resource identification properties on the General tab of the Resource Properties window:
ISaGRAF 5.2
- Workbench 59
Target Options
The target options of a resource define the target operating system on which the resource will
run. You can also choose the target type at the configuration level. However, changing the
target for a configuration affects all resources attached to it. The target options also include the memory size for temporary variables property indicating the space reserved for monitoring variables, constants, and temporary compiler variables.
You specify a resource’s target options on the Target tab of the Resources Properties window:
60
ISaGRAF 5.2
- User Guide
Compilation Options
The compilation options of a resource define many aspects of a resource’s run-time and simulation options:
The generation of debug information
The type of code to generate and compiler options
Embedded zip of the source files
You specify a resource’s compilation options on the Code tab of the Resources
Properties window:
Generate Debug Information
When using the step-by-step mode, for debugging purposes, you need to generate debug
information for a resource and its ST, IL, and LD POUs. For details on step-by-step mode, see
page 344. When setting up debug information, you also need to specify the individual POUs
for which to generate debug information. Debug information includes call stack information which tracks stepping between POUs and called functions. You can only generate debug information for resources producing TIC code.
ISaGRAF 5.2
- Workbench 61
Note:
The first time you choose to generate debug information for a resource, the complete resource is compiled when you build the resource. Subsequently, when you add or remove individual POUs, only those POUs are compiled when you build the project.
To generate debug information for ST, IL, and LD programs
1.
To generate call stack information for use while stepping in POUs, check
Generate debug information
.
2.
To generate debug information, click .
3.
In the Debug Information window, check individual POUs, select all POUs, or unselect all POUs, then click
OK
.
Target Code and Compiler Options
You can specify the generation of three types of code for use in simulation or run time:
Code for simulation, code required when running the application in simulation. To run the Simulator, you must check
Code for Simulation
to produce the application code.
TIC Code, the indication of whether Target Independent Code is produced by the
compiler. TIC code can be executed on virtual machines.
Structured C source code, the indication of whether structured C source code is produced by the compiler. Structured C source code can then be compiled and linked with libraries to produce embedded executable code.
62
ISaGRAF 5.2
- User Guide
Symbol Table
You can specify whether to download the symbol table to the Virtual Machine with the
resource code. The symbol table groups the variable names of the resource. You can also
choose to download the complete symbol table or the reduced symbol table.
Note:
The Complete Table must be selected. The
reduced symbol table
contains only names
of variables for which the 'Address' cell had been completed. For details on the variables grid,
To change the Build Symbol Table
1.
Click
Options
.
The Build Symbol Table dialog box appears.
2.
Choose the type of symbol table to download.
Embed Zip Source
You can embed, on the target, an exchange file (.PXF) holding all data from Workbench
elements. This exchange file is the same as the file created when exporting an element.
ISaGRAF 5.2
- Workbench 63
Run-time Settings
The run-time settings include the cyclic and behavior definitions of a resource when the
resource is executed. For information about execution rules, see page 434.
You specify a resource’s run-time settings on the Settings tab of the Resources Properties window:
64
Trigger cycles, enables you to specify the cycle timing, i.e., the amount of time given to
inputs of the process to drive, executing the POUs of the Workbench resource, then
updating physical outputs. The virtual machine executes the resource code according to
the execution rules. For details about the execution rules, see page 434.
Detect errors, enables the storing of errors. You need to define the number of entries, i.e., the size of the queue (FIFO) in which detected errors are stored.
Cycle to Cycle / Real Time, indicates whether programs are executed during the cycle or
not. For Cycle to Cycle, inputs are read but the code is not executed during the cycle time. This option is useful for testing I/Os.
Memory for Retain, indicates the location where retained values are stored (the required syntax depends on the implementation)
ISaGRAF 5.2
- User Guide
You can also specify advanced settings for resources:
Memory size for online changes
To access advanced settings
"
Click
Advanced
.
SFC Dynamic Behavior Limits
The SFC dynamic behavior limits determine the amount of memory, allocated by the target at
initialization time, to manage SFC dynamic behavior (i.e. token moving). The amount of allocated memory is calculated as a linear relation with the number of SFC POUs:
Alloc Mem (bytes) = N * NbElmt * sizeof(typVa)
NbElmt = GainFactor * NbOfSFC + OffsetFactor
Where:
N = 5 (constant linked to SFC engine design) typVa
= 16 bits in the medium memory model (32 bits in the large memory model)
NbElmt
represents for each executed cycle:
The maximum number of transitions that can be valid. That is to say transitions with at least one of their previous steps being active.
ISaGRAF 5.2
- Workbench 65
A simpler, but more approximate definition is:
The maximum number of steps that can be active.
The maximum number of actions that can be executed.
Here, an action refers to an N, P1 or P0 action linked to a step.
If the available memory is not enough at a specific moment:
If the target is generated with check mode (ITGTDEF_SFCEVOCHECK defined in dsys0def.h), The target kernel generates a warning to signal an SFC token moving error
or an action execution error and the resource is set in ERROR mode (i.e. cycles are no
longer executed). Otherwise, kernel behavior may be unpredictable.
Memory Size for Online Changes
The memory size for online changes defines the amount of memory that is reserved on the PLC for managing online changes:
Code Size, the amount of memory reserved for code sequence changes
User Variable Size, the amount of memory reserved for adding variables data. When
generating symbol monitoring information for a POU, the same amount of memory is
also reserved for the POU.
When performing downloads and online changes, parts of the User Variable Size memory space is used to store project data such as variables values. This memory space becomes
free when you clean the project.
66
ISaGRAF 5.2
- User Guide
Resource Network Parameters
You need to define network parameters attached to the resource for each available network.
You specify a resource’s network parameters on the Network tab of the Resources Properties window:
Note:
The parameters appearing in the list reflect those attached to the resource. Some parameters are read-only. However, when a resource is attached to a network not requiring parameters, the list appears empty.
You can also access the online help by clicking
Help
.
For the HSD network, the current definition is the following:
The consumer computes the time elapsed between production and consumption and tests if it less than the 'ValidityTime' parameter specified for the producer resource in the workbench.
The user must be careful when specifying this value to take into account the cycle time of the producer resource. This resource cannot emit values at a period shorter that its cycle time.
If this time-out is detected, the consumer sets the error variable to
ISA_HSD_KVB_ER_TIMEOUT value.
ISaGRAF 5.2
- Workbench 67
For the ETCP network, the current definition is the following:
On the consumer side, if no data is received during the time specified in the Timeout parameter value, then the error variable is set to ETCP_KVB_ERR_TIMEOUT value.
Custom Resource Parameters
You can define specific
OEM
options for a resource that may be implemented in your target.
Note:
ISaGRAF
standard targets do not have extended parameters. Contact your target supplier for specific details.
68
ISaGRAF 5.2
- User Guide
Resource Access Control
For resource security, you can control access using a password and you can choose to apply the read-only mode to an entire resource. When resources are password-protected, users not having the password can change resource properties, wire and bind variables, modify the memory for retain, and add devices to wired variables. POUs in a resource can have their own level of access control. For instance, a POU having its own password remains locked and cannot be viewed without entering its password. However, a POU using its resource’s password also inherits the resource’s security properties such as the read-only attribute.
The security state of a resource is indicated by the color of the lower triangle in the resource title bar icon. The resource can also be currently opened by another user.
Resource
Icon
Security
State
Gray. The resource has no access control. All users have read and write access in the resource. POUs in the resource may have individual access control.
Red. The resource is locked. Users not having the resource password cannot access the resource or its POUs; these users do not have read or write capabilities. These users can change resource properties, wire and bind variables, modify the memory for retain, and add devices to wired variables.
Cyan. The resource is in read-only mode. Users not having the resource password can view the resource and its POUs; these users only have read capabilities. These users can change resource properties, wire and bind variables, modify the memory for retain, and add devices to wired variables.
POUs in the resource may have individual access control.
Green. The resource is unlocked. User can access the resource and its POUs; this user has read and write capabilities. However, POUs in the resource may have individual access control.
Note:
While in debug mode or performing builds, unlocked resources as well as resources having no access control switch to read-only mode. Locked resources remain locked.
For projects having read-only access control, the resources and POUs making up the project
are also set to the read-only mode except for those having individual access control.
ISaGRAF 5.2
- Workbench 69
When copying, pasting, importing, and exporting resources having access control, password definitions are retained.
When editing a project, resources making up the project are automatically locked by you except for those resources where another user set password protection or that are currently in
use by another user in the single resource editing mode.
To set access control for a resource
You set access control for a resource in its properties’ Security tab.
1.
Specify a password:
To use an unique password, in the New field, enter a password then reenter it in the
Confirm New field.
To use the same password as set for the project, check
Use Project Password
.
2.
To enable all users to access the resource in read-only mode, check
Read Only
.
70
ISaGRAF 5.2
- User Guide
To unlock a resource
When entering a password while in debug mode or performing a build, the resource is only unlocked after stopping the debug mode or when the build is completed.
1.
Right-click the resource’s title bar, then from the contextual menu, choose
Enter Password
.
2.
In the Security dialog box, enter the password for the resource.
The resource is unlocked.
Resource Description
You can include a free-format text description for a resource.
To edit the resource description
1.
Select the resource.
2.
From the Tools menu, choose
Edit Description
.
3.
Edit the description as required.
ISaGRAF 5.2
- Workbench 71
Variable Bindings
Bindings are directional links, i.e., access paths, between variables located in different
resources. One variable is referred to as the producing variable and the other as the consuming
variable. The value stored in the producing variable is transferred to the consuming variable.
The Workbench enables two types of bindings: internal bindings and external bindings.
Internal bindings are between resources within the same project. External bindings are between resources belonging to different projects.
Note:
Online changes are possible as long as internal and external binding definitions remain the same.
Binding
the variable V1 from resource R1 to the variable V2 of resource R2 means that V1 is periodically copied to V2 using memory sharing or network exchanges.
Variables coming from bindings (consumed variables) are refreshed in the resource at the beginning of the cycle, each time the producing resource sends them, i.e. on each end of the producing resource cycle.
The variable is not updated in the consuming resource until the producing resource sends them through the binding media. For example:
Producer
Binding
Consumer
No update of the variable on that cycle
ISaGRAF
does not impose the read-only accessibility for consumed variables.
However, it is highly recommended to declare consumed variables with read-only attribute in order to avoid conflicts between Binding and execution of POUs.
72
ISaGRAF 5.2
- User Guide
This behavior is applied in the HSD and ETCP Binding drivers. This behavior may change when using other network drivers implemented according to different conventions.
Binding error variables
Binding error variables enable the management of binding errors at the consumer resource level; one error variable for one consumer resource for each resource that produces to this
resource. The virtual machine gives specific values to these error variables.
Example
Production errors
The variable 'A' of the R1 resource represents the producer error variable for all binding links starting from R1 and using the HSD driver
(in the example only link from R1 to R3).
The variable 'B' of the R1 resource represents the producer error variable for all all binding links starting from R1 and using the ETCP network
(links from R1 to R4 and from R1 to R5).
Consumption errors
The variable 'F' of the R5 resource represents the consumer error variable for the unique binding link that comes from R1 and using ETCP.
The variable 'G' of the R5 resource represents the consumer error variable for the unique binding link that comes from R2 and using ETCP.
Depending on the driver used the error variables can take different values with different meanings.
Warning:
Once the error variable is set to a non-zero value, it has to be reset to 0 by user or by Programs.
ISaGRAF 5.2
- Workbench 73
To test globally that there is a binding error, you can test the value of the following system variables:
__SYSVA_KVBPERR: for a production error. It is a Boolean variable. If it is true it means there is a production error.
__SYSVA_KVBCERR: for a consumption error. It is a Boolean variable. If it is true it means there is a consumption error.
For HSD:
To test values of one binding error variable, you should create the following defined words in
the dictionary of your project:
The 0 value in the error variable indicates there is no error.
ISA_HSD_KVB_ER_MUTEX
ISA_HSD_KVB_ER_SPACE
1 An error occurred with semaphore management
2 An error occurred with memory space access
ISA_HSD_KVB_ER_NOKERNEL 3 The bound producer is stopped (not running).
This error happens only for consumer resources.
ISA_HSD_KVB_ER_TIMEOUT 4 Variable was not refreshed within the maximum time allowed (ValidityTime). This error happens only for consumer resources.
ISA_HSD_KVB_ER_BAD_CRC 5 Producer and consumer have different CRC.
ISA_HSD_KVB_ER_INTERNAL 6 Internal error
74
ISaGRAF 5.2
- User Guide
For ETCP:
To test values of binding error variables, you should create the following defined words in the
dictionary of your Project:
A value of 0 in the error variable indicates no error.
ETCP_KVB_ERR_BINDING_IN_PROCESS 1 The binding initialization process is on its way.
ETCP_KVB_ERR_NO_PRODUCER 2 The remote producer is not currently runnin g. This error happens only for consumer resources.
ETCP_KVB_ERR_BAD_CRC
Obsolete error value
3 Producer and consumer have different
CRC.
4 The producer has been stopped. This error happens only for consumer resources.
5 Error during diffusion process.
ETCP_KVB_ERR_DATA_DIFFUSSION
ETCP_KVB_ERR_TIMEOUT 6 ETCP server does not answer quickly enough (TimeOut). This error happens only for consumer resources.
ETCP_KVB_ERR_IMPOSSIBLE_TO_BIND 7 Impossible to bind.
ISaGRAF 5.2
- Workbench 75
Internal Bindings
Internal variable bindings are bindings between variables of resources belonging to the same
project. Before creating internal bindings for variables, you need to link the resources holding
them using data links.
You manage resource data links and internal variable bindings in the Bindings List window.
You can also manage resource links directly from the link architecture view.
The Bindings window displays the resource links and internal variable bindings defined for a project. The window is divided into three parts:
The Binding List window toolbar
To access the Binding List window
1.
From the Window menu, choose
project_name
-
Link Architecture
.
The link architecture view appears displaying existing resources and their data links.
2.
Do one of the following:
Click .
Double-click a data link joining two resources.
76
ISaGRAF 5.2
- User Guide
Resource-binding Grid
The Resource-binding grid, on the left side of the Binding List window, displays the data links
between resources. The first column and the top row display the available resource’s numbers.
The resource display order depends on their configuration numbers.
When working in the Resource-binding grid, you can perform various tasks using the mouse or keyboard commands:
Description Mouse Keyboard
Move into the grid
Select an entire row
Switch to the
Variable-binding grid
Select cells
Select a row header
Arrows keys
Shift+space bar
Select an entire column Select a column header
Select the entire grid Select an arrow on the top left of the grid
Ctrl+space bar
Shift+Ctrl+space bar
Click on the Variable-binding grid
Tab
Variable-binding grid
The Variable-binding grid, on the right side of the window, enables you to manage variable
bindings. The variable-binding grid manages the bindings between variables. The grid shows where a binding comes from and where it goes to, the type of the variable, and the network used for communicating.
The column between the variable information indicates the status of the binding:
The binding does not have parameters and the status is OK
The binding does not have parameters but the status is bad
ISaGRAF 5.2
- Workbench 77
The binding has parameters and the status is OK
The binding has parameters but the status is bad
A bad status occurs when the types, string sizes, or dimensions of variables do not correspond or if the network used for the binding does not exist.
When working in the Variable-binding grid, you can perform various tasks using the mouse or keyboard commands:
Description
Move into the grid
Switch to the
Resource-binding grid
Mouse
Select cells
Click in the Resource-binding grid
Keyboard
Arrows keys
Tab
Binding List Toolbar
The Binding List window toolbar enables you to perform many resource link and variable
binding operations:
Hides the resource-binding grid
Accesses the online help
Creates a new binding variable
Edits an existing binding variable. This operation is only available for use in the variable-binding grid.
Deletes selected cells, rows, or columns
Note:
If the two resources are distant, they must be located in configurations that are attached
to the same target. Heterogeneous bindings are not yet supported.
78
ISaGRAF 5.2
- User Guide
Linking Resources
You need to link resources before binding variables belonging to them. Data links between
resources are directional. All bindings using a data link must use the same network. You can
In the Resource-binding grid, you create links between resources by locating the resource
holding the producing variable in the first column and the resource holding the consuming variable in the top row, then selecting the grid cell where both meet.
In the grid, resource links appear as one of two types:
The linked resources belong to the same configuration
The linked resources belong to different configurations
In the link architecture view, you create links by physically joining the resource holding the
producing variable with the resource holding the consuming variable. In this view, data links appear as directional arrows linking the resources. The color of data links depend on the type of bindings using it:
Black
Green
Blue
The data link is only used for internal bindings
The data link is only used for bindings between IEC 61499 function blocks
The data link is used for internal bindings and bindings between IEC 61499 function blocks
When bindings have an error, the symbol is displayed on the data link used by the binding.
ISaGRAF 5.2
- Workbench 79
You can customize the colors of resource data links.
To link resources from the Binding List window
You can access the Binding list window from the main menu or the Windows toolbar.
1.
From the Project menu, choose
Binding List
.
The Binding List window appears.
2.
In the first column of the Resource-binding grid, locate the resource number of the
resource holding the producing variable.
3.
In the top row of the Resource-binding grid, locate the resource number of the resource holding the consuming variable.
4.
Double-click the grid cell where both resource numbers meet.
An icon appears in the grid cell indicating whether the link is between resources from the same
To link resources from the link architecture view
1.
On the resource holding the producing variable, click and hold the Data Link
button , located on its title bar.
2.
Drag the link to the resource holding the consuming variable.
3.
Release the mouse button.
The data link is displayed graphically.
80
ISaGRAF 5.2
- User Guide
Deleting Resource Links
You can delete links between resources, i.e., data links, from within the Binding list window.
You can also delete links from the link architecture view.
Note:
Deleting a resource link also deletes the variable bindings using it.
To delete a resource link from the Binding List window
1.
In the Resource-binding grid, select the grid cell holding the resource link to delete.
2.
Do one of the following:
From the Binding List window’s toolbar, click
Press
Delete
.
The grid cell appears blank.
.
To delete a resource link from the link architecture view
1.
In the link architecture view, click on the resource link.
The selected data link appears hightlighted:
2.
Do one of the following:
From the Edit menu, choose
Delete
.
Press
Delete
.
ISaGRAF 5.2
- Workbench 81
Viewing the Internal Bindings Defined for Resources
You can view all producing variable bindings or all consuming variables defined for a resource
at the same time. You can also choose to view all bindings defined for all resources, i.e., the
entire project. However, when viewing bindings, you cannot edit their definitions.
To view the producing variable bindings for a resource
"
In the first column of the Resource-binding grid, click the corresponding resource
number.
To view the consuming variable bindings for a resource
"
In the top row of the Resource-binding grid, click the corresponding resource number.
To view the bindings defined for a project
"
In the Resource-binding grid, click
.
82
ISaGRAF 5.2
- User Guide
Hiding and Showing Resource Links
In the link architecture view, you can choose to show or hide the data links between resources.
In hidden mode, links cannot be activated or selected. Links appear as short arrows, indicating their direction, sticking out from the top right corner of resources:
To hide or show data links
You can hide or show data links using the main menu or the Options toolbar.
"
From the Options menu, choose
Hide/Show Links
.
Defining Internal Variable Bindings
Before defining bindings between variables, you must first link the resources to which they
belong. For bindings, one variable is known as the producing variable and the other as the consuming variable.
You can only define bindings between variables of a same type. Producing variables can have any direction attribute, i.e., input, output, and internal. Whereas, consuming variables can only have the output or internal attribute and must also have the Free attribute.
You instantiate variable bindings in the Variable-binding grid of the Binding List window.
ISaGRAF 5.2
- Workbench 83
You define variable bindings in the Binding editor. When defining a binding, you need to indicate a producing variable and a consuming variable, and the network used for communicating. The producing variable serves as input for the binding. Whereas, the consuming variable serves as output. You can choose to specify a default value to use in the
event of a communication error. You can also choose to specify a binding error variable.
The Producing Variable selection list contains all variables of the producer resource. The
Consuming Variable selection list contains all variables which do not have the INPUT direction and are not already used as a consumed variable in an existing binding.
The network selection list contains the networks that are supported by the target of the
configuration of the first resource and the target of the configuration of the second resource.
The Binding Parameters list displays the parameters to be defined for the variables bound on the selected network. This list may be empty depending on the network used by the binding.
For example: ETCP does not need any parameters at this level. You define parameters by double-clicking on a parameter line to display the Binding Parameter dialog box (available only when the parameter is editable). Some parameters are read-only.
84
ISaGRAF 5.2
- User Guide
The Binding Error Variables section contains two selection lists for selecting a variable (Global
/ Memory of the DINT type) in each resource to receive binding error values. Producer error variables and consumer error variables can be used in the resource's POUs to trap and act upon errors. The default value is None.
To create a binding between variables
1.
In the Variable-binding grid, select the next available field.
2.
From the Binding List window’s toolbar, click
The Binding editor appears.
.
3.
In the Producing Variable field, select the producing variable.
4.
In the Consuming Variable field, select the consuming variable.
5.
In the Network field, select the network used for communicating.
6.
To set a default value for use in the event of a communication error, select
Use Default Value
, then enter a value in the field.
7.
To use a binding error variable, indicate it in the Binding Error Variables section.
8.
Click
OK
.
ISaGRAF 5.2
- Workbench 85
Editing Internal Variable Bindings
You can change the contents of existing variable bindings. You edit bindings from the
Variables-binding grid of the Binding List window.
To edit the contents of an existing binding
1.
In the Variable-binding grid, select the variable binding.
2.
From the Bindings List window’s toolbar, click
The Binding editor appears.
3.
Make the necessary changes, then click
OK
.
.
Deleting Internal Variable Bindings
You delete variable bindings from the variable-binding grid of the Bindings List window.
To delete a variable binding
1.
In the Variable-binding grid, select the variable binding.
2.
Do one of the following:
From the Binding List window’s toolbar, click
Press
Delete
.
.
86
ISaGRAF 5.2
- User Guide
External Bindings
External variable bindings are bindings between variables of resources belonging to different
projects. When defining external variable bindings, you need to define groups of producer
variables in the producer project, then in the consumer project, link the consumer resource with
the producer resource, then define the external bindings between the producer variables and the
consumer variables.
You define external bindings from the External Bindings List. This list is made up of the
Consumer groups and Producer groups sections. The Consumer groups section lists the groups holding external producer variables having bindings with consumer variables defined in the project. The Producer groups section lists the groups holding outgoing producer variables for consumption in external bindings defined in another project.
When defining producer groups of variables, you group variables of a resource to be consumed by consumer variables of one or more resources located in other projects. Individual variables of a resource can belong to a one or more producer groups.
For producer groups and external bindings, indicates errors that can occur for different situations such as the following:
Producer groups
External bindings
- The project of a producer group cannot be found
- The producer group cannot be found within the specified project
- A confict exists between the consumer and producer resources
- One of the bound producer variables no longer exists
- The producer variable used in the binding no longer exists
- The project holding the producer variable cannot be accessed
ISaGRAF 5.2
- Workbench 87
External Binding List Toolbar
The External Binding List window toolbar enables you to perform many external binding operations. The operations performed by the toolbar items differ depending on whether these are in the Consumer or Producer groups sections.
Accesses the online help
In the Consumer groups section, accesses the Consumer Binding list where you define links between resources and define external bindings from the Bindings editor.
In the Producer groups section, accesses the Producer Binding list where you define groups of producer variables for use in bindings with consumer variables of other projects.
In the Consumer groups section, edits an existing external variable binding.
In the Producer groups section, edits an existing group of producer variables.
In the Consumer groups section, deletes an external variable binding.
In the Producer groups section, deletes a group of producer variables.
To access the External Binding list
1.
From the link architecture view, select the resource for which to create producer groups.
2.
From the Project menu, choose External Binding List or click
88
ISaGRAF 5.2
- User Guide
Defining Producer Variable Groups
You define producer groups of variables for resources of a project to enable accessing them
when defining external variable bindings in consumer resources of other projects. Producer
groups hold producer variables of a resource to be consumed by consumer variables of one or more resources located in other projects.
To define a producer variable group
You define producer variable groups from the External Binding List.
1.
In the Producer Groups list, double-click ...
The Producer Binding List editor is displayed:
2.
Enter a unique Group ID and optional comment.
3.
Specify the network used for the bindings.
ISaGRAF 5.2
- Workbench 89
4.
Specify each variable making up the producer variable group:
a)
In the variable list, click ...
The External Binding editor is displayed.
b)
In the Producing variable field, select the variable to include in the group.
The selected variable’s information is displayed as well as the default network binding parameters. You can edit the values for the network binding parameters.
c)
Click
OK
.
90
ISaGRAF 5.2
- User Guide
Editing Producer Variable Groups
You edit the contents of an existing producer variable groups from their originating resource.
To edit the contents of an existing producer variable group
1.
In the Producer Groups list, select a producer group.
2.
From the Producer’s Group binding list toolbar, click .
3.
In the Producer Binding List editor, make the necessary changes, then click
OK
.
Deleting Producer Variable Groups
When deleting producer groups having producer variables used in external bindings, in the consumer project, the link between the consumer and producer resource shows an error ( ).
To delete a producer group
"
In the Producer Groups list, select the producer group to remove, then from the
Producer’s Group binding list toolbar, click .
ISaGRAF 5.2
- Workbench 91
Linking Resources for External Bindings
Before defining external variable bindings between resources, you need to link the consumer
and producer resources. You link these resources from the consumer resource by identifying the project, resource, and producer group of variables, holding the producer variables whose values are conveyed to the consumer variables. A link between resources flows in
one direction. You can choose to use binding error variables.
To link resources for external variable bindings
1.
From the External Binding List window, double-click ... in the Consumer Groups section.
The Consumer Binding List is displayed.
2.
Define the source of the producer group of variables used for the external bindings.
a)
Browse for the project holding the producer group to include in the bindings.
92
ISaGRAF 5.2
- User Guide
b)
Specify the resource and producer group ID of the producer group.
The resource number, producer group ID, and network used for linking the resources are displayed in the Binding error variables section.
3.
To indicate a binding error variable, select one from the available variables.
Editing External Resource Links
You can edit resource links for existing external bindings from the consumer resource.
Warning:
Editing the linking information for a specified producer group, resource, or project sets all defined external variable bindings in the list in error ( ).
To edit a link between resources of different projects
You edit links between resources from the Consumer Binding List editor.
"
In the Consumer Binding List, make the necessary changes to the project, resource, or producer group information, then click
OK
.
ISaGRAF 5.2
- Workbench 93
Defining External Variable Bindings
and link the consumer and producer resources.
To define an external variable binding
You define external variable bindings from the consumer resource.
1.
In the Consumer Binding List, double-click ...
The External Binding editor is displayed.
2.
Specify the producing variable and consuming variable from their respective lists of available variables.
3.
Indicate whether to use the last value issued from the binding or a default value. When using a default value, specify the value to use.
4.
Click
OK
.
94
ISaGRAF 5.2
- User Guide
Editing External Variable Bindings
You edit the contents of existing external variable bindings from the consumer resource.
To edit an existing external binding
1.
In the External Binding List window, select the binding link to edit in the Consumer groups section.
2.
From the Consumer Group’s binding list toolbar, click .
3.
In the Consumer Binding List editor, select an external binding from the list, then click .
4.
In the Binding editor, make the necessary changes.
Deleting External Variable Bindings
You delete external bindings from the consumer resource.
To delete an existing external binding
1.
In the External Binding List window, select the binding link to edit in the Consumer groups section.
2.
From the Consumer Group’s binding list toolbar, click .
3.
In the Consumer Binding List editor, select an external binding from the list, then click .
ISaGRAF 5.2
- Workbench 95
Parameters
The 'Parameters' component contains the IO Wiring and 'Defined words' sub-components. For
details on the Defined Words Tree, see page 149.
Parameters
I/O Wiring
Defined Words
I/O Wiring
Defined Words
Double-clicking on this item opens the I/O Wiring Tool to select I/O
devices and connect variables to them.
Double-clicking on this item opens the Dictionary on the Defined Words
Tree.
96
ISaGRAF 5.2
- User Guide
Variable Groups
Variables Groups provide a method of managing variables and logically sorting them within a
resource. The variable groups are shown in the Variables Tree, their contents are defined within
the Dictionary Variables grid. For information on the variables tree, see page 145.
Creating Variable Groups
You create variable groups from within the link architecture view. You can rearrange the order
of defined variable groups by dragging and dropping within the variable groups section of a resource window. The group order affects the printing order.
To create a new variable group
1.
From the Window menu, choose
project_name
-
Link Architecture
.
The link architecture view appears displaying all resources and data links defined for a project.
2.
Select a resource.
3.
From the Insert menu, choose
Add Variable Group
.
ISaGRAF 5.2
- Workbench 97
Opening Variable Groups
Opening a variable group opens the Dictionary with the grid showing variables of that group.
You open variable groups from within the link architecture view. For information on the
To open a variable group from the link architecture view
1.
Select a group.
2.
Do one of the following steps:
From the Edit menu, choose
Open
.
Within a resource window, double-click on the required variable group name.
Select a group name then press
Enter
.
To open a variable group from the Dictionary view
1.
Select the Variables Tree.
2.
Double-click the resource name to which the group belongs.
3.
Click on the variable group name.
The grid displays the variables for that particular group.
98
ISaGRAF 5.2
- User Guide
Importing or Exporting Variables and Defined
Words
You can choose to import or export variables data and defined words using either a
comma-separated (CSV) file in a text editor or a Microsoft Excel spreadsheet. To include comments in your data, surround them with quotation marks (").
When using a text editor, you must separate each piece of information from the others with a comma; each line must end with a carriage return; the resulting file can have either the .csv or
.xls extension.When using a spreadsheet, enter each piece of information in a separate cell; leave empty cells if an item is to be omitted; save the file under the CSV or XLS format. These requirements are automatically followed by the export facility; you must respect them if you
build a file to be imported. For variables data, imported data must include the configuration,
resource, and variable names to which it belongs; default values will appear for all other values
that remain empty. For defined words, imported data must indicate _DEFINED_ and
_WORDS_ as the first two columns, then include the name, equivalent, and comment. For variables data and defined words, imported data must include all fields required for variables while leaving unused fields empty.
Note:
The XLS file format is only available when Microsoft Excel is installed on your computer.
ISaGRAF 5.2
- Workbench 99
An example of an Excel file holding variables data is:
Example of a CSV file holding variables data
The first line holds the title of each column (headings) in the same order as these are defined for each variable:
Config,Resource,Name,Alias,Data
Type,StringSize,InitValue,Dimension,Group,Attribute,Scope,Direction,Retain,Address,Com ment,Wiring,
The next line holds the data for the first variable, in the same order as the columns in the first line. Empty spaces between commas indicate that no information is present for the specific
field. The data for each variable starts at the configuration level:
Config1,Resource1,Variable1,"ev1",BOOL,0,"TRUE","",,Write,Global,Outp ut,NO,,"",%QX0.0,
100
ISaGRAF 5.2
- User Guide
The data for the second variable:
Config1,Resource1,Variable2,"ev2",BOOL,0,"FALSE","",,Write,Global,Out put,NO,,"",%QX0.1,
The data for the third variable:
Config1,Resource1,Variable3,"ev3",BOOL,0,"FALSE","",,Free,Global,Inte rnal,NO,,"",,
Example of a CSV file holding defined words
The first line holding the title of each column (headings) in the same order as they are defined for each defined word:
Config,Resource,Name,InitValue,Comment
The next line holds the data for the first defined word, in the same order as the columns in the first line. Empty spaces between commas indicate that no information is present for the specific field:
_DEFINED_,_WORD_,DefWord1,"DW1","Comment for DefWord1"
The data for the second defined word:
_DEFINED_,_WORD_,DefWord2,"DW2","Comment for DefWord2"
The data for the third defined word:
_DEFINED_,_WORD_,DefWord3,"DW3","Comment for DefWord3"
Example of a CSV file holding variables data and defined words
The first line holds the same titles for each column (headings) in the same order as when importing variables with separate lines for individual variables and defined words. The lines for defined words hold the same fields as the variables while only five fields are defined.
Config,Resource,Name,Alias,Data
Type,StringSize,InitValue,Dimension,Group,Attribute,Scope,Direction,Retain,Address,Com ment,Wiring,
ISaGRAF 5.2
- Workbench 101
The data for a variable:
Config1,Resource1,Variable1,"ev1",BOOL,0,"FALSE","",,Write,Global,Out put,NO,,"",%QX0.1,
The data for a defined word:
_Defined_,_Words_,DefWord1,"",,,"DW1","",,,,,,,"Comment for
DefWord1",,
To import variables data or defined words
1.
From the File menu, choose
Import
, then
CSV File
.
2.
In the Import window, do one of the following:
To add the imported information to the Workbench project’s database, click
Append
.
To replace the contents of the Workbench project’s database with the imported data, click
Replace
, then check
Variables
and/or
Defined Words
.
3.
Click
Browse
to locate the file to import, then click
Open
.
4.
In the Import window, click
Import
.
The log import file indicates the status of the variables data or defined words importation into the project database.
To export variables data or defined words
1.
From the File menu, choose
Export
, then
CSV Export
.
2.
In the Export window, indicate whether to export variables or defined words, then do one of the following:
If you are using a template, load the template.
In the browser, check the data fields to export. To create a template using the selected fields, in the Export Templates section, click
Save
.
Note:
When exporting defined words, the Config, Resource, Name, InitValue, and Comment items are automatically checked in the list.
102
ISaGRAF 5.2
- User Guide
3.
Click
Browse
to locate the file (.cvs format) in which to export the information, then click
Open
.
4.
Click
Export
.
The information is stored in the specified file.
Importing or Exporting Target Definitions
You can import and export target definitions into/from a Workbench project using the following command lines:
Import target definitions
plci.exe [-I] –D<Project directory> -F<Input/Output file name>
Export target definitions
plci.exe [-E] –D<Project directory> -F<Input/Output file name> -R<Ref. target>
-D
-F
-R
Where
-I
-E indicates to import a target definition file (TDB) into a project indicates to export a target definition from the project to a target definition file (TDB) indicates the project directory of the target definition indicates the filename of the target indicates the name of the target definition
ISaGRAF 5.2
- Workbench 103
Example
The following example shows the command line to use to import the MyTarget.tdb target definition file into the
MyProject
project folder located in the specified Prj directory.
plci.exe -I -D"C:\Documents and Settings\All Users\Documents\ICS
Triplex ISaGRAF\Projects\ISaGRAF
5.2
\Prj\MyProject" -F"C:\Documents and Settings\All Users\Documents\ICS Triplex ISaGRAF\Projects\
ISaGRAF
5.2
\Prj\MyProject\MyTarget.tdb"
The following example shows the command line to use to export the target definitions from the project located in the
MyProject
folder as the MyTarget.tdb target definition file.
plci.exe -E -D"C:\Documents and Settings\All Users\Documents\ICS
Triplex ISaGRAF\Projects\ISaGRAF
5.2
\Prj\MyProject" -F"C:\Documents and Settings\All Users\Documents\ICS Triplex ISaGRAF\Projects\
ISaGRAF
5.2
\Prj\MyProject\MyTarget.tdb" -RMyTarget
104
ISaGRAF 5.2
- User Guide
Importing
ISaGRAF
3 Projects
You can import
ISaGRAF
3 projects into the Workbench. However, such projects are subject to the differences between
ISaGRAF
3 and
ISaGRAF
5 projects. The importation process consists of generating two library files and a project file of different formats which it imports into the
ISaGRAF
5 Workbench. The library files consist of an exchange file (RXF) and a target definition file (TDB). The project file also consists of exchange file (RXF).
The library exchange file contains the IEC functions and function blocks definitions as well as their source code. The library target definition file contains the definitions of IO boards (simple
I/O devices), IO complex equipment (complex I/O devices), C functions and function blocks, and conversion functions. The project exchange file contains the complete contents of the
ISaGRAF
3
project.
When an
ISaGRAF
3
project contains custom board names not included in an
ISaGRAF
3
library, the importation process produces another output file containing these target definitions.
This target definition file having the TXT extension has the same name and destination as the project exchange file. You import this definition file into the Workbench using the same method as when importing target definition files having the TDB extension.
When using the
ISaGRAF
3
target, to retain the resource definition information created with the Make>Resource command in the
ISaGRAF
3
environment, you need to create a text file called definitions.res in which you can copy the contents of the window resulting from the command. You need to place this file at the root of the resource directory.
The importation process converts the following operators from
ISaGRAF
3
as indicated for the
ISaGRAF
5
environment depending on the target version:
ISaGRAF
3
&
>=1
=1
1
CAT
BOO
ANA
REAL
ISaGRAF
5 with
ISaGRAF
3 Target
ISaGRAF
5 with
ISaGRAF
5 Target
AND AND
OR
XOR
OR
XOR
1 Gain
CAT
BOO
ANA
REAL
1 Gain
+
ANY_TO_BOOL
ANY_TO_DINT
ANY_TO_REAL
ISaGRAF 5.2
- Workbench 105
ISaGRAF
3
TMR
MSG
SYSTEM
ISaGRAF
TMR
MSG
SYSTEM
5 with
ISaGRAF
3 Target
ISaGRAF
5 with
ANY_TO_TIME
ISaGRAF
ANY_TO_STRING
SYSTEM
5 Target
(not currently supported)
When building for the
ISaGRAF
5
To import
ISaGRAF
3 projects
Before importing an
ISaGRAF
3 project, the project must have been previously opened in a licensed
ISaGRAF
3 Workbench to remove any encryption. For retained variables, the memory field (Make>Application Run Time Options>Retain) must remain empty for the importation process, then following the importation in the
ISaGRAF
5
Workbench, you need to reenter the
syntax in the Memory for Retain field of the resource’s run-time settings.
1.
From the File menu, choose
Import
, then
ISaGRAF
3
.
When a project is already opened, the Workbench prompts you to save changes to the project then proceeds with the importation process.
106
ISaGRAF 5.2
- User Guide
The Import
ISaGRAF
3 Project window appears.
Note:
You can stop the importation process at any time by pressing the Escape key.
2.
In the
ISaGRAF
3 Library Folder
field, indicate the installation directory of the
ISaGRAF
3 library used for the
ISaGRAF
3 project.
3.
In the
ISaGRAF
3 project to import
field, indicate the complete path of the project to import.
4.
In the
Identification in
ISaGRAF
5 library
section, provide identification information for the destination resource for the
ISaGRAF
3
library in the
ISaGRAF
5
Workbench including a comment (optional) and a unique number. The resource name is automatically assigned.
ISaGRAF 5.2
- Workbench 107
5.
In the
Identification in
ISaGRAF
5 project
section, provide identification information for the destination resource for the
ISaGRAF
3
project in the
ISaGRAF
5
Workbench including a name, a comment (optional), and a unique number.
6.
At the bottom of the window, indicate a target version and type.
7.
In the
Target name
field, click the required target name from the available options in the drop-down menu, then click
OK
.
8.
When the importation process is complete, compile the imported library and project.
The
ISaGRAF
3
library and project is ready for simulation or execution in the
ISaGRAF
5
Workbench.
To replace TSTART and TSTOP statements for use with
ISaGRAF
5 targets
Replacing TSTART and TSTOP statements to use the TON function block is only required when an ISaGRAF 3 project uses an ISaGRAF 5 target. Wherever the TSTART timer variables are used, you need to replace these with a TON instance timer output parameter. The following example shows the TSTART and TSTOP statements replaced by TON instances:
TON1(BOO1, t#1m); // Replaces TSTART(TMR1) with a maximum programmed time of 1 minute. if TON1.q then // In order to have rising edge detection, the input signal must be reset for next time.
BOO1 := false; // This is an optional step that resets everything as soon as we reach the programmed end_if; // time of 1 minute (in which case TON1.q is set to TRUE). It acts as TSTOP(TMR1)
108
ISaGRAF 5.2
- User Guide
// but resets the ouptut timer value to 0.You can also replace
TSTOP(TMR1) by
// setting the BOO1 variable to False at any time.
if TON1.ET > t#10s then // Work with the elapsed time (ET) parameter as you used to with TMR1.
BOO2 := true; // This shows how at a certain time we can cause 2 booleans to switch their actual state.
BOO3 := false; else
BOO3 := true;
BOO2 := false; end_if;
1.
Open an existing ST program containing the TSTART and TSTOP statements.
2.
For each TSTART and TSTOP statement, you need to create an instance of the TON function block.
a)
Create a new line below the TSTART or TSTOP statement, then press CTRL+R.
b)
In the Select Blocks dialog, locate the TON function block and create an instance for it, then click
OK
.
ISaGRAF 5.2
- Workbench 109
c)
In the New Instance dialog, enter the required information, then click
OK
.
The TON1 instance of the TON function block is created in the dictionary.
3.
In the ST program, for the instance, define the parameters as shown in the following example:
TON1 (BOO1,t#1m);
Note:
Upon detection of a rising edge for the boolean input parameter, the timer starts incrementing, then stops when it reaches the maximum programmed time.
4.
Delete the original TSTART or TSTOP lines.
110
ISaGRAF 5.2
- User Guide
POUs (Program Organization Units)
A POU (Program Organization Unit) is a set of instructions written in one of the following
languages: SFC, FC, IL, ST, FBD, and LD. POUs can also use the IEC 61499 language.
POUs can be programs, functions, or function blocks.
You can perform many tasks when managing POUs:
Programs
Programs constitute the target Cycle. Programs are also known as POUs. POUs defined as
Programs are executed on the Target system respecting the order shown in the Program section.
You need to respect the hierarchy of programs within resources.
Available graphical programming languages are Sequential Function Chart, Flow Chart,
Functional Block Diagram, and Ladder Diagram. Available literal programming languages are
Structured Text and Instruction List. The language of each program is shown as an icon beside the program name:
Sequential Function Chart (SFC)
Flow Chart (FC)
ISaGRAF 5.2
- Workbench 111
Structured Text (ST)
Ladder Diagram (LD)
Function Block Diagram - IEC 61499
Function Block Diagram (FBD)
Instruction List (IL)
Within a resource there are certain restrictions on the relative positions of programs within the hierarchy:
All SFC and FC programs must be adjacent within the hierarchy.
SFC Child or FC Sub-programs must use the same language as their parent.
When using SFC programs in a resource, you may need to change the SFC dynamic behavior
factors defined for the resource. For details on the SFC dynamic behavior factors, see page 65.
You can move or copy programs written in ST, LD, and FBD to the Functions section and programs written in SFC, ST, LD, and FBD to the Function Blocks section. You can also move or copy functions and function blocks to the Programs section. When moving or copying a program to the Function or Function Blocks sections, all local variables defined in the program are converted to function or function block parameters respectively.
Note:
To call a POU written with a different language from SFC or FC program, call a function
or function block (written in ST, LD, FBD or IL).
112
ISaGRAF 5.2
- User Guide
Functions
Any program can call a Function. Functions are also known as POUs. Functions can only be
programmed in ST, LD, or FBD. In all cases, the return parameter of a function must be assigned. You can only declare local variables in functions. However, these local variables cannot be function block instances. Also, you cannot retain the values of variables declared in functions.
Each time a function is executed, its local variables are reset to their initial values (zero when none is provided in the dictionary). When a large structure or array is declared as local variable for a function, the compiler generates code to reset the initial values of each simple variable contained in the structure or array.
The order in which functions appear within their section is not important; functions are called from a POU.
You can move or copy functions to the Function Blocks and Programs sections. You can also move or copy function blocks and programs written with languages supported by functions to the Functions section. When moving or copying a program to the Functions section, all local variables defined in the program are converted to function parameters.
Example
if F1 is programmed as: if (in
1) then
F1 := 10; end_if; in the case in1 is FALSE, F1 will not be assigned, and it can take any value.
in the calling program:
MyVar := F1(TRUE); leads to MyVar := 10; this is OK
MyVar2 := F1(FALSE); you can not predict what will be the value of MyVar2
ISaGRAF 5.2
- Workbench 113
Function Blocks
Any program or function block can call a function block. A function cannot call a function
block. Function blocks are also known as POUs. Function blocks are written in SFC, ST, LD,
or FBD. You can also use the IEC 61499 language. SFC function blocks can have SFC child
function blocks. The order in which function blocks appear within their section is not important; function blocks are called from a POU.
When using SFC function blocks and SFC child blocks, you need to specify the maximum number of tokens for each one in their individual properties.
You can move or copy all function blocks to the Programs section and all but the SFC function block to the Functions section. You can also move or copy functions and programs, written with languages supported by function blocks, to the Functions section. When moving or copying a program to the Function Blocks section, all local variables defined in the program are converted to function block parameters.
Creating POUs
You create, i.e., add, POUs (programs, functions, and function blocks) in resources while in
the link architecture view. You add POUs using the main menu or a contextual menu accessed
by right-clicking the respective component (Program, Function, or Function Block) within a resource. After having created a POU, you can drag and drop it to a new position in its section, to another section, or to another resource. POUs belonging to a same section must have different names. POU names must begin with a letter.
For SFC programs and SFC child programs, you may need to change the SFC dynamic
behavior factors for the resource. For details on the SFC dynamic behavior factors, see page 65.
For each SFC function block and SFC child block, you may need to adjust the maximum number of tokens.
To create a POU
1.
In the resource window, select the POU component to create.
114
ISaGRAF 5.2
- User Guide
2.
From the Insert menu, choose
Add Program
, then the desired language.
The new component appears at the end of its respective section with its name ready to edit.
3.
Type a name for the component.
4.
For SFC POUs, do one of the following:
For an SFC program or SFC child program, make sure the dynamic behavior factors defined for the resource are sufficient by selecting the resource, then from the Edit menu, choosing Properties, then the Settings tab, then clicking
Advanced Settings
.
For an SFC function block or SFC child function block, specify the maximum number of tokens by selecting the block, then from the Edit menu, choosing
Properties, then the Settings tab.
Manipulating POUs
You can move, cut, copy, paste, and delete POUs, with certain exceptions, within their
sections, to other sections, and from one resource to another. You can only move or copy POUs between sections supporting the same language. For instance, you cannot move or copy an SFC program or function block to the Functions section.
You can move programs to change their order of execution or to change them to functions or function blocks. You can move functions to change them to programs or function blocks and move function blocks to change them to programs or functions. Changing a function or function block’s order within its section has no effect on its execution since it is called.
Note:
Before manipulating POUs, you should save the changes made to your project.
To move a POU
1.
Select the POU in the resource window.
2.
Drag and drop the POU to its new location.
ISaGRAF 5.2
- Workbench 115
Note:
You can only move POUs between sections supporting the same language. You cannot move a program (Child SFC or FC) to change its hierarchy level; you can only move it to change its position as a child within the same level. To change the hierarchical level of an SFC
or FC program to become a child, see “Changing Hierarchy Level” on page 118.
To cut, copy, or paste a POU
The cut, copy, and paste commands use the clipboard as temporary storage. Once copied (or cut), a POU can be pasted more than once. You can only paste POUs between sections supporting the same language. SFC programs are pasted at the same hierarchical level as the
selected program. When copying and pasting POUs having access control, password
definitions are retained.
1.
In the resource window, select the POU.
2.
From the Edit menu, choose
Cut
<Ctrl+X>
or
Copy
<Ctrl+C>
(or use the contextual menu).
3.
Select the new location, i.e. the Program, Function, or Function Block section within the same or different resource.
4.
From the Edit menu, choose
Paste
<Ctrl+V>
(or use the contextual menu).
To delete POUs
1.
Select the POU.
2.
From the Edit menu, choose
Delete
<DEL>
.
To copy POUs from a project to another
1.
In the destination project, create a program having the same name and language as the program in the original project.
2.
From the original project directory of the program's resource, copy the
POU_name
.stf
file, then paste the file in the destination project's resource directory.
3.
In the destination project, redeclare local and global variables needed for the POU.
116
ISaGRAF 5.2
- User Guide
Creating FC Sub-programs
Flow Chart (FC)
Flow Chart (FC) Sub-program
To create an FC sub-program
You can create FC sub-programs using the main menu options or a contextual menu accessed by right-clicking the FC program component within a resource.
1.
In the resource window hierarchy, select an existing FC program
2.
From the Insert menu, choose
Add FC Sub-Program
.
.
Creating SFC Child POUs
Sequential Function Chart (SFC)
Child Sequential Function Chart (SFC)
To create a child SFC POU
You can create child SFC POUs using the main menu options or a contextual menu accessed
by right-clicking an SFC POU within a resource.
1.
Select the existing SFC POU in the resource window hierarchy.
2.
From the Insert menu, choose
Add Child SFC
.
ISaGRAF 5.2
- Workbench 117
Changing Hierarchy Level
You can promote or demote child SFC (FC) POUs, depending on their relative position in the hierarchy.
To change the level of an SFC (FC) POU
1.
Select the SFC (FC) POU.
2.
Do one of the following:
From the Edit menu, choose
Move to lower Level
or
Move to upper Level
.
From the Main toolbar, click move it to the upper level.
to move the program to a lower level or to
Example
Consider the following two SFC POUs:
Sequential Function Chart (SFC)
Sequential Function Chart (SFC)
Selecting the second SFC POU and moving it down a level would produce:
Sequential Function Chart (SFC)
Child Sequential Function Chart (SFC)
118
ISaGRAF 5.2
- User Guide
Selecting the Child SFC POU and moving it up a level would result in:
Sequential Function Chart (SFC)
Sequential Function Chart (SFC)
Controlling Access to POUs
read-only mode except for those having individual access control. For instance, a POU having its own password remains locked and cannot be viewed without entering its password. When moving or copying a POU using its resources password, the POU retains this password.
The security state of a POU is indicated by its icon color in the resource:
POU
Icon Color
Security
State
Yellow. The POU has no access control. All users have read and write access
in the POU. In the dictionary view, local variables and parameters are visible
and editable.
Red. The POU is locked. Users not having the POU password cannot access
Blue. The POU is in read-only mode. Users not having the resource password can view the POU; these users do not have write capabilities. The read-only mode for the POU is inherited from the resource to which it belongs. In the
dictionary view, local variables and parameters are visible but not editable.
Green. The POU is unlocked. User can access the POU; this user has read
and write capabilities. In the dictionary view, local variables and parameters
are visible and editable.
Note:
While in debug mode or performing builds, unlocked POUs as well as POUs having no access control switch to read-only mode. Locked POUs remain locked.
ISaGRAF 5.2
- Workbench 119
You can build POUs of all security states.
When copying, pasting, importing, and exporting POUs having access control, password definitions are retained.
To set access control for a POU
You set access control for a POU by setting a password.
1.
In the resource window, select the POU for which to set access control.
2.
From the Edit menu, choose
Properties
.
The Program Properties window is displayed showing the Security tab.
3.
Specify a password:
To use a unique password, in the New field, enter a password then reenter it in the
Confirm New field.
To use the same password as set for the resource to which the POU belongs, check
Use Resource Password
.
120
ISaGRAF 5.2
- User Guide
To unlock a POU
When entering a password while in debug mode or performing builds, the POU is only unlocked after stopping the debug mode or when the build is completed.
1.
In the resource window, right-click the POU, then from the contextual menu, choose
Enter Password
.
2.
In the Security dialog box, enter the password for the POU.
The POU is unlocked.
ISaGRAF 5.2
- Workbench 121
Generating Debug and Monitoring Information
You can choose to generate debug and symbols monitoring information for POUs. Debug information is available for ST, IL, and LD POUs (programs, functions, and function blocks)
for use when debugging using the step-by-step mode. Symbols monitoring information is
available for ST, IL, FBD and LD programs and function blocks for use when debugging or
You set the generation of debug and symbols monitoring information for a POU on the Code
Generation tab of the Program Properties window:
When generating symbols monitoring information for function blocks, you also need to specify the instance symbols extra bytes. This indicates the size of memory reserved for each function block instance for adding symbols monitoring information during online changes. Note that a string-type output takes up 260 bytes.
You can change the default value for the
Generate symbols monitoring information
option as well as the
Instance Symbols Extra Bytes
size. Their values are specified in the
FunctionMonitoringSupportDefault and MonitoringSpaceDefault parameters of the Settings section of the Diamond.ini file, located in the Bin folder. For details on the location of the bin
The symbols information generated for graphically monitoring output values requires a significant amount of memory space. Therefore, when compiling, an error message stating that the memory limit has been reached may be displayed in the output window. In such a case, to enable compiling, you need to either disable monitoring for the POU, remove elements from the POU, or clean the project.
122
ISaGRAF 5.2
- User Guide
To generate debug information for a POU
You can also generate debug information for POUs at the resource level.
1.
In the resource window, select the POU for which to generate debug information.
2.
From the Edit menu, choose
Properties
.
The Program Properties window is displayed showing the Code Generation tab.
3.
Check
Generate debug information
.
To generate monitoring information for a POU
1.
In the resource window, select the POU for which to generate monitoring information.
2.
From the Edit menu, choose
Properties
.
The Program Properties window is displayed showing the Code Generation tab.
3.
Check
Generate symbols monitoring information
.
4.
For function blocks, specify the size of Instance symbols extra bytes.
ISaGRAF 5.2
- Workbench 123
Editing a POU Description
You can add a free-format text description for a POU.
To edit the POU Description
1.
Select a POU.
2.
From the Tools menu, choose
Edit Description
.
3.
Edit the description as required.
124
ISaGRAF 5.2
- User Guide
Hardware Architecture View
The hardware architecture view graphically displays the configurations of a Project and
the network links between them. From the hardware architecture view, you manage many aspects of a project:
attaching targets to configurations
inserting resources into configurations
moving resources between configurations
connecting configurations and networks defining configuration connection properties
defining resource network properties
To switch to the hardware architecture view
•
From the Window menu, choose
project_name
-
Hardware Architecture
.
ISaGRAF 5.2
- Workbench 125
Configurations
A configuration represents a hardware definition:
When creating a new project, a default configuration is automatically created. Subsequent
configurations must be manually inserted.
You can resize configuration windows by placing the cursor over an edge or corner until it shows double arrows and dragging:
Creating Configurations
You can create configurations using the main menu or a contextual menu, accessed by
right-clicking within the workspace. Following the creation of a configuration, the
Configuration Properties dialog box automatically appears where you attach it to a target.
Choosing a target leads to the accessibility of network, I/O devices, and C functions and function blocks supported by this target.
To create a configuration
1.
Switch to hardware architecture View
.
126
ISaGRAF 5.2
- User Guide
2.
From the Insert menu, choose
Configuration
.
An empty configuration is created using a default name, then the Configuration
Properties dialog box appears:
3.
On the Hardware Tab, choose a Target to attach to the configuration:
ISaGRAF 5.2
- Workbench 127
Deleting Configurations
You can delete configurations using the main menu or a contextual menu, accessed by
right-clicking a configuration’s title bar. You cannot delete the last configuration of a project;
projects must have at least one configuration.
To delete a configuration
1.
Select the hardware architecture view
2.
Select a configuration.
.
Note:
To deselect resources in the configuration window, click an empty space in the
configuration window.
3.
From the Edit menu, choose
Delete
<DEL>
.
Moving Configurations
When you move configurations, the hardware architecture view is re-drawn to tidy-up the
display. Fixed-sized gaps are placed between network and configurations.
To move a configuration
1.
Select the configuration.
The selected configuration's title bar is highlighted.
2.
Drag and drop the configuration as desired.
128
ISaGRAF 5.2
- User Guide
Inserting Resources
You can choose to insert, i.e., create, resources directly in a configuration while in the hardware
architecture view of your project. You can also create resources in the link architecture view.
However, in the link architecture, new resources are automatically assigned to the first
configuration.
To insert a resource in a configuration
You can insert resources using the main menu or a contextual menu, accessed by right-clicking the empty space in the configuration’s window.
1.
Select a configuration.
2.
From the Insert menu, choose
Resource
.
ISaGRAF 5.2
- Workbench 129
Moving Resources Between Configurations
When moving resources from one configuration to another, you need to make sure several
aspects of the destination configuration are compatible with those of the source configuration:
Network Information, when both configurations are connected to the same networks, resource information remains intact. Otherwise, you will need to change the binding network information for the moved resource.
C function or C function block calls, when the list of available C functions or function blocks is different for both configurations, when proceeding to build the resource, some errors may occur when the functions called do not point to the functions declared in the
I/O Wiring, when the I/O device list is different for both configurations, the I/O wiring of the moved resource is deleted.
To move a resource from one configuration to another
1.
Click and hold the mouse button on the required resource.
2.
Drag and drop the resource to the new configuration.
130
ISaGRAF 5.2
- User Guide
Configuration Properties
Configuration properties are defined from the hardware architecture view.
To access the Configuration Properties window
1.
From the Window menu, choose
project_name
-
Hardware Architecture
.
The hardware architecture view appears displaying all configurations defined for a
project.
2.
Select a configuration.
3.
From the Edit menu, choose
Properties
.
The Configuration Properties window appears.
ISaGRAF 5.2
- Workbench 131
Configuration Identification
The configuration identification properties enable you to assign a meaningful name to a
configuration. You can also choose to add a comment.
Comments appear within (* *) next to the name of the configuration in the configuration’s title bar. Furthermore, you can choose to replace the configuration representation in the hardware architecture view with a custom bitmap by checking the Use bitmap option, then browsing to locate the bitmap.
Standard Configuration Representation Sample Bitmap Representation
When using a custom bitmap for configurations, a copy of the bitmap is automatically placed in the configuration folder and renamed to use the configuration’s name.
You specify the configuration identification properties in the General tab of the Configuration
Properties window:
132
ISaGRAF 5.2
- User Guide
To show or hide bitmaps
You can show or hide custom bitmap images assigned to configurations. When hiding bitmaps, the default configuration representation is displayed.
1.
Switch to the hardware architecture view
2.
From the Options menu, choose
Hide Bitmaps
.
.
Configuration Target Definitions
The configuration target definition property enables you to attach a target to the configuration.
Changing targets for a configuration affects all resources attached to the configuration.
You specify the configuration target definition property in the Hardware tab of the
Configuration Properties window:
The selection of the target determines:
the network onto which you can connect the configuration and that is used in Binding
definitions
the I/O devices that are available for use in the I/O Wiring tool
the list of C functions and function blocks that are available to call in your programs
ISaGRAF 5.2
- Workbench 133
Warning:
Changing the target of a configuration may lead to the destruction of the I/O wiring of all resources within the configuration and connections to networks. You should assign
targets to configurations as a first step in your project development.
When the advanced options are installed, you can choose whether to download the advanced options features such as alarms and events definitions, trends definitions, events server configuration, and trends server configuration.
You can also choose to add a help file using the Help button.
Target Access Control
For configuration security, you can control access to a target by setting a password. This password is embedded on the target and can only be set or changed while running in real-time or debug mode. The configuration access control prevents the connection of all IXL clients not having the target’s password.
At run time, the security state of a configuration is indicated by its title bar icon:
Configuration
Icon
Security
State
The configuration has no access control. All IXL clients can access the target.
The configuration is not accessible; the target does not recognize the password. IXL clients not having the target password cannot access the target.
The configuration is accessible; the target recognizes the password. IXL clients having the target password can access the target.
134
ISaGRAF 5.2
- User Guide
To specify access control for a configuration
You set access control for a configuration in the configuration’s Security properties.
"
In the Password field, enter the password for the configuration, then reenter the password in the Confirm Password field.
Note:
You can only change a password while in real-time or debug mode. Otherwise, the password embedded on the target remains unchanged.
ISaGRAF 5.2
- Workbench 135
Configuration Description
A free-format text description of the configuration.
To edit the configuration description
1.
Right-click on the configuration title bar.
The contextual menu appears.
2.
Choose
Edit Description
.
3.
Edit the description as required.
136
ISaGRAF 5.2
- User Guide
Networks
Networks provide the means for communication between configurations. Configurations need
to communicate when bindings have been defined within them. Configurations are connected
to the network. The target attached to the configuration must support the network the
configuration is connected to. You define network properties when you create them.
A project can have an unlimited number of networks.
If a network is not implemented in the target, integrators are responsible for developing and
implementing a driver for that particular network.
The default network is ETCP. When multiple networks are defined (or if the target is not defined in the project), the Workbench uses the first default network. When one is not defined in the Workbench, it uses the second default network. When neither default networks are defined, the first network defined for the target is used.
Networks are represented in the hardware architecture view as horizontal 'bar'.
ISaGRAF 5.2
- Workbench 137
Creating Networks
You define network properties at the time of creation. You need to specify the protocol (also
called Network Driver) to use for communications between configurations when bindings are
defined. The parameters defining the network appear in the grid. Some parameters may be
read-only (greyed). Not all networks require parameters at this level, e.g., for Ethernet.
You can choose to integrate help using the Help button.
To create a network
1.
Switch to the hardware architecture view
2.
From the Insert menu, choose
Network
.
.
A new Network is created and the Network Properties dialog is displayed from which you select a protocol. The available protocols are ETCP and ISaRSI.
3.
Select OK.
138
ISaGRAF 5.2
- User Guide
Moving Networks
The Network can be moved vertically within the workspace. This facility is simply a method of providing a preferred view for the user, usually the default view is preferred.
To move a network
1.
Select the network.
The selected network is highlighted.
2.
Drag and drop the network as required.
Note:
The hardware architecture view is re-drawn to 'tidy-up' the display. Fixed-sized gaps are
placed between network and configurations.
ISaGRAF 5.2
- Workbench 139
Connections
Connections between networks and configurations enable communications to flow. You need
to connect each configuration to a network. A configuration can be linked to many networks.
Similarly, a network can be linked to many configurations. You can also define one or more mirror targets onto which you download the same files as on the main target. Mirror targets have the same network parameters as the main target but with different values. Configurations can have a maximum of 100 mirror targets.
140
ISaGRAF 5.2
- User Guide
Creating Connections
When creating a connection, make sure to not select the configuration or network. Click elsewhere in the workspace to deselect these items. In the connection’s properties, you need to specify the IP address of the target, for example:
192.168.2.36
The list of available parameters depends on the network to which the configuration is connected. This list may be empty. Some parameters may be read-only (displayed greyed). For
the (Ethernet) network driver, only the IP address of the configuration is required.
Note:
A connection may fail if the network protocol is not supported by the configuration's
When defining a mirror target, you need to specify the IP address of the target (different from the main target) and the network parameters. The Workbench automatically assigns an instance number to individual mirror targets.
To connect a configuration and network
1.
Click and hold the mouse button on the title bar of the configuration to connect.
The mouse becomes a network connection cursor:
ISaGRAF 5.2
- Workbench 141
2.
Drag and drop the mouse cursor to the required network.
The connection is created and the Connection Properties dialog box is displayed.
3.
In the Value field, enter the IP address, then click
OK
.
Deleting Connections
You can remove existing connections between configurations and networks.
To delete a connection between a configuration and network
1.
Select the connection.
2.
Do one of the following:
From the Edit menu, choose
Delete Connection
.
Press
Delete
.
142
ISaGRAF 5.2
- User Guide
Dictionary View
The Dictionary is an editing tool using tree views and grids for the declaration of the
variables, functions, and function block parameters, user types and defined words of the
The various components are sorted in a tree-like hierarchy, e.g., by resource or by Type. The
Tree name is displayed on the window title bar. The four dictionary tree views are:
Note:
You need to declare variables before proceeding with the I/O Wiring process.
To switch to the Dictionary view
"
Do one of the following steps:
From the Project menu, choose either
Types
,
Variables
,
Function/Function Block
Parameters
, or
Defined Words
.
Note:
The choices available differ depending on whether you are in the hardware architecture
On the Window Buttons toolbar, click
Open a variable group.
.
To switch to the Dictionary view from a language editor
Opening the Dictionary from an Editor opens the Variable Tree and grid for the POU being edited.
ISaGRAF 5.2
- Workbench 143
"
Do one of the following steps:
From the File menu, choose
Dictionary
.
On the Standard Buttons toolbar, click .
Appearance
The Dictionary view is displayed maximized in the workspace. The menus and toolbar now reflect Dictionary options only.
The left of the dictionary workspace is a tree-like hierarchical structure of either variables,
parameters, types, or defined words. The right side of the workspace displays a grid-like table.
144
ISaGRAF 5.2
- User Guide
Variables Tree
The branches provide different ways to access the variables of each resource:
Top Level
Resources
Variable Group Grid displays only variables in that group.
Any Group
All Variables
Global Variables
Grid contains all variables in the
Grid contains all global variables
Programs
Functions
Grid contains global variables and
variables local to the program
Grid contains global variable and variables local to the function
Note:
When the cursor is positioned over an item, the full name and comments are displayed in the ToolTip.
ISaGRAF 5.2
- Workbench 145
Parameters Tree
The branches in each resource show all functions and function blocks, in order to define their
parameters in the corresponding grid.
Top Level
Resources
Functions
Function Grid displays the parameters of the function
Function Blocks
Function Block Grid displays the parameters of the function block
Note:
When the cursor is positioned over an item, the full name and comments are displayed in the ToolTip
146
ISaGRAF 5.2
- User Guide
Types Tree
The various tree levels are represented using the following icons:
Top Level
Arrays
Structures
Structures
Level
Individual Structures
When the cursor is positioned over an item, the full name and comments are displayed in the
ToolTip.
Types have a Common Scope, they can be used as a type or any variable of any resource.
Creating Structures
When modifying existing structures, you can edit the contents of the fields and add fields to the
bottom of the structure. Modifying existing structures may affect the initial values set for the associated variables.
To create a structure
1.
Right-click on the 'Structures' top of tree.
2.
From the Edit menu, choose
Add Structure
.
A structure has been created at the end of the tree. Its name is displayed and ready for editing.
ISaGRAF 5.2
- Workbench 147
Renaming Structures
You can rename a structure using the main menu or a contextual menu, accessed by right-clicking a structure.
To rename a structure
1.
Right-click on the structure to rename.
2.
From the Edit menu, choose
Rename Structure
.
3.
Enter a name and comment in the dialog box.
Deleting Structures
You can delete structures using the main menu or a contextual menu, accessed by right-clicking the structure.
To delete a structure
1.
Select the structure in the tree.
2.
From the Edit menu, choose
Delete Structure
.
148
ISaGRAF 5.2
- User Guide
Defined Words Tree
There is no Tree for defined words, these are entered in the grid. Defined words have a
Common Scope, they can be used in any POU of any resource. For information on the Defined
Working with the Grids
Grids display characteristics and values for components corresponding to the selected Tree
View. You create, manipulate, and make changes for variables, functions, and function block
parameters, user types and defined words directly in the grids. The grid is a table formatted
database. You can use one of two editing modes while working in the grids:
Grid, where you can access individual cells. In this mode, a grid outlines individual cells:
Line, where you can access complete rows, i.e., lines. The information contained in the line appears in a dialog box where you can change it. In this mode, no grid appears:
Keyboard shortcuts enable navigating throughout the grid. The behavior of the shortcuts differs depending on the editing mode of the grid.
Shortcut Grid Mode
Tab Moves from one grid cell to the next from left to right. When editing the contents of a cell, the edition mode is retained in the next cells.
Line Mode
Moves from one line to the next from top to bottom
Shift+Tab Moves from one grid cell to the next from right to left. When editing the contents of a cell, the edition mode is retained in the next cells.
End
Moves from one line to the next from bottom to top
Moves to the bottom of the variables list Moves to the line at the bottom of the variables list
ISaGRAF 5.2
- Workbench 149
Shortcut Grid Mode
Home Moves to the top of the variables list
Line Mode
Moves to the line at the top of the variables list
To switch editing modes
"
Directly above the grid, click .
Resizing Columns
You can resize columns or rows.
To resize a column (or row)
1.
Click and hold a cell header divider:
2.
Drag and drop it as required (drag to the left in the above example to shrink the Name column).
Selecting Rows and Elements
You can select either rows or individual cells in the grid depending on the selected editing mode:
To select rows
"
While in the Line editing mode, click on the row.
"
While in the Grid editing mode, click the left-most edge of the row.
To select items in the grid
While in the Line editing mode, you can select one or more items in the grid.
1.
To select a single item, click the item.
2.
To select more than one consecutive item, click the first item, then while holding down the <SHIFT> key, click the last one.
All the elements between the first and last are selected.
3.
To select many individual items, click each one while holding down the <Ctrl> key.
ISaGRAF 5.2
- Workbench 151
Editing the Contents of the Grid
You can edit the contents of individual cells or complete rows depending on the selected
To edit the contents of a cell
"
While in Grid mode, double-click an element within the row.
To edit the contents of a row
1.
While in Line mode, double-click a row.
The variable dialog is displayed.
2.
Make the necessary changes to the variable fields. For the Type field, you can also access the Select Data Types browser by clicking .
152
ISaGRAF 5.2
- User Guide
Adding or Inserting Rows
You can edit the contents of existing rows, add rows at the end of the grid, or insert rows at a specific location in the grid. You can perform these tasks from the main menu or a contextual menu, accessed by right-clicking in the grid.
To add a row
"
From the Edit menu, choose
Add Row
.
The grid dialog box appears:
Some fields have pull-down menus, showing the options available for that field. The Type field
also enables access to the Select Data Types browser.
Note:
The group name is automatically asserted when a variable group is selected in the
Variable Tree.
To insert a row in the grid
1.
Select a row in the grid.
2.
From the Edit menu, choose
Insert Row
.
When the Line editing mode is selected, a row is inserted in the grid. When the Grid editing
mode is selected, grid dialog box appears.
ISaGRAF 5.2
- Workbench 153
Moving Rows
You can change the position of a variable or a parameter in the grid, by dragging the line to a new position.
Note:
You cannot undo row-moving operations.
Expanding or Collapsing Grid Components
Variables with user types (Arrays and Structures) are initially displayed 'collapsed', i.e. only
the variable definition row is displayed, with a + sign in the row header cell. Clicking on the row header cell expands or collapses that variable.
For example, the variable In1 of type arr1, where arr1 is defined in the Dictionary as an Array of [1..3] Booleans, is initially displayed as:
When expanded, the complete definition of in1 is shown:
154
ISaGRAF 5.2
- User Guide
Cutting, Copying, and Deleting Elements
You can cut, copy, or delete either rows or individual cells in the grid depending on the selected
editing mode. The Cut command removes selected elements and places them on the clipboard.
The Copy command places the selected item on the clipboard. The clipboard holds only one item at a time.
To cut elements
1.
Select an element.
2.
From the Edit menu, choose
Cut
<Ctrl+X>
.
To copy elements
1.
Select an element.
2.
From the Edit menu, choose
Copy
<Ctrl+C>
.
Deleting elements
"
Select an element then press
Delete
.
ISaGRAF 5.2
- Workbench 155
Finding and Replacing Elements
You can search for and replace elements in the grid, however, you can only replace the following elements in the respective grids:
Variables
Name
Alias
()
Init.Value
Dimension
Address
Comment
Parameters
Name
Short Name
Comment
()
Dimension
Types
Name
()
Comment
Defined Words
Word
Equivalent
Comment
To differentiate between upper and lower case characters during a search, check
Match Case
.
To search or replace an element (a character, word or phrase):
1.
From the Edit menu, choose 'Find / Replace' <Ctrl + F>.
The Find / Replace dialog is displayed.
2.
To search for an element, in the Find what field, enter the element to search for, then click
Find Next
.
3.
To replace an element, in the Replace with field, enter the element, then click
Replace
.
To replace all occurrences of the element, click
Replace All
.
156
ISaGRAF 5.2
- User Guide
Pasting Elements
You can paste the contents of the clipboard above the currently selected row(s), if one or more rows have been copied or cut.
To paste
1.
Click on the required insertion point.
2.
From the Edit menu, choose
Paste
<
Ctrl+V
> or on the Standard toolbar, click
OR
1.
Right-click the required insertion point.
2.
From the contextual menu, choose
Paste
.
..
Sorting the Grid
You can sort the contents of individual columns of the grid from the main menu, from the toolbar, or by clicking the individual column headers.
To sort the grid
1.
Do one of the following:
From the Tools menu, choose
Sort Ascending
or
Sort Descending
.
On the toolbar, click descending manner.
to sort in an ascending manner or to sort in a
2.
In the Sorting dialog box, choose the criteria (column) to use for sorting, then click
OK
.
ISaGRAF 5.2
- Workbench 157
Duplicating Rows
You can duplicate rows, automatically generating sequentially numbered 'name' copies.
To duplicate a row
1.
Select the row to Duplicate.
2.
Do one of the following:
From the Tools menu, choose
Duplicate
<Ctrl+U>
.
On the Standard toolbar, click
The Duplicate dialog box is displayed:
.
3.
Enter the From and To numbers to use for the automatic generation of names.
4.
Click
OK
.
The newly created rows are inserted below the selected row.
158
ISaGRAF 5.2
- User Guide
Renumbering Addresses
Renumbering addresses automatically generates contiguous addresses within a selected range
of the grid. Renumbering is only available in the variables grid. When renumbering, certain cells such as a function block instances are ignored since they have no address.
The reduced symbol table contains the set of variables with addresses.
To renumber addresses
1.
Select the rows to renumber their address
2.
From the Tools menu, choose
Renumber Addresses
.
3.
In the Renumber Addresses dialog, enter the 'From Address' (hexadecimal value ranging from : 1 to FFFF).
4.
Click
OK
.
Example
If A1 is entered as a Start Address, A1, A2, A3, A4... are generated.
If AA is entered as a Start Address, AA, AB, AC, AD... are generated.
ISaGRAF 5.2
- Workbench 159
Printing a Grid
You can choose to print the current grid. This command launches the Document Generator with the standard list of elements to be printed for a grid. For information on the Document
To print the current grid
•
From the File menu, choose
.
160
ISaGRAF 5.2
- User Guide
Variables Grid
The variables grid allows the definition of variables for each resource created in the project.
The columns of the variables grid are:
Column
Name
Alias
Group
Type
( )
Dimension
Attribute
Scope
Direction
Init.value
Wiring
Comment
Retain
Address
Details
Variable name: limited to 128 characters beginning with a letter or underscore character followed by letters, digits, and single underscore characters. These cannot have two consecutive underscore characters.
Any name. Used in LD Editor
Group name or "None"
BOOL, SINT, USINT, BYTE, INT, UINT, WORD, DINT, UDINT,
DWORD, LINT, ULINT, LWORD, REAL, LREAL, TIME, DATE,
STRING, Array Types, Structure Types, Function Blocks. See Glossary.
If Type is STRING this represents the string length (max. 255 characters)
For example: [1..4,1..7]. See Glossary.
Read, write, or free. See Glossary.
Global or local to a program or function. see Glossary.
of I/O Wiring; Input, Output or Internal.
Numeric or Textual. See Glossary.
Read-only cell, generated by the I/O Wiring tool. Uses syntax of Directly
User comments: Free format
Yes or No. See Glossary and Resource Settings Properties.
User-defined address of the variable. The format is hexadecimal and the value ranges from1 to FFFF.
ISaGRAF 5.2
- Workbench 161
Parameters Grid
The Parameters grid defines the interface of the functions and function blocks created in the
project resources. The columns for parameters are:
Column Details
Name Parameter name: limited to 128 characters beginning with a letter or underscore character followed by letters, digits, and underscore characters.
These cannot have two consecutive underscore characters.
Short Name Short name used in the FBD and LD Editors for display only (max. 4 chars).
Type BOOL, SINT, USINT, BYTE, INT, UINT, WORD, DINT, UDINT, DWORD,
LINT, ULINT, LWORD, REAL, LREAL, TIME, DATE, STRING, Array
Type, Structure Type, Function Block Type. see Glossary
( ) If Type is STRING, ( ) is the length (max. 255 chars).
Dimension
Example [1..4,1..7] for a two dimensional Array. see Glossary
Direction
Comment
Input Parameter, Output Parameter or Local
User comments: Free format
Note:
Parameters are sorted within the database; "Input", then "Output", then "Local".
Functions have only one output parameter which must be a simple type (i.e., no arrays or
structures). Function block instances can only be defined as local parameters of function
blocks. To call a function block in a function block (nested function blocks), you may create the instance of the called function block as a local parameter of the calling function block. This enables you to spy the local parameters of the called block .
162
ISaGRAF 5.2
- User Guide
Types Grid
In the Types grid, you create complex types that will then be available for variable declaration, i.e., new types will appear in the 'Type' selection in all grids. The columns for types are:
Arrays:
Column Details
Name Array name: limited to 128 characters beginning with a letter or underscore character followed by letters, digits, and underscore characters. These cannot have two consecutive underscore characters.
Element Type Array Element Type: BOOL, SINT, USINT, BYTE, INT, UINT, WORD,
DINT, UDINT, DWORD, LINT, ULINT, LWORD, REAL, LREAL, TIME,
DATE, STRING, User Arrays, Structures
( ) If Type is STRING, this represents the length (maximum 255 characters)
Dimension Example: [1..10] for a one dimensional Array, [1..4,1..7], for a two dimensional Array. The dimension must be defined as a positive double integer
(DINT) value.
Comment User comments: Free format
Structures:
Column Details
Name Element name: limited to 128 characters beginning with a letter or underscore character followed by letters, digits, and underscore characters. These cannot have two consecutive underscore characters.
Element Type Element Type: BOOL, SINT, USINT, BYTE, INT, UINT, WORD, DINT,
UDINT, DWORD, LINT, ULINT, LWORD, REAL, LREAL, TIME, DATE,
STRING, User Arrays, Structures
( )
Comment
If type is STRING, this represents the length (maximum 255 characters)
User comments: Free format
Notes:
To create a structure with an element with a dimension, first create an array, then create a structure with an element of type <Array name>.
Type recursive use is not allowed, e.g., one field of 'str1' cannot use the 'str1' type
ISaGRAF 5.2
- Workbench 163
Defined Words Grid
The columns for defined words are:
Column
Word
Equivalent
Comment
Details
Name used in ST source files: first character must be a letter, following characters must be letters, digits or underscore ( '_' ).
String according to ST syntax, that replaces the defined word during compiling. Example: Word = PI, Equivalent = 3.14159
User comments: Free format
164
ISaGRAF 5.2
- User Guide
Initial Values
Initial values can only apply to variables. If no initial value is entered in the variables grid, a
value of 0 (or FALSE) is used by default. The initial values of variables are applied upon starting resources.
The initial values are:
Variable
BOOL
SINT
USINT
BYTE
INT
UINT
WORD
DINT
UDINT
DWORD
LINT
ULINT
LWORD
REAL
Default
0
0
0
0
0
0.0
0
0
0
0
0
0
FALSE
0
LREAL 0.0
Possible Values
TRUE or FALSE any other short integer value any other unsigned short integer value any byte value any other integer value any other unsigned integer value any other word value any other double integer value any other unsigned double integer value any other double word value any other long integer value any other unsigned long integer value any other long word value any other float value (not double). Scientific format
1.2E+10 can be entered any other float value. Scientific format 1.2E+10 can be entered
ISaGRAF 5.2
- Workbench 165
TIME t#0s any other timer value using the following syntax: t#WhXmYsZms or t#Z
DATE
STRING
0 <= W: number of hours
0 <= X: number of minutes
0 <= Y: number of seconds
0 <= Z: number of milliseconds
Note:
The h, m, s, and ms fields are optional. If t#100 is entered, it corresponds to t#100ms.
d#1970-01-01 any other date value ranging from 1970-01-01 to
2038-01-18 using the following syntax: d#yyyy-mm-dd empty any set of characters contained within single quotes, for example, 'hello'
Array initialization 0 or FALSE
you need to initialize each element of an array*
Structure initialization 0 or FALSE
you need to initialize each field in a structure*
* When initializing the values of elements for arrays or structures, the total number of characters, including commas automatically inserted to separate the initial values defined for each element, cannot exceed 482. In the Dictionary window, the Initial Value field at the root of the array or structure displays this cumulation.
166
ISaGRAF 5.2
- User Guide
To initialize the elements of an array
You initialize an array one element at a time.
1.
Set the dictionary to grid mode.
2.
Expand the array by clicking the '+' sign.
3.
Double-click the array element’s Init Value column.
4.
Enter a value corresponding to the element type.
To initialize the fields of a structure
The first line, with the structure's name, displays the list of each field's values. You initialize a structure one field at a time.
1.
Set the dictionary into the grid mode.
2.
Expand the structure by clicking on the '+' sign.
3.
Double-click on the structure field, in the 'Initial Value' column.
4.
Enter the value that corresponds to the field's type.
The first line, with the structure's name, displays the list of field's values. The parenthesis display a list of values that correspond to the array's elements.
ISaGRAF 5.2
- Workbench 167
Validation
Validation is performed at all levels of input and use of the grid.
When an error is detected, a message box with an error description appears.
Cell-level Validation
The system processes cell-level validation on several aspects:
Variable, array and structure names are limited to 128 characters beginning with a letter or underscore character followed by letters, digits, and underscore characters. These cannot have two consecutive underscore characters.
Dimensions of arrays, for instance, one-dimensional array reads ARRAY[n..m] where n represents the start index and m represents the end index, and multi-dimensional arrays read ARRAY[n1..m1,n2..m2,...]
Initial values of variables. For details about initial values, see page 165.
Text length for alias having a maximum of 128 characters and comments having a maximum of 255 characters
Variables, arrays, and structures use names other than reserved keywords
Validity and range checks of Addresses
168
ISaGRAF 5.2
- User Guide
Row-level Validation
The system validates the rows (records) at grid-level. When editing a row, the system checks:
Retain variables cannot be Input/Output
If Type is not of type String, the "()" column must be empty Direction checks:
Internal: Wiring must be empty
Input: Wiring must begin with %I
Output: Wiring must begin with %Q
Attribute checks:
Can only be "Read-only" for Inputs
Can only be "Write" or "Free" for Outputs
Inputs cannot have an initial value
Retain variables cannot have an initial value
ISaGRAF 5.2
- Workbench 169
Database-level Validation
The system validates the database and verifies the following aspects when saving changes:
IEC 61131-3 functions have only one output parameter, named as the function
Function and function block parameter names are unique
Parameters are ordered as inputs then outputs
Variable names are unique within a resource
Local variable names are unique within a POU and differ from global variable names within the resource
Within a structure, individual field names are unique
The number of function and function block parameters respects the target capabilities
170
ISaGRAF 5.2
- User Guide
I/O Wiring View
I/O wiring enables you to define links between the variables defined in a project and the channels of the devices existing on the target system. Wiring is performed at the resource level, therefore, I/O wiring is only available when a resource is selected in either the link architecture or hardware architecture views and when a target has been attached to the current configuration.
After creating variables in the Dictionary, you perform I/O wiring in the I/O wiring tool by
adding I/O devices, setting device parameters and I/O filters, then wiring the channels of the
To open the
tool from the link or hardware architecture view
1.
Select a resource.
2.
Do one of the following:
From the Project menu, choose
I/O wiring
.
On the Window Buttons toolbar, click .
To open the
tool from the link architecture view
"
Within a resource window, open the parameters component, then the I/O wiring component.
ISaGRAF 5.2
- Workbench 171
Output window
172
Appearance
The I/O Wiring view is displayed in the workspace. The menus and toolbar now reflect I/O
Wiring options only.
The left of the I/O Wiring Workspace is a hierarchical 'Tree View' of defined I/O devices. The
right side of the workspace displays a grid-like table of the free (unwired) variables of the
current resource. These unwired variables are listed in alphabetical order. A Splitter is
available to change the proportion of the width of the Tree and grid windows.
Title bar
Menu bar
Toolbars
Workspace
ISaGRAF 5.2
- User Guide
I/O Wiring Tree View
Parameters
BoardRef
BoardAddress
Wired Channel
Direct
Simple Device
Free Channel
Gain
Offset
Conversion
Complex Device
Name (* comment of the I/O device *)
(Only displayed if the I/O device has defined parameters).
Boolean values) for numeric values for numeric values
When a device has been added, you can use Direct Variable Representation (%IX1.1) to access
IO values. This syntax is shown in the Tree. You can also wire variables that you have already declared in the Dictionary to the device channels, and use these Variable names in your programs to access channel values. The diagram above shows examples of certain simple devices in the I/O Wiring Tree view.
ISaGRAF 5.2
- Workbench 173
Parameters
Double-click on any parameter in the tree to open a dialog box that allows you to modify its value.
Direct/ Reverse
For a boolean IO channel, you can switch between the original value (direct) or its negation
(reverse). Simply double click on 'Direct' or 'Reverse' to swap from one choice to another.
Gain/Offset
For a numerical channel, you can apply a gain and an offset to a channel value.
For inputs, the original value (coming from the input device) is multiplied by the gain, and the
offset value is added. This gives the value used by the programs of the resource.
For outputs, the value of the variable resulting from the execution of the program is multiplied
by the gain and the offset value added, before updating the output device.
Double-click 'Gain' or 'Offset' in the tree to open a dialog box that allows you to modify the values.
Note:
Gain is composed of a multiplier factor and a divider factor.
The conversion formula applied is as follows:
NewValue = (Value * MultFactor) / DivFactor + Offset
For details on specific implementations, contact your supplier.
Conversions
Conversions can be applied to any kind of channels. The list of available conversions depends
on the target implementation. Please contact your supplier for more information on
conversions they provide.
Simply double click on 'Conversion' in the tree to open a dialog box that allows you to select the desired conversion for the channel.
174
ISaGRAF 5.2
- User Guide
I/O Wiring Grid View
The Grid view displays a read-only list of the available (non-wired) variables of the resource
that match the type and direction of the device selected in the Tree View.
Working with the I/O Wiring Tool
When defining the I/O Wiring the first time, the Tree and Grid views are empty. After an I/O
device is added, the Grid view lists all the variables of the current resource that correspond to
the device type and direction. Example: all Boolean inputs for an I/O device: BOOL - Input.
ISaGRAF 5.2
- Workbench 175
Adding I/O Devices
You can create I/O devices containing multiple channels of the same type and direction. The
workbench automatically assigns a device index to each I/O device. You can change the device index to another unique number. The device index value can range from 0 and 65535.
You can add simple and complex devices to the I/O wiring tree. Available devices for a target
are displayed in the device selection list. When adding complex devices, the number of channels, i.e., device size, of individual simple devices making up a complex device varies depending on the definition of the complex device in the target.
To add an I/O device
1.
From the Edit menu, choose
Add I/O Device
or click
The Device Selection dialog box appears:
2.
Choose the device from the pull-down menu.
3.
Change the device index and number of channels (if required and available).
4.
Click
OK
.
176
ISaGRAF 5.2
- User Guide
Opening Devices
You can open existing devices defined for any resource of a project.
To open an existing device
1.
From the File menu, choose
Open Device
or click
2.
In the Open window, browse to select the resource holding the device, then click
Open
.
The devices defined for the selected resource are displayed in the I/O Wiring View.
ISaGRAF 5.2
- Workbench 177
Deleting Devices and Conversions
You can delete devices and conversions from the I/O wiring view. You cannot delete
Parameter, Gain, or Offset elements. You remove a current conversion by replacing it with
"None". You can also disconnect variables attached to selected channels.
When deleting devices, all variables are unwired from the device (as with Free I/O device channels).
To delete a device or conversion
You can delete devices or conversions using the main menu or the I/O Wiring toolbar.
"
From the Edit menu, choose
Delete Device
or click
178
ISaGRAF 5.2
- User Guide
Setting the Real or Virtual Attribute
This command sets the Real/Virtual attribute for the currently selected device.
To toggle the Real/Virtual attribute:
1.
Select the device in the Tree View.
2.
From the Edit menu, choose
Real / Virtual I/O Device
or click
The Tree View icon for a virtual device is .
In Real Mode, I/O variables are directly linked to the corresponding I/O devices. Input or
Output operations in the programs correspond directly to the input or output conditions of the
actual I/O device fields. In virtual mode, I/O variables are processed as internal variables. They can be read or updated by the Debugger so that the user can simulate the I/O processing, but no actual connection is made.
Wiring Channels
You wire variables to channels by selecting a channel in the Tree, then double-clicking or pressing
<Return>
on a variable in the grid. If the channel is already wired, the existing
variable is unwired and replaced by the one in the grid.
After a connection, the variable is removed from the grid and the next channel is selected; only variables available for wiring appear in the grid.
Note:
If no channel is selected, nothing happens.
ISaGRAF 5.2
- Workbench 179
Mapping Channels
You can define the mapping of logical channels to physical channels. When mapping channels, only one link can send to or receive from a logical channel. For an input device, you can map a physical input to one or more logical inputs. Whereas, you cannot map more than one physical input to a logical input. For an output device, you can only link one logical output to one physical output:
Input Device
Physical
Input
Logical
Input
Output Device
Physical
Output
Logical
Ouput
When performing online changes, you can modify channel mappings.
To map logical and physical channels for a device
1.
In the I/O wiring tool, select the device.
2.
From the Edit menu, choose
Map Channels
or click
180
ISaGRAF 5.2
- User Guide
The Map Channels editor displays the current mapping of channels for the device:
3.
For each logical channel to map, locate and double-click its corresponding physical channel, then from the drop-down list assign the new physical channel by double-clicking it.
4.
Click
OK
.
ISaGRAF 5.2
- Workbench 181
Freeing Channels
You can unwire one or all variables for a selected device.
To free one channel
1.
Select a wired channel in the tree view.
2.
Do one of the following:
From the Edit menu, choose
Free I/O device channel
.
From the I/O wiring toolbar, click
Press
Delete
.
To free all channels
1.
Select a device in the tree view.
2.
Do one of the following:
From the Edit menu, choose
Free all I/O device channels
.
From the I/O wiring toolbar, click .
182
ISaGRAF 5.2
- User Guide
Naming Conventions and Limitations
Projects
Programs in a project
Program names
Hierarchical levels
Project names
Types of configurations
Resources per configuration
I/O or conversion tables
Resource names
OEM parameters
OEM parameter names
Projects can contain up to 65 536 programs.
Program names can have up to 128 characters.
Projects can have up to 65 536 levels.
Project names can have up to 128 characters.
Projects containing
ISaGRAF
3
configurations can have project names with up to eight characters.
Projects can contain multiple
ISaGRAF
5
configurations.
Projects can hold only one
ISaGRAF
3
configuration.
Configuration can contain multiple resources.
ISaGRAF
3
configurations can only contain one resource.
The maximum number of I/Os is defined by the
ISaGRAF
license.
ISaGRAF
3
configurations can have up to 127 conversion tables. Furthermore, these tables are also limited to a maximum of two points defined by the
Y=aX+b linear function.
Resource names can have up to 128 characters.
No specific limit exists for the number of parameters.
OEM parameter names can have up to 128 characters.
ISaGRAF 5.2
- 183
POUs (Programs, Functions, and Function Blocks)
POUs
POU names
POU Parameters
POU Parameter names
Projects can have up to 65 536 POUs.
POU names can have up to 128 characters.
ISaGRAF
3
POU names can have up to eight characters.
POUs (functions, function blocks) can have up to 128 parameters (inputs and outputs).
ISaGRAF
3
POUs (programs, functions, function blocks, and sub-programs) can have up to 32 parameters.
POU parameter names can have up to 256 characters.
ISaGRAF
3
POU parameter names can have up to 32 characters.
I/O Wiring
I/Os
I/O boards per project
I/O board names
I/O configuration names
Complex I/O devices per project
Channels per simple and complex device
The maximum number of I/Os is defined by the
ISaGRAF
license.
Projects can have up to 65 536 boards.
I/O board names can have up to 128 characters.
I/O configuration names can have up to 128 characters.
Projects can have up to 65 536 devices.
Simple and complex devices can have up to
65 536 channels.
For
ISaGRAF
3
configurations, simple and complex devices can have up to 128 channels.
184
ISaGRAF 5.2
-
Parameters per simple and complex device
Simple and complex devices have an unlimited number of parameters.
For
ISaGRAF
3
configurations, simple and complex devices can have up to 16 parameters, excluding
OemKey.
Device numbers for the device index
Device numbers can range from O to 65 536.
I/O device and network drive names I/O device and network drive names can have up to
128 characters.
I/O device and network drive names can begin with a letter followed by letters, digits and single underscores.
Language Editors
Graphics in language editors Language editors can contain an unlimited number of graphics.
SFC
Size of SFC diagrams
SFC steps per program
SFC transitions per program
SFC diagrams can have unlimited size.
For
ISaGRAF
3
configurations, SFC diagrams can have a size of 20 by 20 cells.
SFC programs can have up to 65 536 steps.
SFC programs can have up to 65 536 transitions.
ISaGRAF 5.2
- 185
SFC step and transition names SFC step and transition names can have up to
128 characters.
SFC step or transition names can begin with a letter or underscore followed by letters, digits, and single underscores.
SFC step names cannot contain reserved keywords.
SFC steps cannot share the same names as the variables.
For
ISaGRAF
3
configurations, steps names must be
GS
x
and transitions names must be GT
x
.
FC, ST, LD, and FBD
Characters in FC, ST, LD, or FBD program names
Characters in the short names for
FBD and LD editors
IL
IL program names
FC, ST, LD, or FBD program names can have up to
128 characters.
FC, ST, LD, and FBD program names can begin with a letter or underscore followed by letters, digits, and single underscores.
FC, ST, LD, or FBD program short names can have up to four characters.
Labels in an IL program
Label names
IL program names can have up to 128 characters.
IL program names can begin with a letter followed by letters, digits, and single underscores.
IL programs can have an unlimited number of labels.
Label names can have up to 16 characters.
Label names can begin with a letter followed letters, digits and single underscores.
Label names must be unique within an IL program.
A label can have the same name as a variable.
186
ISaGRAF 5.2
-
User-defined Types
Array names
Structure element names
Variables
Dictionary variables
Variable names
STRING variables
Defined Words
Defined words
Array names can have up to 128 characters.
Array names can begin with letters or an underscore followed by letters, digits, and single underscores.
Structure element names can have up to
128 characters.
Structure element names can begin with a letter or an underscore followed by letters, digits, and single underscores.
The dictionary can contain up to 4 294 967 296 entries for each variable type.
Variable names can have up to 128 characters.
For
ISaGRAF
3
configurations, variable names can have up to 32 characters.
Variable names can begin with a letter followed by letters, digits, and underscores.
STRING variables can have up to 255 characters, excluding the terminating null character.
Defined words can contain up to 128 characters.
For
ISaGRAF
3
configurations, defined words can contain up to 32 characters.
Defined words can begin with a letter followed by letters, digits, and underscores.
Defined words cannot contain defined words.
ISaGRAF 5.2
- 187
Functions, Function Blocks, "C" Functions, "C" Function Blocks, "C" Conversion
Functions
Functions and function blocks per program
Functions and function blocks in
ISaGRAF
3
programs
Programs can have up to 65 536 functions or function blocks.
Programs can have up to 255 functions or function blocks, excluding "C" conversion functions.
Programs can have up to 128 "C" conversion functions.
Function and function block names Function and function block names can have up to
128 characters.
Function and function block names in
ISaGRAF
3
Function and function block names can have up to eight characters.
Function and function block parameter names
Function and function block parameter names can have up to 128 characters.
Function and function block parameter names can begin with a letter or an underscore followed by letters, digits, and single underscores.
ISaVIEW
Input text per animated object
Data type STRINGs
Target Definition Builder
Animated objects can have one character of input text.
STRINGs can have up to 255 characters.
Case sensitivity
Data type, function, function block and conversion function names
The Target Definition Builder automatically adjusts case when generating "C" source code.
Data type, function, function block and conversion function names can have up to 128 characters.
Data type, function, function block and conversion function names can begin with a letter or an underscore followed by letters, digits, and single underscores.
Network drive names
Target names
Network drive names can have up to 128 characters.
Target names can have up to 15 characters.
Target names can begin with a letter or an underscore followed by letters, digits, single underscores, and single dashes (minus sign).
ISaGRAF 5.2
- 189
IEC 61499 Distribution View
The IEC 61499 distribution view enables overseeing the distribution of IEC 61499 programs across multiple resources of a project. The distribution view is made up of an upper an a lower window. The upper window displays either the configurations or the resources of a project, in a single row, depending on whether switching from the link architecture or hardware architecture views. From this window, you can perform configuration or resource management operations such as cutting, copying, and pasting programs using the contextual menu, accessed by right-clicking. The lower window displays the distribution of IEC 61499 programs across the resources of a project. IEC 61499 programs, indicated on the left, having function blocks declared in individual configurations or resources display a function block icon aligned vertically below them respectively. Double-clicking these function block icons opens them in the language editor.
The distribution view enables scrolling horizontally to display additional resources and scrolling vertically to display additional IEC 61499 programs.
To switch to the Distribution view
"
On the Layers toolbar, click
61499 layer.
or from the layer selector , select the
ISaGRAF 5.2
- Workbench 191
Run-time System Events
You can log run-time system events on the Windows platform using the Events Logger and view these events using the Events Viewer.
You access the Events Logger and Events Viewer from the Workbench. You can also start the
logger and viewer from command lines.
Logging Events
The Events Logger receives events from ISaGRAF targets. You can view these events using
the Events Viewer. Events are stored in a log file, in Unicode format, located in the Events
Logger folder of the current project’s directory. A new log file is automatically created each day at 00:00:00 hours.
The name of the log file is Events_
YYYYMMDD.
txt where
YYYY
is the year,
MM
is the month, and
DD
is the day on which the file is created.
You can open the log file in text format using a text editor.
When starting the Events Viewer from the Workbench while an application is running, the
Events Logger automatically points towards the application’s project and the logger is started.
You can also choose to start the Events Logger from a command line.
To start the Events Logger from a command line
You can set the Events Logger to start for a given Workbench project from a command line using the following syntax:
EventsLogger -P"
full_directory_path
"
The executable file for the Events Logger is installed in the following location:
Program Files\ICS Triplex ISaGRAF\ISaGRAF\bin\EventsLogger.exe
192
ISaGRAF 5.2
- User Guide
When manually starting the Events Logger, you may need to provide the location of the
Workbench project. The Events Logger needs to be started in it's location directory. For example:
C:> cd "Program Files\ICS Triplex ISaGRAF\ISaGRAF\Bin"
C:> EventsLogger -P"Program Files\ICS Triplex ISaGRAF\Projects\ISaGRAF\
Prj\MyProject"
You can also start the Events Viewer from a command line.
To open a log file
You can view the log of events as a text file by opening the log in a text editor such as Notepad.
The default location for the log file is in the Events Logger folder of the current project’s directory.
"
Locate and double-click the .txt file.
The file opens in the associated text editor.
ISaGRAF 5.2
- Workbench 193
Viewing Events
The Events Viewer displays run-time system events logged with the Events Logger.
The Events Viewer displays the contents of the log file, created daily by the Events Logger. In
the viewer, events appear as they occur. You can sort events according to the categories at the
top of the viewer window:
Date and time when the event took place
Level, the level of the event. Possible values include Error, Warning, and Info.
Module, the module sending the event
Sub-module, the sub-module sending the event
Error, the code number of the error
Description, a textual description of the event
Value, a number relating to target development values
Configuration, the name of the configuration running on the target that sent the event.
When the event is related to a resource, the resource name is added to the configuration name, for example, Config1.Res1.
You can choose to view events for a day other than the current day. You can also view events
for a day in a different month and year as long as the log file for the specified date is available.
Furthermore, you can sort the contents of the viewer according to individual columns in ascending or descending order by clicking a column heading a first time for ascending order and a second time for descending order.
When viewing events, you can access more detailed information for specific messages by pressing F1.
Note:
The Events Logger only logs target errors; Simulator errors are not displayed in the
Events Viewer.
194
ISaGRAF 5.2
- User Guide
To access the Events Viewer
When starting the Events Viewer while running an application, the Events Logger automatically points towards the application’s project and is started.
"
In the Workbench, from the Tools menu, choose
Events Viewer
.
To sort events in the Events Viewer
"
At the top of the window, click a category heading. To inverse sorting order, click the category heading a second time.
To view events for another day
1.
At the top of the window, click the date.
The Events Viewer Date Selection window appears:
2.
To view the events for another day, click the day on the calendar.
3.
To view the dates for another month, do one of the following:
Click or to scroll through the previous or following months.
Click on the month at the top of the calendar, then choose one from the list.
4.
To change the year, click the year at the top of the calendar, then choose one from the list.
ISaGRAF 5.2
- Workbench 195
5.
To return to viewing events for the current day, click below the calendar.
To start the Events Viewer from a command line
You can set the Events Viewer to start for a given Workbench project from a command line using the following syntax:
EventsViewer -P"
full_directory_path
"
The executable file for the Events Viewer is installed in the following location:
Program Files\ICS Triplex ISaGRAF\ISaGRAF\bin\EventsViewer.exe
The Events Viewer needs to be started in it's location directory. For example:
C:> cd "Program Files\ICS Triplex ISaGRAF\ISaGRAF\Bin"
C:> EventsViewer -P"Program Files\ICS Triplex ISaGRAF\Projects\ISaGRAF\
Prj\MyProject"
You can also start the Events Logger from a command line.
196
ISaGRAF 5.2
- User Guide
Language Editors
The Workbench holds several language editors, having some Common Editor Features, for use
with the many supported languages.
Common Editor Features
Each Editor in the Workbench has a similar and consistent interface using standard Windows
layout and functionality (for example, menus, toolbars).
The Dictionary, listing variables that can be used in the current POU, or used to declare new
variables, can be opened from any Editor. Building POU Code and starting Test Mode can also be performed from all the Editors.
Printing from an Editor launches the Document Generator with elements specific to that Editor.
ISaGRAF 5.2
- Workbench 197
Appearance
title bar menu bar toolbars workspace output window status bar
Title Bar
For help locating the title bar, see the Appearance diagram. The title bar displays the
application name and filename of the active Program.
Control Icon
At the left end of the title bar is the Control Icon, which is used to access the Control Menu (see following section). Double-clicking on the Control Icon closes the Editor.
Control Menu
Clicking on the Control icon opens the Control Menu. The Control Menu is used to position the Main Window or to exit.
198
ISaGRAF 5.2
- User Guide
Window Buttons
The standard window buttons appear at the right end of the title bar. Use these to resize or close the Window.
Menu Bar
The Menu Bar contains the Editor's menus. For help locating the menu bar, see the Appearance
diagram. Each menu lists a "family" of selections, each selection performs a specific action.
Note:
Menus that are not currently available are temporarily removed from the menu bar.
Menu Items not available are displayed in gray.
Using the Menus
1.
Open a menu by clicking on it, or by pressing <Alt> plus the letter that is underlined in the menu's title. For example, to open the File Menu, you press <Alt> + <F> (shown in this User's Guide as ALT+F).
2.
Choose a menu selection by clicking on it, by pressing its underlined letter, or by using the cursor keys to highlight it and then pressing <Enter>. Menu selections that appear in grey are not currently available.
Control Icon
When a Program is open, the menu bar has a Control Icon on the left.
Control Menu
Clicking on the Control Icon opens the Control Menu. The Control Menu is used to position the Window or to alternate between them.
Window Buttons
The standard window buttons appear at the right end of the menu bar.
ISaGRAF 5.2
- Workbench 199
Toolbars
The language editors holds toolbars performing various functions.
Displaying the toolbars
To show or hide a toolbar
1.
From the Options Menu, choose
Layout
.
The Layout Dialog Box appears.
2.
Check / uncheck the names of the toolbars to show / hide.
Moving toolbars
The toolbars can be placed anywhere on the screen.
To move a toolbar
1.
Point the cursor at the toolbar's title bar or main panel.
Note:
Do not point at the control icon or one of the window's buttons.
2.
Press and hold the left mouse-button.
3.
Drag the toolbar by moving the mouse.
4.
Release the mouse-button.
200
ISaGRAF 5.2
- User Guide
Docking toolbars
Dock a toolbar to a side of the Workspace by positioning it at the Workspace's edge, this toggles between a toolbar's floating and docked states.
The toolbar shown above appears as follows in its floating state:
ISaGRAF 5.2
- Workbench 201
Standard Toolbar
Saves the current POU
Cuts the selection and places it on the clipboard
Copies the selection and places it on the clipboard
Pastes the contents of the clipboard
Undoes the last operation
Redoes the last operation
Accesses the document generator
Finds and replaces items
202
ISaGRAF 5.2
- User Guide
Switches the application to debug mode
Switches an application to simulation mode
Accesses the cross references browser
Options Toolbar
Increases the X to Y Ratio (LD Only) Cells are displayed wider
Decreases the X to Y Ratio (LD Only) Cells are displayed narrower
ISaGRAF 5.2
- Workbench 203
Debug Toolbar
The Debug toolbar is accessible when you run a POU in either debug or simulation mode.
Switches the application to Real-time mode
Switches the application to cycle-to-cycle mode
rung
line of code or
rung
204
ISaGRAF 5.2
- User Guide
Sets or removes a breakpoint. For LD programs only.
Removes breakpoints. For LD programs only.
Shows/Hides output values. For FBD programs only.
Displays the spy variable list
Stops the debug/simulation mode
Refreshes the status of resources
Displays the ISaVIEW screen builder
ISaGRAF 5.2
- Workbench 205
SFC Breakpoints Toolbar
Sets a breakpoint on step activation
Sets a breakpoint on step deactivation
Sets a breakpoint on transition
206
ISaGRAF 5.2
- User Guide
SFC Tools
ISaGRAF 5.2
- Workbench 207
208
ISaGRAF 5.2
- User Guide
Flow Chart Tools
ISaGRAF 5.2
- Workbench 209
ST Tools
This toolbar is displayed when editing an ST POU, an Action, or a test of an FC or SFC POU
written in ST. Clicking on one button of this toolbar inserts the corresponding word, at the caret position, in the text of the current POU.
Boolean True
Boolean False
Boolean AND operator
Boolean OR operator
Boolean XOR operator
210
ISaGRAF 5.2
- User Guide
IL Tools
This toolbar is displayed when editing an IL POU or an action or a test of an FC or SFC POU written in IL. Clicking on a button of this toolbar inserts the corresponding word, at the caret position, in the text of the current POU.
ISaGRAF 5.2
- Workbench 211
LD Tools
This toolbar is displayed when editing an LD POU or an Action or a test of an FC or SFC POU
written in LD.
212
ISaGRAF 5.2
- User Guide
Change Coil/Contact Type (pressing the
<spacebar>
has the same effect)
FBD Tools
The FBD tools bar is displayed when editing a POU written in the FBD language.
ISaGRAF 5.2
- Workbench 213
214
Adds an LD vertical connection
Change Coil/Contact Type (pressing the
<spacebar>
has the same effect)
Shows or hides the execution order
ISaGRAF 5.2
- User Guide
Workspace
When you open a POU, it appears in a window. This windows appear within the Editor's
Workspace.
For the FBD and LD language editors, you can also change the foreground and background colors.
The Workspace of the FC (Flow Chart) and SFC Editors can be sub-divided into two simultaneous views:
Each view can be zoomed independently.
To split the workspace
1.
From the Window menu, choose
Split
.
2.
Drag and drop the vertical division to the required position.
Grid
The editing grid shows matrix cells. An editor option allows the user to show or hide the grid during development. The grid is very useful for placing new elements.
ISaGRAF 5.2
- Workbench 215
To toggle (display / hide) the grid
From the Layout sub-menu of the Options Menu, choose
Grid
or click
Options toolbar.
on the
Note:
The grid visibility does not affect its use to position elements, simply whether or not it can be seen.
X-Y Ratio
The x-y ratio determines the relative width spacing of the grid compared to the height of each grid 'cell'. This is a display property only, it has no effect on the definition or execution of the
Program.
To change the x-y ratio
From the Options Menu, choose
Layout
OR use the buttons (
Options toolbar.
Note:
The X-Y ratio features are only available when editing LD.
, ) on the
216
ISaGRAF 5.2
- User Guide
Contextual Menus
The Contextual Menus are displayed by clicking the right mouse-button in the Editor
Workspace.
The commands on the Contextual Menu are generally available in the Edit Menu.
Example
ISaGRAF 5.2
- Workbench 217
Output Window
To view the output window
From the Window Menu, choose
Show Output Window
.
The output window appears, docked to the status bar:
Note:
The output window is moved like a toolbar. It is automatically displayed when Building and Debugging a Program. Compilation errors are displayed in the output window.
To clear the output window
From the Window Menu, choose
Clear Output Window
.
Status Bar
The Status Bar appears at the bottom of the Main Window. Information about commands, operations and POUs is given on the Status Bar.
218
ISaGRAF 5.2
- User Guide
Inserting Identifiers
You can insert identifiers, i.e., variables, previously declared in the Dictionary. You can also create new variables and enter constant values into a POU as well as access the parameters of functions or function blocks. When creating a new variable, you need to assign a unique name
(not corresponding to an existing variable) as well as specify its type and scope: global or local
to the POU. These variables are added to the project database with default values for their other attributes (Internal, Free). For new variables of the STRING type, a string of 80 characters is automatically defined.
You insert identifiers using the Select Variable dialog. You can list all types of variables or
individual standard IEC 61131-3 types as well as defined words, arrays, and structures. You
can also list variable groups and variable directions. When editing functions or function blocks,
the parameters option appears in this list. When typing identifier names, the selector
automatically searches for the first item in the list matching the entered criteria.
Note:
Arrays must be declared in the Dictionary View before using them in Functional Block
Diagrams (FBD).
ISaGRAF 5.2
- Workbench 219
To insert an identifier in a POU
1.
From the Edit menu, choose
Insert Identifier
or click
The Select Variable dialog box is displayed.
from the Standard toolbar.
2.
To reduce the number of variables appearing in the list, select a type, variable group, and direction of the identifiers to list. To list the parameters for functions and function blocks, select the Parameters option.
3.
Do one of the following:
To use a previously declared variable, select a variable from the list or type the name of the variable in the field at the top left.
To create a new variable, in the top left field, type a unique name and click
OK
, then in the New Variable dialog box, specify the type and scope for the new variable
(optionally an alias and comment). To specify the local scope, select the name of the currently edited POU.
To enter a constant value, type the value in the field at the top left.
4.
Click
OK
.
The identifier is inserted in the currently edited POU at the current position.
220
ISaGRAF 5.2
- User Guide
Inserting Blocks
You insert blocks, i.e., operators, functions, and function blocks into programs from the Select
Blocks window. The items displayed in the list depend on the program type. For SFC, FC, ST,
LD, FBD, and IL programs, the available items are operators (OPE), standard functions (SFU), standard function blocks (SFB), user IEC 61131-3 Functions (IFU), user IEC 61131-3
Function Blocks (IFB) and all "C" Functions (CFU) and Function Blocks (CFB) supported by the target attached to the current resource. For IEC 61499 programs, the displayed items are user IEC 61499 Function Blocks (IFB) for which instances are defined in the dictionary.
The block identifier field (top left) indicates the selected operator, function, or function block. When an instance is selected, the instance name is displayed.
The resource field (below the block identifier) is only available when editing IEC 61499 programs to indicate the resource on which the selected IEC 61499 function block instance is defined.
The Blocks list enables you to display all or various types of operators, functions, and function blocks.
ISaGRAF 5.2
- Workbench 221
Inputs are only available for operators such as +, *, and AND to define the number of input connections for the block.
For FBD 61131 programs, the Instance field is only available when the currently selected
Block is a declared instance. The Instance field enables you to select the Instance name to
insert into the POU. When the field is left blank, an automatic instance is created for the
function block. For IEC 61499 programs, the Instance field enables you to select the instance of the IEC 61499 function block.
The Help button displays the description of the Block or Function or the associated help if it exists (C Function or Function Block).
The Parameters tab is significant only for some "C" Functions and Function Blocks. It shows the Parameters that are not shown when inserting the block in the program editor. These
Parameters are called "Hidden Parameters". They correspond to Input Parameters of the Block to which you can give a constant value. The Parameters tab allows you to enter a value for these
Parameters.
Select the parameter name in the list, and enter its value in the "Value" edit box, press Enter to assign the value.
222
ISaGRAF 5.2
- User Guide
Printing POUs
You can choose to print a standard list of elements for a POU from the Document Generator.
For information about the Document Generator, see page 389.
To print the current POU
From the File menu, choose
or click on the Standard toolbar.
Opening the Dictionary
From a language editor, you can open the Dictionary filtered for the current POU.
To open the Dictionary
From the File menu, choose
Dictionary
or click on the Standard toolbar.
ISaGRAF 5.2
- Workbench 223
Opening Another POU
From a language editor, you can open another POU written with the language supported by the current editor from any resource.
To open another POU from a language editor
1.
From the file menu, choose Open or click on the Standard toolbar.
2.
In the Open dialog box, from the project tree, select the resource holding the POU to open, then the file from the list of available files.
224
ISaGRAF 5.2
- User Guide
Finding and Replacing in POUs
You can find and replace text throughout all POUs. You can specify to search an entire project, a configuration, a resource, or a POU.
Searches include level 2 code of SFC and FC POUs as well as action block names of steps. The
Find / Replace in POUs utility is not case-sensitive, for instance, FIND is the same as FinD.
To find a step or transition name in an SFC chart or an action or test name in an FC chart, use the Goto command in the Edit menu from the respective editor.
To find an item (characters, word, or phrase)
Searches are performed from top to bottom and from left to right.
1.
From the Edit menu, choose
Find / Replace in POUs
<Ctrl+F>
or click toolbar.
on the
Note:
While in the Dictionary view, the toolbar element accesses the Dictionary grid
Find/Replace utility and the shortcut key for the Find/Replace In POUs menu item
is Ctrl+Shift+F.
2.
Enter the item to search for. To perform a case sensitive search, check
Match Case
.
ISaGRAF 5.2
- Workbench 225
3.
To find the next occurence of the item, click
Find Next
.
4.
To replace found items, in the Replace field, enter the text to replace, then do one of the following:
To replace the found occurence, click
Replace
.
To replace all occurences of an item, click
Replace All
.
226
ISaGRAF 5.2
- User Guide
SFC Editor
The
SFC (Sequential Function Chart) Editor
is launched automatically when an SFC program is opened from the Workbench. The SFC language is used to describe operations of a
sequential process. It uses a simple graphic representation for the different steps of a process,
and conditions that enable the change of active steps. An SFC Program is entered by using the
graphical SFC editor.
SFC is the core of the IEC 61131-3 standard. The other languages (except Flow Chart) usually
describe the actions within the steps and the logical conditions for the transitions. The SFC
editor allows the user to enter complete SFC programs. It combines graphic and text editing capabilities, thus allowing the entry of both the SFC chart, and the corresponding actions and conditions.
The SFC editor is automatically opened when an SFC program is edited.
Note:
Before creating new programs, you need to close the Dictionary.
To subsequently open another program from the SFC Editor
From the File Menu, choose
Open
(
CTRL+O
) or click , on the Standard toolbar.
ISaGRAF 5.2
- Workbench 227
Appearance
Title Bar
Menu Bar
Toolbar
Workspace
Output
Window
Status Bar
228
ISaGRAF 5.2
- User Guide
Menu Bar
Some options are available as keyboard commands.
File
Edit
Open
Close
Save
Build Program
Stop Build Program
Dictionary
Description
Exit
Cut
Copy
Paste
Delete
Undo
Redo
Find / Replace in POUs
Go to
Rename Step/Transition
Renumber
Add Action Block
Ctrl+O
Alt+F4
Ctrl+S
Alt+F3
Ctrl+D
Ctrl+K
Ctrl+P
Ctrl+Q
Ctrl+X
Ctrl+C
Ctrl+V
DEL
Ctrl+Z
Ctrl+Y
Ctrl+F
Ctrl+G
Ctrl+R opens an existing POU closes the POU saves the current POU builds the code for the current POU
stops the build in progress for the
current POU
opens the dictionary filtered for the
current POU
accesses the program description
leaves the language editor removes the selected item and places it on clipboard takes a copy of the selected item and places it on the clipboard inserts the contents of the clipboard into the selected item removes the selected item cancels the last action restores the last cancelled action
finds and replaces text in a project, a
configuration, a resource, or a POU
jumps to the indicated step or transition number
renumbers all elements in the chart
in sequential order
ISaGRAF 5.2
- Workbench 229
Edit
(Continued)
Delete Action Block
Edit Level 2
Edit Level 2 in Separate
Window
Insert/Set Identifier
Insert/Set Block
Tools
Debug
Insert New Rung
Browser
Debug
Simulation
Debug FB
Enter
Ctrl+
Enter
Ctrl+I
Ctrl+R
Ctrl+B
Alt+F6
Alt+F7
F11
opens the level 2 programming for
an element
opens the level 2 programming for
an element in a separate window accesses the Select Variable dialog
box where you can insert a variable
accesses the Select Blocks dialog box where you can select functions and function blocks for use in level 2
ST and IL language Action Blocks inserts a rung
accesses the Cross References browser listing and localizing all
instances of global variables and
I/Os declared in a project
switches the application to debug mode switches the application to simulation mode
opens a selected function block in the language editor with its instantiation values
230
ISaGRAF 5.2
- User Guide
Options Set Level 2 Language
Layout
Customize
Full screen
Target/Code Settings
Window Cascade
Tile
Help
Split
Show Output Window
Clear Output Window
Contents
Search Help On...
About
Ctrl+U
Ctrl+1
Ctrl+4
F1 sets the programming language used for level 2 programming. For programs, possible languages are
ST, IL, and LD. For function blocks, possible languages are ST and LD.
accesses the Layout dialog box where you can make changes to the workplace layout accesses the customization properties for Workbench views and editors opens the workspace to full screen size
accesses the compilation options for
the POU sets the different views of the project to appear in a cascading manner sets the different views of the project to appear in a tiled manner splits the workspace into two simultaneous views displays the output window below the workspace clears the contents of the output window accesses the online help not currently supported displays product and version information
ISaGRAF 5.2
- Workbench 231
Working with the Editor
The SFC language is used to represent sequential processes. The SFC programming is usually separated into two different levels:
Level 1 shows the graphic chart, the reference names of the steps and the transitions, and
the comments.
Level 2 is the ST, LD or IL programming of the actions within the steps, or the conditions
attached to the transitions. Actions or conditions may refer to functions written in other
languages (FBD, LD, ST or IL). The level 2 programming of a step includes action blocks programmed in ST, LD or IL. The level 2 programming of a transition describes a
Boolean condition entered in ST, LD or IL.
Individual elements are automatically linked if the SFC editor considers them to be in a valid position.
From the editor, you can:
Build the current program code to check your program and prepare the code for building the resource code.
Print your program.
Launch the Dictionary.
You can also enter a description to document your Program
From the File menu, choose
Description
.
232
ISaGRAF 5.2
- User Guide
SFC Elements
To draw an SFC chart, you simply introduce the significant components of the chart. The SFC editor automatically draws most of the single lines joining two elements (horizontally or vertically). Lines (or links) can be drawn manually.
To place an SFC component on the chart, the user has to select the type of the component in the editor toolbar and then click in the edition workspace at the desired position. If the mouse button is kept depressed, a "ghost" of the element is shown in order not to place it blindly.
When the symbol is placed, links can be created automatically depending on the element position regarding the existing elements. The editor may not accept the placement of the element. For example, you cannot place an element over an existing element.
Initial Step
Every SFC program must have an
Initial Step
. Initial steps are double bordered. For
information about initial steps, see page 468.
For an IEC 61499 ECC, an initial step corresponds to an execution control initial state (EC
initial state).
To place an Initial Step
1.
On the SFC toolbar, click .
2.
Click in the workspace at the desired position.
ISaGRAF 5.2
- Workbench 233
Step
Steps are given sequentially numbered default names, e.g. S1, S3, S5... For information about
For an IEC 61499 ECC, a step corresponds to an execution control state (EC state).
To place a Step
1.
On the SFC toolbar, click .
2.
Click in the Workspace at the desired position.
Note:
To link a step to an existing transition, place the mouse cursor on the grid cell above or below the transition.
234
ISaGRAF 5.2
- User Guide
Transition
Transitions are given sequentially numbered default names, e.g. T2, T4, T6... For information
about transitions, see page 470.
For an IEC 61499 ECC, a transition corresponds to an execution control transition
(EC transition).
To place a Transition
1.
On the SFC toolbar, click .
2.
Click in the workspace at the desired position.
3.
To link the transition to an existing step, click the mouse with the cursor on the grid cell above or below the step.
ISaGRAF 5.2
- Workbench 235
Divergence/Convergence
To place a
divergence
, click the required divergence from the SFC Toolbar, then click in the chart workspace at the desired position.
To link an OR divergence ( grid cell below the step.
) to an existing step, place the mouse cursor on the
To link an AND divergence ( the transition:
) to an existing transition, click grid cell below
To place a
convergence
and attach it to previous elements, click the left-most branch. OR
( convergences ( ) are attached to the preceding transitions, AND convergences
)are attached to preceding steps.
236
ISaGRAF 5.2
- User Guide
Creating New Branches
Inserting a new branch creates an alternative routing for connections.
To insert a new branch on a divergence or convergence
1.
Select a divergence / convergence.
2.
On the SFC toolbar, click .
Note:
Moving the upper handles, on the left or right of a divergence or convergence, automatically causes a new branch to be created.
To create a branch next to existing branches, select the divergence (OR divergence for transitions, AND divergence for steps), then press F9 or click the new branch icon and add an element (transition or step).
Example
Right-click or press F9 to add a branch Add element on new branch
ISaGRAF 5.2
- Workbench 237
Deleting Branches
Moving non-connected branches back onto the nearest connected branch deletes 'extra' branches.
Select the divergence, place the cursor on the upper-right handle (red square), then drag the branch onto the branch with S29:
Select branch end and move towards existing element
Branch is removed from divergence
Deleting an element removes the branch directly above it.
Select and delete element Element and branch are removed
238
ISaGRAF 5.2
- User Guide
Link
Drawing a
link
is a drag and drop operation linking one element to another. Links always move from a step to a transition or from a transition to a step. Links can be moved using drag and drop operations on the handles (red squares), displayed when the link is selected. For
information about oriented links, see page 470.
For an IEC 61499 ECC, links correspond to data and event connections. Data connections link
data outputs from one function block to data inputs of another. Event connections link event outputs from one function block to event inputs of another.
To insert a link
Inserting a link with a single click on the link origin, or dropping the link in an empty area of the workspace, displays the Jump to a Step dialog. The "Jump to a Step" dialog is only displayed when the link origin is a transition.
ISaGRAF 5.2
- Workbench 239
Choose the required step name then click
OK
.
Jump
You can insert jumps between transitions and steps. For information about jumps to steps, see
To insert a jump
1.
On the SFC toolbar, click
The cursor changes to a 'Jump' cursor.
.
2.
Click on the workspace, immediately below the transition to jump 'from'.
240
ISaGRAF 5.2
- User Guide
3.
In the Jump to a Step dialog, select the required step name then click
OK
.
The step name is indicated next to the jump symbol.
ISaGRAF 5.2
- Workbench 241
Managing Elements
SFC elements can be cut, copied, and pasted within a Sequential Function Chart or, if more than one is open, between different charts. When an element is moved, removed or added, the chart is automatically refreshed, elements are placed according to the grid and links are redrawn.
Select
To select an item simply click on it with the left mouse-button. Multiple selections are made by clicking a blank area of the workspace then drag and drop until the required items are hightlighted. Alternatively, multiple items are selected by holding down (
CTRL
) or (
SHIFT
) then clicking elements to add to the selection.
242
ISaGRAF 5.2
- User Guide
Rename
You can rename steps and transitions.
To rename elements
1.
Select the element to rename.
2.
From the Edit menu, choose
Rename Step (Transition) OR
right-click on the element to display the contextual menu.
The Change Name dialog box appears:
3.
Edit the name then click
OK
.
OR
1.
Select the element to rename.
2.
Click on the name to edit.
3.
Edit the name directly in the program element:
4.
When finished, click elsewhere in the workspace.
ISaGRAF 5.2
- Workbench 243
Move
To move elements
1.
Select the element(s) to move.
2.
Drag the 'ghost' to a valid location.
3.
Drop the elements as required.
Cut
Use the cut command to remove selected elements and move them to the clipboard, replacing the clipboard's current contents.
To cut elements
"
Select the element(s) to cut, then from the Edit menu, choose
Cut
(
CTRL+X
) or click , on the Standard toolbar.
244
ISaGRAF 5.2
- User Guide
Copy
Use the copy command to copy selected elements and place them on the clipboard, replacing the clipboard's current contents.
To copy elements
"
Select the element(s) to copy, then from the Edit menu, choose
Copy
(
CTRL+C
) or click , on the Standard toolbar.
Paste
Use the
Paste
command to place the contents of the clipboard at the insertion point. Pasted elements are automatically assigned sequentially numbered names.
To paste elements
1.
From the Edit menu, choose
Paste
(
CTRL+V
).
2.
Position the 'ghost'.
3.
Click to paste at the new location
OR
1.
On the Standard toolbar, click
2.
Position the 'ghost'.
3.
Click to paste at the new location
.
ISaGRAF 5.2
- Workbench 245
Delete
To delete elements
"
Select the element(s), then from the Edit menu, choose
Delete
<Delete>.
Goto
The step / transition is selected in the level 1.
To go to a step or transition in the current SFC program
1.
From the Edit menu, choose
Goto
.
2.
In the Goto Step/Transition dialog, select the element from the list then click
OK
.
246
ISaGRAF 5.2
- User Guide
Level 2
The
Level 2
window displays the coding for steps and transitions. For steps, the window displays the defined action blocks. For transitions, the window displays the defined conditions.
You can also display a second level 2 window for another step or transition. When first coding steps, you need to add action blocks.
To edit the Level 2
The Edit Level 2 option is available from the main menu and the contextual menu accessed by right-clicking a step or transition.
1.
Select the step or transition.
2.
From the Edit menu, choose
Edit Level 2
.
3.
To display a second level 2 window for another step or transition, do one of the following:
Right-click an element (without selecting it), then choose
Edit Level 2 in separate window
from the contextual menu
Drag to select an element, then press Ctrl+Enter
ISaGRAF 5.2
- Workbench 247
Coding Action Blocks for Steps
You attach
action blocks
to steps by adding them in the level 2 window, then defining their
name, comment (optional), type, and qualifier. Comments are displayed after the action block name in the level 2 window for a step, for example, InitAction (* initialize all *). When changing the type of an action block, the code zone must be empty. For details on actions
You can specify the ST, IL, or LD language for use as default for the level 2 programming of steps.
The available action block types are the following:
Boo
IL
LD
SFC child
ST
Boo action blocks require the selection of a Boolean variable from the variable selector. These action blocks take the name of the selected variable. SFC child action blocks require assigning the name of the SFC child to the action block. You cannot program Boo or SFC-child action blocks.
The available qualifiers for all action block types are None Store Action (N), Set (S), and
Reset (R). The qualifiers for IL, LD, and ST action block types also include the Pulse on
Deactivation Action (P0) and Pulse On Activation Action (P1).
To add action blocks to steps
You can add action blocks using the main menu, the SFC toolbar, or a contextual menu accessed by right-clicking in the level 2 window.
1.
In the SFC chart, select the step for which to add an action block, then from the Edit menu choose
Edit Level 2
.
248
ISaGRAF 5.2
- User Guide
2.
Click in the level 2 window, then from the Edit menu, choose
Add Action Block
or click
, from the SFC toolbar.
3.
In the Add Action Block dialog, enter a name and comment (optional), then select a type and qualifier for the action block. For the Boo type, the selected variable’s name is automatically entered in the Name field. For the SFC child type, enter the name of the
SFC child in the Name field.
4.
Click
OK
.
5.
In the editor window, enter the code for the action block. You cannot program Boo and
SFC child action blocks.
To specify the default programming language for steps
"
From the Options menu, choose Set Default Level 2 Language, then Step, then the desired programming language.
ISaGRAF 5.2
- Workbench 249
Coding Conditions for Transitions
You attach conditions to transitions by programming these in the level 2 window. Only one condition can be attached to a transition. When defining conditions, you indicate a name, a comment (optional), and the programming language (type). The available programming languages for transitions are LD and ST. When changing the programming language of a transition, the code zone must be empty. For details on conditions attached to transitions, see
You can specify the ST or LD language for use as default for the level 2 programming of transitions.
To attach conditions to transitions
1.
In the SFC chart, select the transition for which to attach a condition, then from the Edit menu choose
Edit Level 2
.
The level 2 window is displayed with the transition’s name and set for programming in the ST language.
2.
To change the name or programming language, double-click the level 2 window title bar, then in the Properties dialog, make the necessary changes and click
OK
.
To specify the default programming language for transitions
"
From the Options menu, choose Set Default Level 2 Language, then Transition, then the desired programming language.
250
ISaGRAF 5.2
- User Guide
Moving Action Blocks Up or Down
You can change the order of the action blocks in a step. The displayed order is used during execution.
To move an action block up
1.
Select the step in the SFC chart, then from the Edit menu, choose
Edit Level 2
.
2.
In the level 2 window, click the action block to move up, then do one of the following:
Right-click the action block, then from the contextual menu, choose
Move Up
.
On the SFC toolbar, click .
To move an action block down
1.
Select the step in the SFC chart, then from the Edit menu, choose
Edit Level 2
.
2.
In the level 2 window, click the action block to move up, then do one of the following:
Right-click the action block, then from the contextual menu, choose
Move Down
.
On the SFC toolbar, click .
ISaGRAF 5.2
- Workbench 251
Deleting an Action Block
You delete action blocks from a step from within the level 2 window.
To delete an action block
1.
Select the step in the SFC chart, then from the Edit menu, choose
Edit Level 2
.
2.
In the level 2 window, click the action block to delete, then do one of the following:
From the Edit menu, choose
Delete Action Block
.
From the SFC toolbar, click .
252
ISaGRAF 5.2
- User Guide
Renumbering Charts
Renumbering
of SFC elements takes place from top to bottom, then from left to right.
Renumbering is only applied to steps and transitions having the standard default names (Sx and
Tx).
Before Renumbering After Renumbering
To renumber a chart
From the Edit menu, choose
Renumber
or click , on the SFC toolbar.
ISaGRAF 5.2
- Workbench 253
FC Editor
The
FC (Flow Chart) editor
is launched automatically when an FC program is edited from the Workbench.
Note:
Before creating new programs, you need to close the Dictionary.
To subsequently open another program, from the FC editor
From the File menu, choose
Open
(
CTRL+O
) or click , on the Standard toolbar.
ISaGRAF 5.2
- Workbench 255
Appearance
Title Bar
Menu Bar
Toolbar
Workspace
Output
Window
Status Bar
256
ISaGRAF 5.2
- User Guide
Menu Bar
Some options are available as keyboard commands.
File Open
Close
Save
Build Program
Stop Build Program
Ctrl+O
Alt+F4
Ctrl+S
Alt+F3
Edit
Dictionary
Description
Exit
Undo
Redo
Cut
Copy
Paste
Delete
Find / Replace in POUs
Go to
Renumber
Edit Level 2
Ctrl+C
Ctrl+V
DEL
Ctrl+F
Ctrl+G
Ctrl+D
Ctrl+K
Ctrl+P
Ctrl+Q
Ctrl+Z
Ctrl+Y
Ctrl+X
Enter opens an existing POU closes the POU saves the current POU builds the code for the current POU
stops the build in progress for the
current POU
opens the dictionary filtered for the
current POU
accesses the program description
leaves the language editor cancels the last action restores the last cancelled action removes the selected item and places it on clipboard takes a copy of the selected item and places it on the clipboard inserts the contents of the clipboard into the selected item removes the selected item
finds and replaces text in a project, a
configuration, a resource, or a POU
jumps to the indicated element number
renumbers all elements in the chart
in sequential order
opens the level 2 programming for
an element
ISaGRAF 5.2
- Workbench 257
Edit
(Continued)
Tools
Debug
Options
Edit Level 2 in Separate
Window
Insert/Set Identifier
Insert New Rung
Change Yes/No Direction
Browser
Debug
Simulation
Debug FB
Set Level 2 Language
Layout
Customize
Full screen
Target/Code Settings
Ctrl+Enter opens the level 2 programming for
an element in a separate window
Ctrl+I accesses the Select Variable dialog
box where you can insert a variable in the current POU
Ctrl+R inserts a rung changes the direction of an
Ctrl+B
Alt+F6
Alt+F7
accesses the Cross References browser listing and localizing all
instances of global variables and
I/Os declared in a project
switches the application to debug mode switches the application to simulation mode
F11
Ctrl+U
Ctrl+1 opens a selected function block in the language editor with its instantiation values sets the programming language used for level 2 programming. Possible languages are LD, ST, and IL.
accesses the Layout editor where you specify options such as the toolbars to display, the magnification of the workspace area, and other level 2 options accesses the customization properties for Workbench views and editors opens the workspace to full screen size
accesses the compilation options for
the POU
258
ISaGRAF 5.2
- User Guide
Window Cascade
Tile
Split
Show Output Window
Help
Clear Output Window
Contents
Search Help On...
About
Ctrl+4
F1 sets the different views of the project to appear in a cascading manner sets the different views of the project to appear in a tiled manner splits the workspace into two simultaneous views displays the output window below the workspace clears the contents of the output window accesses the online help not currently supported displays product and version information
ISaGRAF 5.2
- Workbench 259
Working with Flow Charts
Flow Chart programs are created in a resource in the link architecture view of the Workbench.
After having opened the program, you can create / insert new elements in the Level 1 (diagram)
or modify / move existing elements.
Every Flow Chart must have a BEGIN and an END, these are automatically inserted when a
new Flow Chart is created from the link architecture view. These elements can be moved, but
not deleted.
Level 2 programming of each action and test using ST, LD or IL syntax is also performed
within the Flow Chart editor.
To save the current flow chart
From the File menu, choose
Save
(
CTRL+S
) or click
From the editor, you can:
, on the Standard toolbar.
Build the current program code to check your program and prepare the code for building the resource code.
Print your program.
Launch the Dictionary.
To include a description documenting your program
From the File menu, choose
Description
.
260
ISaGRAF 5.2
- User Guide
Flow Chart Elements
Most common operations are performed with the mouse: insertion, selection and drag and drop of elements. Moving an element also moves all the elements directly linked below. Elements are individually re-sizable.
Action
Insert FC
action
creates a new action each time the mouse button is pressed.
Actions are automatically linked by the Flow Chart editor. An action number is automatically
generated, sequentially for each new action. For details about FC actions, see page 492.
ISaGRAF 5.2
- Workbench 261
Test
Insert a test to branch between sections of the program that are executed conditionally. Double-clicking the Yes or No text, swaps their position. For details about FC
IF-THEN-ELSE
This generates a standard
IF-THEN-ELSE
structure in the Flow Chart. Examples
of Flow Chart complex structures are available on page 497.
Actions can be added on both Branches before the Connection.
262
ISaGRAF 5.2
- User Guide
Example
DO-WHILE
This generates a standard
DO-WHILE
structure in the Flow Chart. Examples of
Flow Chart complex structures are available on page 497.
Note:
The difference between this structure and the WHILE-DO is the location of the action(s)
to repeat.
ISaGRAF 5.2
- Workbench 263
WHILE-DO
This generates a standard
WHILE-DO
structure in the Flow Chart. The difference
between this structure and the DO-WHILE is the location of the action(s) to repeat. Examples
of Flow Chart complex structures are available on page 497.
Flow
A
Flow
indicates a link between two elements. For details about FC flow links, see
To insert a flow
1.
On the Flow Chart Tools toolbar, click
2.
Click on the elements to flow from.
.
264
ISaGRAF 5.2
- User Guide
3.
Drag the link to a point on another link or a non-connected element.
4.
Drop the Flow link.
ISaGRAF 5.2
- Workbench 265
Connector
A
Connector
is used to link to an element, without specifically 'drawing' the
link.For details about FC connectors, see page 496.
The Connect To Dialog Box is automatically displayed:
1.
Expand (or collapse) sections in the tree by clicking on the (or ) Buttons.
2.
Select an element then click
OK
.
266
ISaGRAF 5.2
- User Guide
I/O Specific
An
I/O Specific action
is one that contains hardware dependent code, they must
be re-written for different I/Os. For details about FC I/O specific actions, see page 495.
Comment
Comments are free format text inserted anywhere in the Flow Chart for
documentation puposes only. For details about FC comments, see page 496.
ISaGRAF 5.2
- Workbench 267
Sub-Program
When inserting a Sub-program symbol, a dialog box is displayed to select the
Sub-program from the list within the current program. For details about FC sub-programs, see
Note:
Double-clicking on a
Sub-program
opens the selection dialog box to change the sub-program reference
268
ISaGRAF 5.2
- User Guide
Managing Elements
Flow Chart elements can be cut, copied and pasted within a Flow Chart or, if more than one
Flow Chart is open, between different Flow Charts. When an element is moved, removed or added, the chart is automatically refreshed, elements are placed according to the grid and links are redrawn.
Select
To
Select
an item, simply click on it with the left mouse-button. Multiple selections are made by clicking a blank area of the workspace then drag and drop until the required items are hightlighted. The shift key, combined with a mouse click, selects multiple, distant, elements.
ISaGRAF 5.2
- Workbench 269
Cut
Use the cut command to remove selected elements and move them to the clipboard, replacing the clipboard's current contents.
To cut elements
1.
Select the element(s) to cut.
2.
From the Edit menu, choose
Cut
(
CTRL+X
).
OR
1.
Select the element(s) to cut.
2.
On the Standard toolbar, click .
Copy
Use the
copy command
to copy selected elements and place them on the clipboard, replacing the clipboard's current contents.
To copy elements
1.
Select the element(s) to copy.
2.
From the Edit menu, choose
Copy
(
CTRL+C
).
OR
1.
Select the element(s) to copy.
2.
On the Standard toolbar, click .
270
ISaGRAF 5.2
- User Guide
Paste
Use the
Paste
command to place the contents of the clipboard at the insertion point. Any existing selected items are automatically unselected.
To paste elements
1.
From the Edit menu, choose
Paste
(
CTRL+V
) or click
2.
Position the 'ghost'.
3.
Click to paste at the new location
Delete
To delete elements
1.
Select the element(s).
2.
From the Edit menu, choose
Delete
OR press
<Delete>
.
, on the Standard toolbar.
ISaGRAF 5.2
- Workbench 271
Move
All elements linked directly below a 'moved' element are automatically moved and their flow links re-drawn.
To move elements
1.
Select the element(s) to move.
2.
Drag the 'ghost' to a valid location.
3.
Drop the elements as required.
GoTo
To go to a symbol in the current FC program
1.
From the Edit menu, choose
Goto
.
The Goto dialog box appears:
2.
Select the element from the list then click
OK
.
The Action / Test Level 1 is selected.
272
ISaGRAF 5.2
- User Guide
Renumber
Two elements cannot have the same logical number within one Flow Chart. In this case, a renumber facility is provided to automatically generate sequential numbers. The order in which the chart is renumbered is based on each element's position, from top to bottom, then from left to right.
ISaGRAF 5.2
- Workbench 273
Level 2
To view the Level 2 window of an FC Element (action or test)
1.
Select an FC element.
2.
Do one of the following:
From the Edit menu, choose
Edit Level 2
.
Double-click an FC element.
Note:
The FC Level 2 is also shown within the corresponding element representation in the
Level 1 Workspace.
To view the Level 2 of another element, follow the instructions above, in which case the new
Level 2 will replace the one displayed, or open the new Level 2 in a separate window.
274
ISaGRAF 5.2
- User Guide
To open the Level 2 in a separate window
1.
Select an FC element.
2.
Do one of the following:
From the Edit menu, choose
Edit Level 2 in separate window
.
Press
<Ctrl+Return>
.
You can close level 2 windows by clicking on the close icon on the right of their title bar.
Level 2 Window
When the Edit Level 2 command is used:
If no Level 2 window exists, a level 2 window is opened.
If one level 2 window is already open, it is replaced by the level 2 of the current element.
(The Level 2 of the FC window is sub-divisible).
If there are two level 2 windows, the level 2 window that had the focus is replaced by the level 2 of the currently selected element.
A maximum of two separate windows (elements) can be opened for simultaneous editing.
ISaGRAF 5.2
- Workbench 275
Edit the Level 2
ST is the default language of the level 2. You can change the language to LD or IL with the list displayed on the right of the title bar of the level 2 window.
You can set the default language for the level 2 programming from the menu by choosing
Options, then Set Level 2 Language, then the desired default language.
In a test only one condition can be written; In the case of editing in LD, there is only one coil without any variable attached. The coil value corresponds to the value of the test.
In a test, no pulse is permitted, i.e. neither positive, nor negative contacts can be used.
276
ISaGRAF 5.2
- User Guide
Multi-language Editor
The
Multi-language editor
has editing functions for graphical and textual languages.
These editing functions are automatically launched when an FBD, ST, IL, or LD program is opened from the Workbench.
The editor only allows new elements to be inserted if the current position is valid. Use the mouse or cursor keys to move the current position around within the Workspace.
From the editor, you can perform several tasks:
Build the current Program code (to check your Program and prepare the code for building the Resource code)
Print programs
Launch the Dictionary
Note:
Before creating new programs, you need to close the Dictionary.
When printing programs, the fonts used in the diagram are the same as for the editor. The FBD and LD diagrams are scaled to fit the width of the printed page format (portrait or landscape).
To adjust the font for printed diagrams, you need to modify the font used for the editor.
To subsequently open another program, from the Multi-language editor
From the File menu, choose
Open
(
CTRL+O
).
To add a description to a program
From the File menu, choose
Description
.
ISaGRAF 5.2
- Workbench 277
Appearance
Title Bar
Menu Bar
Toolbars
Workspace with or without
Guidelines
Output
Window
Status Bar
Note:
The Language toolbar contains tools for LD, ST, IL, or FBD.
278
ISaGRAF 5.2
- User Guide
Workspace
You can arrange the workspace of the FBD editor to show guideline areas. These areas divide the workspace into logical sections: Inputs, From, Logics, To, and Outputs. Elements move independently of the area guidelines. You can choose to hide individual areas and resize the areas. You can also choose to restore the default area sizes.
When moving the cursor across the FBD or LD editor, the cursor’s coordinates are displayed in the status bar. These coordinates refer to grid areas. For instance, the top-leftmost grid area is coordinate (0,0) and the grid area to its immediate right is coordinate (1,0). The grid coordinates remain the same whether the zoom or cell width changes.
To manage the guidelines
You access the Areas layout options window from the menu or by right-clicking an area titlebar.
1.
To show or hide the guideline areas, from the Tools menu, choose
Show/Hide Areas
, then in the areas layout window, check the areas to display.
2.
To resize an area, drag the boundary on the left or right side of the heading until the area is the width you want.
3.
To return the area guidelines to their initial widths, click
Restore Default Area Sizes
.
ISaGRAF 5.2
- Workbench 279
Menu Bar
The options available differ depending on the POU’s programming language. Some options are available as keyboard commands.
File
Edit
Open
Close
Save
Build Program
Stop Build Program
Dictionary
Description
Exit
Undo
Redo
Cut
Copy
Paste
Special Paste
Delete
Select All
Find / Replace in POUs
Find Matching Name
Ctrl+O
Alt+F4
Ctrl+S
Alt+F3
Ctrl+D
Ctrl+K
Ctrl+P
Ctrl+Q
Ctrl+Z
Ctrl+Y
Ctrl+X
Ctrl+C
Ctrl+V
DEL
Ctrl+A
Ctrl+F
Alt+F2 opens an existing POU closes the POU saves the current POU builds the code for the current POU
stops to build in progress for the
current POU
opens the dictionary filtered for the
current POU
accesses the program description
leaves the language editor cancels the last action restores the last cancelled action removes the selected item and places it on clipboard takes a copy of the selected item and places it on the clipboard inserts the contents of the clipboard into the selected item
places the contents of the clipboard in a specified position
removes the selected item selects all items in the active view
finds and replaces text in a project, a
configuration, a resource, or a POU
finds and selects matching variable names in the current POU
280
ISaGRAF 5.2
- User Guide
Edit
(Continued)
Tools
Debug
Find Matching Coil
Go to Line
Insert/Set Identifier
Insert/Set Block
Insert Rung
Change Coil/Contact Type
Alt+F5
Ctrl+G
Ctrl+I
Ctrl+R
Ctrl+R
Space
finds and selects matching variable names for coils in the current POU
jumps to the indicated line number
accesses the Select Variable dialog
box where you can insert a variable in the current POU
accesses the list of all available functions and function blocks to insert in the current POU
changes the selected coil or contact type
Insert Comment
Browser Ctrl+B
Show/Hide Execution Order Ctrl+W
shows or hides the execution order of FBD diagrams
Show/Hide Areas accesses the areas layout window where you check the areas to display in the FBD editor workspace
Show/Hide Output Values shows or hides the output values of blocks (operators, functions, and function blocks) in the FBD and
LD editors, while in debug or simulation mode
Debug Alt+F6 inserts a comment above a rung in
LD diagrams
accesses the Cross References browser listing and localizing all
instances of global variables and
I/Os declared in a project
Simulation
Spy Selection
Alt+F7
switches the application to debug mode switches the application to simulation mode
adds a selected variable to the
ISaGRAF 5.2
- Workbench 281
Debug
(Continued)
Debug FB
Toggle Breakpoint
Breakpoints
Options
Real Time
Cycle to Cycle
Execute One Cycle
Step
Step Into
Show Current Step
Layout
Customize
Tab Setting
Show Coils/Contacts
Target/Code Settings
Auto Input
282
F11 opens a selected function block in the language editor with its instantiation values
ALT+F11 sets or removes a breakpoint for
step-by-step mode
step-by-step mode
Ctrl+U
switches the application to real-time mode
switches the application to cycle-to-cycle mode
Alt+F10
Alt+F8
executes the current line then steps to the next line
Alt+F9
executes the current line then steps into the next line shows the current step
accesses the Layout editor where you specify which toolbars to display and the magnification of the workspace area accesses the customization properties for Workbench views and editors as well as working preferences sets the number of spaces for the Tab character sets the display of the name, alias, or name and alias for coils and contacts
accesses the compilation options for
the POU assigns a variable name or block when inserting elements
ISaGRAF 5.2
- User Guide
Options
(Continued)
Manual Input
Numerical Display
Show I/O Variable Comments
Help
Hide I/O variable Comments
Show Internal Variable
Comments
Hide Internal Variable
Comments
Window Cascade
Tile
Show Spy List
Show Output Window
Clear Output Window
Show Call Stack
Contents
Search Help On...
About
Ctrl+4
F1 assigns a variable name or block at any time sets the numerical display of values in the FBD editor, displays comments for I/O variables, entered in the dictionary in the FBD editor, hides comments for I/O variables displays comments for I/O variables, entered in the dictionary hides comments for I/O variables sets the different views of the project to appear in a cascading manner sets the different views of the project to appear in a tiled manner accesses the Spy List window where you specify variables whose values
are displayed while in test mode
displays the output window below the workspace clears the contents of the output window
displays the call stack window
accesses the online help not currently supported displays product and version information
ISaGRAF 5.2
- Workbench 283
Multi-Language Elements
The language used for the Program currently edited determines the elements that can be inserted. This is reflected in the menu commands and toolbar buttons.
Note:
Arrays must be declared in the Dictionary View before inserting them in Functional
Block Diagrams (FBD).
ST/IL Elements
The main keywords of the ST or IL language are available in the Language toolbar. When entering ST or IL syntax, basic coding is black while other items are displayed using color:
Keywords are pink
Numbers are brown
Comments are green
Inserting a variable name can be done directly by typing it or by using the Insert Identifier command from the Edit menu. To insert block instances or to get help on a block, use the Insert
Block command from the Edit menu.
284
ISaGRAF 5.2
- User Guide
LD Elements
When editing an LD POU, you can place elements by using the keyboard. Keyboard shortcuts are indicated on the LD toolbar. Alternatively, use the mouse to select the element to insert from the toolbar. The element is inserted at the current position in the diagram.
The current position is the cell that is marked in black.
To attach a variable to a coil or a contact, double-click on it or press
<Return>
when it is selected. The Select Variable dialog box is displayed. You can also use the Insert identifier button on the Standard toolbar.
To attach a block type to a block, double-click on it or press
<Return>
when it is selected.
The Select Block dialog box is displayed. You can also use the Insert Identifier button on the Standard toolbar.
If you want to enter a variable name or block type when you place the element, check "Auto input" in the Option menu. If you want to do it at a later time, uncheck this option.
Contact on the Left
The contact is inserted to the left of the current position (highlighted in black).
Note:
Pressing F2 on the keyboard has the same effect.
Contact on the Right
The contact is inserted to the right of the current position (highlighted in black).
Note:
Pressing F3 on the keyboard has the same effect.
ISaGRAF 5.2
- Workbench 285
Parallel Contact
Inserts a contact, parallel to the current selection.
Note:
Pressing F4 on the keyboard has the same effect.
Coil
Inserts a coil on the current rung.
Note:
Pressing F5 on the keyboard has the same effect.
Block on the Left
The block is inserted to the left of the current position (highlighted in black).
Note:
Pressing F6 on the keyboard has the same effect.
Block on the Right
The block is inserted to the right of the current position (highlighted in black).
Note:
Pressing F7 on the keyboard has the same effect.
Parallel Block
Inserts a block, parallel to the current selection.
Note:
Pressing F8 on the keyboard has the same effect.
Jump
Inserts a jump to a label.
Note:
Pressing F9 on the keyboard has the same effect.
286
ISaGRAF 5.2
- User Guide
Label
In Ladder, the label indentifies a rung.
To enter a label identifying a rung
1.
Press Enter or double-click the header-cell of the rung
2.
In the dialog box, enter a name for the label.
3.
Press OK to confirm.
Return
Inserts a return symbol.
Note:
Pressing Shift+F9 on the keyboard has the same effect.
Change Coil/Contact Type
The available types of coils and contacts are listed in the Language Reference.
For LD elements in FBD diagrams, you can also change the type of contact or coil.
To change the type of a coil or a contact
1.
Select the coil or contact.
2.
Do one of the following:
From the Edit menu, choose Change coil/contact type.
On the LD toolbar, click
Press the
<space bar>
.
.
ISaGRAF 5.2
- Workbench 287
Insert New Rung
To insert a rung between two existing rungs
From the Edit menu, choose
Insert New Rung
.
The new rung is inserted above the rung that contains at least one selected element. The rung is composed of one contact and one coil.
When you press any button on the LD toolbar at the end of the diagram, a new rung is created.
Other Operations
To insert a link
1.
Select the desired part of the rung by clicking on it.
2.
On the right hand side of the LD toolbar, click .
The new link is inserted to the left of the position highlighted in black.
To align coils on all rungs
"justifies" the coils on each rung so that coils are aligned vertically on the right.
288
ISaGRAF 5.2
- User Guide
FBD Elements
When programming in FBD, choose the element to be inserted from the FBD toolbar and place it in the Program Workspace. Ladder elements can also be placed in an FBD Program.
Place all elements (blocks and variables), then link them by using links. An element is automatically linked to another element if it is placed next to it such that their connectors meet.
When wiring intersects or diverges, the junction is indicated by a dot.
Before using arrays in FBD, these must be declared in the Dictionary View. Ladder elements
are also available for use in FBD programs.
To show the order of execution of an FBD program
You can show the order of execution in the form of numerical tags for the following elements in an FBD program: coils, contacts, LD vertical connections, corners, returns, jumps, functions, operators, instances of function blocks (declared or not), and variables where a value is assigned in the program. When the order cannot be determined, the tags display question marks (?). You can perform this task from the menu bar, the toolbar, or keyboard shortcut
(Ctrl+W).
For the execution order of a program, a block is any object in the diagram, a network is a group of blocks linked together, and the position of a block is based on its top-left corner. The following rules apply to the execution order of the program:
Networks are executed from left to right, top to bottom.
All inputs must be resolved before executing the block. When the inputs of two or more blocks are resolved at the same time, the decision for the execution is based on the position of the block (left to right and top to bottom).
The outputs of a block are executed recursively from left to right and top to bottom.
"
From the Tools menu, choose
Show/Hide Execution Order
or click
Standard toolbar.
on the
ISaGRAF 5.2
- Workbench 289
To assign a name to a variable or block graphic symbol
"
Select the graphic symbol, then on the Standard toolbar, click symbol, then double-click it.
To assign variable names or block types when placing an element
"
In the Options menu, choose
Auto Input
.
To assign variable names or block types at any time
"
In the Options menu, choose
Manual Input
.
or select the graphic
290
ISaGRAF 5.2
- User Guide
Variable
Accesses the variable selector enabling the insertion of a variable or constant into the workspace.
To connect a new symbol to an existing one (another variable, a block input, or a block output), keep the mouse button depressed (the cursor becomes a "ghost" symbol) and drag the element until its connecting line on the left (or right) overlaps an existing connecting point. When the mouse is released, the new symbol is automatically created and linked.
Drag to place the element: Release the mouse button. The new variable is automatically connected:
For input and output variables, you can choose to display comments entered in the dictionary directly below the variable by choosing
Show I/O Variable Comments
from the Options menu. You hide comments by choosing
Hide I/O Variable Comments
. When moving the cursor over a selected variable, its data type and hidden comment is displayed as a tooltip.
When entering variable blocks, you can choose to have the Workbench automatically prompt you to enter a constant or select a variable from the Select Variable dialog by choosing
Auto
Input
from the Options menu. You can also choose to enter variable names manually by choosing
Manual Input
.
You can resize variable blocks.
ISaGRAF 5.2
- Workbench 291
Function Block
Accesses the block selector enabling the insertion of a block into the workspace.
Blocks can be function blocks ("C" or IEC 61131-3), functions ("C" or IEC 61131-3) or
operators.
Inputs and outputs can be connected to variables, contacts or coils, or other block inputs or outputs. Formal parameter short names are displayed inside the block.
When moving the cursor over a selected function block or instance of a function block, its comment is displayed as a tooltip. Furthermore, when moving over a parameter, its data type and comment is displayed as a tooltip.
You can resize function blocks.
292
ISaGRAF 5.2
- User Guide
Link
Connection links are drawn between elements in the diagram.
Negation connection links are equivalent to placing a NOT block on a direct link.
Both direct links and negated links are always drawn from an output to an input point (in the direction of the data flow).
Corner
User-defined points may be inserted in the diagram that determine the routing of links. First, place a corner, then add links to and from this point. If no corner is placed, the editor uses a default routing algorithm.
Jump
Inserts a jump in the workspace.
A dialog box containing a list of labels to jump to is displayed. Alternatively, by entering a new name in the edit box, then clicking OK, a Jump is created to a new Label (the corresponding
Label symbol must then be placed in the diagram).
A Jump symbol must be linked to a Boolean point. When this Boolean (left) connection is
TRUE, the execution of the diagram Jumps directly to the target Label.
Note:
Backward jumps may lead to a blocking of the PLC loop in some cases.
ISaGRAF 5.2
- Workbench 293
Label
Inserts a label in the workspace.
The Jump Label dialog box is displayed to enter and create a Label name. Alternatively, if a
Jump symbol was previously inserted, and a new Label name was entered in the edit box, the
Label name specified when creating that Jump can be chosen from the list.
Labels can be placed anywhere in an FBD diagram. They are used as a target for Jump instructions, to change the execution order of the diagram. Labels are not connected to other elements.
Note:
It is highly recommended to place Labels on the left of the diagram in order to increase diagram readability.
For more details about labels, see page 504.
Return
Inserts a return symbol in the workspace.
If the connection line (to the left of the Return symbol) has the Boolean state TRUE, the
Program ends - no further part of the diagram is executed.
No connection can be put on the right of a RETURN symbol.
For more details about return statements, see page 503.
294
ISaGRAF 5.2
- User Guide
LD Elements
The LD elements available for use in Function Block Diagrams are the following:
Left Power Bar
Contacts of the Ladder Diagram language must be connected, on the left, to a left power bar which represents the initial "TRUE" state. The editor also allows the connection of any Boolean symbol to a left power bar.
You can resize the height of a left power bar.
Contacts
A contact can be connected, on the left, to a left power bar or another contact. A contact can be connected, on the right, to any other Boolean point; another contact, a coil, a
Boolean input of a block...
By default, a direct contact is inserted. To change the contact type, select the contact and press the <spacebar>. Repeatedly pressing the <spacebar> cycles between all contact types.
LD Vertical "OR" Connection
LD vertical connection accepts several connections on the left and several connections on the right. Each connection on the right is equal to the OR combination of the connections on the left.
You can resize the height of an OR Connection.
ISaGRAF 5.2
- Workbench 295
Coils
A coil represents an Action. It must be connected on the left to a Boolean symbol, such as a contact or the Boolean output of a block. By default, a coil is inserted with a small
Right Power Bar. If a link is inserted, from the right of a coil to a Right Power Bar, this small
Bar is removed.
Before linking to a Right Power Bar:
After linking to a Right Power Bar:
By default, a direct coil is inserted. To change the coil type, select the coil and press the
<spacebar>. Repeatedly pressing the <spacebar> cycles between the all coil types.
Right Power Bar
Coils may be connected, on the right, to a right power bar. This is optional. If a coil is not connected on the right, a small right power bar is included. For details about multiple
connections, see page 509. For details about basic LD contacts and coils, see page 510.
You can resize the height of a right power bar.
296
ISaGRAF 5.2
- User Guide
Comment
Press this button, on the Language toolbar, then click in the Workspace to insert a comment.
Comments
are free format text inserted anywhere in the FBD POU, for documentation puposes only.
After entering text, click elsewhere in the Workspace to 'validate' the comment.
ISaGRAF 5.2
- Workbench 297
Managing Elements
Programming elements can be cut, copied and pasted within a program or, if more than one is open, between different programs. When an element is moved, removed or added, the chart is automatically refreshed, elements are placed according to the grid and links are redrawn.
Select
Selections can contain text, graphics or both.
To make a selection
Click the cursor on an element to make / change a selection.
To select multiple elements in LD or ST or IL
Drag the cursor to highlight multiple elements in the workspace.
OR
Hold down
SHIFT
then use the cursor keys to extend the current selection.
To select multiple elements in FBD
Click in a blank area of the workspace then drag to enclose the required elements.
OR
Hold down
CTRL
or
SHIFT
, then use the mouse, to add to the current selection.
Note:
In the FBD editor
, ESC
removes the current selection. If the editor is in 'element insertion' mode,
ESC
returns to 'select' mode.
298
ISaGRAF 5.2
- User Guide
Resize
The dimensions of individual programming elements can be changed. Resizing elements in the
Multi-language editor is only valid for FBD POUs.
To resize an element
1.
Select the element to resize.
2.
Click and hold the cursor over on the edge of the selected element.
3.
Drag the edge to the desired position.
The cursor changes during a resize.
4.
Release the mouse button to complete the operation.
Note:
Elements cannot be resized so that they overlap other elements, you may need to move elements prior to resizing.
Undo/Redo
The Multi-language editor provides a multi-level Undo / Redo facility (
limited to only one action for ST and IL
).
To Undo (Redo) the previous action
From the Edit menu, choose
Undo
(
Redo
) or click toolbar.
or , on the Standard
ISaGRAF 5.2
- Workbench 299
Move
Moving elements in the Multi-language editor is only valid for FBD IEC 61131-3 POUs. You can drag individual elements to a new position in the workspace without first selecting them.
However, to drag multiple elements, you need to select each element.
To move elements
To move a single element, click the element and while holding down the mouse drag the element to its new position, then release the mouse.
To move multiple elements, select all elements and while holding down the mouse drag the elements to their new position, then release the mouse.
Cut
Use the Cut command to remove selected Elements and move them to the clipboard, replacing the clipboard's current contents.
To cut elements
1.
Select the element(s) to cut.
2.
From the Edit menu, choose
Cut
(
CTRL+X
).
OR
1.
Select the element(s) to cut.
2.
On the Standard toolbar, click .
300
ISaGRAF 5.2
- User Guide
Copy
Use the Copy command to copy selected elements and place them on the clipboard, replacing the clipboard's current contents.
To copy elements
1.
Select the element(s) to copy.
2.
From the Edit menu, choose
Copy
(
CTRL+C
).
OR
1.
Select the element(s) to copy.
2.
On the Standard toolbar, click .
Paste
Use the
Paste
command to place the contents of the clipboard at the insertion point.
For ST and IL, if text is selected before a paste, it is replaced by the contents of the clipboard.
For LD, the elements on the clipboard are pasted in parallel with selected elements.
To paste before or after a selection, use the Paste Special command. The Paste
command may fail when placing a coil in parallel with a contact or a contact in parallel with a coil
For FBD, using the ghost (keeping the mouse button depressed) enables moving pasted elements to the desired position.
To paste elements
From the Edit menu, choose
Paste
(
CTRL+V
) or click , on the Standard toolbar.
ISaGRAF 5.2
- Workbench 301
Paste Special
This command is only valid for LD POUs. The Paste Special command places the contents of the clipboard in a specified position.
Notes:
The standard Paste command has the same effect as a Parallel Paste Special command.
The Paste command may fail because:
a coil can not be put in parallel with a contact,or a contact can not be put in parallel with a coil.
To paste elements
1.
From the Edit menu, choose Paste Special.
A dialog box appears, to choose the paste location:
2.
Choose the desired paste location.
3.
Click OK.
302
ISaGRAF 5.2
- User Guide
Delete
To delete elements
1.
Select the element(s).
2.
From the Edit menu, choose Delete.
Select All
All the elements in the current Program are simultaneously selected with the Select All command.
To Select All elements
From the Edit menu, choose
Select All
(
CTRL+A
)
Find Matching Name
For LD only. Find Matching Name finds and selects matched variable names within the current
POU. You can also find matching names for function blocks or rung labels.
To find a matching variable name
1.
Select a variable with the name to match.
2.
To select the next element with the same variable name as the current selection, press
<ALT+F2
>.
ISaGRAF 5.2
- Workbench 303
Find Matching Coil
For LD only. Find Matching Coil finds and selects matched variable names within the current
POU. This feature is mainly used while in debug mode, to quickly find rungs forcing suspicious variables.
To find a matching coil
1.
Select a variable name to match.
2.
To select the next coil with the same variable name as the current selection, press
<ALT+F5
>.
Go to Line
The Go To Line command is only valid when editing ST and IL POUs. In the Multi-language editor, you access it from the File menu by choosing Go To Line.
You enter a line number, for the current POU, indicating the line to which to move the cursor.
304
ISaGRAF 5.2
- User Guide
Display/Hide Comments
You specify displaying or hiding variable comments at the language editor level. However, you can also choose to display or hide individual variable comments. For instance, you can choose to display all internal variable comments, then hide the comment for a specific internal variable. You can also choose to hide all I/O variable comments, then display the comment for a specific I/O variable. The display/hide setting for individual comments overrides the display/hide setting at the editor level (for either I/O variable or internal variable comments).
To display/hide comments defined for I/O variables
You display or hide all comments defined for I/O variables at the editor level from the main menu.
"
To display comments for I/O variables, from the Options menu, choose
Show I/O
Variable Comments
.
"
To hide comments for I/O variables, from the Options menu, choose
Hide I/O Variable
Comments
.
To display/hide comments defined for internal variables
You display or hide all comments defined for internal variables at the editor level from the main menu.
"
To display comments for internal variables, from the Options menu, choose
Show
Internal Variable Comments
.
"
To hide comments for internal variables, from the Options menu, choose
Hide Internal
Variable Comments
.
ISaGRAF 5.2
- Workbench 305
To display/hide individual comments defined for variables
You display or hide individual comments defined for I/O variables and internal variables at the comment level from a contextual menu. You can also reset individual variable comments to use the display/hide setting defined for a given type of variable comments.
"
To display the variable comment, select the comment, then right-click and choose
Show Comment
.
"
To hide the variable comment, select the comment, then right-click and choose
Hide Comment
.
"
To set the variable comment to use the display/hide setting specified for the variable type, select the comment, then right-click and choose
Reset Default
.
306
ISaGRAF 5.2
- User Guide
Composite IEC 61499 Editor
The
IEC 61499 Composite editor
enables the creation of composite IEC 61499 function blocks for use in IEC 61499 programs.
From the editor, you can perform several tasks:
Build the current composite IEC 61499 function block code (to check for errors and prepare the code for building the program code)
Print composite IEC 61499 function blocks
Launch the Dictionary
When printing composite IEC 61499 function blocks, the fonts used in the diagram are the same as for the editor. The diagrams are scaled to fit the width of the printed page format
To add a description to a composite IEC 61499 function block
From the File menu, choose
Description
.
ISaGRAF 5.2
- Workbench 307
Appearance
Title Bar
Menu Bar
Toolbars
Workspace with or without
Guidelines
Output
Window
Status Bar
Note:
The Language toolbar contains tools for Composite IEC 61499 function blocks.
Workspace
You can arrange the workspace of the IEC 61499 FBD editor to show guideline areas. These areas divide the workspace into logical sections: Inputs, From, Logics, To, and Outputs.
Elements move independently of the area guidelines. You can choose to hide individual areas and resize the areas. You can also choose to restore the default area sizes.
When moving the cursor across the editor, the cursor’s coordinates are displayed in the status bar. These coordinates refer to grid areas. For instance, the top-leftmost grid area is coordinate
(0,0) and the grid area to its immediate right is coordinate (1,0). The grid coordinates remain the same whether the zoom or cell width changes.
308
ISaGRAF 5.2
- User Guide
To manage the guidelines
You access the Areas layout options window from the menu or by right-clicking an area titlebar.
1.
To show or hide the guideline areas, from the Tools menu, choose
Show/Hide Areas
, then in the areas layout window, check the areas to display.
2.
To resize an area, drag the boundary on the left or right side of the heading until the area is the width you want.
3.
To return the area guidelines to their initial widths, click
Restore Default Area Sizes
.
ISaGRAF 5.2
- Workbench 309
Menu Bar
Some options are available as keyboard commands.
File
Edit
Open
Close
Save
Build Program
Stop Build Program
Dictionary
Description
Exit
Undo
Redo
Cut
Copy
Paste
Delete
Select All
Find / Replace
Insert/Set Identifier
Ctrl+O
Alt+F4
Ctrl+S
Alt+F3
Ctrl+C
Ctrl+V
DEL
Ctrl+A
Ctrl+F
Ctrl+I
Ctrl+D
Ctrl+K
Ctrl+P
Ctrl+Q
Ctrl+Z
Ctrl+Y
Ctrl+X opens an existing POU closes the POU saves the current POU builds the code for the current POU
stops to build in progress for the
current POU
opens the dictionary filtered for the
current POU
accesses the program description
leaves the language editor cancels the last action restores the last cancelled action removes the selected item and places it on clipboard takes a copy of the selected item and places it on the clipboard inserts the contents of the clipboard into the selected item removes the selected item selects all items in the active view
finds and replaces text in a project, a
configuration, a resource, or a POU accesses the Select Variable dialog
box where you can insert a variable in the current POU
310
ISaGRAF 5.2
- User Guide
Tools
Debug
Options
Browser
Show/Hide Guideline Areas
Debug
Simulation
Layout
Customize
Full Screen
Target/Code Settings
Auto Input
Manual Input
Numerical Display
Show I/O Variable Comments
Hide I/O variable Comments
Ctrl+1
Ctrl+B
Alt+F6
Alt+F7
Ctrl+U
accesses the Cross References browser listing and localizing all
instances of global variables and
I/Os declared in a project accesses the areas layout window where you check the areas to display in the FBD editor workspace
switches the application to debug mode switches the application to simulation mode
accesses the Layout editor where you specify which toolbars to display and the magnification of the workspace area accesses the customization properties for Workbench views and editors as well as working preferences opens the workspace to full screen size
accesses the compilation options for
the POU assigns a variable name or block when inserting elements assigns a variable name or block at any time sets the numerical display of values displays comments for I/O variables, entered in the dictionary hides comments for I/O variables
ISaGRAF 5.2
- Workbench 311
Options
(Cont)
Show Internal Variable
Comments
Hide Internal Variable
Comments
Window Cascade
Tile
Show Output Window
Help
Clear Output Window
Contents
Search Help On...
About
Ctrl+4
F1 displays comments for internal variables entered into the dictionary hides comments for internal variables sets the different views of the project to appear in a cascading manner sets the different views of the project to appear in a tiled manner displays the output window below the workspace clears the contents of the output window accesses the online help not currently supported displays product and version information
312
ISaGRAF 5.2
- User Guide
Toolbars
The composite IEC 61499 function block editor holds many toolbars:
Standard Toolbar
Saves the current POU
Cuts the selection and places it on the clipboard
Copies the selection and places it on the clipboard
Pastes the contents of the clipboard
Undoes the last operation
Redoes the last operation
Accesses the document generator
ISaGRAF 5.2
- Workbench 313
314
Finds and replaces items
Switches the application to debug mode
Switches an application to simulation mode
Accesses the cross references browser
ISaGRAF 5.2
- User Guide
Options Toolbar
Increases the X to Y Ratio (LD Only) Cells are displayed wider
Decreases the X to Y Ratio (LD Only) Cells are displayed narrower
Debug Toolbar
The Debug toolbar is accessible when you run a POU in either debug or simulation mode.
Cleans all stored code
Switches the application to Real-time mode
ISaGRAF 5.2
- Workbench 315
316
Switches the application to cycle-to-cycle mode
rung
line of code or
rung
Sets or removes a breakpoint. For LD programs only.
Removes breakpoints. For LD programs only.
Shows/Hides output values. For FBD programs only.
Displays the spy variable list
Stops the debug/simulation mode
ISaGRAF 5.2
- User Guide
Refreshes the status of resources
Displays the ISaVIEW screen builder
IEC61499 Tools
The IEC 61499 tools bar is displayed when editing a POU written in the FBD language.
Adds an IEC 61499 function block
ISaGRAF 5.2
- Workbench 317
IEC 61499 Elements
When programming composite IEC 61499, function blocks, choose the element to be inserted from the language toolbar and place it in the program workspace. The IEC 61499 elements are:
Place all elements (blocks and variables), then link them using links. An element is automatically linked to another element if it is placed next to it such that their connectors meet.
When wiring intersects or diverges, the junction is indicated by a dot.
To assign a name to a variable or block graphic symbol
"
Select the graphic symbol, then on the Standard toolbar, click symbol, then double-click it.
To assign variable names or block types when placing an element
"
In the Options menu, choose
Auto Input
.
To assign variable names or block types at any time
"
In the Options menu, choose
Manual Input
.
or select the graphic
318
ISaGRAF 5.2
- User Guide
Variable
Press this button, on the Language toolbar, then click in the workspace to insert a literal or defined word. For composite IEC 61499 function blocks, you can only insert literals or defined words.
To connect a new symbol to an existing one (another variable, a block input, or an output), keep the mouse button depressed (the cursor becomes a "ghost" symbol) and drag the element until its connecting line on the left (or right) overlaps an existing connecting point. When the mouse is released, the new symbol is automatically created and linked.
Drag to place the element: Release the mouse button. The new variable is automatically connected:
When entering variable blocks, you can choose to have the Workbench automatically prompt you to enter a literal or defined word from the Select Variable dialog by choosing
Auto Input
from the Options menu. You can also choose to enter literal or defined words manually by choosing
Manual Input
.
You can resize variable elements.
ISaGRAF 5.2
- Workbench 319
Function Block
Press this button, on the Language toolbar, then click in the workspace to insert an
IEC 61499 function block. For details about the format of IEC function blocks, see page 532.
Inputs and outputs can be connected to variable blocks (literals or defined words), or other block inputs or outputs. Formal parameter short names are displayed inside the blocks.
Blocks can be resized.
Link
Connection links are drawn between elements in the diagram.
Negation connection links are equivalent to placing a NOT block on a direct link.
Both direct links and negated links are always drawn from an output to an input point (in the direction of the data flow).
Corner
User defined points may be inserted in the diagram that determine the routing of links. First, place a corner, then add links to and from this point. If no corner is placed, the editor uses a default routing algorithm.
Comment
Press this button, on the Language toolbar, then click in the workspace to insert a
Comment.
Comments
are free format text inserted anywhere in the POU, for documentation purposes only.
After entering text, click elsewhere in the Workspace to 'validate' the comment.
Comments can be resized.
320
ISaGRAF 5.2
- User Guide
Managing Elements
Programming elements can be cut, copied and pasted within a POU or, if more than one is open, between different POUs. When an element is moved, removed or added, the chart is automatically refreshed, elements are placed according to the grid and links are redrawn.
Select
Selections can contain text, graphics or both.
To make a selection
Click the cursor on an element to make / change a selection.
To select multiple elements
Click in a blank area of the workspace then drag to enclose the required elements.
OR
Hold down
CTRL
or
SHIFT
, then use the mouse, to add to the current selection.
Resize
The dimensions of individual programming elements can be changed.
To resize an element
1.
Select the element to resize.
2.
Click and hold the cursor over on the edge of the selected element.
3.
Drag the edge to the desired position.
The cursor changes during a resize.
ISaGRAF 5.2
- Workbench 321
4.
Release the mouse button to complete the operation.
Note:
Elements cannot be resized so that they overlap other elements, you may need to move elements prior to resizing.
Undo/Redo
The editor provides a multi-level Undo / Redo facility.
To Undo (Redo) the previous action
From the Edit menu, choose
Undo
(
Redo
) or click toolbar.
or , on the Standard
Move
You can drag individual elements to a new position in the workspace without first selecting them. However, to drag multiple elements, you need to select each element.
To move elements
To move a single element, click the element and while holding down the mouse drag the element to its new position, then release the mouse.
To move multiple elements, select all elements and while holding down the mouse drag the elements to their new position, then release the mouse.
322
ISaGRAF 5.2
- User Guide
Cut
Use the Cut command to remove selected Elements and move them to the clipboard, replacing the clipboard's current contents.
To cut elements
1.
Select the element(s) to cut.
2.
From the Edit menu, choose
Cut
(
CTRL+X
).
OR
1.
Select the element(s) to cut.
2.
On the Standard toolbar, click .
Copy
Use the Copy command to copy selected elements and place them on the clipboard, replacing the clipboard's current contents.
To copy elements
1.
Select the element(s) to copy.
2.
From the Edit menu, choose
Copy
(
CTRL+C
).
OR
1.
Select the element(s) to copy.
2.
On the Standard toolbar, click .
ISaGRAF 5.2
- Workbench 323
Paste
Use the
Paste
command to place the contents of the clipboard at the insertion point.
Use the ghost (keep the mouse button depressed) and move the pasted elements to the desired position.
To paste elements
From the Edit menu, choose
Paste
(
CTRL+V
) or click
Delete
To delete elements
1.
Select the element(s).
2.
From the Edit menu, choose Delete.
OR
1.
Select the element(s).
2.
Press the
(DEL)
key.
, on the Standard toolbar.
Select All
All the elements in the current Program are simultaneously selected with the Select All command.
To Select All elements
From the Edit menu, choose
Select All
(
CTRL+A
)
324
ISaGRAF 5.2
- User Guide
Libraries
Libraries are special projects made up of configurations and resources in which you define functions and function blocks for reuse throughout
ISaGRAF
projects. Libraries also enable you to modularize projects and to isolate functions and function blocks so that these can be validated separately.
Functions and function blocks can be written using the IEC 61131-3 languages (FBD, LD, ST, or IL). Programs and function blocks can also be written using the IEC 61499 language.
Libraries can also contain POUs, global variable definitions, and any other item used for testing functions and function blocks.
Before using libraries, you need to create them.
ISaGRAF 5.2
- Workbench 325
Creating Libraries
You create libraries much the same as you create projects. You base a library on a template
then develop its elements, i.e., configurations, resources, programs, functions, and function
blocks. Libraries are stored in the same location as projects and are also MS-Access database
(.MDB) files:
<root directory>/prj/<library name>/PRJlibrary.MDB
Two templates are available for use with libraries:
Libmonoresource, containing one resource in one configuration
Libmultiresource, containing two resources in two different configurations linked by an ethernet network
Furthermore, the target type of a library resource affects the usability of functions and function blocks throughout projects using the library. Functions and function blocks can only be used in resources referring to the same target type except when they use the SIMULATOR target type. When library resources use the SIMULATOR target type, all of their functions and function blocks can be used in any project resource regardless of its target type. Below are examples of possible combinations of resource target types:
Target in library
NT-TARGET
NT-TARGET
SIMULATOR
Target in project
NT-TARGET
VxWORKS
NT-TARGET
Usage
OK
Not possible
OK
Library functions and function blocks must have unique names. When they have the same names as those defined in a project in which they are used, only those from the project will be recognized. Furthermore, you do not need to compile functions and function blocks in the library before using them in projects. They are compiled in the calling project space, in order to take care of the compiling options defined for the project.
To create a library
1.
From the File menu, choose
New Project\Library
.
2.
Enter a name for the library.
326
ISaGRAF 5.2
- User Guide
3.
Select a template.
4.
Click
OK
.
Using Libraries in a Project
Projects can use functions and function blocks from one or more libraries. You need to create
libraries before using them. Furthermore, you need to define a project’s dependencies, i.e., the
set of libraries the project will use, before using a library’s defined elements. A project can depend on more than one library.
You can also add dependencies to third-party library projects. However, to enable their use,
you need to license third-party library projects. Otherwise, their dependency appears invalid.
Library functions and function blocks can refer to some global defined words or data types defined in the library. In such a case, these defined words and data types from the library can also be used in the project.
A library cannot use functions and function blocks from another library. In other words, you cannot define external dependencies for a library. However, a function or function block from a library can call other functions or function blocks from the same library. Furthermore, functions or function blocks from libraries can call 'C' written functions and function blocks defined for the corresponding target.
All functions and function blocks within a project, including those coming from libraries, must have unique names. When more than one uses the same name, the following conditions apply:
If the functions or function blocks come from different libraries, warnings are generated at compilation and only the first definition is recognized
If one function or function block is defined in the project and the other from a library, only the one defined in the project is recognized. The other is ignored.
Furthermore, when the same name is used for several types or several defined words having different definitions in a project and attached libraries, an error is generated at compilation time. However, when a data type or defined word is defined several times with the same contents or definition, a warning is reported but the project can be compiled.
ISaGRAF 5.2
- Workbench 327
You specify a project’s dependencies in the Add/Remove Dependencies window. This window is divided into the Dependencies list and the Information and Status areas. The Dependencies list displays the full pathnames of all libraries used by the project. The Information area shows the description of the library currently selected in the Dependencies list. The Status area shows the status of the library.
328
ISaGRAF 5.2
- User Guide
Once a project’s dependencies are set up, you can access the functions and function blocks contained in the specified libraries from the Select Blocks dialog box, available in the ST, LD, and FBD editors. In this dialog box, library items appear with the IFB or IFU types and the source library’s path. The IFB type indicates an IEC Function Block and the IFU type indicates an IEC Function.
In the dictionary, when declaring an instance of a function block from a library, the pathname of the library is also displayed together with the function block’s type:
When a project has dependencies, an icon indicating the status of its dependencies appears at the bottom right-hand corner of both the hardware and link architecture views:
The status of the project’s dependencies is OK
The project dependencies refer to an invalid library. This can happen if a library has been removed, renamed or moved.
ISaGRAF 5.2
- Workbench 329
When a project has a dependency on an invalid library, to retain all associations between the
project and library upon renaming or moving, you need to reestablish the library path. Upon
deleting a library, all associations are broken.
To define a project’s dependencies
You can access the Add/Remove Dependencies window from the menu or the main toolbar.
You can only define the dependencies for the currently opened project.
1.
From the Tools menu, choose
Add/Remove Dependencies
.
The Add/Remove Dependencies window appears.
2.
To add a new library to the list of dependencies:
a)
Click
Add
.
b)
In the file browser, locate the library’s PRJlibrary.MDB file.
c)
Click
Open
.
3.
To remove a library from the list of dependencies:
a)
From the Dependencies list, select the library to remove.
b)
Click
Remove
.
330
ISaGRAF 5.2
- User Guide
To reestablish an invalid library path
You reestablish an invalid library path for a renamed or moved library from the Add/Remove
Dependencies window. Reestablishing a library path restores all associations between a project and library.
1.
From the Tools menu, choose
Add/Remove Dependencies
.
The Add/Remove Dependencies window appears.
2.
From the Dependencies list, select the invalid library to reestablish.
3.
Click
Browse
, then locate and select the library.
To license a third-party library project
You can choose to license third-party library projects while adding them as dependencies or at any other time. You initiate licensing for these library projects in the Add/Remove
Dependencies window, then complete the process in the License Manager.
1.
Make sure the third-party library project is copied onto your disk, then from the Tools menu, choose
Add/Remove Dependencies
.
2.
In the Add/Remove Dependencies window, add the third-party library project to the list of dependencies:
a)
Click
Add
.
b)
In the file browser, locate the library’s PRJlibrary.MDB file.
c)
Click
Open
.
A message stating that the library is not licensed is displayed.
d)
Click
OK
.
The License Manager is displayed
ISaGRAF 5.2
- Workbench 331
3.
Do one of the following:
To license the third-party library project at this time, click
Send
in the License
Manager, then include all required information and send the email.
To license the third-party library project at a later time, click
Cancel
in the License
Manager. You can launch the licensing process at any time by selecting the unlicensed third-party library project, then clicking
Browse
to locate, select, and open the library’s PRJlibrary.MDB file.
The original setup code and user codes as well as a Registration Key 1 and Registration
Key 2 will be returned via e-mail.
4.
Upon reception, make sure the setup and user codes are the same as those in the License
Manager window, then copy and paste the registration keys in their respective fields.
The third-party library project is enabled for use.
332
ISaGRAF 5.2
- User Guide
Debug
When developing an application, you can choose to debug, i.e., detect and remove errors, from a project using one of two methods:
Simulation mode. In this case, inputs and outputs are not managed by the target virtual
machine. The rest (i.e. Binding exchanges and execution of the POUs of each resource) is
executed by the standard Windows platform. Each resource will be executed by one
virtual machine on the PC running the Workbench.
Online mode. In this case, each resource is executed by one virtual machine on the real
platform. A download operation is required, to download the code of each resource to the
corresponding platform. For details on downloads, see page 337.
Note:
To enable the debugging of a Project, you must first build it using the Build Project
command. For details on building projects and resources, see page 400.
Before simulating a resource, the code for the simulation has to be generated for each resource.
When switching an application to Debug mode, the Workbench verifies the coherency between the current resource definitions and the resources’ compiled code. The Workbench also verifies
When switching to simulation or debug mode, you need to specify whether to run the main or a mirror target.
While in debug mode, the security state of unlocked resources and resources having no access
control switches to read-only mode. The security state of unlocked POUs and POUs having no
access control also switches to read-only mode. Locked resources and locked POUs remain
locked.
To test a resource "online", its TIC code must be produced and downloaded to the target
ISaGRAF 5.2
- Workbench 333
Status Information
When running a project in Debug mode, status information for resources from the target is updated at a regular interval, indicated by the debug refresh rate. The status information is displayed in resource title bars as:
You can also choose to refresh the status information for resources at any time.
The debug refresh rate applies to all resource data including variables and status information while in debug mode; its default value is 300 milliseconds. You set the refresh rate in the
DefaultRefreshTime property in the [REFRESH] section of the Dta.ini file located in the
Workbench’s Bin folder. You can also set refresh rates for individual resources by adding the following entry for a resource in the same section: RefreshTime(X)=YYY, where X indicates the resource number and YYY indicates the refresh time in milliseconds.
Note:
For a project in normal editing mode, refreshing the status of resources will not refresh the status of resources previously opened by other users for single-resource editing. To refresh the displayed status for these resources, you need to reopen the Workbench project.
Resource Icons
The resource icons appear in the left-most corner of the title bar:
Icon Description
The resource belongs to the current project and is running on the configuration.
The resource belongs to the current project and is either running on the configuration but with a different version or it is not running on the configuration but the code of the resource is available on the configuration.
334
ISaGRAF 5.2
- User Guide
Icon Description
The resource belongs to the current project and is not running on the configuration and no code is available on the configuration.
The resource does not belong to the current project but is running on the configuration. In this case, a new empty resource appears with this icon in the link architecture and hardware architecture views of the project.
Resource icons also display the security state of a resource.
Text Information
The state of the resource appears next to the resource icon before the resource’s name, in the title bar.
Resource State
RUN
STOP
BREAK
ERROR
Description
The resource is running ( real-time mode). You can switch the
resource to cycle-to-cycle mode.
The resource is in cycle-to-cycle mode.
Possible operations are:
- switch the resource to real-time mode
- go to the next step (only when step-by-step mode is instantiated)
The resource is in break point mode (SFC POUs).
Possible operations are:
- switch the resource to real-time mode
- go to the next step (only when step-by-step mode is instantiated)
The resource is in error.
Possible operations are:
- switch the resource to real-time mode
- go to the next step (only when step-by-step mode is instantiated)
ISaGRAF 5.2
- Workbench 335
Resource State Description
STEPPING
The resource is in step-by-step mode.
Possible operations are:
- switch the resource to cycle-to-cycle mode returning the resource
to the start of its cycle without executing the remaining code
- execute the current step and go to the next one
- switch the resource to real-time mode
STEPPING_ERROR The resource is in stepping error mode. This state is caused when an invalid operation occurs such as a division by 0 or a bound check error.
Possible operations are:
- locate the current step to debug it
- switch the resource to cycle-to-cycle mode returning the resource
to the start of its cycle without executing the remaining code
one cycle. The STEPPING and STEPPING_ERROR states are possible while in step-by-step debugging mode.
The existence of code on the configuration is indicated with the following text:
CODE
NOCODE
The resource is not running but the code exists (disk or PROM) on the configuration.
The code does not exist on the configuration.
On a running resource, when the version of code in the project differs from the code on the
corresponding virtual machine of the configuration, a message is displayed.
To refresh the status of resources
"
From the Debug menu, choose
Refresh Status
.
The status information displayed in the title bars of all resources is updated.
336
ISaGRAF 5.2
- User Guide
Download
When simulating a project, you do not need to perform a download operation. You perfom a
download operation for each resource having code to send to a target. When mirror targets are
defined, you also need to perform a download operation to each of these targets.
The Download window shows the list of resources making up a project. In this list, resources are displayed next to the name of the configuration to which they are attached. When the resource code contains debug information generated for ST, IL, or LD programs, the word
"debug" appears in comments.
Note:
Each time you perform a download operation, the Workbench verifies the coherency between the current resource definitions and the resources’ code to download. The Workbench
Conditions necessary to download a resource:
1.
The code (corresponding to the resource available on the hardware configuration) must
first be generated by building the project or resource. By default, TIC code is generated
for a standard virtual machine.
2.
The Configuration manager must be running on the target platform.
3.
The computer where the Workbench is installed must be connected to the configuration through a network supported by the Debugger. The standard network used by the
Workbench is Ethernet (Other implementations may exist).
In the Download window, select the resources to download by clicking on their name in the list
(click again to unselect). You can click
Toggle
to select or unselect a selected resource. You can also choose to select all or unselect all resources.
Download options:
Start after download, indicates that the virtual machine executes the resource code upon
reception
Save after download, indicates that the virtual machine saves the resource code on the
configuration platform upon reception. The code can be saved to a disk, if the platform
ISaGRAF 5.2
- Workbench 337
has one, or another storage method, depending on the platform and the implementation of
To download the code of project resources
At anytime during a download operation, you can abort the operation by clicking
Abort
.
1.
From the Debug menu, choose
Download
or click
2.
Select the resource for which to download code to targets.
on the Standard Toolbar.
3.
Choose the required download options, then click
Download
.
The Workbench downloads the resources code to the targets. However, when using version source control, the Workbench checks in the resources (and their configurations) to download into the version source control repository, then the resources code is downloaded to the targets.
Upon each successful download, the Workbench applies a label to the resource and configuration in the source control repository.
338
ISaGRAF 5.2
- User Guide
Debug/Simulate
You can test a project using one of two modes:
Debug, where you test resources online. The debugger establishes the connections with remote configurations. Execution errors and warnings can appear in the Output Window.
Simulation, where you simulate the running of the project. The Configuration manager
and a virtual machine for each resource is launched. The Simulate I/Os Panel is
displayed.
While in debug or simulation mode, for FBD and LD programs and function blocks, you can choose to graphically monitor the block (operator, function, or function block) output values.
You can temporarily resize variables to enable viewing their output values. Resized variables return to their original size upon quitting debug or simulation mode.
Output values of boolean type are displayed using color. The output value color continues to the next input. The default colors are red when True and blue when False. You can
customize the colors used for the boolean items.
Output values of SINT, USINT, BYTE, INT, UINT, WORD, DINT, UDINT, DWORD,
LINT, ULINT, LWORD, REAL, LREAL, TIME, DATE, and STRING type are displayed as a numeric or textual value in a label directly above the output. When the output is a
structure type, the displayed value is the selected member.
ISaGRAF 5.2
- Workbench 339
When the output value is unavailable, the ??? text is displayed in the output label.
choose to show or hide the output display values.
To start Debug mode
You can start Debug mode from the link architecture view, hardware architecture view, or from
a language editor.
"
From the Debug menu, choose
Debug Target
or click
To start Simulation mode
, on the Standard toolbar.
You can start Simulation mode from the link architecture view, hardware architecture view, or
from a language editor.
"
From the Debug menu, choose
Simulation
or click
To show or hide output values
, on the Standard toolbar.
You can choose to display the values of non-boolean outputs in the FBD and LD editors.
, on the
"
From the Tools menu, choose
Show/Hide Output Values
or click
Debug toolbar.
To stop Debug or Simulation mode
"
From the Debug menu, choose
Stop Debug/Simulation
.
Or
"
On the Debug toolbar, click .
340
ISaGRAF 5.2
- User Guide
Start / Stop a Resource
The "Start" command on the Debug menu enables you to start a resource which has been
stopped. It launches the virtual machine on the configuration system and the resource is
executed. The resource code must be available on the configuration system.
To stop the execution of a resource and kill the corresponding
"
From the Debug menu, choose
Stop
.
Or
"
On the Debug toolbar, click
To stop all resources of the project
.
"
On the Debug toolbar, click .
ISaGRAF 5.2
- Workbench 341
Resource Execution Mode
You can execute a resource in one of three possible execution modes:
When defining a resource’s Settings properties, you can set it to automatically start in real-time
or cycle-to-cycle execution mode prior to code generation. By default, resources start in
Real-time Mode
Real-time mode is the run time normal execution mode where target cycles are triggered by the
resource automatically switches to step-by-step mode when the application encounters a
breakpoint.
A resource where real-time mode is activated is in the RUN state.
To activate real-time mode
"
On the Debug toolbar, click .
342
ISaGRAF 5.2
- User Guide
Cycle-to-cycle Mode
In cycle to cycle mode, the virtual machine loads the resource code but does not execute it until
you execute one cycle or activate real-time mode. When debug information is generated for
POUs in a resource, the resource automatically switches to step-by-step mode when the
application encounters a breakpoint. You can also switch to step-by-step mode by stepping.
A resource where cycle-to-cycle mode is activated can be in one of three states: STOP,
BREAK, and ERROR.
To activate cycle-to-cycle mode
"
On the Debug toolbar, click .
To execute one cycle
Cycle-to-cycle mode must be activated before executing individual cycles.
"
On the Debug toolbar, click .
ISaGRAF 5.2
- Workbench 343
Step-by-step Mode
You can instantiate step-by-step mode for ST, IL, and LD POUs. For ST and IL POUs, you set breakpoints to specific lines of code. For LD POUs, you set breakpoints to rungs. When you run an application in Debug mode, the application stops when it encounters a breakpoint. At
this time, depending on the state of the resource, you can choose to perform various operations:
Step to the next line of code or rung
Step into the next line of code or rung
A resource where step-by-step mode is activated is in the STEPPING state. When the resource encounters a stepping error, the resource is in the STEPPING_ERROR state. When stepping within a resource reaches the end of its cycle, the resource automatically switches to cycle-to-cycle mode in the STOP state.
Note:
You can only set breakpoints for resources producing TIC code; you cannot set breakpoints for resources producing C source code. Furthermore, you cannot set or remove
SFC breakpoints while a resource is in the STEPPING state.
Before setting up step-by-step mode for ST, IL, and LD POUs, you need to specify the
generation of debug information for the resource and the individual POUs.
When switching an application to debug mode, to use step-by-step mode, defined breakpoints are sent to the target. When you stop debug mode, you can choose to remove the breakpoints from the target. Breakpoints remaining on a running target may interfere with its cycle.
In the language editor, while in step-by-step mode, defined breakpoints that have been successfully sent to the target appear as red circles to the left of the line of code or rung; breakpoints that are disabled on the target appear as . The current line is indicated with a yellow arrow at its left. When stepping passes beyond the last line or rung of a POU, the arrow
344
ISaGRAF 5.2
- User Guide
points downward ( ). A Call Stack window shows stepping information such as the name of the POU from which a Step Into command jumped from upon execution.
ISaGRAF 5.2
- Workbench 345
Setting Breakpoints
You set breakpoints for ST, IL, and LD POUs in the POU editor. Before setting breakpoints in
a POU, you need to specify the generation of debug information for the resource and the
individual POUs. For details on generating debug information, see page 61.
Note:
You can only set breakpoints for resources producing TIC code; you cannot set breakpoints for resources producing C source code.
To set a breakpoint in an ST, IL, or LD POU
1.
Click in the line of code or rung on which to set the breakpoint.
2.
On the toolbar, click .
A breakpoint appears to the left of the line of code or rung.
Removing Breakpoints
You can remove breakpoints set for ST, IL, and LD POUs for step-by-step mode.
To remove breakpoints
"
To remove a breakpoint while in its POU, click in the line of code or rung with the breakpoint, then click on the toolbar.
The breakpoint is removed from the line of code or rung.
346
ISaGRAF 5.2
- User Guide
"
To remove a breakpoint from any POU in a resource, click on the toolbar, then select the breakpoint from the list and click
Remove
. You can also remove all breakpoints set in all POUs of the resource by clicking
Remove All
.
The individual or multiple breakpoints are removed from their POUs.
ISaGRAF 5.2
- Workbench 347
Stepping in POUs
While a resource is in the STEPPING state, you can step in a POU ( ST, IL, and LD for which
you generated debug information) once its execution is interrupted by encountering a
breakpoint. You can execute one of two types of steps:
Step, executes the current line of code or rung then steps to the next line or rung
Step into, executes the current line of code or rung then steps into the next line of code or rung. When the next line includes a call to a function, stepping continues in the called function then returns to the next line of code or rung in the POU.
When a resource holds POUs for which debug information is generated, stepping is also available while the resource is in either the STOP, BREAK, or ERROR state. However, in these states, stepping jumps to the first line or rung of the first POU for which debug information is generated.
When stepping in POUs, you can locate the current step from within any POU.
To step to the next line of code or rung
1.
Select the POU to step in.
2.
From the Debug toolbar, click .
The POU executes the current line of code or rung then steps to the next one.
To step into the next line of code or rung
1.
Select the POU to step in.
2.
From the Debug toolbar, click .
The POU executes the current line of code or rung then steps into the next one and stepping continues in any called function before returning to the next line of the POU.
348
ISaGRAF 5.2
- User Guide
To locate the current step in a resource
"
From the Debug toolbar, click .
Set Cycle Time
While in debug mode, you can change the cycle time of a resource. You can also set the cycle
time before building the code for the resource in the run time settings for the resource. To view
the current value of the resource cycle time, from the Debug menu, choose
Diagnosis
.
To change the Cycle Time of the resource
1.
Select the resource.
2.
From the Debug Menu, choose
Change Cycle Timing
.
ISaGRAF 5.2
- Workbench 349
Write / Lock / Unlock
While in debug or simulation mode, you can view the values and lock status of variables from within the dictionary view, LD editor, and FBD editor. In the dictionary view, the Locked column indicates whether a variable is locked. You can also choose to display all variables, locked variables, or unlocked variables.
In the LD and FBD editors, the symbol displayed at the left of a variable name indicates a locked variable.
350
ISaGRAF 5.2
- User Guide
You lock and unlock variables, and force the values of variables from the dictionary view, LD
editor, and FBD editor. You can also unlock variables from the Diagnosis window.
For simple-type members of a complex variable such as a structure or array, locking or unlocking any member affects the entire complex variable.
For function blocks, you need to instantiate these before locking their parameters.
For locked variables, the values displayed in the Logical Value and Physical Value columns of the dictionary view differ depending on their direction:
Locked Variable
Direction
Logical Value
Input
Output
Internal
Locked
Updated by the running TIC code
Locked
Physical Value
Updated by the field value
Locked
Updated by the consumer binding when one exists or else updated by the running TIC code
The following diagram shows the lock/unlock process.
To lock variables
Locking operates differently for simple variables, array and structure elements, and function block parameters. For simple variables, individual variables are locked directly. For structure and array elements, locking an element locks all the elements of the structure or array. For function block parameters, locking a parameter affects only that parameter.
ISaGRAF 5.2
- Workbench 351
From the dictionary view, double-click the variable’s corresponding cell in the Locked column, then in the dialog, click
Lock
.
From the LD or FBD editors, double-click the variable, then in the dialog, click
Lock
.
To unlock variables
For array and structure elements, unlocking an element unlocks all the elements of the structure or array.
From the dictionary view, double-click the variable’s corresponding cell in the Locked column, then in the dialog, click
Unlock
.
In the LD or FBD editors, double-click the variable, then in the dialog, click
Unlock
.
You can also unlock variables from the Diagnosis window.
To force the values of variables
From the dictionary view, double-click the variable’s corresponding cell in the Logical column, then in the dialog, enter a value and click
Write
.
From the LD and FBD editors, double-click the variable, then in the dialog, enter a value and click
Write
.
You can also force the value of variables from the spy list.
352
ISaGRAF 5.2
- User Guide
Diagnosis
You can access diagnostic information for individual resources while running an application
in simulation mode. This information is divided into five categories:
For details on run-time settings for resources, see page 64.
To access diagnostic information for a resource
1.
While the application runs in simulation mode, select a resource for which to obtain diagnostic information.
2.
From the Debug menu, choose
Diagnosis
.
The Diagnosis window displays the diagnostic information for the resource.
Timing
Timing information holds the current values of specific system variables for a selected resource. The timing information is:
Programmed cycle time, the defined cycle time for the resource
Current cycle time, the time of the last executed cycle
Maximum cycle time, the longest period of time used for a cycle, since the resource was started
Overflow, the number of cycles having exceeded the programmed cycle time
ISaGRAF 5.2
- Workbench 353
State, the current state of the resource. Possible states are RUN (real-time mode), STOP,
BREAK, ERROR, STEPPING, and STEPPING_ERROR.
Code, the indication of whether the code has been saved on the target system
For details on setting the cycle time of a resource, see page 349.
System Variables
System variables hold the current values of all system variables for the resource. You can read from or write to system variables. These variables are defined in the
dsys0def.h
file. The system variables are:
Variable Name Type Read/Write Description
__SYSVA_BFDATASZE UDINT Write Address limit of the variable map
Cycle counter __SYSVA_CYCLECNT
__SYSVA_CYCLEDATE
DINT
__SYSVA_KPVRDTBPTRS VA
Read
UDINT Read/Write Timestamp of the beginning of the cycle in milliseconds
Write Address of kernel private data
(internal use)
__SYSVA_KVBPERR
__SYSVA_KVBCERR
__SYSVA_RESNAME
BOOL
BOOL
Read/Write Kernel variable binding producing error (production error)
Read/Write Kernel variable binding consuming error (consumption error)
STRING Read Resource name (max length=255)
__SYSVA_SCANCNT
__SYSVA_SLAVENUM
__SYSVA_TCYCYCTIME
__SYSVA_TCYCURRENT
DINT Read Input scan counter
UDINT Read/Write Resource number
TIME
TIME
Read/Write
Read
Programmed cycle time
Current cycle time
354
ISaGRAF 5.2
- User Guide
Variable Name Type Read/Write Description
__SYSVA_TCYMAXIMUM
__SYSVA_RESMODE
__SYSVA_CCEXEC
__SYSVA_WNGCMPTNM
__SYSVA_WNGCMD
__SYSVA_WNGARG
__SYSVA_WNGNUM
__SYSVA_ZZZZ
TIME
__SYSVA_TCYOVERFLOW DINT
SINT
BOOL
Read
Read
Read
Write
Maximum cycle time since last start
Number of cycle overflows
Resource execution mode.
Possible modes are:
-1: Fatal error
0: No resource available
1: Stored resource available
NOT USED (CMG)
2: Ready to run
3: Run in real time
4: Run in cycle by cycle
5: Run with SFC breakpoint encountered
7: Stopped in stepping mode
Execute one cycle when application is in cycle to cycle mode
STRING Read
SINT Read/Write
Warning component name
Warning command. Set it to 1 to get next warning
DINT
DINT
Read
Read
UDINT N/A
Warning Argument
Warning Number
Not used
Warning:
For the _SYSVA_CCEXEC system variable, its use in an ST program is not significant because resources run in cycle-to-cycle mode. Therefore, programs are not executed.
ISaGRAF 5.2
- Workbench 355
Locked Variables
Locked variables are input, output, and internal variables that have been locked. When deleting
locked variables through an online change, these deleted locked variables remain displayed but are preceded by the _DEL_ prefix. To remove these variables from the list, you need to unlock them.
To unlock variables
To unlock a single variable, select its name in the list then click
Unlock
.
To unlock all variables, click
Unlock All
.
Breakpoints
You can view a list of all breakpoints defined for ST, IL, and LD POUs of a resource, for use
356
ISaGRAF 5.2
- User Guide
Version Information
You can view version information including the compilation version number, the compilation date, and the CRC (Cyclic Redundancy Checking) of the data the resource works on for three sources of resource code: the compiled code for the resource in the Workbench project the code for the resource running on the target the code for the resource stored on the target
ISaGRAF 5.2
- Workbench 357
SFC Breakpoints
While in Debug mode, you can place SFC breakpoints on SFC steps or transitions. When a breakpoint is encountered, the resource is set to the BREAK state. This mode is equivalent to
the cycle-to-cycle mode. Then to overpass the breakpoint, you can choose either to execute one
cycle or switch real-time mode. When a resource is in the BREAK state and step-by-step
debugging is activated for ST, IL, or LD POUs within the resource, you can also step to the
first line of the first POU of the resource for which debug information is generated.
Note:
You can only set breakpoints for resources producing TIC code; you cannot set breakpoints for resources producing C source code. Furthermore, you cannot set or remove
SFC breakpoints while a resource is in the STEPPING state.
Four types of SFC breakpoints are available:
Breakpoint on Step Deactivation
To set a breakpoint command on a step or transition
You can set breakpoint commands from the Breakpoints toolbar or from the contextual menu.
"
Right-click on the step or transition, then from the contextual menu choose the desired breakpoint command.
Once the breakpoint is reached, you can execute one cycle or switch real-time mode to continue
the execution.
358
ISaGRAF 5.2
- User Guide
To remove breakpoints from steps
You can remove breakpoints from the Breakpoints toolbar or from the contextual menu.
1.
To remove a single breakpoint, right-click on the step, then from the contextual menu choose
Remove Breakpoint
.
2.
To remove all breakpoints, right-click on a step, then from the contextual menu choose
Remove All Breakpoints
.
ISaGRAF 5.2
- Workbench 359
Breakpoint on Step Activation
When the step goes from the inactive (no token) to the active (token) state, then breakpoint mode is set for the next cycle. The current cycle goes on executing normally. In particular around the step where the breakpoint is placed, before breakpoint mode is really set:
All P0 actions, linked to all previous steps that become inactive, are executed.
All P1 – S – R – N actions, linked to the step that becomes active, are executed.
The following illustrates cycle execution when a breakpoint on step activation is encountered.
To set a breakpoint on step activation
You can set breakpoint commands from the Breakpoints toolbar or from the contextual menu.
"
Select the step, then from the toolbar, click .
360
ISaGRAF 5.2
- User Guide
Breakpoint on Step Deactivation
When the step goes from the active (token) to the inactive (no token) state, then breakpoint mode is set for the next cycle. Current cycle goes on executing normally. In particular around the step where the breakpoint is placed, before breakpoint mode is really set:
All P0 actions, linked to the step that becomes inactive, are executed.
All P1 – S – R – N actions, linked to all successor steps that become active, are executed.
The following illustrates cycle execution when a breakpoint on step de-activation is encountered.
The behaviors of setting a breakpoint on step activation is the same as step de-activation. These are both available to avoid setting multiple breakpoints as shown below.
Note:
On a given step, you cannot set both a breakpoint on step activation and a breakpoint on step de-activation.
To set a breakpoint on step deactivation
You can set breakpoint commands from the Breakpoints toolbar or from the contextual menu.
"
Select the step, then from the toolbar, click .
ISaGRAF 5.2
- Workbench 361
Breakpoint on Transition
When a transition becomes clearable (transition is valid i.e. all previous steps are active, and its receptivity is true) then breakpoint mode is set for the next cycle. The current cycle goes on executing normally except that the transition is not cleared and therefore related tokens are not moved.
The following illustrates cycles execution when a breakpoint on transition is encountered.
To set a breakpoint on a transition
You can set breakpoint commands from the Breakpoints toolbar or from the contextual menu.
"
Select the transition, then from the toolbar, click .
362
ISaGRAF 5.2
- User Guide
Transition Clearing Forcing
This debug command allows to force the clearing of a transition whether the latter is valid or not (i.e all previous steps are active or not). Tokens are moved and actions are executed as for a usual transition clearing.
More precisely, tokens of all predecessor steps are removed, if any. Tokens of all successor steps are created. All P0 actions linked to all predecessor steps are executed (even if no token was placed). All P1 – S – R – N actions linked to all successor steps are executed.
The following illustrates cycles execution when clearing of a transition is forced.
Warning:
Clearing a transition may lead to abnormal behavior of your chart since it may create several tokens.
To clear a transition
You can clear transitions from the Breakpoints toolbar or from the contextual menu.
"
Select the transition, then from the toolbar, click .
ISaGRAF 5.2
- Workbench 363
Spying Variables
While in Debug mode, you can choose to spy on selected variables, i.e., view the changes of values for these variables. You spy on variables by adding them to a spy list.
To access the Spy List window
You can access the Spy List window from either the link architecture, hardware architecture, or dictionary views as well as the language editors.
"
From the Window menu, choose
Show Spy List
.
Adding Variables to the Spy List
You can add variables to the spy list from the Spy List window, from the dictionary view, and from ST, LD, FBD, or IL programs.
To add a variable from the Spy List window
1.
Within the Spy List window, in the Name column double-click …
2.
From the list of available resources, select the resource holding the variable to spy on.
3.
Using the keyboard arrows or the mouse, move to the Name cell, then press
Enter
.
The list of variables available for the resource appears (you may need to resize the Name column to display complete names).
4.
Using the keyboard arrows, move within the list of variables to the desired variable, then press
Enter
.
To add a variable from the dictionary view
"
In the dictionary view, select then drag a variable from the dictionary grid to the Spy List window.
364
ISaGRAF 5.2
- User Guide
To add a variable from LD or FBD programs
In the language editors, you can add variables to the spy list using the menus, toolbars, or contextual menus.
1.
Start the project in Debug mode.
2.
Double-click the program.
The editor is lauched displaying the program in read-only mode.
3.
Select the variable to spy on.
4.
From the editor’s toolbar, click .
To add a variable from ST or IL programs
In the language editors, you can add variables to the spy list using the menus, toolbars, or contextual menus.
1.
Start the project in Debug mode.
2.
Double-click the program.
The editor is lauched displaying the program in read-only mode.
3.
Do one of the following:
Select the variable and click
Double click on the variable.
on the editor’s toolbar.
ISaGRAF 5.2
- Workbench 365
Selecting Variables in the Spy List
You can select one or more variables in the spy list.
To select variables in the spy list
1.
To select a single variable, click at the beginning of the line holding the variable.
2.
To select more than one line contiguous lines, select the lines holding the variables while holding down the
Shift
key.
3.
To select more than one line non-contiguous lines, select the lines holding the variables while holding down the
Ctrl
key.
Removing Variables from the Spy List
You remove variables from the Spy List window
To remove a variable from the spy list
1.
In the Spy List window, select the variable by clicking on the very beginning of the line.
2.
Press
Delete
.
366
ISaGRAF 5.2
- User Guide
Rearranging the Spy List
You can change the position of a variable within the spy list.
To change the position of a variable in the spy list
"
In the Spy List window, select the variable, then drag and drop it to its new position.
Saving a Spy List
You can save a spy list created for your projects. These lists are saved with the .SPY extension.
To save a spy list
1.
In the Spy List window, right-click in the grid.
2.
From the contextual menu, choose
Save Spy list
.
3.
In the dialog box, enter a name for the file and choose a location then click
Save
.
Warning:
You need to save your list each time you make changes.
Opening an Existing Spy List
You can choose to open a previously created spy list.
To open a previously created spy list
1.
Within the Spy List window, right-click in the grid.
2.
From the contextual menu, choose
Load Spy List
.
ISaGRAF 5.2
- Workbench 367
Forcing / Locking / Unlocking the Value of a Spy List Variable
You can force, i.e., change, lock, and unlock the value of a variable in the spy list.
To force the value of a spy list variable
From the spy list, double-click the variable’s corresponding cell in the Value column, then in the dialog, click
Write
. For boolean variables, click the desired boolean value.
To lock a spy list variable
Locking operates differently for simple variables, array and structure elements, and function block parameters. For simple variables, individual variables are locked directly. For array and structure elements, locking a single element causes all other elements to be locked.
For function block parameters, locking a parameter affects only that parameter.
From the spy list, double-click the variable’s corresponding cell in the Locked column, then in the dialog, click
Lock
.
To unlock a spy list variable
From the spy list, double-click the variable’s corresponding cell in the Locked column, then in the dialog, click
Unlock
.
You can also force, lock, and unlock variables from the Dictionary and Diagnosis window.
368
ISaGRAF 5.2
- User Guide
Simulate a Panel of I/Os
You can simulate a panel of I/Os, i.e., display the values of inputs and outputs defined for a project, in their I/O devices. When testing a project in simulation mode, the Simulator
(I/O Panel Simulation) is automatically launched. The Simulator is automatically closed when the test mode is stopped. You can perform the following tasks from the Simulator:
Opening and closing I/O device windows
Forcing the values of input device channels
The following example shows the Simulator displaying two I/O devices for the "Project3" project:
To display the Simulator
"
While the application runs in Test mode, in the Windows task bar, click .
ISaGRAF 5.2
- Workbench 369
To open and close I/O device windows
You can choose to open individual I/O devices or all I/O devices belonging to items in a project’s structure, i.e. resources, configurations, and projects.
1.
From the browser, double-click an item in the structure. You can also drag and drop items into the Simulator’s workspace.
2.
To close I/O device windows, on the individual windows title bars, click the 'Close
Window' button.
To force the value of an input device channel
You can force, i.e., change, the value of BOOL, numeric-type, and STRING input device channels. For BOOL input devices, forcing the value means changing a TRUE value to FALSE and a FALSE value to TRUE. For numeric-type (SINT, USINT, BYTE, INT, UINT, WORD,
DINT, UDINT, DWORD, LINT, ULINT, LWORD, REAL, LREAL, TIME, DATE) or
STRING input devices, this means entering a new value. A value cell is any cell in the 'value column' of an 'I/O device' window.
1.
Double-click the value cell of the required input device channel.
2.
For numeric-type and STRING input devices, press
Enter
.
370
ISaGRAF 5.2
- User Guide
Appearance
The Simulator is the environment where you can simulate a panel of I/Os. Its window is
divided into two parts: a browser and a workspace.
browser workspace status bar
The browser, located on the left side of the window, displays the defined project items in a tree-like structure, with the project as root. The workspace, to the right of the window, enables you to display the I/O devices defined for the items selected in the browser. Each I/O Device appears in a separate window showing the resource and configuration to which the I/O Device belongs. You can customize many aspects of the Simulator including:
Resizing and moving individual I/O device windows
Displaying I/O device window headers
ISaGRAF 5.2
- Workbench 371
Menu Bar
Some options are available as keyboard commands.
File
View
Option
Open I/O Device
Close
Toolbar
Status Bar
Tree Bar
Auto Vertical Tile Windows
Auto Horizontal Tile Windows
Auto Cascade Windows
Display Header
Display Name
Numerical Display
Auto Save when Exit
Ctrl+O creates a new project
Alt+F4
shows or hides the Simulator’s toolbar
shows or hides the Simulator’s
status bar
shows or hides the Simulator’s
browser sets the I/O device windows to automatically tile vertically sets the I/O device windows to automatically tile horizontally sets the I/O device windows to automatically display in a cascading manner
displays a header at the top of I/O
device windows displays the variable names associated with each channel in all
I/O devices sets the numerical display of values activates or deactivates the automatic saving of changes to the
Simulator including the position and
look of all I/O device windows.
These changes are saved in the current project directory
372
ISaGRAF 5.2
- User Guide
Window Cascade
Tile
Help Contents
Search for Help On
About displays the I/O device windows in a cascading manner displays the I/O device windows in a tiling manner accesses the online help not currently supported displays product and version information
Toolbar
shows or hides the Simulator’s browser
display the variable names associated with each channel in all I/O devices displays integer values in the hexadecimal format displays integer values in the decimal format sets real values to be rounded off to one digit after the decimal point.
Otherwise, values appear in scientific notation (1.0E+2) format sets real values to be rounded off to two digits after the decimal point sets real values to be rounded off to three digits after the decimal point sets real values to be rounded off to four digits after the decimal point sets real values to be rounded off to five digits after the decimal point sets the I/O device windows to appear in a cascading manner
ISaGRAF 5.2
- Workbench 373
sets the I/O device windows to appear in a horizontal tiling manner sets the I/O device windows to appear in a vertical tiling manner
Contextual Menu
A contextual menu, accessed by right-clicking within an I/O device window, enables you to change the numeric presentation of values, the display options (I/O window header and variable name), and split the window.
Displaying I/O Device Window Headers
In the Simulator, you can choose to display a header at the top of device I/O windows in the
following format:
<Resource number>:<Resource name> (<configuration name>)
'Direction:' <'Input' / 'Output'> '- Type:' <type-name>
1: C1_R1 (Config C1)
Direction: Input - Type: BOOL
To display window headers
"
From the Option menu, choose
Display Header
.
374
ISaGRAF 5.2
- User Guide
Moving or Hiding the Browser
You can move, resize, or hide the Simulator’s browser. To undock it, click on the 'double line'
and drag the window. You can move it to the top, bottom, left, and right of the workspace or completely outside of the Simulator window.
To move or hide the browser
1.
To move the browser, click its frame then drag it to the new location.
2.
To hide the browser, from the View menu, choose
Treebar
.
ISaGRAF 5.2
- Workbench 375
Online Changes
You can modify a resource while it runs. This is sometimes necessary for chemical processes where any interruption may jeopardize production or safety. When performing online changes, you can choose to update a running resource at the time of download or at a later time.
However, online changes should be used with care.
ISaGRAF
may not detect all possible conflicts generated by user-defined operations as a result of these online changes.
The initial values of variables are applied upon starting resources. Online changes do not start resources. The following tasks are available when performing online changes:
Internal Bindings Adding, deleting, and editing.
Creating and deleting data links between resources.
Creating and deleting bindings between variables.
Changing the consumer error variable and consumption behavior of a binding. Changing the producing variable, consuming variable, or network for a binding creates a new one.
during which the consumer can remain in the update state.
376
ISaGRAF 5.2
- User Guide
Internal Variables
I/O Variables
I/O Channels
Adding, deleting, and relocating internal variables.
When renaming or changing the data type of internal variables, the
Workbench creates new variables. Therefore, variables are initialized.
Changing the alias, initial value, group, scope, direction, retain setting, address, and comment of variables. When changing the initial value of a read-only internal value, the Workbench reinitializes the variable. When changing the scope of a variable, the Workbench reinitializes the variable.
Modifying the length of string variables. When decreasing the length, the contents of the string is truncated to the new length.
Switching a variable attribute between the input and output attribute. You cannot switch variables between the internal and input/output attribute.
Adding and removing elements in arrays for internal variables. For multi-dimensional arrays, you can only add elements to the first dimension. The Workbench initializes these new elements. Adding elements to other dimensions causes the Workbench to initialize a new array.
Renaming, adding variables to, removing variables from the group to which a variable belongs or moving the variable to another group.
Wiring, unwiring, and swapping I/O variables whose data type
(scalar type for arrays), length (string variables), dimension
(arrays), and address remains unchanged. For these I/O variables, you can modify the direction (input or output only), scope, attribute (read, write, or free), retain flag, alias, and comment.
When modifying the direction, I/O variables cannot change to or from the internal type.
Modifying the group and bindings in which I/O variables are defined.
Changing the wired variable as well as the reverse/direct, gain, offset, and conversion settings.
ISaGRAF 5.2
- Workbench 377
To perform an online change
"
From the Debug menu, choose
Online Change: Download
, then choose the desired option.
Code Sequences
A sequence of code is a complete set of ST, IL, LD, FBD 61131, or FBD 61499 instructions executed in a row. In a cyclic program, a code sequence is the entire list of instructions written in the program. In an SFC or FC program, a code sequence is the level 2 programming of one step / action or transition / test.
An online change consists in replacing one or more code sequences, without stopping the PLC execution cycle. Therefore, you cannot add, delete, or rename any POUs. Note that in such a case, no compiler warning is generated and the changes will be denied at download step.
Particular case of SFC
Since the control of SFC tokens is very critical, you cannot modify an SFC structure or add, renumber, or remove a step or transition.
The switch occurs between two cycles:
In the case of a step that was already active, if the new code of the step contains non-stored boolean or SFC child actions or P1 actions, then such actions are not updated.
Afterwards when the step becomes inactive, the Boolean is reset / the SFC child is killed
/ P0 actions are executed.
In the case of a step that becomes inactive, if its code sequence has changed, then the new one is used (P0 actions are executed).
Code sequence for receptivity equation of a transition is changed if it is required and it will be evaluated when the transition is valid.
378
ISaGRAF 5.2
- User Guide
Particular case of IEC 61131-3 function blocks
You can make changes to the body of an IEC 61131-3 function block but cannot change its definition. That is to say you cannot change:
The number of parameters.
Parameters name, type, direction (input, local, output), dimension for arrays, and string size for string type.
Therefore, in case of graphic languages you cannot add/remove nested blocks ('C' block or
IEC 61131-3 block calls) because they lead to automatic instances and therefore number of
parameters modifications. For same reasons you cannot add/remove a 'pulse' variable.
Particular case of calls to 'C' Functions
You can add a call to a standard 'C' function. You cannot add a call to a user 'C' function if it is its first use.
Particular case of calls to 'C' Function Blocks
ISaGRAF 5.2
- Workbench 379
Variables
As the variable database is a critical part of the resource, it can be accessed at any time by other processes (via multitasking PLC). It is also possible to modify variable values from the
Debugger. Therefore, you cannot add, rename, or remove a variable online. However, you can modify the way a variable is used in the application. You can also reserve "unused" internal or
I/O variables in the first version of the resource, so that future modifications can make use of them.
Target databases contain different styles of variables each having their own limitations.
Declared Variables
Declared variables are declared using the Dictionary. You can add or remove new variables in the dictionary, with or without initial values.
Renaming a variable causes the PLC to lose the values of the variable.
When the initial value of an existing variable is changed, no warning message appears and the modification is not taken into account by the target at the online change stage. When changes are saved, the new initial value takes effect at the next 'Stop’/’Start’.
During code generation, the Workbench linker retains information about removed and added variables in the PLC data memory map. When performing complete downloads instead of online changes, you should clean the project before building it.
To conserve the ability to perform online changes, you must not perform the following operations:
Add a variable with the same name as a variable that was previously removed from the dictionary
Add/Remove an I/O variable
Change the definition of an existing variable
The definition of a variable refers to many aspects:
Type
380
ISaGRAF 5.2
- User Guide
Scope
Dimension (arrays)
String size (for string type)
Direction (Input / Output / Internal)
Address
Retain attribute
Function Block Instances
Each instance of IEC 61131-3 or 'C' written function corresponds to data stored in
ISaGRAF
virtual machine real time database. You cannot add new automatic instances of IEC 61131-3
function blocks or of standard 'C' function blocks with or without initial values. To enable online changes, you need to work with function block instances declared in the Dictionary.
You cannot add any user 'C' Function Blocks instances.
Compiler Allocated Hidden Variables
The compiler generates "hidden" temporary variables to solve complex expressions. The compiler forces a minimum number of temporary variables to be allocated for each program, even if not used for compiling the first version of the resource. As long as a new compiling of the resource gives a number of allocated temporary variables lower than this minimum, the online change will be possible.
ISaGRAF 5.2
- Workbench 381
I/O Devices
Since the I/O system is very open, required modifications should be implemented by an integrator, using specific features of the corresponding hardware.
For simple or complex I/O devices, when supported by the driver, you can perform online changes for OEM parameters. For I/O channels, also when supported by the driver, you can perform online changes for the Gain, Offset, Direct, and Conversion parameters as well as the
mapping of logical and physical channels. You can wire new I/O variables. You can also swap
I/O variables whose data type (scalar type for arrays), length (string variables), dimension
(arrays), and address remains unchanged. For these I/O variables, you can modify the direction, scope, attribute (read, write, or free), retain flag, alias, and comment. Before changing the direction and attribute of I/O variables, these must be unwired. Operations such as modifying device parameters may be available using specific functions provided by the integrator.
Memory Requirements
In order to support the "Online Change" capability, the target PLC must have free memory space to enable the storage of:
The modified version of the code sequences. Original code and modified code have to be stored in PLC memory.
The addition of new data variables
Online changes will be denied if there is not enough memory space. You specify the available memory for online changes in the Advanced settings for resource properties. For details about
advanced settings for resources, see page 64.
382
ISaGRAF 5.2
- User Guide
Miscellaneous Limitations
As described before, you can change code sequences and add or remove variables with some
limitations. However, you cannot change the descriptions of I/O devices. Other limitations exist for various items of a project:
Types, you cannot add, remove, or change types definitions. When required, you could define extra types. Such extra types could then be used for future changes.
Bindings, for some changes made to bindings, no warning message appears during compilation and modifications are not taken into account by the target at online change.
Resource properties, for some changes made to other options, no warning message appears and the modification is not taken into account by the target at on line change.
During compilation, changes that are not allowed are detected result in the generation of warning outputs. Online changes are denied. The target also does some extra checks. However this function should be used with care.
ISaGRAF
may not detect all possible conflicts generated by user-defined operations as a result of these online changes.
ISaGRAF 5.2
- Workbench 383
Operations
Modifying a running resource consists of the following operations:
1.
Modifying the resource source code on the Workbench
2.
Generating the new resource code
3.
Downloading the new resource code using "Online change: download" command on the
Debug menu (instead of "download")
4.
Switching from the old resource code to the new one in between PLC execution cycles, using the "Online change: update" command on the Debug menu
This procedure guarantees that the Target PLC always has a complete and reliable running resource, and enables you to control the timing of the sample operations in a very safe and efficient way. It also enables the user to modify the project when required.
Regardless to the process itself, the "Online Change" is essentially the same as a normal "stop, download and start" set of commands. The only differences are that no variable state is lost and the switching time is very short (usually 1 or 2 cycle duration). During the switch, no variable is modified, and all internal, input, or output variables keep the same value before and after the resource modification. During the switch, no action is performed, and SFC tokens are not moved.
Detailed operations:
1.
Before making any change on a running application, it is highly recommended to make a copy of the current project under another name.
2.
Before editing any program, you should edit the description of each POU that will be modified and indicate the current date and the nature of the modification, to ease future program maintenance. Select the POU and use the "Tools / Edit Description" command.
3.
When one or more allowed changes have been made, the code of the new resource must be generated on the workbench before downloading. Use the Project / Build Resource command .
384
ISaGRAF 5.2
- User Guide
4.
Use the "Debug / Online Change: Download" command displayed, check the options as desired:
Update and Save after download
Update after download
Update later
. In the dialog box
The modified code is downloaded by selecting the "Download" button. This may slightly slow
down the PLC during transfer.
To save your change later, once it is validated, use the command "Debug / Save code on target".
This command saves the code of the running resource (including changes). To update your change later, use the command "Debug / On-line change: Update".
If you did not update the change after download (above option):
Using the Debugger, connect the Target PLC and perform any operation which can make the resource update faster, or more safely, then run the "Debug / On-line change: update" command
A message is displayed in the Output window to indicate the success of the switch. If unsuccessful, the existing running application remains as is.
ISaGRAF 5.2
- Workbench 385
Debug Function Block Instances
You can visually debug instances of function blocks. Function blocks can be written in SFC,
ST, FBD 61131, FBD 61499, or LD language. Visual debugging consists of animating the source code of the function block body with the data of a specified instance of the block.
Below is an example of a very simple function block programmed in FBD. The
LIB_FB1 function block has the in
input and the out
output and a constant having a value of 1:
You can distinguish two types of instances of function blocks:
Declared instances declared in the variable dictionary. These instances are considered as variables.
Automatic instances created in LD or FBD diagrams. The compiler automatically assigns a unique identifier to each automatic instance. This identifier consists of the
__INST prefix and a sequential number before the function block’s name.
386
ISaGRAF 5.2
- User Guide
At debug time, you can select instances within a program to open and visualize their diagram.
The following examples show the
LIB_FB1
function block used as an automatic instance and a declared instance in the
P2
program. The upper diagrams show the instances in the program, whereas, the lower diagrams show the individual instances open.
Automatic Instance Declared Instance
The automatic instance is assigned the INST7LIB_FB1@P2 name and the declared instance retains its defined name, INSTANCE_LIB_FB1@P2. For automatic and declared instances, a suffix consisting of the @ symbol and scope is added to the instance name.
To debug declared instances of function blocks
You can debug variables declared instances of function blocks either from the dictionary, in the LD and FBD diagrams, and in the resource window. However, when declared instances are from a library, you can only debug these from the dictionary or from the LD and FBD diagrams.
Note:
You cannot debug function block instances declared as parameters of function blocks.
"
To debug a declared instance do one of the following:
From the dictionary view, select the block then from the Debug menu, choose
Debug FB
.
ISaGRAF 5.2
- Workbench 387
In the function blocks section of a resource window, locate the block then double-click it.
In the LD or FBD diagram, locate the block then double-click it.
To debug automatic instances of function blocks
You can only debug automatic instances of function blocks from the LD and FBD diagrams.
"
Open the LD or FBD diagram where the instance is inserted then double-click it.
Clean Stored Code
If you have downloaded a resource with the "Save" option checked in the Download dialog
box, the resource’s code is stored on the target system. Then if the target system restarts, it will load this code and start a virtual machine to run this code.
Note:
If you want to clean (i.e. remove) this code from the target and avoid restarting on it, from the Debug menu, choose
Clean Stored Code
.
388
ISaGRAF 5.2
- User Guide
Document Generator
You can build and print the complete or partial documentation for the current project from within the Document Generator.
You can access the Document Generator from the hardware architecture view, link architecture view, dictionary view, or any of the language editors. The Document Generator window has three tabs:
Table, showing a table (or tree) representing all items that can be printed for the current
project
Options, showing a list of printing options
Preview, displaying a preview of the project to print
To print the documentation for a project
You can choose to print from any tab of the Document Generator.
1.
From the File menu, choose
or click
The Document Generator is displayed.
on the Standard toolbar.
2.
On the Table tab, select the project items to print.
3.
On the Options tab, set the desired printing options for the project documentation.
4.
On the Preview tab, review the appearance of the documentation print job.
5.
Click
.
Building and formatting a project’s documentation may take a few minutes. Before running other commands in the Workbench, you should wait until the printing task is completed.
Building the whole documentation may require a large space on the hard disk. If the disk is full, an error message is displayed, then you need to either free up disk space by removing files or reduce the size of the print task.
ISaGRAF 5.2
- Workbench 389
Table of Items
The table of items displays all items available for printing for a project. The items preselected for printing differ depending on the location from which printing is initiated. For example, when you initiate printing from the link architecture view where the Main resource is selected, all items defined for this resource appear selected in the Document Generator.
When you initiate printing from a program, only the items defined for the program appear selected in the Document Generator. You can always choose to select other items for printing.
You expand or collapse a branch of the tree, by clicking the / symbol before an item.
Clicking here collapses GMAIN sub-tree
Clicking here expands Drive sub-tree
You select items for printing by checking the box at their left. You deselect items by unchecking them. Checking an item at the top of a sub-tree automatically selects all items below it for printing. In the following example, only the Main resource was checked for printing:
390
ISaGRAF 5.2
- User Guide
When some (but not all) items within a tree are selected, the check box at the top of the structure is grayed:
When items such as projects, resources, or POUs are password-protected (locked), these are unavailable for printing and appear grayed:
ISaGRAF 5.2
- Workbench 391
Printing Options
Project documentation uses the default printer settings specified for your computer. However, you can define many other printing options. You can choose to place each item on a new page.
You can also choose to print diagrams in landscape orientation. This option sets the printing of all FBD and LD diagrams using the landscape orientation while printing all other items using the portrait orientation. FBD and LD diagrams including guideline areas are automatically scaled to fit the width of the printed pages. You can also specify printing options for the following documentation aspects:
Header / Footer
. You can choose to display document information including the date and page count as a header at the top of each page or as a footer at the bottom of each page.
You can also choose to have no headers or footers. You can modify the contents of the displayed header or footer by clicking Edit in the Header/Footer section of the printing options.
You can choose to use one of two formats as header/footer. One format provides three fields where you can enter text. In both formats, you can change the logo by entering the path and filename of a bitmap (.bmp) file. Click "…" to browse and select your file.
392
ISaGRAF 5.2
- User Guide
When replacing the bitmap for the format B option, you need to use one consistent with the resolution of your printer. For example, the default bitmaps are consistent with a 600 dpi printer.
Page numbering
. You can specify the page numbering method used for the project document printing: page count (#/total number of pages), page number (#), or section number (#.#.#.#.#).
For page count, the page section in the header/footer displays the page number out of the total number of pages and the table of contents starts count at 1.
For page number, the page section in the header/footer displays the page number and the table of contents starting count at the Start Page value. When no value is specified, page numbering begins at 1.
For section number, the page section in the header/footer displays the page number and the table of contents starting count at the Start Section value after the table of contents page; the header and table of contents pages use the lower-case Roman numerals i and ii, then section numbering begins. When no value is specified, section numbering begins at 1.
You can only include page numbering in a header or footer.
Cover page
. You can choose to include the header or footer on the cover page of the project documentation. You can also choose to add a printing history. When the printing starts up, a dialogue box is displayed where you can enter a note describing the actual print command. Such notes are stored in a history file and are printed on the first page of any future document (including the present one).
Margins
. You can choose to include visible margins on all pages. When checked, the width of each margin (top, bottom, left, right) is user-definable, using the corresponding edit boxes.
Fonts
. You can change the font used to print text by clicking Text font and making the desired changes. You can change the font used to print all titles (corresponding to items listed in the table) by clicking Title font and making the desired changes.
ISaGRAF 5.2
- Workbench 393
Preview
You can choose to preview a document with the selected items before printing. You can scroll the complete document. You can also print previewed pages. For ST POUs, the line numbers are included in the document printing.
394
ISaGRAF 5.2
- User Guide
While printing pages, you can choose to print all of a document, the current page, or specific sections of the document. When defining the printing of a range between sections, you need to specify the start and end section.
Since pagination for project documentation is set using the default paper dimensions specified for your computer, when changing the paper dimensions from the Print dialog, the pagination for project documentation differs from the preview.
ISaGRAF 5.2
- Workbench 395
Code Generator
The Code Generator is launched with the "Build …" commands of the Workbench and editors.
The Code Generator shows compilation errors in the output window.
You can build the code of a single POU, a complete resource, or a whole Project.
Warning:
Before building code, you should save all programs currently being editing.
Build
Before downloading code onto your target systems, you must first build the code of the whole project. This operation builds the code of all resources of the project, and builds information used to recognize your systems on networks. You cannot build projects open in the read-only mode.
Once a project has been built, subsequent builds only recompile the parts of the project needing
recompilation. You can choose to rebuild a project, i.e., recompiling a whole project, to ensure
that the complete compiled version is up-to-date with the current Workbench project. You can rebuild projects following a date change on a system or relocation of a project onto a different computer. When symbols monitoring information is enabled for function blocks, the
Workbench always compiles these whether building or rebuilding.
You can choose to clean projects. However, after cleaning a project, you cannot perform online
changes. Therefore, to retain the ability to perform online changes, you can rebuild a project rather than cleaning then building it.
While performing builds, the security state of unlocked resources and resources having no
remain locked.
ISaGRAF 5.2
- Workbench 397
To build the project
From the Project menu, choose
Build Project
or click on the Standard toolbar.
If the hardware architecture view is not changed, building resource code is enough to update
To rebuild a project
From the Project menu, choose
Rebuild Project
or click on the Standard toolbar.
398
ISaGRAF 5.2
- User Guide
Build a POU
While editing a POU, the "Build program" command allows you to verify programming syntax errors for the current program.
Error messages are displayed in the Output window. Double-clicking on the error message
places the caret on the error or, for graphic programs, selects the erroneous graphic element.
The Build program command verifies the current program even if it has not been modified since its last verification.
ISaGRAF 5.2
- Workbench 399
Building Resources / Projects
The "Build Resource" or "Build Project" command displays the number of the error detected
in all POUs in the Output window.
Double-clicking on the number of
errors
of a POU opens the corresponding editor for corrections to be made.
The "Build Project" performs the "Build Resource" command for all resources of the project and builds information used to recognize configurations on networks.
Note:
While in single resource mode, you cannot build a resource having links to libraries located on a different computer.
The "Build Resource" command constructs the entire code of the resource. Before generating anything, this command checks the syntax of the declarations and programs of each resource.
Errors that cannot be detected during single program compiling are detected using these
commands. For example, the IO Wiring and Binding Links are checked.
Programs which have already been checked (with no errors detected) and have not been modified since their last "Build program" operation are not re-compiled. Variable declaration verification and coherence checking are always performed.
400
ISaGRAF 5.2
- User Guide
Stopping Builds
You can stop a build, i.e, compilation, in progress for a project, resource, or POU. This feature
is not available when using a PROPI interface. When a build process is stopped, it can be
restarted without affecting the incremental or full compilation. After a build is stopped, online changes can be performed since a copy of the last build is kept until a complete new one is generated.
To stop a build
"
From the Project menu, choose
Stop Build
.
Or
"
On the Standard toolbar, click .
You can also abort build operations by pressing the
<ESCAPE>
key.
ISaGRAF 5.2
- Workbench 401
Cleaning Projects
The "Clean Project" or "Clean Resource" commands (on the Project menu of the Workbench) simulate a modification of all the project's (or resource's) programs, so that they are all verified during the next "Build Project" or "Build Resource" operation.
Note:
After cleaning a project, you cannot perform online changes. Cleaning projects or resources actually deletes all files generated during the last "Build" command. Therefore, to retain the ability to perform online changes, you can rebuild a project rather than cleaning then building it.
402
ISaGRAF 5.2
- User Guide
Compiler Options
Compiler options are defined for each resource. These options enable setting up the parameters
used by the Code Generator to build and optimize the target code. In the Compilation Options
of a resource, you select the type of code to generate according to corresponding targets and set up the optimizer parameters according to the expected compilation and run-time
requirements. For details on resource compilation options, see page 61.
The general compiler options are the following:
Check array index, enables the verification of array indices
Enable internal state information for functions. Functions containing no internal state information denotes that the invocation of a function with the same arguments always yields the same values.
Generate Diagnostic files from POU object files,
To be defined
ISaGRAF 5.2
- Workbench 403
The optimizer compiler option is the following:
Optimize common expressions in a linear part of code, enables the code generator to optimize the TIC code
Optimization performs many tasks: removes unused temporary variables, replaces each constant expression with its result, replaces repeated expressions and subexpressions with their equivalent values, suppresses unused and surplus target labels and null jumps, and simplifies arithmetic operations.
The link compiler options are the following:
404
ISaGRAF 5.2
- User Guide
Generate map files, enables the generation of resource level files containing debugging information. The files are placed at the root of the resource folder and are named using the resource name as a prefix with .ttc, .tws, and .map as extensions.
Dump POU files, enables the generation of resource level files containing debugging information and places them at root of the resource folder. Some of the files are named using the resource name as a prefix, the POU name as a suffix, and have the extensions
.ttc and .tws. Other files are named using the POU name with .lst and .unc as extensions.
Dump configuration files, enables the generation of resource level files containing debugging information and places them at the root of the resource folder. The files are named using the resource name as a prefix with .ttc and .tws as extensions.
Dump network files, enables the generation of network and configuration level files containing debugging information. The files are placed at the root of the network folder and at the root of the configuration folder. The files placed in the network folder are named "NetworkConf" and have the extensions .ttc and .tws. The files placed in the configuration folder are named using the resource name as a prefix and have .ttc and .tws
as extensions.
To access the compiler options for a resource
The general and link compiler options are accessed for individual resources from the resources properties window.
1.
From the Window menu, choose
project_name
-
Link Architecture
.
2.
3.
From the Edit menu, choose
Properties
.
The Resource Properties window is displayed.
4.
On the Code tab, click
Compiler Options
.
The Compiler Options dialog is displayed.
ISaGRAF 5.2
- Workbench 405
C Source Code
The workbench compiler produces, by default, TIC code (Target Independent Code) that can
be executed by virtual machines. The compiler also enables the production of code in "C". You
POUs written in FC (Flow Chart), FBD, LD, ST, IL and action blocks and conditions of SFC
POUs are generated in "C" source code format.
The "C" source files must be compiled and linked to the target libraries in order to produce the final executable code. For further information about recommended implementation techniques, refer to the "I/O Development Toolkit User's Guide".
Note:
Some debugging features such as downloading the resource code, online modification, and breakpoints are not available when the resource is compiled using the "C" language.
406
ISaGRAF 5.2
- User Guide
Project Tree View
The Project Tree View displays the project structure and enables accessing most aspects of the currently opened project. For instance, you can access the link or hardware architecture views, the internal binding list, elements (programs, functions, and function blocks) defined for resources and I/O wiring. You can also access utilities such as the events viewer, trends logger, and driver monitor.
Contextual menus enabling tasks such as locating and opening project elements are available by right-clicking these elements.
To access the Project Tree View
"
From the
Window
menu, choose
Show Project Tree View
.
ISaGRAF 5.2
- Workbench 407
Cross References Browser
The Cross References Browser is a tool that finds in the POUs of a project all references to global variables, i.e., cross references, defined in a project. It provides a total view of the declared variables in the programs of the project and where these are used. The aim of the browser is to list all the global variables, I/Os, as well as the automatic and declared function block instances in the project, and to localize, in the source of each program the parts of source code where those variables are used. The browser is very useful for a global view of one variable life cycle. This helps localize side effects, and reduce the time to understand the project during maintenance.
The browser is divided into five sections:
A, the list of global objects declared in a project
B, the search field where you enter a name to search in the list of objects
C, the description of the object selected in the list
D, the locations of the object selected in the list in the project POUs. For variables, the description includes the direction, i.e., READING FROM, WRITING TO.
ISaGRAF 5.2
- Workbench 409
E, an output window where messages and error messages are displayed
When viewing global objects in the browser, the used in any POUs.
symbol indicates that the object is not
You can perform many tasks from the browser’s toolbar: keeps the browser always on top locates the name entered in the Find field (B) from the list of global objects declared in the project (A) browses, i.e., parse the POUs to re-calculate the cross references prints the cross references clears the output window shows or hides the list of declared objects
410
ISaGRAF 5.2
- User Guide
shows or hides the output window accesses the available options for the calculation of cross references
To access the browser
You can access the browser using the menu, the toolbars, or from a contextual menu, available by right-clicking in a language editor.
"
From the Tools menu, choose Browser or from the Window Buttons toolbar, click
.
Calculating Cross References
When you calculate cross references, these are stored in a cross references file. Such a file is automatically created for each resource of a project. These files eliminate the need to parse
POUs each time the browser is closed and re-opened. When files are missing or invalid due to changes in the project, messages are displayed in the output window. The cross reference files
are deleted when you clean a project.
When cross references are out of date, the icon appears in the browser’s title bar.
To calculate cross references
"
From the Browser’s toolbar, click .
Browsing the POUs of a Project
Occurrences of a selected object in the source files of an open project appear in the locations section of the browser. Double-clicking an occurrence opens the program directly where the object appears.
ISaGRAF 5.2
- Workbench 411
Defining Search Options
You can define the search options used when finding cross references. The options consist of three types: the global object to search for during the next scan, the objects to list in the browser window, and the exact set of configurations and resources in which to search for selected objects. You can choose to scan the cross references for one or more resources in order to shorten calculation time.
The options for the global object to search for are:
Variables
Programs
Functions
Function Blocks
Defined Words all global variables and I/Os program names (SFC or FC names can be used in parent programs) all functions declared in the project or in attached libraries, plus "C" and standard functions available for the corresponding target all automatic and declared function blocks declared in the project or in attached libraries, plus "C" and standard function blocks available for the corresponding target aliases defined in the "Defined Words" section of the dictionary, in the project or in attached libraries
The options specifying what objects to list in the browser window are:
Unused
Used list unused variables list variables used in POUs
To define search options
Changes only take effect during the next scan.
1.
From the browser’s toolbar, click .
2.
In the list of available options, check the desired options.
412
ISaGRAF 5.2
- User Guide
Version Source Control
You can manage the changing versions of Workbench elements including projects, configurations, resources, and POUs by saving them to a version source control repository.
Saving these elements to a control repository enables you to retrieve older versions of the elements at a later time. The information saved in the repository also includes advanced options definitions such as alarms and events, field communications, fail-over mechanisms, trending, and Web HMI data servers. Version source control also applies to projects opened in single-resource mode.
You save version source control information to a repository using one of two modes:
file mode where you specify a path for a local or remote computer client/server mode where you specify login information and server location. Before setting this mode, the repository project must exist.
The default uses the file mode and saves this information in a VSC folder in the project folder.
A repository folder, defined by the path, can hold multiple version source control projects. You
can choose to clear the version source control status for a project. Clearing the version source
control status for a project means disabling the version source control for the project. The version source control repository must be removed manually.
Workbench elements are always editable. Therefore, you do not need to check these out of the control repository to modify them. At any time, you can check in, i.e., save, changes made to elements in the control repository. When you check in an element, all of its descendants are also checked in. For instance, when you check in a project, all of its configurations, resources, and POUs are checked in. You can only check in or get elements available for edition; you cannot check in or get elements having the read-only attribute. However, you can view the history of read-only elements.
When you retrieve, i.e., get, a Workbench element from the control repository, this element is automatically updated to the current version. Therefore, a local element containing more current definitions could be overwritten. Before using a retrieved project or configuration, you need to recompile the entire project. Before using a retrieved resource or POU, you need to recompile the resource.
ISaGRAF 5.2
- Workbench 413
Deleting or renaming previously checked in Workbench elements detaches these from their history in the control repository. For instance, before retrieving any part of a deleted resource’s history, you need to recreate a new instance of the resource having the same name.
When performing a check in, individual elements are placed in four file types within the control repository. For example, a project is split into a project file, a configuration file for each configuration, a resource file for each resource, and a POU file for each POU. The project file contains a list calling its configurations, resources, and POUs. The information retained in each type of file varies:
Element Type
POU
Resource
Configuration
Project
Retained in Control Repository
POU properties, local variables, symbols, and advanced options definitions as well as a list of contained child POUs
Resource properties, global variables, internal\external bindings, I/O devices, variable groups, and advanced options definitions as well as a list of contained POUs
Configuration settings network connections, and advanced options definitions as well as a list of contained resources
Project settings types, and advanced options definitions as well as a list of contained configurations, and resources
Stored element files do not retain information such as imported target definitions, compilation output files, driver definitions, and protocols. Each POU also has a second file holding the code and instructions (
POU_name
.stf).
The version control status of an element is indicated in the Workbench. For a project, the status is indicated in textual format in the title bar: Up-to-date or Locally modified. For a configuration or resource, the status is displayed as an icon at the left-hand corner of its title bar. For a POU, the status is applied directly to the POU icon.
Up-to-date. The file is identical to the latest version in the source control database or to its retrieved version.
Locally modified. The file differs from the latest version in the source control database or from its retrieved version. A modification at any level affects the upwards status of the project elements. For instance, when modifying a resource, the status of the resource as well as the configuration and project to which it belongs become locally modified.
414
ISaGRAF 5.2
- User Guide
When using version source control with your projects, you can perform the following tasks:
Performing a Check in of a Workbench Element
Viewing the History of Workbench Elements
Results and errors for version source control operations are displayed in the output window.
To define a version source control repository
You can choose to save version source control information for a project using the file mode or the client\server mode.
1.
With the project open in the Workbench, from the File menu, choose
Project Properties
.
2.
In the Project Properties window, select the Version Control tab.
3.
In the Repository path and Repository Project field, specify the location in which to save the version source control information by clicking to browse the path.
The syntax to specify a server repository path on a remote computer is as follows:
UserName
:
Password
@
RemoteComputer
where
UserName
and
Password
represent the logon information for the remote computer,
RemoteComputer
represents the name or IP address of the computer.
ISaGRAF 5.2
- Workbench 415
To clear version source control status for a project
1.
With the project open in the Workbench, from the File menu, choose
Project Properties
.
2.
In the Project Properties window, select the Version Control tab.
3.
Make sure the repository path is the correct one for the project, then click
Clear VSC status
.
The version source control information is disabled for the project.
416
ISaGRAF 5.2
- User Guide
Performing a Check in of a Workbench Element
You can check in, i.e., save, project, configuration, resource, and POU definitions not having the read-only attribute into a version source control repository. For elements having access control, the check-in process encrypts the element in the version source control repository making them accessible upon entering a valid password.
To check in a project
1.
With the project open in the Workbench, from the Tools menu, choose
Check-in
, then
Project
.
2.
In the Check-in dialog, enter a comment (optional), then click
OK
.
The project definitions including all of its configurations, resources, and POUs are saved in the version source control repository.
To check in a configuration, resource, or POU
You can check in configurations and resources from the hardware architecture view. You can check in resources and POUs from the link architecture view. You can check in configurations, resources, or POUs using the main menu or from a contextual menu, available by right-clicking the element.
1.
In the applicable view, select the element to check in.
2.
From the Tools menu, choose
Check In
, then the respective option.
3.
In the Check In dialog, enter a comment (optional), then click
OK
.
The element’s definitions are saved in the version source control repository. For configurations, these definitions include all of its resources and POUs. For resources, these definitions include all of its POUs.
ISaGRAF 5.2
- Workbench 417
Viewing the History of Workbench Elements
You can view the history of projects, configurations, resources, and POUs that have been checked in to the version source control repository. Each checked in version appears as a separate entry.
To view the history of a project
"
With the project open in the Workbench, from the Tools menu, choose
View History
.
All previously checked-in versions of the project are displayed.
To view the history of a configuration, resource, or POU
You can view the history of configurations and resources from the hardware architecture view.
You can view the history of resources and POUs from the link architecture view. You can view the history of configurations, resources, or POUs using the main menu or from a contextual menu, available by right-clicking the element.
"
In the applicable view, select the element for which to view the history, choose
View History
, then the respective option.
All previously checked-in versions of the element are displayed.
418
ISaGRAF 5.2
- User Guide
Getting a Previous Version
When viewing the history of a project, configuration, resource, or POU, you can choose to get, i.e., retrieve, a previously checked in version of the element. For elements having access control, you can access them upon entering a valid password.
Warning:
Since getting an element from the control repository automatically updates a locally held version to the retrieved version, a local element or its underlying elements containing more current definitions could be overwritten. For example, getting a project from the control repository where a resource and POU have been locally modified since the check in causes the resource and POU to be overwritten with their older definitions contained in the control repository.
When you delete or rename a Workbench element that was checked in to the control repository, you cannot retrieve any part of the history for this element from the repository unless you recreate a new instance of this element having the same name.
To get a previous version of a Workbench element
"
In the History list of elements, select the version to retrieve, then click
Get
.
This older version replaces the current version.
ISaGRAF 5.2
- Workbench 419
Comparing Current and Previous Versions
When viewing the history of a project, configuration, resource, or POU, you can choose to compare a previously checked in version of the element with the current version or another checked-in version.
To compare a previous and current version of an element
"
In the History list of elements, select the version with which to compare, then click
Diff
.
The response indicates whether the files are different or identical. To navigate between
File Differences windows and the Workbench, you need to close the History window.
Accessing Details for a Previous Version
When viewing the history of a project, configuration, resource, or POU, you can access history details on a previously checked in version of the element. These details include the incremental version number, automatically assigned at check in, the date on which the version was checked in, and the identity of the user who checked in the version as well as an optional comment.
To access the history details of a previous version
"
In the History list of elements, select the version for which to access details, then click
Details
.
The History Details dialog is displayed showing the details for the selected version.
420
ISaGRAF 5.2
- User Guide
Creating a History Report
When viewing the history of a project, configuration, resource, or POU, you can choose to create a report of text format (.txt) on the history of the element. This report lists all or selected incremental checked-in versions, the dates of each check in, and the user that performed each check in. A report can also include the differences from one version to the next. Before sending a report to a file, you can choose to preview it.
To create a history report for an element
1.
In the History list of elements, click
Report
.
2.
In the History Report dialog, do the following:
To include version numbers, check-in dates, and check-in users, check
Include details
.
To include the differences between versions, check
Include differences
.
3.
To preview the report before sending it to file, click
Preview
.
4.
To send the report to file, click
OK
, then choose the location in which to save the file.
ISaGRAF 5.2
- Workbench 421
Language Reference
This Language Reference is a complete description of all available features for programming
PLC applications with this Workbench.
A description of the project architecture, variables and the syntax of each programming language is given, along with a full listing of the standard functions, function blocks and
Operators that can be called by programs.
ISaGRAF 5.2
- Language Reference 423
Project Architecture
A Project is composed of configurations. A configuration is a hardware platform composed of
one or more resources. A resource represents a target Virtual Machine. A resource is divided
into several programming units called POUs (Program Organization Unit). The POUs of a
resource are linked together in a tree-like architecture. POUs can be described using any of
SFC
,
FC
,
ST
,
IL
,
FBD
, or
LD
graphic or literal languages. POUs can be programs, functions
424
ISaGRAF 5.2
- User Guide
Programs
A Program is a logical programming unit, that describes operations between
variables
of the process. Programs describe either
sequential
or
cyclic
operations. Cyclic programs are
executed at each target system Cycle. The execution of sequential programs has a Dynamic
Behavior.
Programs are linked together in a hierarchy tree. Those placed on the top of the hierarchy are activated by the system.
Child-programs
(lower level of the hierarchy – only for SFC and FC:
Child SFC and FC Sub-programs) are activated by their father. A program can be described with any of the available graphic or literal languages:
Sequential Function Chart
(SFC)
Flow Chart
(FC)
Function Block Diagram
(FBD)
Ladder Diagram
(LD)
Structured Text
(ST)
Instruction List
(IL)
The same program cannot mix several languages, except for LD and FBD which can be combined into one diagram.
SFC programs and SFC child programs have dynamic behavior limits which are set at the
resource level. Whereas, SFC function blocks and SFC child function blocks each have their own maximum number of tokens which are set in their individual properties.
ISaGRAF 5.2
- Language Reference 425
Cyclic and Sequential Operations
The hierarchy of POUs is divided into three main sections or groups:
Program Section
Programs located in this part represent the target cycle. Note that inside this section, SFC and FC programs, which represent sequential operations, are grouped together.
Function Section
Set of functions that can be called by any program.
Function Block
Section
Set of function blocks that can be called by any program.
Programs before and after SFC and FC programs describe cyclic operations, and are not time dependent. They are called
cyclic programs
. SFC and FC programs describe sequential operations, where the time variable explicitly synchronizes basic operations. These are called
Sequential programs
. Cyclic programs are systematically executed at the beginning of each run time cycle. Main sequential programs (at the top of the hierarchy) are executed according to the SFC and FC dynamic behavior.
POUs of the "Functions" section are programs that can be called by any other program in the project. These are called
functions
. A function can call another function.
POUs of the "Function Block" section are programs that can be called by any other POU in the project. Thes are called
function blocks
. A function block section can call functions or other function blocks.
Main sequential programs must be described with the SFC or the FC language. Cyclic programs cannot be described with the SFC language, neither with the FC language. Any SFC program may own one or more SFC child. Any FC program can "call" one or more FC sub-program.
Functions can be described with the ST, LD, or FBD languages and function blocks can be described with the SFC, ST, LD, or FBD language. Functions and function blocks can be called
from actions or conditions of SFC or FC programs.
Programs located at the beginning of the cycle (before sequential programs) are typically used
to describe preliminary operations on input devices to build high level filtered variables. Such variables are frequently used by the programs of the sequential programs. Programs located at the end of the cycle (after sequential programs) are typically used to describe security
426
ISaGRAF 5.2
- User Guide
operations on the variables operated on by sequential programs, before sending values to output devices.
Child SFC POUs
Any SFC POU may control other SFC POUs. Such low level units are called
child SFC
. A child SFC POU is a parallel unit that can be started, killed, frozen, or restarted by its parent.
The
parent POU
and child POU must both be described with the SFC language. A child SFC
POU may have local variables.
When a parent POU starts a child SFC, it puts an
SFC token
(activates) into each initial step of the child. This command is described with the
GSTART
statement or with the name of the child with the S qualifier. When a parent POU kills a child SFC, it clears all the tokens existing in the steps of the child. Such a command is described with the
GKILL
statement or with the name of the child and the R qualifier. When a father POU starts a child, the father continues its execution.
When a parent POU freezes a child SFC, it clears all the tokens existing in the child, and keeps their position in memory. Such a command is described with the
GFREEZE
statement. When a parent POU restarts a frozen child SFC, it restores all the tokens cleared when the child was frozen. Such a command is described with the
GRST
statement.
Child SFC function block instances, as their SFC function block fathers, have a maximum
number of tokens, unlike SFC programs whose dynamic behavior limits are set at the resource
level. You specify the tokens limit for an SFC function block in its setting properties, accessed by selecting the block, then from the Edit menu, choosing Properties, then the Settings tab.
When using an SFC function block with an SFC child, you can access, for read-only purposes, the local values of the child from its father by entering the child’s name and the parameter in an action or transition’s code. For example, to access the
Local1
parameter of an SFC child named
FB_Child
, in an action or transition defined for the SFC function block father, you would write the following:
FB_Child.Local1
ISaGRAF 5.2
- Language Reference 427
FC Sub-Programs
Any FC program can call one or more FC program. The
FC Sub-program
execution is driven by its
parent program
. The parent FC program execution is suspended until the FC
Sub-program execution ends.
Parent program FC sub-program FC sub-program
428
ISaGRAF 5.2
- User Guide
Functions
A function execution is driven by its parent program. The execution of the parent program is suspended until the function ends:
Main program Function Function
Any program of any Section may call one or more functions. A function may have local variables. The ST, LD, FBD or IL languages can be used to describe a function.
Warning:
The system does not support recursivity during function calls. A run-time error occurs when a program of the "Functions" Section is called by itself or by one of its called functions. Furthermore, a function does not store the local value of its local variables. A function is not instantiated, therefore, cannot call function blocks.
The interface of a function must be explicitly defined, with a type and a unique name for each
of its calling (or Input Parameter) or return parameter (or Output Parameter). In order to
support the ST language convention, the return parameter must have the same name as the function. There is only one output parameter.
ISaGRAF 5.2
- Language Reference 429
The following information shows how to set the value of the return parameter in the body of a function, in the various languages:
ST:
IL:
FBD: assign the return parameter using its name (the same name as the function):
FunctionName := <expression>; the value of the current result (IL register) at the end of the sequence is stored in the return parameter:
LD 10
ADD 20 (* return parameter value = 30 *) set the return parameter using its name:
LD:
FunctionName use a coil symbol with the name of the return parameter:
FunctionName
430
ISaGRAF 5.2
- User Guide
Function Blocks
Function blocks can use the SFC, ST, LD, or FBD languages. Function blocks are instantiated meaning
local variables
of a function block are copied for each Instance. When calling a
function block in a program, you actually call the Instance of the block: the same code is called but the data used are the one which have been allocated for the Instance. Values of the variables
of the Instance are stored from one cycle to the other.
Function Block Implementation (* ST Programming *)
(* FB1 is a declared Instance of the SAMPLE Function Block *)
The interface of a function block must be explicitly defined, with a type and a unique name for
each of its calling (or Input Parameter) or return parameters (or output parameters). A function
block can have more than one output parameter.
The following information shows how to set the value of an output parameter in the body of a function block, in the various languages:
ST:
IL: assign the output parameter using its name concatenated with the function block name
FunctionBlockName.OutputParaName := <expression>; use LD and ST operator:
LD FunctionBlockName.OutputParaName
ST 20 (* value of Parameter = 20 *)
ISaGRAF 5.2
- Language Reference 431
FBD: set the return parameter using its name:
OutputParaName
LD: use a coil symbol with the name of the return parameter:
OutputParaName
Warning:
When you need a loop in your function block, you must use local variable before doing the loop.
This will not work: This is OK:
SFC function block instances, as their SFC child blocks, have a maximum number of tokens,
unlike SFC programs whose dynamic behavior limits are set at the resource level. You specify
the tokens limit for an SFC function block in its setting properties, accessed by selecting the block, then from the Edit menu, choosing Properties, then the Settings tab.
432
ISaGRAF 5.2
- User Guide
Description Language
A program can be described with any of the following graphic or literal languages:
Sequential Function Chart (SFC) for high level operations
Flow Chart (FC) for high level operations
Function Block Diagram (FBD) for cyclic complex operations
Ladder Diagram (LD) for Boolean operations only
Structured Text (ST) for any cyclic operations
Instruction List (IL) for low level operations
The IEC 61499 distribution method is also available to describe programs.
A program cannot contain multiple languages. However, you can combine FBD and LD in a single program. The language used to describe a program is chosen when creating the program and cannot be changed.
ISaGRAF 5.2
- Language Reference 433
Execution Rules
The system is Synchronous. All operations are triggered by a clock. The basic duration of the
clock is called the cycle timing:
1.
Scan input variables
2.
Consume bound variables
3.
Execute POUs
4.
Produce bound variables
5.
Update output devices
Wait
Programmed Cycle Time
In the case where bindings (Data Links between resources) have been defined, variables
consumed by this resource are updated after the inputs are scanned, and the variables produced to other resources are "sent" before updating the outputs.
If a cycle time is programmed, the virtual machine waits until this time has elapsed before
starting the execution of a new cycle. The POUs execution time varies depending upon the
number of active steps in SFC Programs and on instructions such as Jump, IF and Return…
434
ISaGRAF 5.2
- User Guide
Common Objects
These are main features and common
objects
of the programming data base. Such objects can
be used in any POU (Program Organization Unit: programs, functions or function blocks)
written with any of the
IEC 61499, SFC
,
FC
,
FBD
,
IL
,
ST
, or
LD
languages.
Data Types
Any constant, expression, or variable used in a POU (written in any language) must be
characterized by a type. Type coherence must be followed in graphic operations and literal statements.
Types are known by any resource of a Project; types have a common Scope. These types are:
User Types (based on standard IEC 61131-3 types)
Standard IEC 61131-3 Types
You can program objects using 18 standard IEC 61131-3 types:
BOOL: logic (true or false) value
SINT: short integer continuous value (8 bit)
USINT: unsigned short integer continuous value (8 bit)
BYTE: byte value (8 bit)
INT: single integer continuous value (16 bit)
UINT: unsigned single integer continuous value (16 bit)
WORD: word value (16 bit)
ISaGRAF 5.2
- Language Reference 435
DINT: double integer continuous value (32 bit)
UDINT: unsigned double integer continuous value (32 bit)
DWORD: double word value (32 bit)
LINT: long integer continuous value (64 bit)
ULINT: unsigned long integer continuous value (64 bit)
LWORD: long word value (64 bit)
REAL: real (floating) continuous value (32 bit)
LREAL: long real (floating) continuous value (64 bit)
TIME: time values less than one day; these value types cannot store dates (32 bit)
DATE: date values (32 bit)
STRING: character string having a defined
size
, representing the maximum number of characters the string can contain. For example, to define
MyString
as a string containing
10 characters, enter
MyString(10)
. For information on using string variables, see
Based on the above standard IEC 61131-3 types, you can define new user types. Furthermore, you can define arrays or structures using standard IEC 61131-3 types, arrays, or other user types.
When creating a variable, a dimension can be given to define an array. The following example shows the
MyVar
variable of type BOOL having a dimension defined as follows:
[1..10]
FOR i = 1 TO 10 DO
MyVar[i] := FALSE;
END_FOR;
436
ISaGRAF 5.2
- User Guide
User Types: Arrays
You can define arrays of standard IEC 61131-3 types or user types. An array has one or more
dimension
. When an array is defined, a variable can be created with this type and a structure can have a field with this type. Array dimensions are positive DINT constant expressions and array indexes are DINT constant expressions or variables.
Note:
Arrays must be declared in the Dictionary View before using them in Functional Block
Diagrams (FBD).
Example
1. One-dimensional array
:
MyArrayType is an array of 10 BOOL. Its dimension is defined as follows: [1..10].
MyVar is of type MyArrayType.
Ok := MyVar[4];
2. Two-dimensional array
:
MyArrayType2 is an array of DINT. It has two dimensions defined as follows:
[1..10,1..3]
MyVar2 is of type MyArrayType2
MyVar2[1,2] := 100;
3. Array of an array
:
MyVar3 is an array of MyArrayType; Its dimension is defined as follows [1..3]
FOR I := 1 TO 3 DO
FOR J := 1 TO 10 DO
MyVar3[I][J] := FALSE;
END_FOR;
END_FOR;
ISaGRAF 5.2
- Language Reference 437
User Types: Structures
Users can define structures using standard IEC 61131-3 types or user types. A structure is
composed of sub-entries called
Fields
. When a structure is defined, a variable can be created with this type.
Example
MyStruct1 is composed of:
Field1 which is BOOL
Field2 which is DINT
MyStruct2 is composed of:
Field1 which is DINT
Field2 which is BOOL
Field3 which is an array of 10 DINT
Field4 which is of type MyStruct1
MyVar of type MyStruct2 can be used as follows:
Value1 := MyVar.Field1; (* Value1 is of type DINT *)
Ok1 := MyVar.Field2; (* Ok1 is of type BOOL *)
Tab[2] := MyVar.Field3[5]; (* Tab is an array of DINT *)
Value2 := MyVar.Filed3[8]; (* Value2 is of type DINT *)
Ok2 := MyVar.Field4.Field1; (* Ok2 is of type BOOL *)
438
ISaGRAF 5.2
- User Guide
Constant Expressions
Constant expressions
are relative to one type. The same notation cannot be used to represent constant expressions of different types.
Boolean Constant Expressions
ISaGRAF
targets evaluate all parts of Boolean expressions. Whereas, the IEC 61131-3 standard states that Boolean expressions may be evaluated only to the extent necessary to determine the resultant value.
In the following example, according to the standard, if B is zero then the first expression
(B <> 0)
is false and the second expression
(A/B > 0)
is not performed.
ISaGRAF
targets perform the second expression
(A/B > 0)
, a division by zero occurs, and the state of the resource switches to error.
if ((B <> 0) and (A/B > 0)) then
GREATER := true; else
GREATER := false; end_if;
There are only two Boolean constant expressions:
TRUE
is equivalent to the integer value 1
FALSE
is equivalent to the integer value 0
"True" and "False" keywords are not case-sensitive.
ISaGRAF 5.2
- Language Reference 439
Short Integer Constant Expressions
Short integer constant expressions represent signed integer (8 bit) values: from
-128 to +127
Short integer constants may be expressed with one of the following
Bases
. Short integer constants must begin with a
Prefix
that identifies the Bases used:
Base Prefix
DECIMAL (none)
HEXADECIMAL "16#"
OCTAL
BINARY
"8#"
"2#"
Example
19
16#A1
8#28
2#0101_0101
The underscore character ('_') may be used to separate groups of digits. It has no particular significance other than to improve constant expression readability.
440
ISaGRAF 5.2
- User Guide
Unsigned Short Integer and BYTE Constant Expressions
Unsigned short integer and BYTE constant expressions represent unsigned integer (8 bit) values: from
0 to 255
Short integer and BYTE constants may be expressed with one of the following
Bases
. These constants must begin with a
Prefix
that identifies the Bases used:
Base Prefix
DECIMAL (none)
HEXADECIMAL "16#"
OCTAL
BINARY
"8#"
"2#"
Example
19
16#A1
8#28
2#0101_0101
The underscore character ('_') may be used to separate groups of digits. It has no particular significance other than to improve constant expression readability.
ISaGRAF 5.2
- Language Reference 441
Integer Constant Expressions
Integer constant expressions represent signed integer (16 bit) values: from
-32768 to 32767
Integer constants may be expressed with one of the following
Bases
. Integer constants must begin with a
Prefix
that identifies the Bases used:
Base Prefix
DECIMAL (none)
HEXADECIMAL "16#"
OCTAL
BINARY
"8#"
"2#"
Example
-260
16#FEFC
8#177374
2#0101_0101_0101_0101
The underscore character ('_') may be used to separate groups of digits. It has no particular significance other than to improve constant expression readability.
442
ISaGRAF 5.2
- User Guide
Unsigned Integer and WORD Constant Expressions
Unsigned integer and WORD constant expressions represent unsigned integer (16 bit) values: from
0 to 65535
Unsigned integer and WORD constants may be expressed with one of the following
Bases
.
These constants must begin with a
Prefix
that identifies the Bases used:
Base Prefix
DECIMAL (none)
HEXADECIMAL "16#"
OCTAL
BINARY
"8#"
"2#"
Example
+33000
16#80E8
8#100350
2#0101_0101_0101_0101
The underscore character ('_') may be used to separate groups of digits. It has no particular significance other than to improve constant expression readability.
ISaGRAF 5.2
- Language Reference 443
Double Integer Constant Expressions
Double integer constant expressions represent signed double integer (32 bit) values: from
-2147483648
to
+2147483647
Double integer constants may be expressed with one of the following
Bases
. Double integer constants must begin with a
Prefix
that identifies the Bases used:
Base
DECIMAL
HEXADECIMAL
OCTAL
BINARY
Prefix
(none)
"16#"
"8#"
"2#"
Example
-908
16#1A2B3C4D
8#1756402
2#1101_0001_0101_1101_0001_0010_1011_1001
The underscore character ('
_
') may be used to separate groups of digits. It has no particular significance other than to improve constant expression readability.
444
ISaGRAF 5.2
- User Guide
Unsigned Double Integer and Double Word Constant
Expressions
Unsigned double integer and Double Word constant expressions represent unsigned double integer (32 bit) values: from
0 to 4294967295
Double integer and double word constants may be expressed with one of the following
Bases
.
Double integer and double word constants must begin with a
Prefix
that identifies the
Bases used:
Base
DECIMAL
HEXADECIMAL
OCTAL
BINARY
Prefix
(none)
"16#"
"8#"
"2#"
Example
+908
16#1A2B3C4D
8#1756402
2#1101_0001_0101_1101_0001_0010_1011_1001
The underscore character ('
_
') may be used to separate groups of digits. It has no particular significance other than to improve constant expression readability.
ISaGRAF 5.2
- Language Reference 445
Long Integer Constant Expressions
Long integer constant expressions represent signed long integer (64 bit) values: from
-9223372036854775808 to 9223372036854775807
Long integer constants may be expressed with one of the following
Bases
. Long integer constants must begin with a
Prefix
that identifies the Bases used:
Base
DECIMAL
HEXADECIMAL
OCTAL
BINARY
Prefix
(none)
"16#"
"8#"
"2#"
Example
-908
16#1A2B3C4D
8#1756402
2#1101_0001_0101_1101_0001_0010_1011_1001_
1101_0001_0101_1101_0001_0010_1011_1001
The underscore character ('
_
') may be used to separate groups of digits. It has no particular significance other than to improve constant expression readability.
446
ISaGRAF 5.2
- User Guide
Unsigned Long Integer and Long Word Constant
Expressions
Unsigned long integer and long word constant expressions represent unsigned long integer (64 bit) values: from
0 to 18446744073709551615
Unsigned long integer and long word constants may be expressed with one of the following
Bases
. Long integer and long word constants must begin with a
Prefix
that identifies the
Bases used:
Base
DECIMAL
HEXADECIMAL
OCTAL
BINARY
Prefix
(none)
"16#"
"8#"
"2#"
Example
+908
16#1A2B3C4D
8#1756402
2#1101_0001_0101_1101_0001_0010_1011_1001_
1101_0001_0101_1101_0001_0010_1011_1001
The underscore character ('
_
') may be used to separate groups of digits. It has no particular significance other than to improve constant expression readability.
ISaGRAF 5.2
- Language Reference 447
Real Constant Expressions
Real constant expressions can be written with either
Decimal
or
Scientific
representation. The decimal point ('.') separates the Integer and Decimal parts. The decimal point must be used to differentiate a Real constant expression from an Integer one. The scientific representation uses the letter 'E' to separate the mantissa part and the exponent. The exponent part of a real scientific expression must be a signed integer value from -37 to +37. A real variable has six significant digits.
Example
3.14159
+1.0
-789.56
-1.0E+12
1.0E-15
+1.0E-37
The expression "
123
" does not represent a Real constant expression. Its correct real representation is "
123.0
".
448
ISaGRAF 5.2
- User Guide
Long Real Constant Expressions
Long real constant expressions can be written with either
Decimal
or
Scientific
representation.
The decimal point ('.') separates the Integer and Decimal parts. The decimal point must be used to differentiate a Real constant expression from an Integer one. The scientific representation uses the letter 'E' to separate the mantissa part and the exponent. The range of a real scientific expression must be a signed integer value from 1.7E -308 to 1.7E +308. A long real variable has 15 significant digits.
Example
3.14159
+1.0
-789.56
-1.0E+12
1.0E-15
+1.0E-37
The expression "
123
" does not represent a long real constant expression. Its correct real representation is "
123.0
".
ISaGRAF 5.2
- Language Reference 449
Timer Constant Expressions
Timer constant expressions represent time values from 0 to 1193h2m47s294ms. The lowest allowed unit is a millisecond. Standard time units used in constant expressions are:
Hour
Minute
Second
Millisecond
The "h" letter must follow the number of hours
The "m" letter must follow the number of minutes
The "s" letter must follow the number of seconds
The "ms" letters must follow the number of milliseconds
The time constant expression must begin with "
T#
" or "
TIME#
" prefix. Prefixes and unit letters are not case sensitive. Some units may not appear.
Example
T#1H450MS
1 hour, 450 milliseconds
time#1H3M
1 hour, 3 minutes
The expression "0" does not represent a time value, but an Integer constant.
450
ISaGRAF 5.2
- User Guide
Date Constant Expressions
Date constant expressions represent date values in the year-month-day format, separated by hyphens. Possible date constant expressions range from 1970-01-01 to 2038-01-18 GMT.
The date constant expression must begin with "
D#
" or "
DATE#
" prefix. Prefixes and unit letters are not case sensitive.
Example
D#2005-02-20 date#2005-02-20
String Constant Expressions
String constant expressions represent character strings. Characters must be preceded by a quote and followed by an apostrophe. For example:
'THIS IS A MESSAGE'
Warning:
The apostrophe '
'
' character cannot be used within a string constant expression. A string constant expression must be expressed on one line of the program source code. Its length cannot exceed 255 characters, including spaces.
Empty string constant expression is represented by two apostrophes, with no space or tab character between them:
'' (* this is an empty string *)
The dollar ('
$
') special character, followed by other special characters, can be used in a string constant expression to represent a non-printable character:
Sequence
$$
$'
Meaning
'$' character apostrophe
ASCII (hex)
16#24
16#27
Example
'I paid $$5 for this'
'Enter $'Y$' for YES'
ISaGRAF 5.2
- Language Reference 451
$L
$R
$N
$P
$T
$hh (*) line feed carriage return new line new page tabulation any character
16#0a
16#0d
16#0d0a
16#0c
16#09
16#hh
'next $L line'
' llo $R He'
'This is a line$N'
'lastline $P first line'
'name$Tsize$Tdate'
'ABCD = $41$42$43$44'
(*)
"
hh
" is the hexadecimal value of the ASCII code for the expressed character.
452
ISaGRAF 5.2
- User Guide
Variables
Variables
can be
LOCAL
to one program or
GLOBAL
to a resource. Local variables can be
used by one program only. Global variables can be used in any program of the resource. Local
or Global information is called the Scope
of the variable
.
Variable names
must conform to the following rules:
Names cannot exceed 128 characters
The first character must be a letter
The following characters can be letters, digits or the underscore character
C
D
E
F
G
I
A
B
Reserved Keywords
A list of the reserved keywords is shown below. Such Identifiers cannot be used to name a POU
or a variable:
ABS, ACOS, ADD, ANA, AND, AND_MASK, ANDN, ARRAY, ASIN, AT,
BCD_TO_BOOL, BCD_TO_INT, BCD_TO_REAL, BCD_TO_STRING,
BCD_TO_TIME, BOO, BOOL, BOOL_TO_BCD, BOOL_TO_INT,
BOOL_TO_REAL, BOOL_TO_STRING, BOOL_TO_TIME, BY, BYTE,
CAL, CALC, CALCN, CALN, CALNC, CASE, CONCAT, CONSTANT, COS,
DATE, DATE_AND_TIME, DELETE, DINT, DIV, DO, DT, DWORD,
ELSE, ELSIF, EN, END_CASE, END_FOR, END_FUNCTION, END_IF,
END_PROGRAM, END_REPEAT, END_RESSOURCE, END_STRUCT,
END_TYPE, END_VAR, END_WHILE, ENO, EQ, EXIT, EXP, EXPT,
FALSE, FIND, FOR, FUNCTION,
GE, GFREEZE, GKILL, GRST, GSTART, GSTATUS, GT,
IF, INSERT, INT, INT_TO_BCD, INT_TO_BOOL, INT_TO_REAL,
INT_TO_STRING, INT_TO_TIME,
ISaGRAF 5.2
- Language Reference 453
U
V
O
P
R
J
L
M
N
S
T
W
X
JMP, JMPC, JMPCN, JMPN, JMPNC,
LD, LDN, LE, LEFT, LEN, LIMIT, LINT, LN, LOG, LREAL, LT, LWORD,
MAX, MID, MIN, MOD, MOVE, MSG, MUL, MUX,
NE, NOT,
PROGRAM
R, READ_ONLY, READ_WRITE, REAL, REAL_TO_BCD, REAL_TO_BOOL,
REAL_TO_INT, REAL_TO_STRING, REAL_TO_TIME, REPEAT, REPLACE,
RESSOURCE, RET, RETAIN, RETC, RETCN, RETN, RETNC, RETURN,
S, SEL, SHL, SHR, SIN, SINT, SQRT, ST, STN, STRING, STRING_TO_BCD,
STRING_TO_BOOL, STRING_TO_INT, STRING_TO_REAL,
STRING_TO_TIME, STRUCT, SUB, SUB_DATE_DATE, SYS_ERR_READ,
SYS_ERR_TEST, SYS_INITALL, SYS_INITANA, SYS_INITBOO,
SYS_INITTMR, SYS_RESTALL, SYS_RESTANA, SYS_RESTBOO,
SYS_RESTTMR, SYS_SAVALL, SYS_SAVANA, SYS_SAVBOO,
SYS_SAVTMR, SYS_TALLOWED, SYS_TCURRENT, SYS_TMAXIMUM,
SYS_TOVERFLOW, SYS_TRESET, SYS_TWRITE, SYSTEM,
TAN, TASK, THEN, TIME, TIME_OF_DAY, TIME_TO_BCD,
TIME_TO_BOOL, TIME_TO_INT, TIME_TO_REAL, TIME_TO_STRING,
TMR, TO, TOD, TRUE, TYPE,
UDINT, UINT, ULINT, UNTIL, USINT,
VAR, VAR_ACCESS, VAR_EXTERNAL, VAR_GLOBAL, VAR_IN_OUT,
VAR_INPUT, ,VAR_OUTPUT
WHILE, WITH, WORD
All keywords beginning with an underscore ('_') character are internal keywords and must not be used in textual instructions.
454
ISaGRAF 5.2
- User Guide
Directly Represented Variables
The system enables the use of directly represented variables in the source of the programs to
represent a free Channel. Free Channels are the ones which are not linked to a declared I/O variable. The identifier of a directly represented variable always begins with "%" character.
The naming conventions of a directly represented variable for a channel of a single I/O device.
"
s
" is the slot number of the I/O device. "
c
" is the number of the Channel:
%IXs.c
free Channel of a Boolean input I/O device
%IBs.c
free Channel of a Short integer, Unsigned short integer, or BYTE input I/O device
%IWs.c
free Channel of an Integer, Unsigned integer, or WORD input I/O device
%IDs.c
%ILs.c
free Channel of a Double integer, Unsigned double integer, Double word, or
DATE input I/O device free Channel of a Long integer, Unsigned long integer, Long word, or Long real input I/O device free Channel of a Real input I/O device
%IRs.c
%ITs.c
%ISs.c
free Channel of a Time input I/O device free Channel of a String input I/O device
%QXs.c
free Channel of a Boolean output I/O device
%QBs.c
free Channel of a Short Integer, Unsigned short integer, or BYTE output I/O device
%QWs.c
free Channel of an Integer, Unsigned integer, or WORD output I/O device
%QDs.c
free Channel of a Double integer, Unsigned double integer, Double word, or
DATE output I/O device
%QLs.c
free Channel of a Long integer, Unsigned long integer, Long word, or Long real output I/O device
%QRs.c
free Channel of a Real output I/O device
%QTs.c
%QSs.c
free Channel of a Time output I/O device free Channel of a String output I/O device
ISaGRAF 5.2
- Language Reference 455
The naming conventions of a directly represented variable for a Channel of a complex device.
"
s
" is the slot number of the device. "
b
" is the index of the single I/O device within the complex device. "
c
" is the number of the Channel:
%IXs.b.c
%IBs.b.c
%IWs.b.c
%IDs.b.c
%ILs.b.c
%IRs.b.c
%ITs.b.c
%ISs.b.c
%QXs.b.c
%QBs.b.c
%QWs.b.c
%QDs.b.c
%QLs.b.c
%QRs.b.c
%QTs.b.c
%QSs.b.c
free Channel of a Boolean input I/O device free Channel of a Short Integer, Unsigned short integer, or BYTE input I/O device free Channel of an Integer, Unsigned integer, or WORD input I/O device free Channel of a Double integer, Unsigned double integer, Double word, or
DATE input I/O device free Channel of a Long integer, Unsigned long integer, Long word, or Long real input I/O device free Channel of an Real input I/O device free Channel of a Time input I/O device free Channel of a String input I/O device free Channel of a Boolean output I/O device free Channel of a Short Integer, Unsigned short integer, or BYTE output I/O device free Channel of an Integer, Unsigned integer, or WORD output I/O device free Channel of a Double integer, Unsigned double integer, Double word, or
DATE output I/O device free Channel of a Long integer, Unsigned long integer, Long word, or Long real output I/O device free Channel of a Real output I/O device free Channel of a Time output I/O device free Channel of a String output I/O device
Example
%QX1.6
6th channel of the I/O device #1 (boolean output)
%ID2.1.7
7th channel of the I/O device #1 in the device #2 (integer input)
456
ISaGRAF 5.2
- User Guide
Information on Variables
All variables have an Attribute and a Direction.
Variables can have one of the following Attributes:
Free
Variable which can be used for reading or writing, with an initial value
Read
Read-only variable with an initial value
Write
Write-only variable with an initial value
They also have a direction:
Internal
Internal variable updated by the programs
Input
Variable connected to an input device (refreshed by the system)
Output
Variable connected to an output device
Note:
Some variables cannot be input or output (Timers for example). Each restriction is indicated in the corresponding section.
Variables of standard IEC 61131-3 types can be given an Initial Value. The default initial value
is 0 or FALSE. The initial value is the value of the variable when the Target starts the first
ISaGRAF 5.2
- Language Reference 457
Boolean Variables (BOOL)
Boolean means Logic. Such variables can take one of the Boolean values:
TRUE
or
FALSE
.
Boolean variables are typically used in Boolean expressions.
Short Integer Variables (SINT)
Short Integer variables are 8-bit signed integers from -128 to +127.
A
bit of a short integer
variable can be accessed using the following syntax:
MyVar.i
If MyVar is a short Integer.
MyVar.i is a Boolean. "i" must be a constant value from 0 to 7.
Unsigned Short Integer (USINT) or BYTE Variables
Unsigned Short Integer or BYTE variables are 8-bit unsigned integers from 0 to 255.
A
bit of an unsigned short integer
or
BYTE
variable can be accessed using the following syntax:
MyVar.i
If MyVar is an unsigned short integer or BYTE.
MyVar.i is a Boolean. "i" must be a constant value from 0 to 7.
458
ISaGRAF 5.2
- User Guide
Integer Variables (INT)
Integer variables are 16-bit signed integers from -32768 to 32767.
A
bit of an integer
variable can be accessed using the following syntax:
MyVar.i
If MyVar is an Integer.
MyVar.i is a Boolean. "i" must be a constant value from 0 to 15.
Unsigned Integer (UINT) or WORD Variables
Unsigned Integer or WORD variables are 16-bit unsigned integers from 0 to 65535.
A
bit of an unsigned integer
or
WORD
variable can be accessed using the following syntax:
MyVar.i
If MyVar is an unsigned integer or WORD.
MyVar.i is a Boolean. "i" must be a constant value from 0 to 15.
ISaGRAF 5.2
- Language Reference 459
Double Integer Variables (DINT)
Double Integer variables are 32-bit signed integers from -2147483648 to +2147483647.
A
bit of a double integer
variable can be accessed using the following syntax:
MyVar.i
If MyVar is an Integer.
MyVar.i is a Boolean. "i" must be a constant value from 0 to 31.
Unsigned Double Integer (UDINT) or Double Word
(DWORD) Variables
Unsigned Double Integer or Double Word variables are 32-bit unsigned integers from 0 to 4294967295.
A
bit of an unsigned double integer
or
double word
variable can be accessed using the following syntax:
MyVar.i
If MyVar is an unsigned double integer or double word.
MyVar.i is a Boolean. "i" must be a constant value from 0 to 31.
460
ISaGRAF 5.2
- User Guide
Long Integer Variables (LINT)
Long Integer variables are 64-bit signed integers from -9223372036854775808 to
9223372036854775807.
A
bit of a long integer
variable can be accessed using the following syntax:
MyVar.i
If MyVar is a long integer.
MyVar.i is a Boolean. "i" must be a constant value from 0 to 63.
Unsigned Long Integer (ULINT) or Long Word (LWORD)
Variables
Unsigned Long Integer or Long Word variables are 64-bit unsigned integers from 0 to 18446744073709551615.
A
bit of an unsigned long integer
or
long word
variable can be accessed using the following syntax:
MyVar.i
If MyVar is an unsigned long integer or long word.
MyVar.i is a Boolean. "i" must be a constant value from 0 to 63.
ISaGRAF 5.2
- Language Reference 461
Real Variables (REAL)
Real variables are standard IEEE 32-bit floating values (single precision).
1 sign bit + 23 mantissa bits + 8 exponent bits
The exponent value cannot be less than
-37
or greater than
+37
. A real variable has six significant digits.
Long Real Variables (LREAL)
Long Real variables are standard IEEE 64-bit floating values (double precision).
1 sign bit + 52 mantissa bits + 11 exponent bits
The value cannot be less than
1.7E -308
or greater than
1.7E +308
. A long real variable has 15 significant digits.
462
ISaGRAF 5.2
- User Guide
Timer Variables (TIME)
Timer means
clock
or
counter
. Such variables have time values and are typically used in Time expressions. A Timer value cannot exceed
1193h2m47s294ms
and cannot be negative. Timer variables are stored in 32 bit words. The internal representation is a positive number of milliseconds.
Date Variables (DATE)
Date variables have date values and are typically used in Date expressions. A Date value ranges from 1970-01-01 to 2038-01-18. Date variables are stored in 32 bit words. The internal representation is a positive number of seconds since 1970-01-01 at midnight GMT.
String Variables (STRING)
String variables contain character strings. The length of the string can change during process operations. The length of a string variable cannot exceed the capacity (maximum length) specified when the variable is declared. String capacity is limited to 255 characters excluding the terminating null character (0).
String variables can contain any character of the standard ASCII table (ASCII code from
0
to
255
). The null character (
0
) can exist in a character string, however, it indicates the end of the string.
Strings have a
size
representing the maximum number of characters that the string can contain.
For example, to define the
MyString
string containing 10 characters, you would write
MyString(10)
.
ISaGRAF 5.2
- Language Reference 463
Comments
Comments may be freely inserted in literal languages such as ST and IL. A comment must begin with the special characters "(*" and terminate with the characters "*)". Comments can be inserted anywhere in a ST program, and can be written on more than one line.
Example
counter := ivalue; (* assigns the main counter *)
(* this is a comment expressed on two lines *) c := counter (* you can put comments anywhere *) + base_value + 1;
Interleave comments cannot be used. This means that the "(*" characters cannot be used within a comment.
Warning:
The IL language only accepts comments as the last component of an instruction line.
464
ISaGRAF 5.2
- User Guide
Defined Words
The system allows the re-definition of constant expressions, true and false Boolean expressions, keywords or complex
ST
expressions. To achieve this, an identifier name, called a
defined word
, has to be given to the corresponding expression. Defined words have a
Common Scope: they can be used in any POU of any resource of the Project.
Example
YES is TRUE
PI is 3.14159
OK is (auto_mode AND NOT (alarm))
When such an equivalence is defined, its
identifier
can be used anywhere in an ST program to replace the attached expression. This is an example of ST programming using defines:
If OK Then angle := PI / 2.0; isdone := YES;
End_if;
Warning:
When the same identifier is defined twice with different ST equivalencies, the last defined expression is used. For example:
Define: means:
OPEN is FALSE
OPEN is TRUE
OPEN is TRUE
Naming defined words must conform to following rules: name cannot exceed 128 characters first character must be a letter following characters can be letters, digits or underscore ('_') character
ISaGRAF 5.2
- Language Reference 465
Warning:
A defined word can not use a defined word in its definition, for example, you can not have:
PI is 3.14159
PI2 is PI*2
Write the complete equivalence using constants or variables and operations:
PI2 is 6.28318
466
ISaGRAF 5.2
- User Guide
SFC Language
Sequential Function Chart (SFC)
is a graphic language used to describe
sequential operations
. The process is represented as a set of well defined
Steps
, linked by Transitions. A
Boolean Condition is attached to each Transition. A set of Actions are attached to each Step.
For programs, Conditions and Actions are detailed using three other languages: ST, IL, or LD.
For function blocks, Conditions and Actions are detailed using only two other languages: ST
or LD. From Conditions and Actions, any Function or Function Block in any language can be
called.
SFC Main Format
An SFC Program is a graphic set of Steps and Transitions, linked together by oriented
Links
.
Multiple connection Links are used to represent divergences and convergences. The basic graphic rules of the SFC are:
SFC Programs must have at least one Initial Step
A Step cannot be followed by another Step
A Transition cannot be followed by another Transition
ISaGRAF 5.2
- Language Reference 467
SFC Basic Components
The basic components (graphic symbols) of the SFC language are: Steps and Initial Steps,
Transitions, Oriented Links, and Jumps to a Step.
Steps and Initial Steps
A step is represented by a single square. Each step is referenced by a name, written in the step square symbol. The above information is called the level 1 of the step:
Reference Name
At run time, a token indicates that the step is active:
Active Step: Inactive Step:
The initial situation of an SFC program is expressed with initial steps. An initial step has a double bordered graphic symbol. A token is automatically placed in each initial step when the program is started.
Initial Step:
An SFC program must contain at least one initial step.
468
ISaGRAF 5.2
- User Guide
These are the attributes of a step. Such fields may be used in any of the other languages:
StepName.x
activity
of the Step (Boolean value)
StepName.t
activation
duration
of the Step (time value)
(where
StepName
is the name of the step)
For SFC function blocks, when reading a child active step or duration from a father:
ChildName.__S1.x activity
of the Step (Boolean value)
ChildName.__S1.t
activation
duration
of the Step (time value)
(where
ChildName
is the name of the child. Note that S1 is preceded by two underscore
(_)characters)
For details about ST extensions, see page 551.
ISaGRAF 5.2
- Language Reference 469
Transitions
Transitions are represented by a small horizontal bar that crosses the connection link. Each transition is referenced by a name, written next to the transition symbol. The above information is called the level 1 of the transition:
Reference Name
Oriented Links
Single lines are used to link steps and transitions. These are oriented links. When the orientation is not explicitly given, the link is oriented from the top to the bottom.
Explicit orientation from
Transistion GT11 to Step GS10
Implicit orientation from
Step GS10 to Transition
GT10
470
ISaGRAF 5.2
- User Guide
Jump to a Step
Jump symbols may be used to indicate a connection link from a transition to a step, without having to draw the connection line. The jump symbol must be referenced with the name of the destination step:
Jump to Step GS10
A Jump symbol cannot be used to represent a Link from a Step to a Transition.
Example
The following charts are equivalent:
ISaGRAF 5.2
- Language Reference 471
Divergences and Convergences
Divergences are multiple connection links from one SFC symbol (step or transition) to many other SFC symbols. Convergences are multiple connection links from more than one SFC symbols to one other symbol. Divergences and convergences can be single or double.
Single Divergences (OR)
A single divergence is a multiple link from one step to many transitions. It allows the active token to pass into one of a number of branches. A single convergence is a multiple link from many transitions to the same step. A single convergence is generally used to group the SFC branches which were started on a single divergence.
Single divergences and convergences are represented by single horizontal lines.
Single Divergence
Single Convergence
The conditions attached to the different Transitions at the beginning of a single divergence are
not implicitly exclusive
.
472
ISaGRAF 5.2
- User Guide
Example
(* SFC Program with single divergence and convergence *)
Normal OR divergence:
ISaGRAF 5.2
- Language Reference 473
Double Divergences (AND)
A double divergence is a multiple link from one transition to many steps. It corresponds to parallel operations of the process. A double convergence is a multiple link from many steps to the same transition. A double convergence is generally used to group the SFC branches started on a double divergence.
Double divergences and convergences are represented by double horizontal lines.
Double Divergence
Double Convergence
474
ISaGRAF 5.2
- User Guide
Example
(* SFC program with double divergence and convergence *)
ISaGRAF 5.2
- Language Reference 475
Actions within Steps
The level 2 of an SFC step is the detailed description of the actions executed during the step activity. This description is made by using SFC literal features, and other languages such as
Structured Text (
ST
) or Ladder Diagram (
LD
). The basic types of Actions are:
Boolean actions with Set, Reset or Non-Stored Qualifier.
List of instructions programmed in ST, LD or IL with Pulse or Non-Stored Qualifier
SFC Actions (management of SFC children) with Non-Stored Qualifier.
Several Actions (with same or different types) can be described in the same Step.
The special feature that enables the use of any of the other languages is calling Functions and
Function blocks (written in ST, LD, and FBD)
ISaGRAF
executes individual SFC steps in the following order:
1.
Step activation - beginning when the previous transition is cleared. During this period, defined action blocks are executed in the order of appearance.
2.
Step cycle - beginning when the step becomes active and ending when the step completes deactivation. During this period, defined action blocks are executed in the order of appearance.
3.
Step deactivation - ending when the following transition becomes active. During this period, defined action blocks other than Boolean (Boo) action blocks having the N qualifier are executed in the order of appearance. Boolean (Boo) action blocks are executed after all other action blocks.
476
ISaGRAF 5.2
- User Guide
Boolean Actions
Boolean Actions assign a Boolean Variable with the activity of the Step. The Boolean Variable can be an output or a memory Variable. It is assigned each time the Step activity starts or stops.
This is the meaning of the basic Boolean Actions:
N on a Boolean Variable
assigns the Step activity signal to the Variable
S on a Boolean Variable
sets the Variable to TRUE when the Step activity signal becomes TRUE
R on a Boolean Variable
resets the Variable to FALSE when the Step activity signal becomes TRUE
The Boolean Variable must be an OUTPUT or a MEMORY variable. The following SFC programming leads to the indicated behavior:
Qualifier
Variable Name (S10.X is the activity of Step S10)
ISaGRAF 5.2
- Language Reference 477
Pulse Actions
A pulse action is a list of instructions, which are
executed only once at the activation of the
Step: P1 Qualifier, or executed only once at the deactivation of the Step: P0 Qualifier
.
Instructions are written using the ST, IL or LD syntax.
The following shows the results of a pulse Action with the P1 Qualifier:
Step Activity
Execution
Example
Qualifier Action Name
Code
478
ISaGRAF 5.2
- User Guide
Non-stored Actions
A non-stored (normal) action is a list of ST, IL or LD instructions which are executed
at each
active
period of the step. Instructions are written according to the used language syntax. Non-stored actions have the "N" qualifier.
The following is the results of a non-stored Action:
Step Activity
Execution
Example
Qualifier Action Name
Code
ISaGRAF 5.2
- Language Reference 479
SFC Actions
An SFC action is a child SFC sequence, started or killed according to the change of the step activity signal. An SFC action can have the
N
(Non stored) Qualifier. This is the meaning of the action on SFC child:
N on a child
starts the child sequence when the Step becomes active, and kills the child sequence when the Step becomes inactive
The SFC sequence specified as an Action must be a
child SFC Program
of the program currently being edited.
Example
(* SFC Program using SFC Action *)
The main SFC Program is named
Father
having one SFC child, called
SeqMlx
. The SFC programming of the father SFC Program is:
Qualifier Child SFC Name
480
ISaGRAF 5.2
- User Guide
List of Instructions
Actions corresponding to several operations can be written as a program using ST, IL and LD
syntax. Such actions can have N, P0 or P1 qualifiers.
Calling Functions and Function Blocks
Functions (written in ST, LD, or FBD) or Function Blocks (written in SFC, ST, LD, or FBD)
or "C" Functions and "C" Function Blocks, can be directly
called from
an SFC action block, based on the syntax of the language used in the action block.
Detailed syntax can be found in the corresponding language section.
Example
(* SFC program with a Function call in an Action Block *)
Qualifier Action name
ST Code with Function Call
ISaGRAF 5.2
- Language Reference 481
Conditions Attached to Transitions
At each Transition, a Boolean expression is attached that conditions the clearing of the
Transition. The condition is usually expressed with ST or LD language. This is the Level 2 of the Transition. Ways to program a condition:
Conditions programmed in ST or LD
Calling Function from a Transition
Warning:
When no expression is attached to the Transition, the default condition is
TRUE
.
Condition Programmed in ST
The Structured Text (ST) language can be used to describe the condition attached to a
Transition. The complete expression must have Boolean type and may be terminated by a semi colon, according to the following syntax:
< boolean_expression > ;
The expression may be a TRUE or FALSE constant expression, a single input or an internal
Boolean Variable, or a combination of Variables that leads to a Boolean value.
Example
(* SFC Program with ST programming for Transitions *)
Condition name
ST Code
482
ISaGRAF 5.2
- User Guide
Condition Programmed in LD
The Ladder Diagram (LD) language can be used to describe the condition attached to a transition. The diagram is composed of only one rung with one coil. The coil value represents the transition's value.
Example
(* SFC Program with LD programming for transitions *)
Calling Functions from a Transition
Any Function (written in ST, LD, or FBD), or a "C" Function can be called to evaluate the
condition attached to a
Transition
, according to the following syntax in ST:
< function > ( ) ;
The value returned by the Function must be Boolean and yields the resulting condition: return value =
FALSE
-> condition is
FALSE
return value =
TRUE
-> condition is
TRUE
ISaGRAF 5.2
- Language Reference 483
Example
(* SFC program with function call for transitions *)
Condition name
ST Code with Function call
Note:
The syntax of Function call for LD and IL is given in the corresponding language section.
Calling Function Blocks from a Transition
It is not recommended to call a Function Block in an SFC conditionfor the following reasons:
A Function Block should be called at each Cycle, typically in a cyclic Program. For example, counting blocks make incremental operation at each Cycle, Trigger Blocks need to store value of a Boolean at each Cycle to test rising or falling edges…
An SFC condition is evaluated only when all its preceding Steps are active (not at each
Cycle)
484
ISaGRAF 5.2
- User Guide
SFC Execution Cycles
An SFC execution cycle consists of the following stages:
1.
SFC execution starts.
2.
For all SFC transitions, determine if these are clearable.
3.
Identify active steps.
4.
For each active step, execute its code.
5.
SFC execution ends.
For IEC 61499 programs, a loop of an execution control chart is equivalent to one SFC
execution cycle. For more details about the execution control chart cycles, see page 535.
Within the execution cycle, the dynamic behaviors of the SFC language are the following:
Initial situation
The
Initial Situation
is characterized by the
Initial Steps
which are, by definition, in the active state at the beginning of the operation.
At least one
Initial Step must be present in each SFC program.
Clearing of a transition
A transition has three properties: enabled/disabled, active/inactive, and clearable/non-clearable. A transition is enabled when all immediately preceding steps linked to its corresponding transition symbol are
active
, otherwise, the transition is disabled. A transition is active if its condition is True.
A transition is clearable if it is enabled and active at the same time. When a transition is clearable, the steps immediately preceding it become inactive and those immediately following it become active.
ISaGRAF 5.2
- Language Reference 485
Changing of state of active steps
The clearing of a transition simultaneously leads to the
active
state of the immediately following steps and to the inactive state of the immediately preceding steps. The code within a step is only executed if the step is active.
Simultaneous clearing of transitions
All transitions (of all SFC programs) that can be cleared (enabled and active), are simultaneously cleared.
486
ISaGRAF 5.2
- User Guide
SFC Program Hierarchy
The system enables the description of the vertical structure of SFC Programs. SFC Programs are organized in a
hierarchy tree
. Each SFC Program can control (start, kill...) other SFC
Programs. Such Programs are called
children
of the SFC Program which controls them. SFC
Programs are linked together into a main
hierarchy tree
, using a "
father - child
" relationship:
Father
Program
Child
Program
The basic rules implied by the hierarchy structure are:
SFC Programs which have no father are called "main" SFC Programs
Main SFC Programs are activated by the system when the application starts
A Program can have several child Programs
A child of a Program cannot have more than one father
A child Program can only be controlled by its father
A Program cannot control the children of one of its own children
ISaGRAF 5.2
- Language Reference 487
The basic actions that a father SFC Program can take to control its child Program are:
Start (
GSTART
)
Starts the child Program: activates each of its Initial Steps.
Children of this child Program are not automatically started.
Kill (
GKILL
)
Kills the child Program by deactivating each of its active Steps.
All the children of the child Program are also killed
.
Freeze (
GFREEZE
)
Deactivates each of the active Steps of the Program, and memorizes them so the program can be restarted. All the children of the child Program are also frozen.
Restart (
GRST
)
Restarts a frozen SFC Program by reactivating all the suspended Steps. Children of the Program are not automatically restarted.
Get status (
GSTATUS
)
Gets the current status (active, inactive or frozen) of a child
Program.
Refer to "SFC Actions" or to the ST sub-sections "GSTART" "GKILL" "GFREEZE" "GRST"
and "GSTATUS" for more details.
488
ISaGRAF 5.2
- User Guide
FC Language
Flow Chart (FC)
is a graphic language used to describe
sequential operations
. A Flow Chart diagram is composed of
actions
and
tests.
Between actions and test are
oriented links
representing data flow.
Actions and tests can be described with ST, LD or IL languages. Functions and Function blocks of any language (except SFC) can be called from actions and tests.
A Flow Chart program can call another Flow Chart program. The called FC program is a
sub-program
of the calling FC program.
FC Basic Components
The basic components of the Flow Chart language are:
beginning of chart ending of chart
ISaGRAF 5.2
- Language Reference 489
FC BEGIN
A "
Begin
" symbol must appear at the beginning of a Flow Chart program. It is unique and cannot be omitted. It represents the initial state of the chart when it is activated. Below is the drawing of a "Begin" symbol:
The "Begin" symbol always has a connection (on the bottom) to the other objects of the chart.
A flow chart is not valid if no connection is drawn from "Begin" to another object.
FC END
An "
End
" symbol must appear at the end of a Flow Chart program. It is unique and cannot be omitted. It represents the final state of the chart, when its execution has been completed. Below is the drawing of an "End" symbol:
The "End" symbol generally has a connection (on the top) to the other objects of the chart. A flow chart may have no connection to the "End" object (always looping chart). The "End" object is still visible at the bottom of the chart in this case.
490
ISaGRAF 5.2
- User Guide
FC Flow Links
A flow link is a line that represents a flow between two points of the diagram. A link is always terminated by an arrow. Below is the drawing of a flow link:
Example
Two links cannot be connected to the same source connection point.
ISaGRAF 5.2
- Language Reference 491
FC Actions
An
action
symbol represents actions to be performed. An action is identified by a number and a name. Below is the drawing of an "Action" symbol:
Two different objects of the same chart cannot have the same name or logical number.
Programming language for an action can be ST, LD or IL.
An action is always connected with links, one arriving to it, one starting from it.
FC Conditions
A
Condition
represents a Boolean
test
. A Condition is identified by a number and a name.
According to the evaluation of attached ST, LD or IL expression, the flow is directed to "YES" or "NO" path. Below are the possible drawings for a Condition symbol:
Two different objects of the same chart cannot have the same name or logical number.
492
ISaGRAF 5.2
- User Guide
The programming of a test is either: an expression in ST, or a single rung in LD, with no symbol attached to the unique Coil, or several instructions in IL. The IL register (or current result) is used to evaluate the
Condition.
When programmed in ST text, the expression may optionally be followed by a semi-colon.
When programmed in LD, the unique coil represents the condition value.
A condition equal to:
0 or FALSE directs the flow to NO
1 or TRUE directs the flow to YES
A test is always connected with an arriving link, and both forward connections must be defined.
ISaGRAF 5.2
- Language Reference 493
Other FC Components
In addition to basic components, more complex flow charts are built using
FC sub-programs
.
You can also use Connectors instead of flow links. This leads to more readable charts, when too many flow links "cross" many elements.
FC Sub-Program
The system enables the description of the vertical structure of FC programs. FC programs are organized in a
hierarchy tree
. Each FC program can call other FC programs. Such a program is called a
child program
of the FC program which calls them. FC programs which call FC sub-programs are called
father programs
. FC programs are linked together into a main hierarchy tree, using a "Father - Child" relation:
Father
Program
Child
Program
A
sub-program
symbol in a Flow Chart represents a call to a Flow Chart sub-program.
Execution of the calling FC program is suspended till the sub-program execution is complete.
A Flow Chart sub-program is identified by a number and a name, as other programs, Functions or Function Blocks. Below is the drawing of a "Sub-Program call" symbol:
Two different objects of the same chart cannot have the same logical number.
The basic rules implied by the FC hierarchy structure are:
FC programs which have no father are called
main FC programs
.
Main FC programs are activated by the system when the application starts
494
ISaGRAF 5.2
- User Guide
A program can have several child programs
A child of a program cannot have more than one father
A child program can be called only by its father
A program cannot call the children of one of its own children
The same sub-program may appear several times in the father chart.
A Flow Chart sub-program call represents the complete execution of the sub chart. The father chart execution is suspended during the child chart is performed.
The sub-program calling Blocks must follow the same Connection rules as the ones defined for an action.
FC I/O Specific Actions
An
I/O specific action
symbol represents actions to be performed. As other actions, an I/O specific action is identified by a number and a name. The same semantic is used on standard actions and I/O specific actions. The aim of I/O specific actions is only to make the chart more readable and to give focus on non-portable parts of the chart. Using I/O specific actions is an optional feature. The drawing of an "I/O Specific Action" symbol is:
I/O specific actions have exactly the same behavior as standard actions. This covers their properties, ST, LD or IL programming, and connection rules.
ISaGRAF 5.2
- Language Reference 495
FC Connectors
Connectors
are used to represent a link between two points of the diagram without drawing it.
A Connector is represented as a circle and is connected to the source of the flow. The drawing of the Connector is completed, on the appropriate side (depending on the direction of the data flow), by the identification of the target point (generally the name of the target symbol). Below is the standard drawing of a connector:
A Connector always targets a defined Flow Chart symbol. The destination symbol is identified by its logical number.
FC Comments
A
Comment
Block contains text that has no sense for the semantic of the chart. It can be inserted anywhere on an unused space of the Flow Chart document window, and is used to document the program. Below is the drawing of a "Comment" symbol:
496
ISaGRAF 5.2
- User Guide
FC Complex Structure Examples
This section shows
Complex Structure
examples that can be defined in a Flow Chart diagram.
Such Structures are combinations of basic objects linked together.
IF / THEN / ELSE
(1) place for "THEN" actions to be inserted
(2) place for "ELSE" actions to be inserted
REPEAT / UNTIL
(3) place for repeated actions to be inserted
WHILE / DO
(4) place for repeated actions to be inserted
ISaGRAF 5.2
- Language Reference 497
FC Dynamic Behavior
The execution of a Flow Chart diagram can be explained as follows:
The Begin symbol takes one Target Cycle
The End symbol takes one Target Cycle and ends the execution of the chart. After this symbol is reached, no more actions of the chart are executed.
The flow is broken each time an item (action, decision) is encountered that has already been reached in the same Cycle. In such a case the flow will continue on the next Cycle.
Note:
Contrary to SFC, an action is not a stable state.
FC Checking
Apart from attached ST, LD, or IL programming, some other syntactic rules apply to Flow
Chart itself. The following are the main rules:
All "connection" points of all symbols must be wired (connection to "End" symbol may be omitted)
All symbols must be linked together (no isolated part should appear)
All connectors should have valid destinations
498
ISaGRAF 5.2
- User Guide
FC Examples
Two examples of Flow Chart are provided.
A structured chart using IF/THEN/ELSE and REPEAT/UNTIL structures
This first example shows a structured chart using IF/THEN/ELSE and REPEAT/UNTIL
Structures:
ISaGRAF 5.2
- Language Reference 499
A non-structured chart using a Connector
This example shows a non-structured chart using a Connector. The use of Connectors in such a case avoid the drawing of very long links that could be hard to follow in the case of a large chart, when source and destination of a link cannot be visible together on the screen:
500
ISaGRAF 5.2
- User Guide
FBD Language
The
Functional Block Diagram
(
FBD
) is a graphic language. It allows the programmer to
build complex procedures by taking existing functions from the standard library or from the
function or function block section.
FBD Diagram Main Format
FBD diagram describes a function between
input variables
and
output variables
. A function is described as a set of elementary blocks. Input and output variables are connected to blocks by connection lines. An output of a block may also be connected to an input of another block.
Function
Inputs Outputs
An entire function operated by an FBD program is built with standard elementary
blocks
from the standard library or from the function or function block section. Each block has a fixed number of input connection points and a fixed number of output connection points. A block is represented by a single rectangle. The inputs are connected on its left border. The outputs are connected on its right border. An elementary block performs a single function between its inputs and its outputs. The name of the function to be performed by the block is written in its rectangle symbol. Each input or output of a block has a well defined type.
Function Name
Inputs Outputs
ISaGRAF 5.2
- Language Reference 501
Input variables of an FBD program must be connected to input connection points of blocks.
The type of each variable must be the same as the type expected for the associated input. An input for FBD diagram can be a Constant Expression, any internal or input variable, or an
output variable. For information on constant expressions, see page 439.
Output variables of an FBD program must be connected to output connection points of blocks.
The type of each variable must be the same as the type expected for the associated block output.
An output for FBD diagram can be any internal or output variable, or the name of the Function
(for functions only). When an output is the name of the currently edited function, it represents the assignment of the return value for the function (returned to the calling program).
Input and output variables, inputs and outputs of the blocks are wired together with connection lines, or
links
. Single lines may be used to connect two logical points of the diagram:
An input variable and an input of a block
An output of a block and an input of another block
An output of a block and an output variable
For information on variables, see page 457.
The connection is oriented, meaning that the line carries associated data from the left end to the right end. The left and right ends of the connection line must be of the same data type.
Multiple right connection, also called
divergence
can be used to broadcast an information from its left end to each of its right ends. All the ends of the connection must be of the same data type.
For information on data types, see page 435.
502
ISaGRAF 5.2
- User Guide
RETURN Statement
The "
<RETURN
"
>
keyword may occur as a diagram output. It must be connected to a Boolean output connection point of a block. The RETURN statement represents a
Conditional End
of the program: if the output of the box connected to the statement has the Boolean value
TRUE
, the end (remaining part) of the diagram is not executed.
Example
(* ST equivalence: *)
If auto_mode OR alarm Then
Return;
End_if; bo67 := (bi10 AND bi23) OR x_cmd;
ISaGRAF 5.2
- Language Reference 503
Jumps and Labels
Labels
and
jumps
are used to control the execution of the diagram. No other object may be connected on the right of a jump or label symbol. The following notation is used:
>>LAB
Jump to a label (label name is "LAB")
LAB:
Definition of a label (label name is "LAB")
If the connection line on the
left
of the jump symbol has the Boolean state
TRUE
, the execution of the program directly jumps to after the corresponding label symbol.
Example
(* IL Equivalence: *)
NOMODIF: ld or st ld ld and jmpc or st manual b1
NOMODIF input1 input2 result result valid cmd10
504
ISaGRAF 5.2
- User Guide
Boolean Negation
A single connection line with its right end connected to an input of a block can be terminated by a
Boolean negation
. The negation is represented by a small circle. When a Boolean negation is used, the left and right ends of the connection line must have the
BOOL
type.
Example
ISaGRAF 5.2
- Language Reference 505
Calling Functions and Function Blocks
The FBD language enables the
calling of functions or function blocks
Function Block is represented by a box. The name written in the box is the name of the function
or function blocks.
In the case of a function, the return value is the only output from the box. Function blocks can have more than one output.
Example
(* ST Equivalence – in ST, we have to define an intermediate variable: net_weight *) net_weight := Weighing (mode, delta); (* call function *)
If (net_weight = 0) Then Return; End_if; weight := net_weight + tare_weight;
506
ISaGRAF 5.2
- User Guide
LD Language
Ladder Diagram
(
LD
) is a graphic representation of Boolean equations, combining
Contacts
(input arguments) with
Coils
(output results). The LD language enables the description of tests and modifications of
Boolean
data by placing graphic symbols into the program chart. LD graphic symbols are organized within the chart exactly as an electric Contact diagram. LD diagrams are connected on the left side and on the right side to vertical
Power Rails
. These are the basic graphic components of an LD diagram:
Left vertical power rail
Right vertical power rail
Horizontal connection line
Vertical connection line
Multiple connection lines (all connected together)
Contact associated with a variable
Coil associated to an output or to an internal variable
ISaGRAF 5.2
- Language Reference 507
Power Rails and Connection Lines
An LD diagram is limited on the left and right side by vertical lines, named
left power rail
and
right power rail
respectively.
left power rail right power rail
LD diagram graphic symbols are connected to power rails or to other symbols by connection lines, or
links
. Connection lines are horizontal or vertical.
horizontal connection lines vertical connection lines vertical connection lines with OR meaning
Each line segment has a boolean state
FALSE
or
TRUE
. The Boolean state is the same for all the segments directly linked together. Any horizontal line connected to the left
vertical power rail
has the
TRUE
state.
508
ISaGRAF 5.2
- User Guide
Multiple Connections
The Boolean state given to a single horizontal connection line is the same on the left and on the right ends of the line. Combining horizontal and vertical connection lines enables the building of
multiple connections
. The Boolean state of the ends of a multiple connection follows logic rules.
A
multiple connection on the left
combines
more than one
horizontal lines connected on the
left
side of a vertical line, and
one
line connected on its
right
side. The Boolean state of the right end is the LOGICAL OR between all the left extremities.
(* Example of multiple LEFT connection *)
(* right end state is (v1 OR v2 OR v3) *)
A
multiple connection on the right
combines
one
horizontal line connected on the
left
side of a vertical line, and
more than one
line connected on its
right
side. The Boolean state of the left end is propagated into each of the right ends.
(* Example of multiple RIGHT connection *)
(* ST equivalence: *) output1 := input1; output2 := input1;
A
multiple connection on the left and on the right
combines
more than one
horizontal line connected on the
left
side of a vertical line, and
more than one
line connected on its right side.
The Boolean state of each of the right ends is the LOGICAL OR between all the left ends.
ISaGRAF 5.2
- Language Reference 509
(* Example of multiple LEFT and RIGHT connection *)
(* ST Equivalence: *) output1 := input1 OR input2; output2 := input1 OR input2; output3 := input1 OR input2;
Basic LD Contacts and Coils
Several symbols are available for input
contacts
:
Contact with Rising Edge Detection
Contact with Falling Edge Detection
Several symbols are available for output
coils
:
Coil with Rising Edge Detection
Coil with Falling Edge Detection
510
ISaGRAF 5.2
- User Guide
The name of the variable is written above any of these graphic symbols:
Name of the associated Boolean variable
Left Connection Right Connection
Direct Contact
A
Direct Contact
enables a
Boolean operation
between a
connection line
state and a
Boolean variable
.
Left Connection Right Connection
The state of the connection line on the right of the Contact is the Logical AND between the state of the left connection line and the value of the variable associated with the Contact.
Example
(* ST Equivalence: *) output1 := input1 AND input2;
ISaGRAF 5.2
- Language Reference 511
Inverted Contact
An
Inverted Contact
enables a
Boolean operation
between a
connection line
state and the
Boolean negation of a
Boolean variable.
Left Connection Right Connection
The state of the connection line on the right of the Contact is the Logical AND between the state of the left connection line and the
Boolean negation
of the value of the variable associated with the Contact.
Example
(* ST Equivalence: *) output1 := NOT (input1) AND NOT (input2);
512
ISaGRAF 5.2
- User Guide
Contact with Rising Edge Detection
A Contact with rising edge detection (positive) enables a Boolean operation between a
connection line state and the rising edge of a Boolean variable.
Left Connection Right Connection
The state of the connection line on the right of the contact is set to TRUE when the state of the connection line on the left is TRUE, and the state of the associated variable rises from FALSE to TRUE. It is reset to FALSE in all other cases.
Example
(* ST Equivalence: *) output1 := input1 AND (input2 AND NOT (input2prev));
(* input2prev is the value of input2 at the previous cycle *)
ISaGRAF 5.2
- Language Reference 513
Contact with Falling Edge Detection
A Contact with
detection (negative) enables a
Boolean operation
between a
connection line
state and the falling edge of a
Boolean variable
.
Left Connection Right Connection
The state of the connection line on the right of the Contact is set to
TRUE
when the state of the connection line on the left is
TRUE
, and the state of the associated variable
falls
from
TRUE to FALSE. It is reset to FALSE in all other cases.
Example
(* ST Equivalence: *) output1 := input1 AND (NOT (input2) AND input2prev);
(* input2prev is the value of input2 at the previous cycle
*)
514
ISaGRAF 5.2
- User Guide
Direct Coil
Direct Coils
enable a Boolean output of a connection line Boolean state.
Left Connection Right Connection
The associated variable is assigned with the Boolean
state of the left connection
. The state of the left connection is propagated into the right connection. The right connection may be
connected to the right vertical Power Rail. For information on variables, see page 457.
The associated Boolean variable must be OUTPUT or MEMORY.
The associated name can be the name of the proram (for Function only). This corresponds to
the assignment of the return value of the function.
Example
(* ST Equivalence: *) output1 := input1; output2 := input1;
ISaGRAF 5.2
- Language Reference 515
Inverted Coil
Inverted Coils
enable a Boolean output according to the Boolean negation of a connection line state.
Left Connection Right Connection
The associated variable is assigned with the Boolean
negation
of the
state of the left connection
. The state of the left connection is propagated into the right connection. Right connection may be connected to the right vertical power rail. For information on variables, see
The associated Boolean variable must be OUTPUT or MEMORY.
The associated name can be the name of the program (for Function only). This corresponds to
the assignment of the return value of the function.
Example
(* ST Equivalence: *) output1 := NOT (input1); output2 := input1;
516
ISaGRAF 5.2
- User Guide
SET Coil
"
Set" Coils
enable a Boolean output of a connection line Boolean state.
Left Connection Right Connection
The associated variable is SET TO TRUE when the boolean state of the left connection becomes TRUE. The output variable keeps this value until an inverse order is made by a
"RESET" coil. For information on variables, see page 457. The state of the left connection is
propagated into the right connection. Right connection may be connected to the right vertical power rail.
The associated Boolean variable must be OUTPUT or MEMORY.
Example
(* ST Equivalence: *)
IF input1 THEN output1 := TRUE;
END_IF;
IF input2 THEN output1 := FALSE;
END_IF;
ISaGRAF 5.2
- Language Reference 517
RESET Coil
"Reset" Coils enable Boolean output of a connection line Boolean state.
Left Connection Right Connection
The associated variable is RESET TO FALSE when the Boolean
state of the left connection
becomes
TRUE
. The output variable keeps this value until an inverse order is made by a "SET"
coil. For information on variables, see page 457. The state of the left connection is propagated
into the right connection. Right connection may be connected to the right vertical Power Rail.
The associated Boolean variable must be OUTPUT or MEMORY.
Example
(* ST Equivalence: *)
IF input1 THEN output1 := TRUE;
END_IF;
IF input2 THEN output1 := FALSE;
END_IF;
518
ISaGRAF 5.2
- User Guide
Coil with Rising Edge Detection
Coils with rising edge detection or "Positive" coils enable Boolean output of a connection line
Boolean state.
Left Connection Right Connection
The associated variable is set to
TRUE
when the Boolean
state of the left connection
rises from
FALSE to TRUE. The output variable resets to FALSE in all other cases. For information on
variables, see page 457. The state of the left connection is propagated into the right connection.
Right connection may be connected to the right vertical power rail.
The associated Boolean variable must be OUTPUT or MEMORY.
Example
(* ST Equivalence: *)
IF (input1 and NOT(input1prev)) THEN output1 := TRUE;
ELSE output1 := FALSE;
END_IF;
(* input1prev is the value of input1 at the previous cycle *)
ISaGRAF 5.2
- Language Reference 519
Coil with Falling Edge Detection
Coils with falling edge detection or "Negative" coils enable Boolean output of a connection
line Boolean state.
Left Connection Right Connection
The associated variable is set to
TRUE
when the Boolean
state of the left connection
falls from
TRUE to FALSE. The output variable resets to FALSE in all other cases. For information on
variables, see page 457. The state of the left connection is propagated into the right connection.
Right connection may be connected to the right vertical power rail.
The associated Boolean variable must be OUTPUT or MEMORY.
Example
(* ST Equivalence: *)
IF (NOT(input1) and input1prev) THEN output1 := TRUE;
ELSE output1 := FALSE;
END_IF;
(* input1prev is the value of input1 at the previous cycle *)
520
ISaGRAF 5.2
- User Guide
RETURN Statement
The
RETURN
label can be used as an output to represent a conditional end of the program.
No connection can be put on the right of a RETURN symbol.
If the
left connection
line has the
TRUE
Boolean state, the program ends without executing the equations entered on the following lines of the diagram.
When the LD program is a function, its name has to be associated with an output coil to set the return value (returned to the calling program).
Example
(* ST Equivalence: *)
If Not (manual_mode) Then RETURN; End_if; result := (input1 OR input3) AND input2;
ISaGRAF 5.2
- Language Reference 521
Jumps and Labels
Labels, conditional and unconditional jumps symbols, can be used to control the execution of the diagram. No connection can be put on the right of the label and jump symbol. The following notations are used:
>>LAB jump to label named "LAB"
LAB: definition of the label named "LAB"
If the
connection on the left
of the jump symbol has the TRUE Boolean state, the program execution is driven after the label symbol.
Example
(* IL Equivalence: *)
OTHER: ldn jmpc ld st jmp ld st
END: manual_mode
OTHER input1 result
END input2 result
(* end of program *)
522
ISaGRAF 5.2
- User Guide
BLOCKS in LD
Using the LD editor, you connect function boxes to Boolean lines. A function can actually be
an operator, a function block or a function. As all blocks do not have always a Boolean input
and/or a Boolean output, inserting blocks in an LD diagram leads to the addition of new parameters
EN, ENO
to the block interface.
The "EN" input
On some operators, functions or function blocks, the first input does not have Boolean data
type. As the first input must always be connected to the rung, another input is automatically inserted at the first position, called "
EN
". The block is executed only if the
EN
input is TRUE.
Below is the example of a comparison operator, and the equivalent code expressed in ST:
IF rung_state THEN q := (value1 > value 2);
ELSE q := FALSE;
END_IF;
(* continue rung with q state *)
The "ENO" output
On some operators, functions or function blocks, the first output does not have Boolean data
type. As the first output must always be connected to the rung, another output is automatically inserted at the first position, called "
ENO
". The
ENO
output always takes the same state as the first input of the block. Below is an example with AVERAGE function block, and the equivalent code expressed in ST:
AVERAGE(rung_state, Signal, 100);
OutSignal := AVERAGE.XOUT; eno := rung_state;
(* continue rung with eno state *)
ISaGRAF 5.2
- Language Reference 523
The "EN" and "ENO" parameters
On some cases, both
EN
and
ENO
are required. Below is an example with an arithmetic operator, and the equivalent code expressed in ST:
IF rung_state THEN result := (value1 + value2);
END_IF; eno := rung_state;
(* continue rung with eno state *)
524
ISaGRAF 5.2
- User Guide
IEC 61499 Language
The
IEC 61499
language is a distribution method enabling the distribution of individual IEC
61499 function blocks belonging to an IEC 61499 program across multiple resources. The
IEC 61499 standard function blocks are available with the IEC 61499 library.
In an
IEC 61499
project, you create programs into which you insert IEC 61499 basic function
blocks and composite function blocks.
Note:
The IEC 61499 implementation in
ISaGRAF
is based on the
Function blocks - Part 1:
Architecture
and
Function blocks - Part 2: Software Tools Requirements
documents available from the ANSI webstore.
ISaGRAF 5.2
- Language Reference 525
IEC 61499 Program Main Format
In IEC 61499 programs, IEC 61499 function blocks are distributed across resources. Inputs and outputs from these function blocks distributed between resources are connected with bindings. These bindings are automatically created. Inputs and outputs between function blocks must respect data types. For IEC 61499 function blocks, identifiers can only be literals or defined words.
Insertion of an IEC 61499 basic function block or composite function block into a program is
enabled following the declaration of an instance of the block in the Dictionary.
When splitting an IEC 61499 function block output to connect with two inputs,
ISaGRAF
automatically performs the split. Therefore, use of the E_SPLIT function block is not required.
Resources having an instance of an IEC 61499 function block display the IEC 61499 program in which the function block is defined in their window, from the link architecture view.
Therefore, a given IEC 61499 program can appear in multiple resource windows. Bindings between resources are displayed in the Binding List editor. The color of resource data links, displayed in the link architecture view, depends on the types of bindings using them: green for
526
ISaGRAF 5.2
- User Guide
IEC 61499 bindings, blue for IEC 61499 bindings and internal bindings, and black for internal bindings.
When adding an IEC 61499 function block instance in a resource for a given program, resource windows in the link architecture are automatically updated upon saving and closing the language editor.
IEC 61499 function blocks are distinct from IEC 61131-3 function blocks; An execution
control chart handles the events and algorithms handle the data. In
ISaGRAF
, IEC 61499 is implemented as either SFC (basic function blocks) or IEC 61499 FBD (composite function blocks). IEC 61499 function blocks have specific parameter types, for instance, event input and event output.
Basic function block type Execution control chart
In an execution control chart, individual items represent SFC elements: a box with a double outline indicates the initial step arrows indicate transitions
ISaGRAF 5.2
- Language Reference 527
boxes with a single outline indicate steps double boxes indicate generated outputs. The space on the left indicates an algorithm name when one is defined.
An IEC 61499 program is built with standard blocks from the IEC 61499 library and user-defined IEC 61499 function blocks.
The IEC 61499 editor displays IEC 61499 function block diagrams.
528
ISaGRAF 5.2
- User Guide
Basic IEC 61499 Function Block Format
Basic IEC 61499 function blocks are defined using SFC elements to develop their event control chart. The following example shows the E_Merge function block made up of an initial step, two transitions, and a step:
E_MERGE Event Control Chart
SFC Equivalent
LocalEventInput_EI1(EI1);
LocalEventInput_EI2(EI2);
(* gets the events *)
LocalEventInput_EI1.Trigger or
LocalEventInput_EI2.Trigger;
(* tests for an event *)
EOLocal:=EOLocal+1;(* processes the algorithm *)
EO:=EOLocal;(* generates the output event*)
When defining the parameters of basic IEC 61499 function blocks, a LocalEventInput instance
is automatically created for each argument having the event input type.
ISaGRAF 5.2
- Language Reference 529
Make sure to disregard all unsolicited events in an SFC diagram transition. Typically, a step in an SFC diagram is made up of two actions:
A P1 action initiating an event
An N action receiving an event corresponding to the previous initiated event
Therefore, in the P1 and N actions, you must correctly call
LocalEventInput_EI
where
EI
is the expected event. Also, the P1action must precede the N action.
530
ISaGRAF 5.2
- User Guide
Composite IEC 61499 Function Block Format
Composite IEC 61499 function blocks are defined using IEC 61499 FBD calling standard
IEC 61499 function blocks, basic function blocks, and composite function blocks to perform the required operations. You define composite function blocks in the IEC 61499 FBD editor.
A composite IEC61499 function block is like a function block network where nodes are basic and/or composite function blocks and their parameters and where branches are data connections and event connections.
The following example shows the E_CYCLE composite function block:
E_CYCLE Algorithm
IEC 61499 FBD Equivalent
ISaGRAF 5.2
- Language Reference 531
IEC 61499 Function Block Main Format
IEC 61499 function blocks are made up of event inputs and outputs as well as data inputs and outputs:
Event Inputs Event Outputs
Data Inputs Data Outputs
An IEC 61499 function block is represented by a box having an upper section representing the event control chart and a lower section representing the data process. Three names are indicated in the block: the instance name at the top, the function block name at the center, and the resource in which it is declared at the bottom.
532
ISaGRAF 5.2
- User Guide
The parameters for standard IEC 61499 function blocks are displayed in the dictionary with their equivalent
ISaGRAF
direction attribute. The E_TABLE function block shows the following directions for its inputs and outputs:
DT and N data inputs having the Input direction
START and STOP event inputs having the Event Input direction.
CV data output having the Output direction
EO event output having the Event Output direction
CTRL and DLY are the function block instances created to enable the calling of the
Standard IEC 61499 E_TABLE_CTRL and E_DELAY function blocks respectively
LocalEventInput_START and LocalEventInput_STOP are created automatically for the
START and STOP arguments of the function block.
Each function block argument having the event input direction is automatically assigned an
function block. For details on the LocalEventInput
ISaGRAF 5.2
- Language Reference 533
Implementation of the WITH Qualifier
.
ISaGRAF
automatically ensures the synchronization between data inputs and event inputs.The
IEC 61499 graphical representation of the E_TABLE function block below shows the DT and
N data inputs latched to the START event input and the CV data output latched to the EO event output.
ISaGRAF
automatically latches the CV data input to the EO event input.
IEC 61499 graphical representation of WITH qualifier joining inputs and outputs
534
ISaGRAF 5.2
- User Guide
Execution Control Chart Cycles
The execution cycle of an execution control chart consists of the following stages:
1.
Execution control chart starts.
2.
For all the SFC transitions, determine if these are clearable.
3.
Identify the active steps.
4.
For each active step, execute its code.
5.
Execution control chart ends.
For execution control charts, the SFC engine includes a protection mechanism preventing it
current cycle if it continued to encounter an active step in the diagram. It is assumed that the
SFC function block is actually an execution control chart designed to prevent such an occurence.
ISaGRAF 5.2
- Language Reference 535
Cycle Execution Time in IEC 61499 Programs
In IEC 61499 programs, total execution time depends on the cycle execution of multiple resources and the individual IEC 61499 function blocks. For instance, when using basic
IEC 61499 function blocks, the diagram consisting of FB1, FB2, FB3, and FB4 completes execution after a minimum of four complete cycles of each resource. Each resource cycle executes the steps of an event control chart until reaching a false transition.
The following formula expresses the minimum total time required to execute one cycle of the above program:
Total time = cycle time (ResourceA) X 2 + cycle time (ResourceB) X 2
536
ISaGRAF 5.2
- User Guide
ST Language
ST
(
Structured Text
) is a high level structured language designed for automation processes.
This language is mainly used to implement complex procedures that cannot be easily expressed with graphic languages. ST language can be used for the description of the actions within the
Steps and conditions attached to the Transitions of the SFC or the Actions and Tests of the FC
Language.
ST Main Syntax
An ST program is a list of ST
statements
. Each statement ends with a semi-colon (
";"
) separator. Names used in the source code (variable identifiers, constants, language keywords...) are separated with
inactive separators
(space character, end of line or tab stops) or by
active separators
, which have a well defined significance (for example, the
">"
separator indicates a "greater than" comparison.
Comments
may be freely inserted into the text. A comment must begin with
"(*"
and ends with
"*)"
. These are basic types of ST statements: assignment statement (variable := expression;)
selection statements (IF, THEN, ELSE, CASE...) iteration statements (FOR, WHILE, REPEAT...) control statements (RETURN, EXIT...) special statements for links with other languages such as
SFC
When entering ST syntax, basic coding is black while other items are displayed using color:
Keywords are pink
Numbers are brown
Comments are green
ISaGRAF 5.2
- Language Reference 537
Inactive separators may be freely entered between active separators, constant expressions and identifiers. ST inactive separators are:
Space
(blank) character,
Tabs
and
End of line
character.
Unlike line-formatted languages such as IL, end of lines may be entered anywhere in the program. The rules shown below should be followed when using inactive separators to increase
ST program readability:
Do not write more than one statement on one line
Use tabs to indent complex statements
Insert comments to increase readability of lines or paragraphs
Line numbers are displayed at the left of each programming line. The font and background color of the line numbers is the same font used by the ST editor. When long lines are wrapped, the line number is not incremented.
Example
Low Readability
imax := max_ite; cond := X12; if not(cond (* alarm *) then return; end_if; for i (* index *) := 1 to max_ite do if i <> 2 then Spcall(); end_if; end_for;
(* no effect if alarm *)
High Readability
(* imax : number of iterations *)
(* i: FOR statement index *)
(* cond: process validity *) imax := max_ite; cond := X12; if not (cond) then return; end_if;
(* process loop *) for i := 1 to max_ite do if i <> 2 then
Spcall (); end_if; end_for;
538
ISaGRAF 5.2
- User Guide
Expressions and Parentheses
ST expressions combine ST
operators
and variable or constant
operands
. For each single expression (combining operands with one ST operator), the type of the operands must be the same. This single expression has the same data type as its operands, and can be used in a more complex expression. For example:
(boo_var1 AND boo_var2) not (boo_var1)
(sin (3.14) + 0.72)
(t#1s23 + 1.78) has BOOL type has BOOL type has REAL type is an invalid expression
For information on data types, see page 435.
Parentheses
are used to isolate sub parts of the expression, and to explicitly order the priority of the operations. When no parentheses are given for a complex expression, the operation sequence is implicitly given by the default
priority
between ST operators. For example:
2 + 3 * 6 equals 2+18=20
(2 + 3) * 6 equals 5*6=30 because multiplication operator has a higher priority priority is given by parenthesis
ISaGRAF 5.2
- Language Reference 539
Functions or Function Block Calls
Standard ST function calls may be used for each of following objects:
Functions and function blocks written in IEC 61131-3 languages
"C" functions and function blocks
Calling Functions
Calling Functions from ST:
Name:
Meaning:
name of the called function written in IEC 61131-3 language or in "C"
calls a ST, IL, LD or FBD Functions or a "C" function and gets its return
value
<
variable
>
:=
<
funct
>
(<par1
>
,
... <
parN
>
); Syntax:
Operands:
The type of return value and calling parameters must follow the interface defined for the function.
Return value:
value returned by the function
Function calls may be used in any expression.
Example
Example1: IEC 61131-3 function call
(* Main ST program *)
(* gets an integer value and converts it into a limited time value *) ana_timeprog := SPlimit ( tprog_cmd ); appl_timer := ANY_TO_TIME (ana_timeprog * 100);
540
ISaGRAF 5.2
- User Guide
(* Called FBD function named 'SPlimit' *)
Example2: "C" function call – same syntax as for IEC 61131-3 function calls
(* Functions used in complex expressions: min, max, right, mlen and left are standard "C" functions *) limited_value := min (16, max (0, input_value) ); rol_msg := right (message, mlen (message) - 1) + left (message, 1);
ISaGRAF 5.2
- Language Reference 541
Calling Function Blocks
Calling Function Blocks from ST:
Name:
Meaning:
Syntax:
name of the function block instance
calls a function block from the standard library or from the user's library
and accesses its return parameters
(* call of the function block *)
<
blockname
>
(
<
p1
>
,
<
p2
> ...
);
(* gets its return parameters *)
<
result
>
:=
<
blockname
>
.
<
ret_param1
>
;
...
<
result
>
:=
<
blockname
>
.
<
ret_paramN
>
;
Operands:
parameters are expressions which match the type of the parameters specified for that function block
Return value:
See Syntax to get the return parameters.
Consult the 'Standard Function Blocks' section to find the meaning and type of each function block parameter. The function block instance (name of the copy) must be declared in the dictionary
Example
(* ST program calling a function block *)
(* declare the instance of the block in the dictionary: *)
(* trigb1 : block R_TRIG - rising edge detection *)
(* Function block activation from ST language *) trigb1 (b1);
(* return parameters access *)
If (trigb1.Q) Then nb_edge := nb_edge + 1; End_if;
542
ISaGRAF 5.2
- User Guide
ST Operators
Standard operators such as AND, NOT, OR, XOR, etc. are described in the Standard Operators
section.
ST Basic Statements
Assignment
Name:
Meaning:
:=
Assigns a variable to an expression
Syntax:
<variable> := <any_expression> ;
Operands:
Variable must be an internal or output variable and the expression must have the same type
The expression can be a call to a function.
Example
(* ST program with assignments *)
(* variable <<= variable *) bo23 := bo10;
(* Variable <<= expression *) bo56 := bx34 OR alrm100 & (level >= over_value); result := (100 * input_value) / scale;
(* assignment with function call *) limited_value := min (16, max (0, input_value) );
ISaGRAF 5.2
- Language Reference 543
RETURN Statement
Name:
Meaning:
Syntax:
Operands:
RETURN
terminates the execution of the current program
RETURN
(none)
;
In an SFC action block, the RETURN statement indicates the end of the execution of that block only.
Example
(* FBD specification of the program: programmable counter *)
(* ST implementation of the program, using RETURN statement *)
If NOT (CU) then
Q := false;
CV := 0;
RETURN; (* terminates the program *) end_if; if RESET then
CV := 0; else if (CV < PV) then
CV := CV + 1; end_if; end_if;
Q := (CV >= PV);
544
ISaGRAF 5.2
- User Guide
IF-THEN-ELSIF-ELSE Statement
Name: IF ... THEN ... ELSIF ... THEN ... ELSE ... END_IF
Meaning:
executes one of several lists of ST statements selection is made according to the value of a Boolean expression
Syntax: IF
<
Boolean_expression
>
THEN
<statement> ;
<statement> ;
...
ELSIF
<
Boolean_expression
>
THEN
<statement> ;
<statement> ;
...
ELSE
<statement> ;
<statement> ;
...
END_IF
;
The ELSE and ELSIF statements are optional. If the ELSE statement is not written, no instruction is executed when the condition is FALSE. The ELSIF statement may be used more than once. The ELSE statement, if used, must appear only once at the end of the ‘IF, ELSIF...’ sequence.
Example
(* ST program using IF statement *)
IF manual AND not (alarm) THEN level := manual_level; bx126 := bi12 OR bi45;
ELSIF over_mode THEN level := max_level;
ELSE level := (lv16 * 100) / scale;
END_IF;
ISaGRAF 5.2
- Language Reference 545
(* IF structure without ELSE *)
If overflow THEN alarm_level := true;
END_IF;
CASE Statement
Name:
Meaning:
Syntax:
CASE ... OF ... ELSE ... END_CASE
executes one of several lists of ST statements selection is made according to an integer expression
CASE <integer_expression> OF
<value> : <statements> ;
<value> , <value> : <statements> ;
...
ELSE
<statements> ;
END_CASE;
Case values must be integer constant expressions. Several values, separated by commas, can lead to the same list of statements. The ELSE statement is optional.
Example
(* ST program using CASE statement *)
CASE error_code OF
255: err_msg := 'Division by zero'; fatal_error := TRUE;
1: err_msg := 'Overflow';
2, 3: err_msg := 'Bad sign';
ELSE err_msg := 'Unknown error';
END_CASE;
546
ISaGRAF 5.2
- User Guide
WHILE Statement
Name: WHILE ... DO ... END_WHILE
Meaning:
iteration structure for a group of ST statements the "continue" condition is evaluated BEFORE any iteration
Syntax: WHILE <Boolean_expression> DO
<statement> ;
<statement> ;
...
END_WHILE ;
Warning:
Because the virtual machine is a
synchronous
system, input variables are not refreshed during WHILE iterations. The change of state of an input variable cannot be used to describe the condition of a WHILE statement.
Example
(* ST program using WHILE statement *)
(* this program uses specific "C" functions to read characters *)
(* on a serial port *) str := ''; (* empty string *) nbchar := 0;
WHILE ((nbchar < 16) & ComIsReady ( )) DO str := str + ComGetChar ( ); nbchar := nbchar + 1;
END_WHILE;
ISaGRAF 5.2
- Language Reference 547
REPEAT Statement
Name:
Meaning:
Syntax:
REPEAT ... UNTIL ... END_REPEAT
iteration structure for a group of ST statements the "continue" condition is evaluated AFTER any iteration
REPEAT
<statement> ;
<statement> ;
...
UNTIL <Boolean_condition>
END_REPEAT ;
Warning:
Because the virtual machine is a
synchronous
system, input variables are not refreshed during REPEAT iterations. The change of state of an input variable cannot be used to describe the ending condition of a REPEAT statement.
Example
(* ST program using REPEAT statement *)
(* this program uses specific "C" functions to read characters *)
(* on a serial port *) str := ''; (* empty string *) nbchar := 0;
IF ComIsReady ( ) THEN
REPEAT str := str + ComGetChar ( ); nbchar := nbchar + 1;
UNTIL ( (nbchar >= 16) OR NOT (ComIsReady ( )) )
END_REPEAT;
END_IF;
548
ISaGRAF 5.2
- User Guide
FOR Statement
Name: FOR ... TO ... BY ... DO ... END_FOR
Meaning:
executes a limited number of iterations, using an integer index variable
Syntax: FOR <index> := <mini> TO <maxi> BY <step> DO
<statement> ;
<statement> ;
END_FOR;
Operands: index
: internal integer variable increased at each loop
mini
: initial value for index (before first loop)
maxi
: maximum allowed value for index
step
: index increment at each loop
The [ BY step ] statement is optional. If not specified, the increment step is 1
Warning:
Because the virtual machine is a
synchronous
system, input variables are not refreshed during FOR iterations.
This is the "WHILE" equivalent of a FOR statement: index := mini; while (index <= maxi) do
<statement> ;
<statement> ; index := index + step; end_while;
Example
(* ST program using FOR statement *)
(* this program extracts the digit characters of a string *) length := mlen (message); target := ''; (* empty string *)
FOR index := 1 TO length BY 1 DO code := ascii (message, index);
IF (code >= 48) & (code <= 57) THEN target := target + char (code);
END_IF;
END_FOR;
ISaGRAF 5.2
- Language Reference 549
EXIT Statement
Name:
Meaning:
Syntax:
EXIT
exit from a FOR, WHILE or REPEAT iteration statement
EXIT
;
The EXIT is commonly used within an IF statement, inside a FOR, WHILE or REPEAT block.
Example
(* ST program using EXIT statement *)
(* this program searches for a character in a string *) length := mlen (message); found := NO;
FOR index := 1 TO length BY 1 DO code := ascii (message, index);
IF (code = searched_char) THEN found := YES;
EXIT;
END_IF;
END_FOR;
550
ISaGRAF 5.2
- User Guide
ST Extensions
The following statements and functions are available to control the execution of the SFC child
programs. They may be used inside action blocks written in ST in SFC steps.
starts an SFC program or function block kills an SFC program freezes an SFC program restarts a frozen SFC program or function block gets current status of an SFC program
Warning:
These functions are not part of the IEC 61131-3 standard.
Easy equivalents can be found for GSTART and GKILL using the following syntax in the
SFC step: child_name with the S qualifier (* equivalent to GSTART(child_name); *) child_name with the R qualifier (* equivalent to GKILL(child_name); *)
The following fields can be used to access the status of an SFC step or child (from its father):
StepName.x
StepName.t
ChildName.__S1.x
ChildName.__S1.t
Boolean value that represents the
activity of the Step
time elapsed since the last activation of the step:
activity duration
("
StepName
" represents the name of the SFC step)
Boolean value that represents the
activity of the child
time elapsed since the last activation of the step:
activity duration
("
ChildName
" represents the name of the SFC child)
ISaGRAF 5.2
- Language Reference 551
GSTART Statement in SFC Action
Name:
Meaning:
Syntax:
Operands:
Return value:
GSTART
Starts an SFC child program or function block by placing a token into each of its initial Steps. The abbreviated syntax is equivalent to an
SFC Child action block having the S qualifier. The extended syntax only applies to SFC child function blocks.
GSTART
( <
child_name
> ); or
GSTART
( <
child_name,step_name,input1,input2,...inputn
> ) where
child_name
represents the name of the SFC child POU
step_name
represents the name of the active step.
step_name
must be preceded by two underscore characters (e.g., __S1
) input1,input2,...inputn
indicate the values of the input parameters of the SFC child POU the specified SFC program must be a child of the one in which the statement is written
(none)
Children of the child program are not automatically started by the GSTART statement. For
details about SFC actions, see page 480.
Note:
Since GSTART is not part of the IEC 61131-3 standard, it is preferable to use the S qualifier attached to the child name.
552
ISaGRAF 5.2
- User Guide
GKILL Statement in SFC Action
Name: GKILL
Meaning:
Syntax:
Kills a child SFC program by removing the Tokens currently existing in its
Steps. The syntax is equivalent to an SFC Child action block having the
R qualifier.
GKILL
( <
child_name
> ); where
child_name
represents the name of the SFC child POU
Operands:
the specified SFC program must be a child of the one in which the statement is written
Return value:
(none)
Children of the child program are automatically killed with the specified program. For details
Note:
Since GKILL is not part of the IEC 61131-3 standard, it is preferable to use the R qualifier attached to the child name.
Example
ISaGRAF 5.2
- Language Reference 553
GFREEZE Statement in SFC Action
Name: GFREEZE
Meaning:
Syntax:
freezes a child SFC (program or function block); suspends its execution. The suspended SFC POU can then be restarted using the GRST statement.
GFREEZE ( <
child_name
> );
where
child_name
represents the name of the SFC child POU
Operands:
the specified SFC program must be a child of the one in which the statement is written
Return value:
(none)
Children of the child program are automatically frozen along with the specified program.
Note:
GFREEZE is not part of the IEC 61131-3 standard.
Example
554
ISaGRAF 5.2
- User Guide
GRST Statement in SFC Action
Name: GRST
Meaning:
Syntax:
restarts a child SFC program frozen by the GFREEZE statement: all the
Tokens removed by GFREEZE are restored. The extended syntax only applies to SFC child function blocks.
GRST
( <
child_name
> ); or
GRST
( <
child_name,input1,input2,...inputn
> ); where
child_name
represents the name of the SFC child POU
input1,input2,...inputn
indicate the value of the input parameter of the SFC child POU
Operands:
the specified SFC program must be a child of the one in which the statement is written
Return value:
(none)
Children of the child program are automatically restarted by the GRST statement.
GRST is not part of the IEC 61131-3 standard.
ISaGRAF 5.2
- Language Reference 555
GSTATUS Statement in SFC Action
Name:
Meaning:
GSTATUS
returns the current status of an SFC program
Syntax:
Operands:
<var> := GSTATUS ( <
child_name
> );
where
child_name
represents the name of the SFC child POU the specified SFC program must be a child of the one in which the statement is written
Return value:
0 = Program is inactive (killed)
1 = Program is active (started)
2 = Program is frozen
Note:
GSTATUS is not part of the IEC 61131-3 standard.
Example
556
ISaGRAF 5.2
- User Guide
IL Language
Instruction List
, or
IL
is a low level language. Instructions always relate to the
current result
(or
IL register
). The operator indicates the operation that must be made between the current value and the operand. The result of the operation is stored again in the current result.
IL Main Syntax
An IL program is a list of
instructions
. Each instruction must begin on a new line, and must contain an
operator
, completed with optional
modifiers
and, if necessary, for the specific operation, one or more
operands
, separated with commas (
','
). A
label
followed by a colon
(
':'
) may precede the instruction. If a
comment
is attached to the instruction, it must be the last component of the line. Comments always begin with
'(*'
and ends with
'*)'
. Empty lines may be entered between instructions. Comments may be placed on empty lines. Furthermore, when entering IL syntax, basic coding is black while other items are displayed using color:
Keywords are pink
Numbers are brown
Comments are green
Example
Label
Start:
Operator
LD
ANDN
ST
Operand
IX1
MX5
QX2
Comments
(* push button *)
(* command is not forbidden *)
(* start motor *)
ISaGRAF 5.2
- Language Reference 557
Labels
A
label
followed by a colon (
':'
) may precede the instruction. A label can be put on an empty line. Labels are used as operands for some operations such as jumps. Labels must conform to the following naming rules: name cannot exceed
16
characters first character must be a
letter
following characters must be
letters
,
digits
or
'_'
character
The same name cannot be used for more than one label in the same IL program. A label can have the same name as a Variable.
Operator Modifiers
The available operator
modifiers
are shown below. The modifier character must complete the name of the operator, with no blank characters between them:
(
N
C
Boolean negation of the operand delayed operation conditional operation
The
'N'
modifier indicates a Boolean negation of the operand. For example, the instruction
ORN IX12
is interpreted as:
result := result OR NOT (IX12)
.
The parenthesis
'('
modifier indicates that the evaluation of the instruction must be delayed until the closing parenthesis
')'
operator is encountered.
The
'C'
modifier indicates that the attached instruction must be executed only if the current result has the Boolean value TRUE (different than 0 for non-Boolean values). The
'C'
modifier can be combined with the
'N'
modifier to indicate that the instruction must be executed only if the current result has the Boolean value FALSE (or 0 for non-Boolean values).
558
ISaGRAF 5.2
- User Guide
Delayed Operations
Because there is only one IL register (
current result
), some operations may have to be
delayed
, so that the execution order of the instructions can be changed. Parentheses are used to indicate delayed operations:
'('
')'
is a modifier is an operator indicates the operation to be delayed executes the delayed operation
The opening
parenthesis '('
modifier indicates that the evaluation of the instruction must be delayed until the closing parenthesis
')'
operator is encountered.
Example
AND(
OR
)
IX12
IX35 is interpreted as:
result := result AND ( IX12 OR IX35 )
ISaGRAF 5.2
- Language Reference 559
IL Operators
The following table summarizes the standard operators of the IL language:
CAL
JMP
)
RET
Operator
LD
ST
S
R
&
(
(
(
(
(
C N
(
(
(
(
C N
C N
N (
N (
N (
(
N (
Modifier Operand
N
N
Variable, constant
Variable
BOOL variable
BOOL variable
BOOL
BOOL
BOOL
BOOL
Variable, constant
Variable, constant
Variable, constant
Variable, constant
Variable, constant
Variable, constant
Variable, constant
Variable, constant
Variable, constant
Variable, constant
Function block instance name
Label
Description
Loads operand
Stores current result
Sets to TRUE
Resets to FALSE
Boolean AND
Boolean AND
Boolean OR exclusive OR
Addition
Subtraction
Multiplication
Division
Test: >
Test: >=
Test: =
Test <=
Test <
Test <>
Calls a function block
Jumps to label
Returns from function
Executes delayed operation
560
ISaGRAF 5.2
- User Guide
In the next section, only operators which are specific to the IL language are described, other standard operators can be found in the section "standard operators, Function Blocks and
Functions".
LD Operator
Operation:
Allowed modifiers:
Operand:
loads a value in the current result
N constant expression internal, input or output Variable
Example
LDex:
LD
LD
LD
LD
LDN
LD
LD
LD
LD false true
123
123.1
(* result := FALSE Boolean constant *)
(* result := TRUE Boolean constant *)
(* result := integer constant *)
(* result := real constant *) t#3ms (* result := time constant *) boo_var1 (* result := Boolean Variable *) ana_var1 (* result := integer Variable *) tmr_var1 (* result := timer Variable *) boo_var2 (* result := NOT ( Boolean Variable ) *)
ISaGRAF 5.2
- Language Reference 561
ST Operator
Operation:
stores the current result in a variable.
The current result is not modified by this operation.
N
Allowed modifiers:
Operand:
internal or output Variable
Example
STboo:
STana: LD
ST
STtmr: LD
ST
LD false
ST
STN boo_var1 boo_var2
(* boo_var1 := FALSE *)
(* boo_var2 := TRUE *)
123 ana_var1 t#12s tmr_var1
(* ana_var1 := 123 *)
(* tmr_var1 := t#12s *)
S Operator
Operation:
stores the Boolean value TRUE in a Boolean Variable, if the current result has the Boolean value TRUE. No operation is processed if current result is FALSE. The current result is not modified by this operation
Allowed modifiers:
(none)
Operand:
output or internal Boolean Variable
Example
SETex: LD
S true (* current result := TRUE *) boo_var1 (* boo_var1 := TRUE *)
562
ISaGRAF 5.2
- User Guide
LD
S false
(* current result is not modified *)
(* current result := FALSE *) boo_var1 (* nothing done - boo_var1 unchanged *)
R Operator
Operation:
stores the Boolean value FALSE in a Boolean Variable, if the current result has the Boolean value TRUE. No operation is processed if current result is FALSE. The current result is not modified by this operation
(none)
Allowed modifiers:
Operand:
output or internal Boolean Variable
Example
RESETex: LD
R
ST
LD
R true (* current result := TRUE *) boo_var1 (* boo_var1 := FALSE *)t
(* current result is not modified *) boo_var2 (* current result is not modified *) false (* current result := FALSE *) boo_var1 (* nothing done - boo_var1 unchanged *)
ISaGRAF 5.2
- Language Reference 563
JMP Operator
Operation:
Allowed modifiers:
Operand:
jumps to the specified label
C N label defined in the same IL program
Example
(* the following example tests the value of an integer selector (0 or 1 or 2) *)
(* to set one from 3 output Booleans. *)
(*Test "is equal to 0" is made with the JMPC operator *)
JMPex: test1:
LD
ANY_TO_BOOL
JMPC
LD
ST
JMP
LD
SUB selector test1 true bo0
JMPend
1
(* selector is 0 or 1 or 2 *)
(* conversion to Boolean *)
(* if selector = 0 then *)
(* bo0 := true *)
(* end of the program *) selector
(* decrease selector: is now 0 or 1 *)
(* conversion to Boolean *)
(* if selector = 0 then *) test2:
JMPend:
ANY_TO_BOOL
JMPC
LD
ST
JMP
LD
ST test2 true bo1
JMPend true bo2
(* bo1 := true *)
(* end of the program *)
(* last possibility *)
(* bo2 := true *)
(* end of the IL program *)
564
ISaGRAF 5.2
- User Guide
RET Operator
Operation:
ends the current IL program. If the IL sequence is a
Function, the current result is returned to the calling program
C N
Allowed modifiers:
Operand:
(none)
Example
(* the following example tests the value of an integer selector (0 or 1 or 2) *)
(* to set one from 3 output Booleans. *)
(*Test "is equal to 0" is made with the JMPC operator *)
JMPex: LD
ANY_TO_BOOL
JMPC
LD
ST
RET selector test1 true bo0
(* selector is 0 or 1 or 2 *)
(* conversion to Boolean *)
(* if selector = 0 then *)
(* bo0 := true *)
(* end - return 0 *)
(* decrease selector *) test1: test2:
LD
ST
LD
RET
LD
SUB
ANY_TO_BOOL
JMPC
RETNC
ST selector
1 test2 true bo1
1 bo2
(* selector: is now 0 or 1 *)
(* conversion to Boolean *)
(* if selector = 0 then *)
(* bo1 := true *)
(* load real selector value *)
(* end - return 1 *)
(* last possibility *)
(*returns if the selector has *)
(* bo2 := true *)
ISaGRAF 5.2
- Language Reference 565
: LD 2 (* load real selector value *)
(* end - return 2 *)
) Operator
Operation:
Allowed modifiers:
Operand:
executes a delayed operation. the delayed operation was notified by "("
(none)
(none)
Example
(* The following program interleaves delayed operations: *)
(* res := a1 + (a2 * (a3 - a4) * a5) + a6; *)
Delayed: LD a1
ADD( a2
MUL( a3
SUB a4
)
MUL
)
ADD
ST
(* result := a1; *)
(* delayed ADD - result := a2; *)
(* delayed MUL - result := a3; *)
(* result := a3 - a4; *)
(* execute delayed MUL - result := a2 *
(a3-a4); *) a5 (* result := a2 * (a3 - a4) * a5; *)
(* execute delayed ADD *) a6
(* result := a1 + (a2 * (a3 - a4) * a5); *)
(* result := a1 + (a2 * (a3 - a4) * a5) + a6;
*) res (* store current result in variable res *)
566
ISaGRAF 5.2
- User Guide
Calling Functions
A
Function call from IL
(written in any of the ST, LD, FBD, or "C" language), uses its name as an operator.
Operation:
executes a Function - the value returned by the function is stored into the IL current result
(none)
Allowed modifiers:
Operand:
The first calling parameter must be stored in the current result before the call. The following ones are expressed in the operand field, separated by commas.
Example
(* Calling Function : converts an integer value into a time value *)
Main: LD
MYFUNC
ST
GT
RETC
LD
MUL
ANY_TO_TIME
ST bi0 bi1,bi2 (* call function to get integer value
*) result (* result := value returned by function *) vmax (* test value overflow *)
(* return if overflow *) result
1000 tmval
(* converts seconds in milliseconds
*)
(* converts to a timer *)
(* stores converted value in a timer
*)
(* Called Function named MYFUNC : evaluates the integer value *)
(* given as a binary value on three Boolean inputs: in0, in1, in2 are the three Boolean input parameters of the Function *)
ISaGRAF 5.2
- Language Reference 567
LD
ANY_TO_DINT
MUL
ST
LD
ANY_TO_DINT
ADD
MUL
ST
LD
ANY_TO_DINT
ADD in2
(* result = ANY_TO_DINT (in2); *)
2 (* result := 2*ANY_TO_DINT (in2); *) temporary (* temporary := result *) in1 temporary (* result := 2*ANY_TO_DINT (in2) +
ANY_TO_DINT (in1); *)
2 (* result := 4*ANY_TO_DINT (in2) +
2*ANY_TO_DINT (in1); *) temporary (* temporary := result *) in0 temporary (* result := 4*ANY_TO_DINT (in2) +
2*ANY_TO_DINT (in1)+ANY_TO_DINT (in0); *)
568
ISaGRAF 5.2
- User Guide
Calling Function Blocks: CAL Operator
Operation:
Allowed modifiers:
Operand:
calls a function block
C N
Name of the function block instance.
The input parameters of the blocks must be assigned before the call using LD/ST operations sequence.
Output parameters are known if used.
Example
(* Calling function block SR : SR1 is an instance of SR *)
LD
AND
ST
LD
ST
CAL
LD
ST auto_mode start_cmd
SR1.set1
stop_cmd
SR1.reset
SR1
SR1.Q1
command
(* FBD equivalent : *)
(*We suppose R_TRIG1 is an instance of R_TRIG block and CTU1 is an instance of CTU block*)
ISaGRAF 5.2
- Language Reference 569
ST
CAL
LD
ST
LD
ST
ST
LDN
ST
LD
LD
ST
CAL
LD
(* FBD equivalent: *) command
R_TRIG1.clk
R_TRIG1
R_TRIG1.Q
CTU1.cu auto_mode
CTU1.reset
100
CTU1.pv
CTU1
CTU1.Q
overflow
CTU1.cv
result
570
ISaGRAF 5.2
- User Guide
Standard Operators
The following are
Standard Operators
of the IEC languages:
Arithmetic operations
Boolean operations
Comparator
Concatenation
Adds two or more variables
Divides two variables
Multiplies two or more variables
Subtracts a variable from another
Assigns one variable into another
Integer negation
Boolean AND
Boolean OR
Boolean exclusive OR
Boolean negation
Tests if one value is less than another
Tests if one value is less than or equal to another
Tests if one value is greater than another
Greater Than or Equal Tests if one value is greater than or equal
to another
Tests if one value is equal to another
Tests if one value is not equal to another
Concatenates multiple messages into one
(for
ISaGRAF
3
configurations only)
ISaGRAF 5.2
- Language Reference 571
Data conversion
Converts to Unsigned double integer
Converts to Double WORD
Converts to Long integer
Converts to Unsigned long integer
Converts to Long WORD
Converts to Real
Converts to Long real
Converts to Time
Converts to Boolean
Converts to Short integer
Converts to Unsigned short integer
Converts to BYTE
Converts to Integer
Converts to Unsigned integer
Converts to WORD
Converts to Double integer
Converts to Date
Converts to String
Converts to Boolean (for
ISaGRAF
3
configurations only)
Converts to integer (for
ISaGRAF
3
configurations only)
Converts to real (for
ISaGRAF
3
configurations only)
Converts to string (for
ISaGRAF
3
configurations only)
Varies depending on the implementation of the treated I/O (for
ISaGRAF
3
configurations only)
572
ISaGRAF 5.2
- User Guide
System Parameters
Converts to time (for
ISaGRAF
3
configurations only)
Accesses the system parameters (for
ISaGRAF
3
configurations only)
*
Note:
For this operator, the number of inputs can be extended to more than two.
Arguments:
(inputs) output
SINT - USINT - BYTE - INT -
UINT - WORD -
DINT
- UDINT -
DWORD - LINT - ULINT -
LWORD - REAL - LREAL can be INTEGER or REAL
(all inputs must have the same format)
SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT -
LWORD - REAL - LREAL
multiplication
of the input terms
Description:
Multiplication of two or more integer or real variables.
ISaGRAF 5.2
- Language Reference 573
Example
(* FBD example with Multiplication Operators *)
LD
MUL
ST
LD
MUL
MUL
ST
(* ST equivalence *) ao10 := ai101 * ai102; ao5 := (ai51 * ai52) * ai53;
(* IL equivalence: *) ai101 ai102 ao10 ai51 ai52 ai53 ao5
574
ISaGRAF 5.2
- User Guide
+
Note:
For this
Operator
, the number of inputs can be extended to more than two.
Arguments:
(inputs) output
SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT -
LWORD - REAL - LREAL -
TIME - STRING can be of any integer, real, TIME, or
STRING format
(all inputs must have the same format)
SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT -
LWORD - REAL - LREAL -
TIME - STRING
addition
of the input terms
Description:
Addition of two or more integer, real, TIME, or STRING variables.
Example
(* FBD example with Addition Operators *)
ISaGRAF 5.2
- Language Reference 575
LD
ADD
ST
LD
ADD
ADD
ST
(* ST equivalence: *) ao10 := ai101 + ai102; ao5 := (ai51 + ai52) + ai53;
(* IL equivalence: *) ai101 ai102 ao10 ai51 ai52 ai53 ao5
576
ISaGRAF 5.2
- User Guide
-
Arguments:
IN1
IN2
Q
SINT - USINT - BYTE - INT - UINT - WORD -
DINT - UDINT - DWORD - LINT - ULINT -
LWORD - REAL - LREAL - TIME
SINT - USINT - BYTE - INT - UINT - WORD -
DINT - UDINT - DWORD - LINT - ULINT -
LWORD - REAL - LREAL - TIME
SINT - USINT - BYTE - INT - UINT - WORD -
DINT - UDINT - DWORD - LINT - ULINT -
LWORD - REAL - LREAL - TIME can be of any integer, real or long real, or TIME format
(IN1 and IN2 must have the same format) subtraction (first
-
second)
Description:
Subtraction
of two integer, real, or TIME variables (first - second).
Example
(* FBD example with Subtraction Operators *)
(* ST equivalence: *) ao10 := ai101 - ai102;
ISaGRAF 5.2
- Language Reference 577
/
ao5 := (ai51 - 1) - ai53;
(* IL equivalence: *)
LD ai101
SUB ai102
ST ao10
LD ai51
SUB 1
SUB ai53
ST ao5
Arguments:
IN1
IN2
Q
SINT - USINT - BYTE - INT - UINT - WORD
- DINT - UDINT - DWORD - LINT - ULINT -
LWORD - REAL - LREAL can be of any integer or real format
(operand)
SINT - USINT - BYTE - INT - UINT - WORD
- DINT - UDINT - DWORD - LINT - ULINT -
LWORD - REAL - LREAL non-zero integer or real value
(divisor)
(IN1 and IN2 must have the same format)
SINT - USINT - BYTE - INT - UINT - WORD
- DINT - UDINT - DWORD - LINT - ULINT -
LWORD - REAL - LREAL integer or real
division
of IN1 by
IN2
Description:
Division of two integer or real variables (the first divided by the second).
578
ISaGRAF 5.2
- User Guide
Example
(* FBD example with Division Operators *)
LD
DIV
ST
LD
DIV
DIV
ST
(* ST Equivalence: *) ao10 := ai101 / ai102; ao5 := (ai5 / 2) / ai53;
(* IL equivalence: *) ai101 ai102 ao10 ai51
2 ai53 ao5
ISaGRAF 5.2
- Language Reference 579
1 GAIN
Arguments:
IN SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
Q SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
IN and Q must have the same format
Description:
assignment
of one variable into another one
This Block is very useful to directly link a diagram input and a diagram output. It can also be used (with a Boolean negation line) to invert the state of a line connected to a diagram output.
Example
(* FBD example with assignment Operators *)
(* ST equivalence: *) ao23 := ai10; bo100 := NOT (bi1 AND bi2);
580
ISaGRAF 5.2
- User Guide
(* IL equivalence: *)
LD
ST
LD
AND ai10 ao23 bi1 bi2
STN bo100
AND
Note:
For this Operator, the number of inputs can be extended to more than two.
Arguments:
(inputs) output
BOOL
BOOL Boolean AND of the input terms
Description:
Boolean
AND
between two or more terms.
ISaGRAF 5.2
- Language Reference 581
Example
(* FBD example with "AND" Operators *)
(* ST equivalence: *) bo10 := bi101 AND NOT (bi102); bo5 := (bi51 AND bi52) AND bi53;
(* IL equivalence *)
&
&
ST
LD
ANDN
ST
LD bi101 bi102 bo10 bi51 bi52 bi53 bo5
(* current result := bi101 *)
(* current result := bi101 AND not(bi102) *)
(* bo10 := current result *)
(* current result := bi51; *)
(* current result := bi51 AND bi52 *)
(* current result := (bi51 AND bi52) AND bi53 *)
(* bo5 := current result *)
582
ISaGRAF 5.2
- User Guide
ANY_TO_BOOL
Arguments:
IN
Q
SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
BOOL any non-Boolean value
TRUE for non-zero numerical value
FALSE for zero numerical value
TRUE for 'TRUE' string
FALSE for 'FALSE' string
Description:
Converts
any variable
to a
Boolean variable
Example
(* FBD example with "Convert to Boolean" Operators *)
(* ST Equivalence: *) ares := ANY_TO_BOOL (10); (* ares is TRUE *)
ISaGRAF 5.2
- Language Reference 583
tres := ANY_TO_BOOL (t#0s); mres := ANY_TO_BOOL ('FALSE');
(* IL equivalence: *)
LD
ANY_TO_BOOL
ST
LD
ANY_TO_BOOL
ST
LD
ANY_TO_BOOL
ST
10 ares t#0s tres
'FALSE' mres
(* tres is FALSE *)
(* mres is FALSE *)
584
ISaGRAF 5.2
- User Guide
ANY_TO_SINT
Arguments:
IN
Q
BOOL - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
SINT any value other than a short integer
0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to a
Short integer variable
(8-bit)
Example
(* FBD example with "Convert to Short Integer" Operators *)
(* ST Equivalence: *) bres := ANY_TO_SINT (true);
ISaGRAF 5.2
- Language Reference
(* bres is 1 *)
585
tres := ANY_TO_SINT (t#0s46ms); mres := ANY_TO_SINT ('0198');
(* IL equivalence: *)
LD
ANY_TO_SINT
ST
LD
ANY_TO_SINT
ST
LD
ANY_TO_SINT
ST true bres t#1s46ms tres
'0198' mres
(* tres is 46 *)
(* mres is 198 *)
586
ISaGRAF 5.2
- User Guide
ANY_TO_USINT
Arguments:
IN
Q
BOOL - SINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
USINT any value other than an unsigned short integer
0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to an
unsigned short integer variable
(8-bit)
Example
(* FBD example with "Convert to Unsigned Short Integer" Operators *)
(* ST Equivalence: *) bres := ANY_TO_USINT (true);
ISaGRAF 5.2
- Language Reference
(* bres is 1 *)
587
tres := ANY_TO_USINT (t#0s46ms); mres := ANY_TO_USINT ('0198');
(* IL equivalence: *)
LD
ANY_TO_USINT
ST
LD
ANY_TO_USINT
ST
LD
ANY_TO_USINT
ST true bres t#1s46ms tres
'0198' mres
(* tres is 46 *)
(* mres is 198 *)
588
ISaGRAF 5.2
- User Guide
ANY_TO_BYTE
Arguments:
IN
Q
BOOL - SINT - USINT - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
BYTE any value other than a byte
0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to a
BYTE variable
(8-bit)
Example
(* FBD example with "Convert to BYTE" Operators *)
(* ST Equivalence: *) bres := ANY_TO_BYTE (true);
ISaGRAF 5.2
- Language Reference
(* bres is 1 *)
589
tres := ANY_TO_BYTE (t#0s46ms); mres := ANY_TO_BYTE ('0198');
(* IL equivalence: *)
LD
ANY_TO_BYTE
ST
LD
ANY_TO_BYTE
ST
LD
ANY_TO_BYTE
ST true bres t#1s46ms tres
'0198' mres
(* tres is 46 *)
(* mres is 198 *)
590
ISaGRAF 5.2
- User Guide
ANY_TO_INT
Arguments:
IN
Q
BOOL - SINT - USINT - BYTE - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
INT any value other than an integer
0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to an
integer variable
(16-bit)
Example
(* FBD example with "Convert to Integer" Operators *)
(* ST Equivalence: *) bres := ANY_TO_INT (true);
ISaGRAF 5.2
- Language Reference
(* bres is 1 *)
591
tres := ANY_TO_INT (t#0s46ms); mres := ANY_TO_INT ('0198');
(* IL equivalence: *)
LD
ANY_TO_INT
ST
LD
ANY_TO_INT
ST
LD
ANY_TO_INT
ST true bres t#1s46ms tres
'0198' mres
(* tres is 46 *)
(* mres is 198 *)
592
ISaGRAF 5.2
- User Guide
ANY_TO_UINT
Arguments:
IN
Q
BOOL - SINT - USINT - BYTE - INT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
UINT any value other than an unsigned integer
0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to an
unsigned integer variable
(16-bit)
Example
(* FBD example with "Convert to Unsigned Integer" Operators *)
(* ST Equivalence: *) bres := ANY_TO_UINT (true);
ISaGRAF 5.2
- Language Reference
(* bres is 1 *)
593
tres := ANY_TO_UINT (t#0s46ms); mres := ANY_TO_UINT ('0198');
(* IL equivalence: *)
LD
ANY_TO_UINT
ST
LD
ANY_TO_UINT
ST
LD
ANY_TO_UINT
ST true bres t#1s46ms tres
'0198' mres
(* tres is 46 *)
(* mres is 198 *)
594
ISaGRAF 5.2
- User Guide
ANY_TO_WORD
Arguments:
IN
Q
BOOL - SINT - USINT - BYTE - INT -
UINT - DINT - UDINT - DWORD - LINT -
ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
WORD any value other than a word
0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to a
WORD variable
(16-bit)
Example
(* FBD example with "Convert to WORD" Operators *)
(* ST Equivalence: *) bres := ANY_TO_WORD (true); tres := ANY_TO_WORD (t#0s46ms); mres := ANY_TO_WORD ('0198');
ISaGRAF 5.2
- Language Reference
(* bres is 1 *)
(* tres is 46 *)
(* mres is 198 *)
595
(* IL equivalence: *)
LD
ANY_TO_WORD
ST
LD
ANY_TO_WORD
ST
LD
ANY_TO_WORD
ST true bres t#1s46ms tres
'0198' mres
ANY_TO_DINT
Arguments:
IN BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING any value other than a double integer
Q DINT 0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to a
double integer variable
(32-bit)
596
ISaGRAF 5.2
- User Guide
Example
(* FBD example with "Convert to Double Integer" Operators *)
(* ST Equivalence: *) bres := ANY_TO_DINT (true); tres := ANY_TO_DINT (t#1s46ms); mres := ANY_TO_DINT ('0198');
(* IL equivalence: *)
LD
ANY_TO_DINT
ST
LD
ANY_TO_DINT
ST
LD
ANY_TO_DINT
ST true bres t#1s46ms tres
'0198' mres
(* bres is 1 *)
(* tres is 1046 *)
(* mres is 198 *)
ISaGRAF 5.2
- Language Reference 597
ANY_TO_UDINT
Arguments:
IN BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - DWORD - LINT -
ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING any value other than an unsigned double integer
Q UDINT 0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to an
unsigned double integer variable
(32-bit)
Example
(* FBD example with "Convert to Unsigned Double Integer" Operators *)
(* ST Equivalence: *) bres := ANY_TO_UDINT (true);
598
(* bres is 1 *)
ISaGRAF 5.2
- User Guide
tres := ANY_TO_UDINT (t#1s46ms); mres := ANY_TO_UDINT ('0198');
(* IL equivalence: *)
LD
ANY_TO_UDINT
ST
LD
ANY_TO_UDINT
ST
LD
ANY_TO_UDINT
ST true bres t#1s46ms tres
'0198' mres
(* tres is 1046 *)
(* mres is 198 *)
ISaGRAF 5.2
- Language Reference 599
ANY_TO_DWORD
Arguments:
IN BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT - LINT -
ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
Q DWORD any value other than a double word
0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Convert
any variable
to a
double word variable
(32-bit)
Example
(* FBD example with "Convert to Double Word" Operators *)
(* ST Equivalence: *) bres := ANY_TO_DWORD (true);
600
(* bres is 1 *)
ISaGRAF 5.2
- User Guide
tres := ANY_TO_DWORD (t#1s46ms); mres := ANY_TO_DWORD ('0198');
(* IL equivalence: *)
LD
ANY_TO_DWORD
ST
LD
ANY_TO_DWORD
ST
LD
ANY_TO_DWORD
ST true bres t#1s46ms tres
'0198' mres
(* tres is 1046 *)
(* mres is 198 *)
ISaGRAF 5.2
- Language Reference 601
ANY_TO_LINT
Arguments:
IN
Q
BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT - LWORD -
REAL - LREAL - TIME - DATE - STRING
LINT any value other than a long integer
0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to a
long integer variable
(64-bit)
Example
(* FBD example with "Convert to Long Integer" Operators *)
(* ST Equivalence: *) bres := ANY_TO_LINT (true);
602
(* bres is 1 *)
ISaGRAF 5.2
- User Guide
tres := ANY_TO_LINT (t#0s46ms); mres := ANY_TO_LINT ('0198');
(* IL equivalence: *)
LD
ANY_TO_LINT
ST
LD
ANY_TO_LINT
ST
LD
ANY_TO_LINT
ST true bres t#1s46ms tres
'0198' mres
ANY_TO_ULINT
(* tres is 46 *)
(* mres is 198 *)
Arguments:
IN
Q
BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - LWORD - REAL -
LREAL - TIME - DATE - STRING
ULINT any value other than an unsigned long integer
0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to an
unsigned long integer variable
(64-bit)
ISaGRAF 5.2
- Language Reference 603
Example
(* FBD example with "Convert to Unsigned Long Integer" Operators *)
(* ST Equivalence: *) bres := ANY_TO_ULINT (true); tres := ANY_TO_ULINT (t#0s46ms); mres := ANY_TO_ULINT ('0198');
(* IL equivalence: *)
LD
ANY_TO_ULINT
ST
LD
ANY_TO_ULINT
ST
LD
ANY_TO_ULINT
ST true bres t#1s46ms tres
'0198' mres
(* bres is 1 *)
(* tres is 46 *)
(* mres is 198 *)
604
ISaGRAF 5.2
- User Guide
ANY_TO_LWORD
Arguments:
IN
Q
BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT - DWORD
- LINT - ULINT - REAL - LREAL - TIME -
DATE - STRING
LWORD any value other than a long word
0 if IN is FALSE / 1 if IN is TRUE number of milliseconds for a timer integer part for real decimal number represented by a string
Description:
Converts
any variable
to a
long word variable
(64-bit)
Example
(* FBD example with "Convert to Long Word" Operators *)
(* ST Equivalence: *) bres := ANY_TO_LWORD (true); tres := ANY_TO_LWORD (t#0s46ms); mres := ANY_TO_LWORD ('0198');
ISaGRAF 5.2
- Language Reference
(* bres is 1 *)
(* tres is 46 *)
(* mres is 198 *)
605
(* IL equivalence: *)
LD
ANY_TO_LWORD
ST
LD
ANY_TO_LWORD
ST
LD
ANY_TO_LWORD
ST true bres t#1s46ms tres
'0198' mres
ANY_TO_REAL
Arguments:
IN
Q
BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT - LWORD -
LREAL - TIME - DATE - STRING
REAL any value other than a real
0.0 if IN is FALSE / 1.0 if IN is TRUE number of milliseconds for a timer equivalent number for integer
Description:
Converts
any variable
to a
real variable
606
ISaGRAF 5.2
- User Guide
Example
(* FBD example with "Convert to Real" Operators *)
(* ST Equivalence: *) bres := ANY_TO_REAL (true); tres := ANY_TO_REAL (t#1s46ms); ares := ANY_TO_REAL (198);
(* IL equivalence: *)
LD
ANY_TO_REAL
ST
LD
ANY_TO_REAL
ST
LD
ANY_TO_REAL
ST true bres t#1s46ms tres
198 ares
(* bres is 1.0 *)
(* tres is 1046.0 *)
(* ares is 198.0 *)
ISaGRAF 5.2
- Language Reference 607
ANY_TO_LREAL
Arguments:
IN
Q
BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT - LWORD -
REAL - TIME - DATE - STRING
LREAL any value other than a long real
0.0 if IN is FALSE / 1.0 if IN is TRUE number of milliseconds for a timer equivalent number for integer
Description:
Converts
any variable
to a
long real variable
Example
(* FBD example with "Convert to Long Real" Operators *)
(* ST Equivalence: *) bres := ANY_TO_LREAL (true); tres := ANY_TO_LREAL (t#1s46ms); ares := ANY_TO_LREAL (198);
608
(* bres is 1.0 *)
(* tres is 1046.0 *)
(* ares is 198.0 *)
ISaGRAF 5.2
- User Guide
(* IL equivalence: *)
LD
ANY_TO_LREAL
ST
LD
ANY_TO_LREAL
ST
LD
ANY_TO_LREAL
ST true bres t#1s46ms tres
198 ares
ANY_TO_TIME
Arguments:
IN BOOL - SINT - USINT - BYTE
- INT - UINT - WORD - DINT -
UDINT - DWORD - LINT -
ULINT - LWORD - REAL -
LREAL - STRING any positive value other than a time and date format
IN (or integer part of IN if it is real) is the number of milliseconds
STRING (number of milliseconds, for example, a value of 300032 represents 5 minutes and 32 milliseconds)
Q TIME time value represented by IN. A value of
1193h2m47s295ms indicates an invalid time.
Description:
Converts
any variable other than a time or date type
to a
timer variable
.
ISaGRAF 5.2
- Language Reference 609
Example
(* FBD example with "Convert to Timer" Operators *)
(* ST Equivalence: *) ares := ANY_TO_TIME (1256); rres := ANY_TO_TIME (1256.3);
(* IL equivalence: *)
LD
ANY_TO_TIME
ST
LD
ANY_TO_TIME
ST
1256 ares
1256.3
rres
(* ares := t#1s256ms *)
(*rres := t#1s256ms *)
610
ISaGRAF 5.2
- User Guide
ANY_TO_DATE
Arguments:
IN BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT - LWORD -
REAL - LREAL - TIME - STRING
Q DATE any value other than a date format date value represented by IN. A value of
-1 indicates an invalid date.
Description:
Converts
any variable
to a
date variable
Example
(* FBD example with "Convert to Date" Operators *)
(* ST Equivalence: *) ares := ANY_TO_DATE (1109110199); (* ares := d#2005-02-22 *) rres := ANY_TO_DATE (1109110199.3); (*rres := d#2005-02-22 *)
(* IL equivalence: *)
LD
ANY_TO_DATE
1109110199
ISaGRAF 5.2
- Language Reference 611
ST
LD
ANY_TO_DATE
ST ares
1109110199.3
rres
ANY_TO_STRING
Arguments:
IN
Q
BOOL - SINT - USINT - BYTE
- INT - UINT - WORD - DINT -
UDINT - DWORD - LINT -
ULINT - LWORD - REAL -
LREAL - TIME - DATE
STRING any non-string value
If IN is a Boolean, 'FALSE' or 'TRUE'
If IN is an integer or a real, decimal representation
If IN is a TIME:
TIME time1
STRING s1 time1 :=13 ms; s1 :=ANY_TO_STRING(time1);
(* s1 = '0s13' *)
Description:
Converts
any variable
to a
string variable
612
ISaGRAF 5.2
- User Guide
Example
(* FBD example with "Convert to string" Operators *)
(* ST Equivalence: *) bres := ANY_TO_STRING (TRUE); ares := ANY_TO_STRING (125);
(* IL equivalence: *)
LD
ANY_TO_STRING
ST
LD
ANY_TO_STRING
ST true bres
125 ares
(* bres is 'TRUE' *)
(* ares is '125' *)
ISaGRAF 5.2
- Language Reference 613
BOO
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
IN
Q
DINT- REAL -
TIME - STRING
A non-boolean value
BOOL TRUE for non-zero numerical value
FALSE for zero numerical value
TRUE for 'TRUE' message
FALSE for 'FALSE' message
Description:
Converts a non-boolean variable to a boolean variable.
Example
(* FBD example with "BOO" operators *)
(* ST equivalence: *) ares := BOO (10);(* ares is TRUE *) tres := BOO (t#0s);(* tres is FALSE *)
614
ISaGRAF 5.2
- User Guide
mres := BOO ('false');(* mres is FALSE *)
(* IL equivalence *)
LD
BOO
ST
LD
BOO
ST
LD
BOO
ST
10 ares t#0s tres
'false' mres
CAT
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
(inputs) output
STRING
STRING
The number of inputs can be extended to more than two. However, the addition of all message lengths must not exceed output message capacity.
Concatenation of the input messages
Description:
Concatenates multiple messages into one message.
ISaGRAF 5.2
- Language Reference 615
Example
(* FBD example with "CAT" Operator *)
LD
ADD
ADD
ST
(* ST equivalence: *) myname := ('Mr' + ' ') + 'Jones';
(* means: myname := 'Mr Jones' *)
(* IL equivalence *)
'Mr'
''
'Jones' myname
616
ISaGRAF 5.2
- User Guide
Equal
Arguments:
IN1 BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT - LWORD -
REAL - LREAL - TIME - DATE - STRING
Both inputs must have the same format.
The TIME input only applies to the ST and IL languages. The BOOL input is not accepted in the IL language.
IN2 BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT - LWORD -
REAL - LREAL - TIME - DATE - STRING
Q BOOL TRUE if IN1
=
IN2
Description
Test if one value is
EQUAL TO
another one (on integer, real, time, date, and string variables)
Note:
The equality test on a TIME variable is not recommended for testing output of TIME blocks such as TON, TP, TOF, BLINK and for testing StepName.t in SFC chart.
Example
(* FBD example with "Is Equal to" Operators *)
ISaGRAF 5.2
- Language Reference 617
LD
EQ
ST
LD
EQ
ST
(* ST Equivalence: *) aresult := (10 = 25); (* aresult is FALSE *) mresult := ('ab' = 'ab'); (* mresult is TRUE *)
(* IL equivalence: *)
10
25 aresult
'ab'
'ab' mresult
618
ISaGRAF 5.2
- User Guide
Greater Than or Equal
Arguments:
IN1 SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
Both inputs must have the same type.
The TIME input only applies to the ST and IL languages.
IN2 SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
Q BOOL TRUE if IN1 >= IN2
Description:
Test if one value is
GREATER THAN or EQUAL TO
another one (on integers, reals, times, dates, or strings)
Note:
The equality test on a TIME variable is not recommended for testing output of TIME blocks such as TON, TP, TOF, BLINK and for testing StepName.t in SFC chart.
ISaGRAF 5.2
- Language Reference 619
Example
(* FBD example with "Greater or Equal to" Operators *)
(* ST Equivalence: *) aresult := (10 >= 25); (* aresult is FALSE *) mresult := ('ab' >= 'ab'); (* mresult is TRUE *)
(* IL equivalence: *)
LD 10
GE 25
ST aresult
LD 'ab'
GE 'ab'
ST mresult
620
ISaGRAF 5.2
- User Guide
Greater Than
Arguments:
IN1 SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
Both inputs must have the same type
IN2 SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
Q BOOL TRUE if IN1 > IN2
Description:
Test if one value is
GREATER THAN
another one (on integers, reals, times, dates, or strings)
Example
(* FBD example with "Greater than" Operators *)
ISaGRAF 5.2
- Language Reference 621
LD
GT
ST
LD
GT
ST
(* ST Equivalence: *) aresult := (10 > 25); (* aresult is FALSE *) mresult := ('ab' > 'a'); (* mresult is TRUE *)
(* IL equivalence: *)
10
25 aresult
'ab'
'a' mresult
ISA3_ANA
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
IN
Q
BOOL- REAL -
TIME - STRING
A non-integer value
DINT 0 if IN is FALSE / 1 if IN is TRUE
Number of milliseconds for a timer
Integer part for real
Decimal number represented by a string
Description:
Converts a non-integer variable to an integer variable.
622
ISaGRAF 5.2
- User Guide
Example
(* FBD example with "ISA3_ANA" operators *)
(* ST equivalence: *) bres := ISA3_ANA (true);(* bres is 1 *) tres := ISA3_ANA (t#1s46ms);(* tres is 1046 *) mres := ISA3_ANA ('0198');(* mres is 198 *)
(* IL equivalence *)
LD
ISA3_ANA
ST
LD
ISA3_ANA true bres t#1s46ms
ST
LD tres
'0198'
ISA3_
ANA
ST mres
ISaGRAF 5.2
- Language Reference 623
ISA3_REAL
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
IN
Q
BOOL - DINT -
TIME
A non-real value (no message)
REAL 0.0 if IN is FALSE / 1.0 if IN is TRUE
Number of milliseconds for a timer
Equivalent number for integer
Description:
Converts a non-real variable to a real variable.
Example
(* FBD example with "ISA3_REAL" operators *)
624
ISaGRAF 5.2
- User Guide
(* ST Equivalence: *) bres := ISA3_REAL (true); tres := ISA3_REAL (t#1s46ms); ares := ISA3_REAL (198);
(* IL equivalence: *)
LD
ISA3_REAL
ST
LD
ISA3_REAL
ST
LD
ISA3_REAL
ST true bres t#1s46ms tres
198 ares
(* bres is 1.0 *)
(* tres is 1046.0 *)
(* ares is 198.0 *)
ISaGRAF 5.2
- Language Reference 625
ISA3_SYSTEM
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
MODE DINT Identifies the system parameter and the access mode
ARG DINT - TIME New value for a "write" access
PARAM DINT Value of the accessed parameter
Description:
Accesses the system parameters
The following is the list of available commands (pre-defined keywords) for the SYSTEM function:
Command
SYS_TALLOWED
SYS_TCURRENT
SYS_TMAXIMUM
SYS_TOVERFLOW
SYS_TRESET
SYS_TWRITE
SYS_ERR_TEST
SYS_ERR_READ
Meaning
read allowed cycle timing read current cycle timing read maximum cycle timing read cycle timing overflows reset timing counters change cycle timing check for run time errors read oldest run time error
626
ISaGRAF 5.2
- User Guide
The following are the expected arguments for pre-defined functions of the SYSTEM function:
Command
SYS_TALLOWED
SYS_TCURRENT
SYS_TMAXIMUM
SYS_TOVERFLOW
SYS_TRESET
SYS_TWRITE
SYS_ERR_TEST
SYS_ERR_READ
Argument
0
0
0
0
0
0
0 new allowed cycle timing
Return Value
allowed cycle timing current cycle timing maximum detected timing number of timing overflows
0 written time
0 if no error detected oldest error code
Example
(* FBD example with "ISA3_SYSTEM" operators *)
(* ST Equivalence: *) alarm := (SYSTEM (SYS_TOVERFLOW, 0) <> 0);
If (alarm) Then
ISaGRAF 5.2
- Language Reference 627
nb_err := nb_err + 1; rc := SYSTEM (SYS_TRESET, 0);
End_If;
Less Than or Equal
Arguments:
IN1 SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
Both inputs must have the same type.
The TIME input only applies to the ST and IL languages.
IN2 SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
Q BOOL TRUE if IN1 <= IN2
Description:
Tests if one value is
LESS THAN or EQUAL TO
another one (on integers, reals, times, dates, or strings)
Note:
The equality test on a TIME variable is not recommended for testing output of TIME blocks such as TON, TP, TOF, BLINK and for testing StepName.t in SFC chart.
628
ISaGRAF 5.2
- User Guide
Example
(* FBD example with "Less or equal to" Operators *)
LD
LE
ST
LD
LE
ST
(* ST Equivalence: *) aresult := (10 <= 25); (* aresult is TRUE *) mresult := ('ab' <= 'ab'); (* mresult is TRUE *)
(* IL equivalence: *)
10
25 aresult
'ab'
'ab' mresult
ISaGRAF 5.2
- Language Reference 629
Less Than
Arguments:
IN1 SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
Both inputs must have the same type
IN2 SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL -
TIME - DATE - STRING
Q BOOL TRUE if IN1
<
IN2
Description:
Test if one value is
LESS THAN
another one (on integers, reals, times, dates, or strings)
Example
(* FBD example with "Less than" Operators *)
(* ST Equivalence: *) aresult := (10 < 25); (* aresult is TRUE *)
630
ISaGRAF 5.2
- User Guide
mresult := ('z' < 'B'); (* mresult is FALSE *)
(* IL equivalence: *)
LD
LT
ST
LD
LT
ST
10
25 aresult
'z'
'B' mresult
MSG
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
IN
Q
BOOL - DINT - REAL
STRING
A non-string value
''false' or 'true' if IN is a boolean value decimal representation if IN is an integer or real
Description:
Converts an integer or real variable to a string variable.
ISaGRAF 5.2
- Language Reference 631
Example
(* FBD example with "Convert to Message" blocks *)
LD
MSG
ST
LD
MSG
ST
(* ST Equivalence: *) bres := MSG (TRUE); ares := MSG (125);
(* IL equivalence: *) true bres
125 ares
(* bres is 'TRUE' *)
(* ares is '125' *)
632
ISaGRAF 5.2
- User Guide
NEG
Arguments:
IN SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL
Input and output must have the same format
Q SINT - USINT - BYTE - INT - UINT -
WORD - DINT - UDINT - DWORD - LINT
- ULINT - LWORD - REAL - LREAL
Description:
Assignment of the
negation
of a variable.
Example
(* FBD example with Negation Operators *)
(* ST equivalence: *) ao23 := - (ai10); ro100 := - (ri1 + ri2);
(* IL equivalence: *)
LD
MUL ai10
-1
ISaGRAF 5.2
- Language Reference 633
ST
LD
ADD
MUL
ST ao23 ri1 ri2
-1.0
ro100
NOT
Arguments:
IN: Any Boolean variable or complex expression
Q: TRUE when IN is FALSE
FALSE when IN is TRUE
Description:
Returns the negation of a complete Boolean expression.
Example
(* FBD example with "NOT" Operator *)
(* ST equivalence: *) bo10 := bi101 XOR NOT (bi102);
634
ISaGRAF 5.2
- User Guide
(* IL equivalence: *)
LD bi101
XORN bi102
ST bo10
Not Equal
Arguments:
IN1 BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT - LWORD -
REAL - LREAL - TIME - DATE - STRING both inputs must have the same type
IN2 BOOL - SINT - USINT - BYTE - INT -
UINT - WORD - DINT - UDINT -
DWORD - LINT - ULINT - LWORD -
REAL - LREAL - TIME - DATE - STRING
Q BOOL TRUE if first <> second
Description:
Test if one value is
NOT EQUAL TO
another one (on integer, real, time, date, and string variables)
ISaGRAF 5.2
- Language Reference 635
Example
(* FBD example with "Is Not Equal to" Operators *)
LD
NE
ST
LD
NE
ST
(* ST Equivalence: *) aresult := (10 <> 25); (* aresult is TRUE *) mresult := ('ab' <> 'ab'); (* mresult is FALSE *)
(* IL equivalence: *)
10
25 aresult
'ab'
'ab' mresult
636
ISaGRAF 5.2
- User Guide
OPERATE
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
IO DINT
FUNCT DINT
ARG
Q
DINT
DINT
Input or output variable
Action to be operated
Argument for I/O action
Return check
Description:
Accesses an IO channel
The meaning of OPERATE arguments depends on the I/O interface implementation. Refer to your hardware manual or corresponding I/O board technical note to learn more about
OPERATE capabilities.
ISaGRAF 5.2
- Language Reference 637
OR
Note:
For this Operator, the number of inputs can be extended to more than two.
Arguments:
(inputs) output
BOOL
BOOL Boolean
OR
of the input terms
Description:
Boolean OR of two or more terms.
Example
(* FBD example with "OR" Operators *)
(* ST equivalence: *) bo10 := bi101 OR NOT (bi102); bo5 := (bi51 OR bi52) OR bi53;
638
ISaGRAF 5.2
- User Guide
(* IL equivalence: *)
OR
OR
ST
LD
ORN
ST
LD bi101 bi102 bo10 bi51 bi52 bi53 bo5
TMR
Arguments:
IN
Q
DINT
TIME
A non-TIME value
IN (or integer part of IN if it is real) is the number of milliseconds
Time value represented by IN
Description:
Converts an integer or real variable to a time one.
ISaGRAF 5.2
- Language Reference 639
Example
(* FBD example with "Convert to Timer" Operators *)
LD
TMR
ST
LD
TMR
ST
(* ST Equivalence: *) ares := TMR (1256); rres := TMR (1256.3);
(* IL equivalence: *)
1256 ares
1256.3
rres
(* ares := t#1s256ms *)
(*rres := t#1s256ms *)
640
ISaGRAF 5.2
- User Guide
XOR
Arguments:
IN1 BOOL
IN2 BOOL
Q BOOL Boolean
exclusive OR
of the two input terms
Description:
Boolean exclusive OR between two terms.
Example
(* FBD example with "XOR" operators *)
ISaGRAF 5.2
- Language Reference 641
(* ST equivalence: *) bo10 := bi101 XOR NOT (bi102); bo5 := (bi51 XOR bi52) XOR bi53;
(* IL equivalence: *)
LD bi101
XORN bi102
ST
LD bo10 bi51
XOR
XOR
ST bi52 bi53 bo5
642
ISaGRAF 5.2
- User Guide
Standard Functions
The following are the standard functions supported by the system:
Arithmetic
Operations
Absolute value of a real value
Array manipulation
(for
ISaGRAF
3 configurations only)
Exponent, power calculation of real values
Modulo
Random value
Truncate decimal part of a real value
Arc cosine, Arc sine, Arc tangent of
a real value
Cosine, Sine, Tangent of a real value
Creates an array of integers
Binary operations
Reads an element in an array of integers
Stores (writes) a value in an array of integers
Integer bit-to-bit Exclusive OR mask
Rotate Left, Rotate Right an integer
value
ISaGRAF 5.2
- Language Reference 643
Boolean operations
Data manipulation
File management (for
ISaGRAF
3 configurations only)
Shift Left, Shift Right an integer value
Odd parity
Minimum, Maximum, Limit
Multiplexer (4 or 8 entries)
Binary selector
Closes a binary file
Tests if end of a file has been reached
Opens a binary file in read mode
Opens a binary file in write mode
Reads integer and real variables from a binary file
Writes integer and real variables to a binary file
Reads MESSAGE variables from a binary file
Writes MESSAGE variables to a binary file
644
ISaGRAF 5.2
- Language Reference
Serial
Communications
1
String manipulation
ISA_SERIAL_DISCONNECT Disconnects the communication link
Opens a communication link
Receives data from the communication link
Sends data on the communication link
Closes the communication port
Performs a serial connection with an
RS-232 or TCP-IP link
Sets the parameters of an open communication link
Returns a series of communication statuses
Character -> ASCII code
ASCII code -> Character
Get string length
Target control
Delete sub-string, Insert string
Find sub-string, Replace sub-string
Extract left, middle or right of a string
String representing the current time
Sends a custom event message to an alarms and events logger
Performs various operations regarding failover on a target node.
Provides access to custom hardware services in field equipment
Sends run-time error messages to a
PrintLog process
ISaGRAF 5.2
- Language Reference 645
Time operations
Gets the current date
Compares two dates and gives the difference in TIME format
Gives date or time of the day (for
ISaGRAF
3
configurations only)
1. The serial communications functions enable communication with devices having non-standard protocols using the TCP/IP protocol or serial ports. For example, you could use these functions when no pre-defined communication driver exists for a device. Virtual machines using serial communications do not run in real time and their cycles may become blocked for periods of time lasting up to several seconds. Therefore, when using serial communications, you need to communicate with a separate process from your real-time process.
ABS
Arguments:
IN
Q
REAL
REAL
Any signed real value
Absolute value (always positive)
Description:
Gives the absolute (positive) value of a real value.
646
ISaGRAF 5.2
- Language Reference
Example
(* FBD Program using "ABS" Function *)
(* ST Equivalence: *) over := (ABS (delta) > range);
(* IL Equivalence: *)
LD
ABS
GT
ST delta range over
ISaGRAF 5.2
- Language Reference 647
ACOS
Arguments:
IN REAL Must be in set [-1.0 .. +1.0]
Q REAL Arc-cosine of the input value (in set [0.0 .. PI])
= 0.0 for invalid input
Description:
Calculates the Arc cosine of a real value.
Example
(* FBD Program using "COS" and "ACOS" Functions *)
(* ST Equivalence: *) cosine := COS (angle); result := ACOS (cosine); (* result is equal to angle *)
(* IL Equivalence: *)
LD
COS
ST angle cosine
648
ISaGRAF 5.2
- Language Reference
ACOS
ST result
AND_MASK
Arguments:
IN DINT Must have integer format
MSK DINT Must have integer format
Q DINT Bit-to-bit logical
AND
between IN and MSK
Description:
Integer AND bit-to-bit mask.
Example
(* FBD example with AND_MASK Operators *)
(* ST Equivalence: *) parity := AND_MASK (xvalue, 1); (* 1 if xvalue is odd *) result := AND_MASK (16#abc, 16#f0f); (* equals 16#a0c *)
ISaGRAF 5.2
- Language Reference 649
(* IL equivalence: *)
LD
AND_MASK
ST
LD
AND_MASK
ST xvalue
1 parity
16#abc
16#f0f result
ARCREATE
Arguments:
ID
SIZE
OK
DINT
DINT
DINT
Identifier of the array (must be in set [0..15])
Number of elements in the array execution status :
1 = if array has been successfully created
2 = invalid array identifier or array already created
3 = invalid size
4 = not enough memory
Description:
Creates an array of integers.
Warning:
There are at most 16 arrays in an application. Arrays contain integer analog values.
As dynamic memory allocation is performed, this function may cause a system error if the array size is too close to the size of the available memory.
650
ISaGRAF 5.2
- Language Reference
Example
(* FBD Program creating an array of integers*)
(* ST Equivalence: *) array_error := (ARCREATE (ident, 16) <> 1));
(* IL Equivalence: *)
LD ident
ARCREATE i6
NE 1
ST array_error
ISaGRAF 5.2
- Language Reference 651
ARREAD
Arguments:
ID DINT
POS DINT
Q DINT
Identifier of the array (must be in set [0..15])
Position of the element in the array must be in set [0 .. size-1] value of the element read
0 if the arguments are not valid
Description:
Reads an element in an array of integers.
Example
(* FBD program using an array management function*)
(* ST Equivalence: *)
If (array_error) Then Return; End_if; read_value := ARREAD (ident, index);
(* array_error comes from the ARCREATE call *)
(* IL Equivalence: *)
LD
RETC array_error
652
ISaGRAF 5.2
- Language Reference
LD
ARREAD
ST ident index read_value
ARWRITE
Arguments:
ID DINT
POS DINT
IN
OK
DINT
DINT
Identifier of the array (must be in set [0..15])
Position of the element in the array; must be in set [0 .. size-1]
New value for the element
Execution status:
1 = writing has succeeded
2 = invalid array identifier
3 = invalid index
Description:
Stores (writes) a value in an array of integers.
ISaGRAF 5.2
- Language Reference 653
Example
(* FBD program using an array management function*)
(* ST Equivalence: *)
If (array_error) Then Return; End_if; write_status := ARWRITE (Ident, Index, value);
(* array_error comes from the ARCREATE call *)
(* IL Equivalence: *)
LD
RETC
LD
ARREAD
ST array_error ident index,value write_status
654
ISaGRAF 5.2
- Language Reference
ASCII
Arguments:
IN
Pos
STRING Any non-empty string
DINT Position of the selected character in set [1.. len] (len is the length of the
IN string)
Code DINT Code of the selected character (in set [0 .. 255]) returns 0 is Pos is out of the string
Description:
Gives the ASCII code of one character in a string.
Example
(* FBD Program using "ASCII" Function *)
(* ST Equivalence: *)
FirstChr := ASCII (message, 1);
(* FirstChr is the ASCII code of the first character of the string *)
(* IL Equivalence: *)
LD message
ASCII 1
ST FirstChr
ISaGRAF 5.2
- Language Reference 655
ASIN
Arguments:
IN REAL Must be in set [-1.0 .. +1.0]
Q REAL Arc-sine of the input value (in set [-PI/2 .. +PI/2])
= 0.0 for invalid input
Description:
Calculates the Arc sine of a real value.
Example
(* FBD Program using "SIN" and "ASIN" Functions *)
(* ST Equivalence: *) sine := SIN (angle); result := ASIN (sine); (* result is equal to angle *)
(* IL Equivalence: *)
LD
SIN
ST angle sine
656
ISaGRAF 5.2
- Language Reference
ASIN
ST result
AS_SEND_EVENT
Arguments:
EVNT AS_EVENT Event to send to the alarm and events logger on the Windows NT platform:
State DINT The type of event.
Possible values are:
16: simple events to convert from the DINT format
48: simple events of
REAL format
64: system events from the list of errors. For this type, you need to indicate the error’s code in the ID.
EventTime TIMESPEC The time at which the event was created
ISaGRAF 5.2
- Language Reference 657
TMOT
RES
DINT
DINT
ID
Quality
DINT
DINT
The unique identifier for an event automatically assigned by the alarms server
(logger). For system events, you indicate the error’s code from the list of errors.
Quality value of the event message
ActiveTime
InactiveTime
TIMESPEC Event timestamp
TIMESPEC Event timestamp
Value
ResourceNumber
REAL
DINT
Event value
Resource number from the Workbench
Time interval before the function stops sending, in milliseconds
Status of the operation:
100 = Event success
101 = Event no queue
102 = Event semaphore timeout
103 = Event semaphore error
104 = Event queue full
Description:
For alarms and events notification, sends a custom event message to an alarms server (logger) on the Windows NT platform, while in online mode, not simulation. When using this function with either Boolean events or numerical events, you need to disable their auto-detection property.
Example 1
The following user-defined ST program sends a custom event message to the alarms server
(logger). This program uses the following local variables:
658
ISaGRAF 5.2
- Language Reference
MyEvent
Attribute: Free
Direction: Memory
Now1
Attribute: Free
Direction: Memory
result
Type: DINT
Attribute: Free
Direction: Memory
MyEvent.state := 16 (* input value DINT=16, REAL=48 *);
Now1();
MyEvent.EventTime.sec := Now1.sec;
MyEvent.EventTime.nsec := Now1.nsec;
MyEvent.ID := 7; (* Alarms Server Event ID*)
MyEvent.quality := 0;
MyEvent.ActiveTime.sec := Now1.sec;
MyEvent.ActiveTime.nsec := Now1.nsec;
MyEvent.value := MyEvent.value + 1.0;
MyEvent.ResourceNumber := 1 (* input variable resource number *); result := AS_SEND_EVENT(MyEvent,100);
Example 2
The following example shows the
Generate_event
user-defined ST function that also sends a custom event message to the alarms server (logger). This function uses the following local variables and parameters:
TimeStamp
Attribute: Free
Direction: Memory
CurrentEvent
Attribute: Free
Direction: Memory
EventID
Type: DINT
Alias: ID
Direction: Input
Value
Type: REAL
Alias: VAL
Direction: Input
Generate_event
Type: DINT
Direction: Output
ISaGRAF 5.2
- Language Reference 659
CurrentEvent.state := 48 (* input value DINT=16, REAL=48 *);
TimeStamp();
CurrentEvent.EventTime.sec := TimeStamp.sec;
CurrentEvent.EventTime.nsec := TimeStamp.nsec;
CurrentEvent.ID := EventID;
CurrentEvent.quality := 0;
CurrentEvent.ActiveTime.sec := TimeStamp.sec;
CurrentEvent.ActiveTime.nsec := TimeStamp.nsec;
CurrentEvent.value := Value;
CurrentEvent.ResourceNumber := 1 (* current resource number *);
CurrentEvent.Text := '';
Generate_event := AS_SEND_EVENT(CurrentEvent,100);
660
ISaGRAF 5.2
- Language Reference
ATAN
Arguments:
IN REAL Any long real value
Q REAL Arc-tangent of the input value (in set [-PI/2 .. +PI/2])
= 0.0 for invalid input
Description:
Calculates the arc tangent of a real value.
Example
(* FBD Program using "TAN" and "ATAN" Function *)
(* ST Equivalence: *) tangent := TAN (angle); result := ATAN (tangent); (* result is equal to angle*)
(* IL Equivalence: *)
LD
TAN
ST angle tangent
ISaGRAF 5.2
- Language Reference 661
ATAN
ST result
CHAR
Arguments:
Code DINT
Q STRING
Code in set [0 .. 255]
One character string the character has the ASCII code given in input Code
(ASCII code is used modulo 256)
Description:
Gives a one character string from a given ASCII code.
Example
(* FBD Program using "CHAR" Function *)
(* ST Equivalence: *)
Display := CHAR ( value + 48 );
(* value is in set [0..9] *)
(* 48 is the ascii code of '0' *)
(* result is one character string from '0' to '9' *)
662
ISaGRAF 5.2
- Language Reference
(* IL Equivalence: *)
LD
ADD
CHAR
ST value
48
Display
COS
Arguments:
IN REAL Any REAL value
Q REAL Cosine of the input value (in set [-1.0 .. +1.0])
Description:
Calculates the cosine of a real value.
Example
(* FBD Program using "COS" and "ACOS" Functions *)
(* ST Equivalence: *) cosine := COS (angle); result := ACOS (cosine); (* result is equal to angle *)
ISaGRAF 5.2
- Language Reference 663
(* IL Equivalence: *)
LD
COS
ST
ACOS
ST angle cosine result
CURRENT_ISA_DATE
Arguments:
DATE DATE The current date
Description:
Gets the current date. The GET_TIME_STRING function, GET_TIME_STRUCT and NOW
function blocks also perform time-related operations. The ANY_TO_DINT function enables
the conversion of DATE to the number of seconds since 1970/01/01 00:00:00:000 GMT
(Greenwich Mean Time).
664
ISaGRAF 5.2
- Language Reference
Example
(* FBD Program using "
CURRENT_ISA_DATE
" Function *)
(* ST Equivalence: *) datResult := CURRENT_ISA_DATE();
(* IL Equivalence: *)
CURRENT_ISA_DATE
ST datResult
ISaGRAF 5.2
- Language Reference 665
DAY_TIME
Arguments:
SEL
Q
DINT output selection
0= get current date
1= get current time
2= get day of week
STRING time/date expressed on a character string
''YYYY/MM/DD' if SEL = 0
''HH:MM:SS' if SEL = 1 day name if SEL = 2 (ex: 'Monday')
Description:
Gives date or time of the day as a message string.
Example
(* FBD Program using "DAY_TIME" function *)
(* ST Equivalence: *)
Display := Day_Time (0) + ' ; ' + Day_Time (1);
(* Display text format is: 'YYYY/MM/DD ; HH:MM:SS' *)
(* IL Equivalence: First done is call to DAY_TIME(1)*)
666
ISaGRAF 5.2
- Language Reference
LD 1
DAY_TIME 'EFGH'
ST
LD hour_str
0
DAY_TIME
ADD ';'
ADD
ST hour_str
Display
DELETE
(*intermediate result*)
Arguments:
IN STRING Any non-empty string
NbC DINT Number of characters to be deleted
Pos
Q
DINT Position of the first deleted character
(first character of the string has position 1)
STRING modified string empty string if Pos < 1 initial string if Pos > IN string length initial string if NbC <= 0
Description:
Deletes a part of a string.
ISaGRAF 5.2
- Language Reference 667
Example
(* FBD Program using "DELETE" Function *)
(* ST Equivalence: *) complete_string := 'ABCD' + 'EFGH'; (* complete_string is 'ABCDEFGH' *) sub_string := DELETE (complete_string, 4, 3); (* sub_string is 'ABGH'*)
(* IL Equivalence: *)
LD
ADD
ST
'ABCD'
'EFGH' complete_string
DELETE 4,3
ST sub_string
668
ISaGRAF 5.2
- Language Reference
EXPT
Arguments:
IN REAL Any signed real value
EXP DINT Integer exponent
Q REAL
(IN
EXP
)
Description:
Gives the real result of the operation: (base exponent
) 'base' being the first argument and
'exponent' the second one.
Example
(* FBD Program using "EXPT" Function *)
(* ST Equivalence: *) tb_size := ANY_TO_DINT (EXPT (2.0, range) );
(* IL Equivalence: *)
LD
EXPT
ANY_TO_DINT
ST
2.0
range tb_size
ISaGRAF 5.2
- Language Reference 669
F_CLOSE
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
ID
OK
DINT
File number returned by F_ROPEN or F_WOPEN
BOOL return status
TRUE if file close is OK
FALSE if an error occurred
Description:
Closes a binary file open with functions F_ROPEN or F_WOPEN.
This function is not included in the
ISaGRAF
simulator.
Example
(* FBD program using file management blocks *)
670
ISaGRAF 5.2
- Language Reference
(* ST Equivalence: *) file_id := F_ROPEN('data.bin'); ok := F_CLOSE(file_id);
(* IL Equivalence: *)
LD
F_ROPEN
ST
F_CLOSE
'data.bin' file_id
(* file_id is already in the current
IL result *)
ST
ISaGRAF 5.2
- Language Reference 671
F_EOF
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
ID
OK
DINT
File number returned by F_ROPEN or F_WOPEN
BOOL End of file indicator.
TRUE if end of file has been reached at the last read or write procedure call.
With FM_READ, the last message read from a file
may not be correct, if the last character is not a string terminator.
Description:
Tests if end of file has been reached.
This function is not included in the
ISaGRAF
simulator.
672
ISaGRAF 5.2
- Language Reference
Example
(* FBD program using file management blocks *)
(* ST Equivalence: *) file_id := F_ROPEN('data.bin');
WHILE not(F_EOF(file_id))
VAL := FA_READ(file_id);
END_WHILE;
MESSAGE := 'last val = ' + msg(VAL); ok := F_CLOSE(file_id);
(* IL Equivalence: *)
LD
F_ROPEN
ST
'data.bin' file_id
ISaGRAF 5.2
- Language Reference 673
NOT_EOF:
LD
F_EOF
JMPC
LD
FA_READ
ST
LD
F_EOF
JMPNC
END_OF_FILE: LD
MSG
ST
LD
ADD
ST
LD
F_CLOSE
ST file_id
END_OF_FILE file_id
VAL file_id
NOT_EOF
VAL val_msg
'last val=' val_msg
MESSAGE file_id
OK
(* if not eof, go on reading *)
(* conversion of VAL into a message *)
674
ISaGRAF 5.2
- Language Reference
F_ROPEN
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
PATH STRING May include the access path to the file using the \ or / symbol to specify a directory. To ease application portability, / or \ is equivalent.
ID DINT File number
0 if an error occurs: file does not exist
Description:
Opens a binary file in read mode. To be used with FA_READ, FM_READ, and F_CLOSE.
This function is not included in the
ISaGRAF
simulator.
Example
(* FBD program using file management blocks *)
(* ST Equivalence: *) file_id := F_ROPEN('c:\data \data.bin'); error := (file_id=0);
ISaGRAF 5.2
- Language Reference 675
(* IL Equivalence: *)
LD
F_ROPEN
ST
EQ
ST
'c:\data\data.bin' file_id
0 error
F_WOPEN
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
PATH STRING May include the access path to the file using the \ or / symbol to specify a directory. To ease application portability, / or \ is equivalent.
ID DINT File number
0 if an error occurs. If the file already exists, it is overwritten
Description:
Opens a binary file in write mode. To be used with FA_WRITE, FM_WRITE, and F_CLOSE.
This function is not included in the
ISaGRAF
simulator.
676
ISaGRAF 5.2
- Language Reference
Example
(* FBD program using file management blocks *)
(* ST Equivalence: *) file_id := F_WOPEN('c:\data\data.bin'); error := (file_id=0);
(* IL Equivalence: *)
LD
F_WOPEN
ST
EQ
ST
'c:\data\data.bin' file_id
0 error
ISaGRAF 5.2
- Language Reference 677
FA_READ
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
ID
Q
DINT
File number: returned by F_ROPEN
DINT Integer value read from file
Description:
Reads integer variables from a binary file. To be used with F_ROPEN and F_CLOSE. This
procedure makes a sequential access to the file, from the previous position. The first call after
F_ROPEN reads the first four bytes of the file, each call pushes the reading pointer. To check
if the end of file is reached, use F_EOF.
This function is not included in the
ISaGRAF
simulator.
678
ISaGRAF 5.2
- Language Reference
Example
(* FBD program using file management blocks *)
(* ST Equivalence: *) file_id := F_ROPEN('voltramp.bin'); vstart := FA_READ(file_id); vend := FA_READ(file_id); vinc := FA_READ(file_id); delta_tim := tmr(FA_READ(file_id)); ok := F_CLOSE(file_id);
ISaGRAF 5.2
- Language Reference 679
(* IL Equivalence: *)
LD
F_ROPEN
ST
FA_READ
ST
LD
FA_READ
ST
LD
FA_READ
ST
LD
FA_READ
TMR
ST
LD
F_CLOSE
ST
'voltramp.bin' file_id
0 vstart file_id vend file_id vinc file_id delta_tim file_id
OK
(*read vstart*)
(*read vend*)
(*read vinc*)
(*read delta_tim*)
(*conversion into a timer*)
680
ISaGRAF 5.2
- Language Reference
FA_WRITE
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
ID
IN
OK
DINT
File number: returned by F_WOPEN
DINT Integer value to be written in the file
BOOL Execution status: TRUE if ok
Description:
Writes integer variables to a binary file. This procedure makes a sequential access to the file,
from the previous position. The first call after F_WOPEN writes the first four bytes of the file,
each call pushes the writing pointer.
This function is not included in the
ISaGRAF
simulator.
ISaGRAF 5.2
- Language Reference 681
Example
(* FBD program using file management blocks*)
682
ISaGRAF 5.2
- Language Reference
LD
F_ROPEN
ST
LD
ST
LD
FA_WRITE
ANA
ADD
ST
LD
FA_WRITE
ANA
ADD
ST
LD
FA_WRITE
(* ST Equivalence: *) file_id := F_WOPEN('voltramp.bin'); nb_written := 0; nb_written := nb_written + ana(FA_WRITE(file_id,vstart)); nb_written := nb_written + ana(FA_WRITE(file_id,vend)); nb_written := nb_written + ana(FA_WRITE(file_id,vinc)); nb_written := nb_written + ana(FA_WRITE(file_id,ana(delta_tim))); ok := F_CLOSE(file_id);
IF ( nb_written <> 4) THEN
ERROR := ERR_FILE;
END_IF;
(* IL Equivalence: *)
'voltramp.bin' file_id
0 nb_written file_id vstart nb_written nb_written file_id vend nb_written nb_written file_id vinc
(*write vstart*)
(*write vend*)
(*write vinc*)
ISaGRAF 5.2
- Language Reference 683
ANA
ADD
LD
ANA
ST
LD
FA_WRITE
ANA
ADD
ST
F_CLOSE
ST
LD
EQ
RETC
LD
ST nb_written ana_delta_tim file_id ana_delta_tim nb_written nb_written
OK nb_written
4
ERR_FILE
ERROR
(*write delta_tim*)
(*convert it to an integer*)
(*return if equal 4*)
(*else error*)
684
ISaGRAF 5.2
- Language Reference
FM_READ
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
ID
Q
DINT
file number: returned by F_ROPEN
STRING String value read from file
Description:
Reads string variables from a binary file. To be used with F_ROPEN and F_CLOSE. This
procedure makes a sequential access to the file, from the previous position. The first call after
F_ROPEN reads the first string of the file, each call pushes the reading pointer. A string is a
terminated by null (0), end of line ('\n') or return ('\r'); To check if the end of file is reached, use
This function is not included in the
ISaGRAF
simulator.
ISaGRAF 5.2
- Language Reference 685
Example
(* FBD program using file management blocks *)
(* ST Equivalence: *) file_id := F_ROPEN('voltramp.bin'); status1 := FM_READ(file_id); status2 := FM_READ(file_id);
IF (F_EOF(file_id)) THEN
ERROR := ERR_FILE; unused_eof_mes := FM_READ(file_id);
END_IF; ok := F_CLOSE(file_id);
686
ISaGRAF 5.2
- Language Reference
(* IL Equivalence: *)
LD
F_ROPEN
ST
FA_READ
ST
LD
FA_READ
ST
LD
F_EOF
JMPNC
CLOSE_FILE
LD
ST
LD
FM_READ
ST
LD
F_CLOSE
ST
'voltramp.bin' file_id status1 file_id status2 file_id
CLOSE_FILE
ERR_FILE
ERROR file_id unused_eof_mes file_id
OK
(*read status1*)
(*read status2*)
(*read vinc*)
(*if end of file jump not done*)
(*read unused_eof_mes*)
ISaGRAF 5.2
- Language Reference 687
FM_WRITE
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
ID
IN
OK
DINT
File number: returned by F_WOPEN
STRING String value to be written in the file
BOOL Execution status: TRUE if successful
Description:
Writes string variables to a binary file. To be used with F_WOPEN and F_CLOSE. A message
is written in the file as a null terminated string. This procedure makes a sequential access to the
file, from the previous position. The first call after F_WOPEN writes the first string to the file,
each call pushes the writing pointer.
This function is not included in the
ISaGRAF
simulator.
Example
(* FBD program using file management blocks*)
688
ISaGRAF 5.2
- Language Reference
(* ST Equivalence: *) file_id := F_WOPEN('trace.txt'); ok := FM_WRITE(file_id,'First message'); ok := FM_WRITE(file_id,'Last message'); ok := F_CLOSE(file_id);
(* IL Equivalence: *)
LD
F_WOPEN
ST
FM_WRITE
ST
LD
FM_WRITE
ST
LD
F_CLOSE
ST
'trace.txt' file_id
'First message'
OK file_id
'Last message'
OK file_id
OK
(*write first msg*)
(*write second msg*)
(*write vend*)
ISaGRAF 5.2
- Language Reference 689
FAILOVER
Note:
This function is for use only with the Advanced Options.
Syntax:
SINT
FAILOVER
(
operation
)
Arguments:
operation
SINT The fail-over operation performed.
Possible values are:
0: sets the node to standby indefinitely; it can never become active unless the node is restarted
1: indicates whether the node is primary or secondary
2 : indicates whether the node is active or standby
3: sets the node to standby; it can become active
4: indicates the status of the other node, in the specific failover mechanism; whether it is on regular or indefinite standby.
5: indicates whether the failover mechanism is operational
690
ISaGRAF 5.2
- Language Reference
Returns:
Result
SINT Result of the operation. Results vary depending on the
operation
performed.
For operation 0, setting the node to standby indefinitely, the possible values are:
1 = operation succeeded
0 = operation failed
For operation 1, indicating whether the node is primary or secondary, the possible values are:
1 = node is primary
0 = node is secondary
For operation 2, indicating whether the node is active or standby, the possible values are:
1 = node is active
0 = node is on standby
For operation 3, setting the node to standby, the possible values are:
1 = operation succeeded
0 = operation failed
For operation 4, indicating the status of the other node for the specific failover mechanism, the possible values are:
1 = the other node is on regular standby, able to take over
0 = the other node is on indefinite standby, unable to take over
For operation 5, indicating whether the failover mechanism is operational, the possible values are:
1 = the failover is operational
0 = the failover is not operational
ISaGRAF 5.2
- Language Reference 691
Description:
Performs various operations regarding failover mechanisms on a specific target node where a
Failover mechanism has been instantiated: determine whether the failover mechanism is operational set a node to standby, causing the other to become active set the node to standby indefinitely, causing the other to become active indefinitely determine the mode of a node, i.e., active or standby determine the status of a node, i.e., primary or secondary determine the ability of the inactive node to take over in the event of failure, i.e., whether it is on regular or indefinite standby
692
ISaGRAF 5.2
- Language Reference
FIND
Arguments:
In STRING Any string
Pat STRING Any non-empty string (Pattern)
Pos DINT = 0 if sub string Pat not found
= position of the first character of the first occurrence of the sub-string
Pat
(first position is 1) this function is
case sensitive
Description:
Finds a sub-string in a string. Gives the position in the string of the sub-string.
Example
(* FBD Program using "FIND" Function *)
(* ST Equivalence: *) complete_string := 'ABCD' + 'EFGH'; (* complete_string is 'ABCDEFGH' *) found := FIND (complete_string, 'CDEF'); (* found is 3 *)
ISaGRAF 5.2
- Language Reference 693
(* IL Equivalence: *)
LD
ADD
ST
FIND
ST
'ABCD'
'EFGH' complete_string
'CDEF' found
GET_TIME_STRING
Arguments:
SEC
NSEC
Q
DINT
DINT
Number of seconds since 1970/01/01 00:00:00:000
Number of nanoseconds from the beginning of the second indicated by
SEC
STRING Date, in the YYYY/MM/DD HH:MM:SS:MMM format
Description:
Transforms a date given in seconds to a text format. The GET_TIME_STRUCT and NOW
function blocks also perform time-related operations.
694
ISaGRAF 5.2
- Language Reference
Example
(* ST equivalence: NOW1 is an instance of the NOW block. *)
NOW1(); number_seconds := NOW1.SEC; number_nanos := NOW1.NSEC; cur_date := GET_TIME_STRING(number_seconds, number_nanos);
IOCTRL
Note:
This function is for use only with the Advanced Options.
Arguments:
DriverID
Command
DINT
DINT
Id number of the communication driver
Custom hardware services function nunber (specific for each driver)
STRING Name of the structure variable request defined in the Dictionary StrNameIn
StrNameOut STRING Name of the structure variable response defined in the
Dictionary
Returns:
Error BOOL Status of the operation:
TRUE = Operation succeeded
FALSE = Operation failed
Description:
Provides access to Custom Hardware Services in the field equipment. The main purpose of this function is to access services not available by the standard interface with the driver. The services are field equipment-specific.
ISaGRAF 5.2
- Language Reference 695
Example
To get the card type in the AL2000 field communication driver:
StrGetCommandType.slot := 1;
Status := IOCTRL(DriverId,1001,’StrGetCommandType’,
‘StrRespGetCommandType’);
IF Status = TRUE then
Type := StrRespGetCommandType.type;
ELSE
END_IF;
//ERROR
INSERT
Arguments:
IN
Str
Pos
Q
STRING Initial string
STRING String to be inserted
DINT Position of the insertion the insertion is done before the position
(first valid position is 1)
STRING Modified string empty string if Pos <= 0 concatenation of both strings if Pos is greater than the length of the IN string
Description:
Inserts a sub-string in a string at a given position.
696
ISaGRAF 5.2
- Language Reference
Example
(* FBD Program using "INSERT" Function *)
(* ST Equivalence: *)
MyName := INSERT ('Mr JONES', 'Frank ', 4);
(* MyName is 'Mr Frank JONES' *)
(* IL Equivalence: *)
LD 'Mr JONES'
INSERT 'Frank ',4
ST MyName
ISaGRAF 5.2
- Language Reference 697
ISA_SERIAL_CLOSE
Arguments:
HDLE
ERR
DINT
DINT handle of the communication link status of the operation:
0 = operation succeeded
-1 = operation failed
Description:
Closes the communication port, causing the PCP_SER administrator to terminate or the
PCP_IP administrator and data sockets to close.
The
ISaGRAF
simulator does not support this function.
Example
To close the communication port for the
HDLE
communication link:
ISA_SERIAL_CLOSE(HDLE);
698
ISaGRAF 5.2
- Language Reference
ISA_SERIAL_CONNECT
Arguments:
HDLE DINT
MODE STRING[6]
BUFF handle of the communication link connection mode: 'SERVER' or 'CLIENT'
STRING[255] information required for the connection. This information varies depending on the protocol and connection mode. Four cases can occur:
PCP_SER CLIENT RTS/DTR signals are asserted.
To perform a connection by modem, enter the required commands and the self-dial telephone number in BUFF. To perform an immediate connection (NULL MODEM), put an empty string in BUFF.
PCP_SER
PCP_IP
SERVER
CLIENT
RTS/DTR signals are asserted.
To indicate a valid connection, you can use either the
CTS/DSR signal (by putting an empty string in BUFF) or the modem’s DCD signal (by putting any string in BUFF).
You have to insert the server’s host name in BUFF. A connection is established with the server, using the host name
(hosts).
ISaGRAF 5.2
- Language Reference 699
PCP_IP SERVER
ERR DINT status of the operation:
0 = operation succeeded
-1 = operation failed
Description:
Performs a serial connection with an RS-232 or TCP-IP link.
The
ISaGRAF
simulator does not support this function.
You need to insert an empty string in BUFF. The host name for the server is defined in the hosts file.
Example
To make on a valid connection in the SERVER connection mode: error := ISA_SERIAL_CONNECT(handle, 'SERVER', ''); errorBool := LOG_MSG('ErrLog', 'Connect: '+ ANY_TO_STRING (error));
IF error = 0 THEN
(* No error: Proceed with the next step*)
END_IF;
To make a valid connection in the CLIENT connection mode: error := ISA_SERIAL_CONNECT(handle, 'CLIENT', 'hostname'); errorBool := LOG_MSG('ErrLog', 'Connect: '+ ANY_TO_STRING (error));
IF error = 0 THEN
(* No error: Proceed with the next step*)
ELSE error := ISA_SERIAL_CLOSE(handle);
END_IF;
700
ISaGRAF 5.2
- Language Reference
ISA_SERIAL_DISCONNECT
Arguments:
HDLE DINT
ERR DINT handle of the communication link
FLSH STRING[5] indicates whether the data transmission must be completed before stopping the communication:
'FLUSH' complete the transmission
' ' disregard the completion of the transmission. Any value having a maximum of five characters. status of the operation:
0 = operation succeeded
-1 = operation failed
Description:
Disconnects the communication link.
The
ISaGRAF
simulator does not support this function.
Examples
To complete the transmission before stopping the
HDLE
communication link and place the status of the operation in the
ERR
variable:
ERR:= ISA_SERIAL_DISCONNECT(HDLE, 'FLUSH');
To immediately disconnect the
HDLE
communication link disregarding the completion of the transmission:
ISA_SERIAL_DISCONNECT(HDLE, '');
ISaGRAF 5.2
- Language Reference 701
ISA_SERIAL_OPEN
Arguments:
SERV STRING[1] administrator used: 'PCP_SER' or 'PCP_IP'
PORT STRING[255] varies depending on the administrator used in SERV:
PCP_SER, enter the name of the serial device
PCP_IP, enter the IP port number of the server
RES DINT handle of the communication link
Description:
Warning:
This function uses the Malloc dynamic memory allocation at run time.
Opens a communication link. You can start an RS-232 (PCP_SER) or TCP/IP (PCP_IP) link.
Each time a communication link is opened, a communication administrator is started.
The
ISaGRAF
simulator does not support this function.
Examples
To open a communication link using the PCP_SER protocol: handle := ISA_SERIAL_OPEN('PCP_SER','/dev/ser1'); errorBool := LOG_MSG('ErrLog', 'Open: '+ ANY_TO_STRING (handle));
IF handle > 0 THEN
(* No error: Proceed with the next step*)
END_IF;
702
ISaGRAF 5.2
- Language Reference
To open a communication link using the PCP_IP protocol: handle := ISA_SERIAL_OPEN('PCP_IP', '7500'); errorBool := LOG_MSG('ErrLog', 'Open: ' + ANY_TO_STRING (error));
IF handle > 0 THEN
(* No error: Proceed with the next step*)
END_IF;
ISA_SERIAL_RECEIVE
Arguments:
HDLE DINT handle of the communication link
DATA STRING[255] received information
LGTH DINT
TIMO DINT length of the data, in bytes. The maximum length is 255 bytes. maximum number of seconds during which a receive block occurs
ERR DINT status of the operation:
0 = operation succeeded
-1 = operation failed
Description:
Warning:
This function uses the Malloc dynamic memory allocation at run time.
ISaGRAF 5.2
- Language Reference 703
Receives data from the communication link. Reception stops when either the specified number of bytes or the timeout is reached. If data contains a character string that will be used as such, you must make sure that it finishes with a null terminator.
The
ISaGRAF
simulator does not support this function.
Examples
To receive data using a communication link: error := ISA_SERIAL_RECEIVE(handle, data, 11, 0); errorBool := LOG_MSG('ErrLog', 'Received data: '+ data);
IF error = -1 THEN error := ISA_SERIAL_STATUS(handle, SocketError, stat1, stat2, stat3); errorBool := LOG_MSG('ErrLog', 'Received error: '+ ANY_TO_STRING
(SocketError));
END_IF;
704
ISaGRAF 5.2
- Language Reference
ISA_SERIAL_SEND
Arguments:
HDLE DINT handle of the communication link
DATA STRING[255] information to be transmitted
LGTH DINT
ERR DINT length of the data, in bytes. The maximum length is 255 bytes.
status of the operation:
0 = operation succeeded
-1 = operation failed
Description:
Warning:
This function uses the Malloc dynamic memory allocation at run time.
Sends data on the communication link.
The
ISaGRAF
simulator does not support this function.
Example
To send the string
'Hello world
' on a communication link: error := ISA_SERIAL_SEND(handle, 'Hello world', 11);
IF error = -1 THEN error := ISA_SERIAL_STATUS(handle, SocketError, stat1, stat2, stat3); errorBool := LOG_MSG('ErrLog', 'Sent error: '+
ANY_TO_STRING(SocketError));
ELSE errorBool := LOG_MSG('ErrLog', 'Data Sent: Hello World');
END_IF;
ISaGRAF 5.2
- Language Reference 705
ISA_SERIAL_SET
Arguments:
HDLE
ARG1
DINT
DINT handle of the communication link content varies depending on the protocol used:
For PCP_SER, handshake, echo, and trace *
ARG2 DINT
ARG3 DINT
For PCP_IP, trace
OFF = 0
ON = 1 baud rate. Only used with PCP_SER protocol.
number of stop bits (1 or 2). Only used with PCP_SER protocol.
ARG4 STRING[8] parity: even, odd, none. Only used with PCP_SER protocol.
ERR DINT status of the operation:
0 = operation succeeded
-1 = operation failed
Description:
Sets the parameters of an open communication link. These parameters vary according to the protocol and the serial communication standard.
The
ISaGRAF
simulator does not support this function.
706
ISaGRAF 5.2
- Language Reference
* For PCP_SER, the value of
ARG1
varies according to the serial communications standard.
If RS-232 is used,
ARG1
holds the state of the trace: 1 = ON, 0 = OFF. On the other hand, with
RS-485,
ARG1
holds the composite states of handshake, echo, and trace:
Handshake
1
1
1
1
0
0
0
0
Examples
Echo
1
1
0
0
1
1
0
0
Trace
0
1
0
1
0
1
0
1
ARG1
6
7
4
5
2
3
0
1
To set the parameters of the
HDLE
communication link using the PCP_SER protocol and the
RS-232 serial communication standard without trace, having a baud rate of 9600, 8 bits, and even parity:
ERR:= ISA_SERIAL_SET(HDLE, 0, 9600, 8, 'even');
To set the parameters of the
HDLE
communication link using the PCP_IP protocol with a trace:
ERR:= ISA_SERIAL_SET(HDLE, 1, 0, 0, '');
ISaGRAF 5.2
- Language Reference 707
ISA_SERIAL_STATUS
Arguments:
HDLE DINT
STA1 DINT
STA2 DINT handle of the communication link error number. Refer to the target operating system’s errno.h file.
varies depending on the protocol used:
For PCP_SER, number of received characters
For PCP_IP, port number of the client if in server mode, or port number of the server if in client mode
CD control bit. Only used for the PCP_SER protocol. STA3 DINT
STA4 STRING[255] address of the client if in server mode, or address of the server if in client mode. Only used for the PCP_IP protocol.
ERR DINT status of the operation:
0 = operation succeeded
-1 = operation failed
Description:
Returns a series of communication statuses. These statuses vary depending on the protocol.
The
ISaGRAF
simulator does not support this function.
708
ISaGRAF 5.2
- Language Reference
Examples
To get the communication statuses of the
HDLE
communication link using the PCP_SER protocol and place them in their respective variables:
ERR:= ISA_SERIAL_STATUS(HDLE, STA1, STA2, STA3, STA4);
To get the communication statuses of the
HDLE
communication link using the PCP_IP protocol and place them in their respective variables:
ERR:= ISA_SERIAL_STATUS(HDLE, STA1, STA2, STA3, STA4);
LEFT
Arguments:
IN
NbC
Q
STRING
DINT
STRING
Any non-empty string
Number of characters to be extracted. This number cannot be greater than the length of the IN string.
Left part of the IN string (its length = NbC) empty string if NbC <= 0 complete IN string if NbC >= IN string length
Description:
Extracts the left part of a string. The number of characters to be extracted is given.
ISaGRAF 5.2
- Language Reference 709
Example
(* FBD Program using "LEFT" and "RIGHT" Functions *)
LD
LEFT
ST
LD
RIGHT
ADD
ST
(* ST Equivalence: *) complete_string := RIGHT ('12345678', 4) + LEFT ('12345678', 4);
(* complete_string is '56781234' the value issued from RIGHT call is '5678' the value issued from LEFT call is '1234'
*)
(* IL Equivalence: First done is call to LEFT *)
'12345678'
4 sub_string (* intermediate result *)
'12345678'
4 sub_string complete_string
710
ISaGRAF 5.2
- Language Reference
LIMIT
Arguments:
MIN
IN
DINT Minimum allowed value
DINT Any signed integer value
MAX DINT Maximum allowed value
Q DINT Input value bounded to allowed range
Description:
Limits an integer value into a given interval. Whether it keeps its value if it is between minimum and maximum, or it is changed to maximum if it is above, or it is changed to minimum if it is below.
Example
(* FBD Program using "LIMIT" Function *)
(* ST Equivalence: *) new_value := LIMIT (min_value, value, max_value);
(* bounds the value to the [min_value..max_value] set *)
ISaGRAF 5.2
- Language Reference 711
(* IL Equivalence: *)
LD min_value
LIMIT value, max_value
ST new_value
LOG
Arguments:
IN REAL Must be greater than zero
Q REAL Logarithm (base 10) of the input value
Description:
Calculates the logarithm (base 10) of a real value.
Example
(* FBD Program using "LOG" Function *)
712
ISaGRAF 5.2
- Language Reference
LD
ABS
ST
LOG
ST
(* ST Equivalence: *) xpos := ABS (xval); xlog := LOG (xpos);
(* IL Equivalence: *) xval xpos xlog
ISaGRAF 5.2
- Language Reference 713
LOG_MSG
Note:
This function is for use only with the Advanced Options.
Arguments:
LOG_NAME STRING The name of the log as defined in the PrintLog command. To use the default run-time error log, enter ErrLog. Otherwise, start a new PrintLog process, using another log name, in the same node as the resource calling this function.
MSG STRING The message that will appear in the log. It can hold up to 94 alpha-numeric characters. Note: You can timestamp logged messages by selecting the timestamp option in the PrintLog command.
Q BOOL If TRUE the message was logged or else an error occured
Description:
Sends a log message to a PrintLog process. PrintLog is a process that can record messages in a file or output them to a device like a printer. For information on the PrintLog command and run-time error logs for targets, refer to the Starting a Runtime Error Log application note.
Example
(* ST *)
SUCCESS := LOG_MSG('ErrLog','ALARM A')
714
ISaGRAF 5.2
- Language Reference
MAX
Arguments:
IN1 DINT Any signed integer value
IN2 DINT (cannot be REAL)
Q DINT Maximum of both input values
Description:
Gives the maximum of two integer values.
Example
)
(* FBD Program using "MIN" and "MAX" Function *
(* ST Equivalence: *) new_value := MAX (MIN (max_value, value), min_value);
(* bounds the value to the [min_value..max_value] set *)
(* IL Equivalence: *)
LD
MIN max_value value
ISaGRAF 5.2
- Language Reference 715
MAX
ST min_value new_value
MID
Arguments:
IN STRING Any non-empty string
NbC DINT Number of characters to be extracted cannot be greater than the length of the IN string
Pos
Q
DINT Position of the sub-string the sub-string first character will be the one pointed to by Pos
(first valid position is 1)
STRING Middle part of the string (its length = NbC) empty string if parameters are not valid
Description:
Extracts a part of a string. The number of characters to be extracted and the position of the first character are given.
716
ISaGRAF 5.2
- Language Reference
Example
(* FBD Program using "MID" Function *)
(* ST Equivalence: *) sub_string := MID ('abcdefgh', 2, 4);
(* sub_string is 'de' *)
(* IL Equivalence: *)
LD
MID
ST
'abcdefgh'
2,4 sub_string
ISaGRAF 5.2
- Language Reference 717
MIN
Arguments:
IN1 DINT Any signed integer value
IN2 DINT (cannot be REAL)
Q DINT Minimum of both input values
Description:
Gives the minimum of two integer values.
Example
(* FBD Program using "MIN" and "MAX" Function *)
(* ST Equivalence: *) new_value := MAX (MIN (max_value, value), min_value);
(* bounds the value to the [min_value..max_value] set *)
(* IL Equivalence: *)
LD
MIN max_value value
718
ISaGRAF 5.2
- Language Reference
MAX
ST min_value new_value
MLEN
Arguments:
IN
NbC
STRING
DINT
Any string
Number of characters in the IN string
Description:
Calculates the length of a string.
Example
(* FBD Program using "MLEN" Function *)
(* ST Equivalence: *)
ISaGRAF 5.2
- Language Reference 719
LD
MLEN
ST
LT
RETC
LD
LEFT
ST nbchar := MLEN (complete_string);
If (nbchar < 3) Then Return; End_if; prefix := LEFT (complete_string, 3);
(* this program extracts the 3 characters on the left of the string and put the result in the prefix string variable nothing is done if the string length is less than 3 characters *)
(* IL Equivalence: *) complete_string nbchar
3 complete_string
3 prefix
720
ISaGRAF 5.2
- Language Reference
MOD
Arguments:
IN
Base
Q
DINT Any signed INTEGER value
DINT Must be greater than zero
DINT Modulo calculation (input MOD base) returns -1 if Base <= 0
Description:
Calculates the modulo of an integer value.
Example
(* FBD Program using "MOD" Function *)
(* ST Equivalence: *) division_result := (value / divider); (* integer division *) rest_of_division := MOD (value, divider); (* rest of the division *)
(* IL Equivalence: *)
ISaGRAF 5.2
- Language Reference 721
LD
DIV
ST
LD
MOD
ST value divider division_result value divider rest_of_division
MUX4
Arguments:
SEL
IN1..IN4
Q
DINT Selector integer value (must be in set [0..3])
DINT Any integer values
DINT = value1 if SEL = 0
= value2 if SEL = 1
= value3 if SEL = 2
= value4 if SEL = 3
= 0 for all other values of the selector
Description:
Multiplexer with four entries: selects a value between four integer values.
722
ISaGRAF 5.2
- Language Reference
Example
(* FBD Program using "MUX4" Function *)
(* ST Equivalence: *) range := MUX4 (choice, 1, 10, 100, 1000);
(* select from 4 predefined ranges, for example, if choice is 1, range will be 10 *)
(* IL Equivalence: *)
LD
MUX4
ST choice
1,10,100,1000 range
ISaGRAF 5.2
- Language Reference 723
MUX8
Arguments:
SEL
IN1..IN8
Q
DINT Selector integer value (must be in set [0..7])
DINT Any integer values
DINT = value1 if selector = 0
= value2 if selector = 1
...
= value8 if selector = 7
= 0 for all other values of the selector
Description:
Multiplexer with eight entries: selects a value between eight integer values.
724
ISaGRAF 5.2
- Language Reference
Example
(* FBD Program using "MUX8" Function *)
(* ST Equivalence: *) range := MUX8 (choice, 1, 5, 10, 50, 100, 500, 1000, 5000);
(* select from 8 predefined ranges, for example, if choice is 3, range will be 50 *)
(* IL Equivalence: *)
LD
MUX8
ST choice
1,5,10,50,100,500,1000,5000 range
ISaGRAF 5.2
- Language Reference 725
NOT_MASK
Arguments:
IN DINT Must have integer format
Q DINT Bit-to-bit negation on 32 bits of IN
Description:
Integer bit-to-bit negation mask.
Example
(* FBD example with NOT_MASK Operators *)
(*ST equivalence: *) result := NOT_MASK (16#1234);
(* result is 16#FFFF_EDCB *)
(* IL equivalence: *)
LD
NOT_MASK
ST
16#1234 result
726
ISaGRAF 5.2
- Language Reference
ODD
Arguments:
IN DINT
Q BOOL
Any signed integer value
TRUE if input value is odd
FALSE if input value is even
Description:
Tests the parity of an integer: result is odd or even.
Example
(* FBD Program using "ODD" Function *)
(* ST Equivalence: *)
If Not (ODD (value)) Then Return; End_if; value := value + 1;
(* makes value always even *)
(* IL Equivalence: *)
LD
ODD value
ISaGRAF 5.2
- Language Reference 727
RETNC
LD
ADD
ST value
1 value
OR_MASK
Arguments:
IN DINT Must have integer format
MSK DINT Must have integer format
Q DINT Bit-to-bit logical
OR
between IN and MSK
Description:
Integer OR bit-to-bit mask.
Example
(* FBD example with OR_MASK Operators *)
728
ISaGRAF 5.2
- Language Reference
(* ST Equivalence: *) parity := OR_MASK (xvalue, 1); (* makes value always odd *) result := OR_MASK (16#abc, 16#f0f); (* equals 16#fbf *)
(* IL equivalence: *)
LD
OR_MASK
ST
LD
OR_MASK
ST xvalue
1 parity
16#abc
16#f0f result
POW
Arguments:
IN REAL Real number to be raised
EXP REAL Power (exponent)
Q REAL
(IN
EXP
)
1.0 if IN is not 0.0 and EXP is 0.0
0.0 if IN is 0.0 and EXP is negative
0.0 if both IN and EXP are 0.0
0.0 if IN is negative and EXP does not correspond to an integer
Description:
Gives the real result of the operation: (base exponent
) 'base' being the first argument and
'exponent' the second one. The exponent is a real value.
ISaGRAF 5.2
- Language Reference 729
Example
(* FBD Program using "POW" Function *)
(* ST Equivalence: *) result := POW (xval, power);
(* IL Equivalence: *)
LD
POW
ST xval power result
730
ISaGRAF 5.2
- Language Reference
RAND
Arguments: base
Q
DINT
DINT
Defines the allowed set of number
Random value in set [0..base-1]
Description:
Gives a random integer value in a given range.
Example
(* FBD Program using "RAND" function *)
ISaGRAF 5.2
- Language Reference 731
(* ST Equivalence: *) selected := MUX4 ( RAND (4), 1, 4, 8, 16 );
(* random selection of 1 of 4 pre-defined values the value issued of RAND call is in set [0..3], so 'selected' issued from MUX4, will get 'randomly' the value
1 if 0 is issued from RAND, or 4 if 1 is issued from RAND, or 8 if 2 is issued from RAND, or 16 if 3 is issued from RAND,
*)
732
ISaGRAF 5.2
- Language Reference
REPLACE
Arguments:
IN
Str
STRING Any string
STRING String to be inserted (to replace NbC chars)
NbC DINT
Pos DINT
Number of characters to be deleted
Position of the first modified character
(first valid position is 1)
Q STRING Modified string:
- NbC characters are deleted at position Pos
- then substring Str is inserted at this position returns empty string if Pos <= 0 returns strings concatenation (IN+Str) if Pos is greater than the length of the IN string returns initial string IN if NbC <= 0
Description:
Replaces a part of a string by a new set of characters.
ISaGRAF 5.2
- Language Reference 733
Example
Replaces a part of a string by a new set of characters.
(* ST Equivalence: *)
MyName := REPLACE ('Mr X JONES, 'Frank', 1, 4);
(* MyName is 'Mr Frank JONES' *)
(* IL Equivalence: *)
LD
REPLACE
ST
'Mr X JONES'
'Frank',1,4
MyName
734
ISaGRAF 5.2
- Language Reference
RIGHT
Arguments:
IN STRING Any non-empty string
NbC DINT Number of characters to be extracted. This number cannot be greater than the length of the IN string.
Q STRING Right part of the string (length = NbC) empty string if NbC <= 0 complete string if NbC >= string length
Description:
Extracts the right part of a string. The number of characters to be extracted is given.
Example
(* FBD Program using "LEFT" and "RIGHT" Functions *)(* ST Equivalence: *)
ISaGRAF 5.2
- Language Reference 735
LD
LEFT
ST
LD
RIGHT
ADD
ST complete_string := RIGHT ('12345678', 4) + LEFT ('12345678', 4);
(* complete_string is '56781234' the value issued from RIGHT call is '5678' the value issued from LEFT call is '1234'
*)
(* IL Equivalence: First done is call to LEFT *)
'12345678'
4 sub_string (* intermediate result *)
'12345678'
4 sub_string complete_string
736
ISaGRAF 5.2
- Language Reference
ROL
Arguments:
IN DINT Any integer value
NbR DINT Number of 1 bit rotations (in set [1..31])
Q DINT Left rotated value no effect if NbR <= 0
Description:
Make the bits of an integer rotate to the left. Rotation is made on 32 bits:
Example
(* FBD Program using "ROL" Function *)
ISaGRAF 5.2
- Language Reference 737
(* ST Equivalence: *) result := ROL (register, 1);
(* register = 2#0100_1101_0011_0101*)
(* result = 2#1001_1010_0110_1010*)
(* IL Equivalence: *)
LD
ROL
ST register
1 result
ROR
Arguments:
IN DINT Any integer value
NbR DINT Number of 1 bit rotations (in set [1..31])
Q DINT Right rotated value no effect if NbR <= 0
Description:
Make the bits of an integer rotate to the right. Rotation is made on 32 bits:
738
ISaGRAF 5.2
- Language Reference
Example
(* FBD Program using "ROR" Function *)
(* ST Equivalence: *) result := ROR (register, 1);
(* register = 2#0100_1101_0011_0101 *)
(* result = 2#1010_0110_1001_1010 *)
(* IL Equivalence: *)
LD
ROR
ST register
1 result
ISaGRAF 5.2
- Language Reference 739
SEL
Arguments:
SEL
IN1, IN2
Q
BOOL Indicates the chosen value
DINT Any integer values
DINT = IN1 if SEL is FALSE
= IN2 if SEL is TRUE
Description:
Binary selector: selects a value between two integer values.
Example
(* FBD Program using "SEL" Function *)
(* ST Equivalence: *)
ProCmd := SEL (AutoMode, ManuCmd, InpCmd);
(* process command selection *)
(* IL Equivalence: *)
LD AutoMode
740
ISaGRAF 5.2
- Language Reference
SEL
ST
ManuCmd,InpCmd
ProCmd
SET_PRIORITY
Arguments:
IN SINT
New priority for the virtual machine. Possible values are:
0: SET_PRIORITY() returns the current virtual machine priority (no change)
1-29: new priority for the virtual machine
Q SINT
priority of the virtual machine before SET_PRIORITY() was called
Description:
Changes the priority of a virtual machine in the target operating system.
The
ISaGRAF
simulator does not support this function.
Example
(* ST *) old_priority := SET_PRIORITY(26);
ISaGRAF 5.2
- Language Reference 741
SHL
Arguments:
IN DINT Any integer value
NbS DINT Number of 1 bit shifts (in set [1..31])
Q DINT Left shifted value no effect if NbS <= 0
0 replaces the least significant bit
Description:
Shifts the 32 bits of an integer to the left and places a 0 in the least significant bit.
Example
(* FBD Program using "SHL" Function *)
742
ISaGRAF 5.2
- Language Reference
(* ST Equivalence: *) result := SHL (register,1);
(* register = 2#0100_1101_0011_0101 *)
(* result = 2#1001_1010_0110_1010 *)
(* IL Equivalence: *)
LD
SHL
ST register
1 result
SHR
Arguments:
IN
NbS
Q
DINT Any integer value
DINT Number of 1 bit shifts (in set [1..31])
DINT Right shifted value no effect if NbS <= 0
0 replaces the most significant bit
Description:
Shifts the 32 bits of an integer to the right and places a 0 in the most significant bit.
ISaGRAF 5.2
- Language Reference 743
Example
(* FBD Program using "SHR"Function *)
(* ST Equivalence: *) result := SHR (register,1);
(* register = 2#1100_1101_0011_0101 *)
(* result = 2#1110_0110_1001_1010 *)
(* IL Equivalence: *)
LD register
SHR 1
ST result
744
ISaGRAF 5.2
- Language Reference
SIN
Arguments:
IN REAL Any REAL value
Q REAL Sine of the input value (in set [-1.0 .. +1.0])
Description:
Calculates the Sine of a real value.
Example
(* FBD Program using "SIN" and "ASIN" Functions *)
(* ST Equivalence: *) sine := SIN (angle); result := ASIN (sine); (* result is equal to angle *)
(* IL Equivalence: *)
LD
SIN
ST
ASIN
ST angle sine result
ISaGRAF 5.2
- Language Reference 745
SQRT
Arguments:
IN REAL Must be greater than or equal to zero
Q REAL Square root of the input value
Description:
Calculates the square root of a real value.
Example
(* FBD Program using "SQRT" Function *)
(* ST Equivalence: *) xpos := ABS (xval); xroot := SQRT (xpos);
(* IL Equivalence: *)
LD
ABS
ST
SQRT
ST xval xpos xrout
746
ISaGRAF 5.2
- Language Reference
SUB_DATE_DATE
Arguments:
DAT1 DATE First date in a comparison
DAT2 DATE Second date in a comparison
TIME TIME Difference in TIME format between DAT1 and DAT2. The possible date difference values range from t#0h to t#1193h2m47s294ms inclusively.
A value of 1193h2m47s295ms indicates an error for either of the following conditions:
- DAT1 is less than DAT2
- The difference between DAT1 and DAT2 is greater than
1193h2m47s294ms
Description:
Compares two dates and gives the difference in TIME format.
Example
(* FBD Program using "
SUB_DATE_DATE
" Function *)
ISaGRAF 5.2
- Language Reference 747
(* ST Equivalence: *) timResult := SUB_DATE_DATE (datVal1, datVal2);
(* IL Equivalence: *)
LD datVal1
SUB_DATE_DATE datVal2
ST timResult
TAN
Arguments:
IN REAL Cannot be equal to PI/2 modulo PI
Q REAL Tangent of the input value
= 1E+38 for invalid input
Description:
Calculates the Tangent of a real value.
748
ISaGRAF 5.2
- Language Reference
Example
(* FBD Program using "TAN" and "ATAN" Functions *)
(* ST Equivalence: *) tangent := TAN (angle); result := ATAN (tangent); (* result is equal to angle*)
(* IL Equivalence: *)
LD
TAN
ST
ATAN
ST angle tangent result
TRUNC
Arguments:
IN REAL Any REAL value
Q REAL If IN>0, biggest integer less or equal to the input
If IN<0, least integer greater or equal to the input
ISaGRAF 5.2
- Language Reference 749
Description:
Truncates a real value to have just the integer part.
Example
(* FBD Program using "TRUNC" Function *)
(* ST Equivalence: *) result := TRUNC (+2.67) + TRUNC (-2.0891);
(* means: result := 2.0 + (-2.0) := 0.0; *)
(* IL Equivalence: *)
LD
TRUNC
ST
LD
TRUNC
ADD
ST
2.67
temporary
-2.0891
temporary result
(* temporary result of first TRUNC *)
750
ISaGRAF 5.2
- Language Reference
XOR_MASK
Arguments:
IN
MSK
Q
DINT
DINT
DINT
Must have integer format
Must have integer format
Bit-to-bit logical
Exclusive OR
between IN and MSK
Description:
Integer exclusive OR bit-to-bit mask
Example
(* FBD example with
XOR_MASK
Operators *)
(* ST Equivalence: *) crc32 := XOR_MASK (prevcrc, nextc); result := XOR_MASK (16#012, 16#011); (* equals 16#003 *)
(* IL equivalence: *)
LD
XOR_MASK prevcrc nextc
ISaGRAF 5.2
- Language Reference 751
ST
LD
XOR_MASK
ST crc32
16#012
16#011 result
752
ISaGRAF 5.2
- Language Reference
Standard Function Blocks
ISaGRAF
supports three types of standard function blocks:
Basic Operations
Basic function blocks perform various basic operations:
ISaGRAF
supports the following standard function blocks:
Alarms management
Boolean operations
Communications
Comparator
Counters
High/low limit alarm with hysteresis
Set dominant bistable
Reset dominant bistable
Rising edge detection
Falling edge detection
Connection to a resource
Sending of a message to a resource
Reception of a message from a resource
Full comparison Function Block
Up counter
Down counter
Up-down counter
ISaGRAF 5.2
- Language Reference 753
Data manipulation
Process control
Running average over N samples
Differentiation according to time
Boolean hysteresis on difference of reals
Integration over time
Semaphore manipulation
Signal generation
Target control
Time operations
Stack of integer
Manipulates a software semaphore
Blinking Boolean signal
Signal generator
Provides access, from the Workbench while in Run mode, to the alarm properties of alarm-configured or event-configured variables
Provides access to the field communication statistical information
Current time, in the date's parts
Current time, in seconds
On-delay timing
Off-delay timing
Pulse timing
Note:
When new function blocks are created, they can be called from any language.
754
ISaGRAF 5.2
- Language Reference
AS_AE
Note:
This function block is for use only with the Advanced Options.
Arguments:
RES DINT
7
8
101
102
103
104
5
6
3
4
1
2 status of the operation:
0
ISaGRAF 5.2
- Language Reference 755
STR STRING Message corresponding to the status of the operation obtained in
RES:
0 = OK
1 = SPEC file not found
2 = Incorrect spec file format
3 = Unknown variable name
4 = Symbol table not found
5 = General failure
6 = Unknown input type
7 = No memory available
8 = AS_AE instance already exists
101 = No event queue
102 = Send event queue timeout
103 = Access event queue error
104 = Event queue full
Description
Provides access, while in online mode, to the alarm properties of alarm-configured or event-configured variables. For each resource having such variables, the AS_AE function block is automatically instantiated when you perform a build.
The AS_AE function block is not instantiated during simulation mode.
The results of the function block appear in the dictionary, in the form of array structures: one structure, AS_AE_FB, holding the function block's status information, an instance,
AS_Alarm_
type
, for each alarm test set for each alarm-configured variable, and an instance,
AS_Event_
type
, for each event-configured variable. A file making the correspondence between tests for alarm-configured variables and event-configured variables and their AS_AE function instances is automatically created. This file is located in My
Projects\ISaGRAF\Workbench\Prj\
project_name
\SymbolTable\
resource_name
_AE.txt.
756
ISaGRAF 5.2
- Language Reference
Each alarm test array holds its alarm properties, previously defined in the advanced options for variables, for one test condition of an alarm-configured variable. Whereas, each event test array holds the event properties, also previously defined in the advanced options for variables, for one event-configured variable. Alarm and event specific data types are used for the AS_AE function instances. These properties differ depending on the data type of the variable:
Alarm/Event
Configuration
Alarm
Alarm
Alarm
Event
Event
Event
Variable Type
REAL, FLDIOREAL
DINT, FLDIODINT
DINT, FLDIODINT
BOOL, FLDIOBOOL
AS_AE Array
Instantiation
BOOL, FLDIOBOOL
REAL, FLDIOREAL
Data Type
COND_P_REAL
COND_P_DINT
COND_P_BOOL
EVENT_P_REAL
EVENT_P_DINT
EVENT_P_BOOL
Properties available from the Workbench for the alarm and event types:
AS_Alarm_REAL
Struct{
DINT State (*OUT bit 0: active/inactive, bit 1 enable/disable, bit 2: ack*)
TIMESPEC ActiveTime (*OUT*)
TIMESPEC InactiveTime (*OUT*)
TIMESPEC AckTime (*OUT*)
DINT
BOOL
Timeout (*IN transient filter*)
Enable (*IN*)
BOOL
REAL
REAL
REAL
Acknowledge (*IN*)
Level (*IN*)
Hysterisis (*IN*)
Deadband (*IN*)
}COND_P_REAL
Note:
If you change the value of AckTime, bit 2 of the State field is set to 1.
ISaGRAF 5.2
- Language Reference 757
AS_Alarm_DINT
Struct{
DINT
}COND_P_DINT
AS_Alarm_BOOL
TIMESPEC
TIMESPEC
TIMESPEC
DINT
BOOL
BOOL
REAL
REAL
REAL
State (*OUT bit 0: active/inactive, bit 1 enable/disable, bit 2: ack*)
ActiveTime (*OUT*)
InactiveTime (*OUT*)
AckTime (*OUT*)
Timeout (*IN transient filter*)
Enable (*IN*)
Acknowledge (*IN*)
Level (*IN*)
Hysterisis (*IN*)
Deadband (*IN*)
Struct{
}COND_P_BOOL
AS_EVENT_REAL
DINT State (*OUT bit 0: active/inactive, bit 1 enable/disable, bit 2: ack*)
TIMESPEC ActiveTime (*OUT*)
TIMESPEC InactiveTime (*OUT*)
TIMESPEC AckTime (*OUT*)
DINT Timeout (*IN transient filter*)
BOOL
BOOL
SINT
Enable (*IN*)
Acknowledge (*IN*)
Mode (*IN*)
Struct{
BOOL Enable (*IN*)
758
ISaGRAF 5.2
- Language Reference
}COND_P_REAL
AS_EVENT_DINT
REAL
Struct{
}COND_P_REAL
AS_EVENT_BOOL
BOOL
DINT
Struct{
BOOL
SINT
}COND_P_BOOL
Deadband (*IN*)
Enable (*IN*)
Deadband (*IN*)
Enable (*IN*)
Mode (*IN bit 0: 0 -> 1 trigger, bit 1: 1 ->
0 trigger*)
ISaGRAF 5.2
- Language Reference 759
AVERAGE
Arguments:
RUN
XIN
BOOL TRUE=run / FALSE=reset
REAL Any real Variable
N DINT Application defined number of samples
XOUT REAL Running average of XIN value
Note:
When setting or changing the value for N, you need to set RUN to FALSE, then set it back to TRUE.
Description:
Stores a value at each cycle and calculates the average value of all already stored values. Only the N last values are stored.
The number of samples
N
cannot exceed
128
.
If the "
RUN
" command is
FALSE
(reset mode), the output value is equal to the input value.
When the maximum N of stored values is reached, the first stored value is erased by the last one.
Example
(* FBD Program using "AVERAGE" Block: *)
760
ISaGRAF 5.2
- Language Reference
(* ST Equivalence: AVERAGE1 instance of AVERAGE block *)
AVERAGE1((auto_mode & store_cmd), sensor_value, 100); ave_value := AVERAGE1.XOUT;
BLINK
Arguments:
RUN BOOL Mode: TRUE=blinking / FALSE=reset the output to false
CYCLE TIME Blinking period. Possible values range from 0ms to 23h59m59s999ms.
Q BOOL Output blinking signal
Description:
Generates a blinking signal.
Timing diagram:
ISaGRAF 5.2
- Language Reference 761
CMP
Arguments:
VAL1 DINT
VAL2 DINT
LT
EQ
GT
BOOL
BOOL
BOOL
Description:
Any signed integer value
Any signed integer value
TRUE if val1 is Less Than val2
TRUE if val1 is Equal to val2
TRUE if val1 is Greater Than val2
Compare two values: tell if they are equal, or if the first is less or greater than the second one.
Example
(* FBD Program using "CMP" Block *)
(* ST Equivalence: We suppose CMP1 is an instance of CMP block *)
CMP1(level, max_level); pump_cmd := CMP1.LT OR CMP1.EQ; alarm := CMP1.GT AND NOT(manual_mode);
762
ISaGRAF 5.2
- Language Reference
CONNECT
Arguments:
EN_C BOOL Enable connection.
PARTNER STRING Name of the remote communication partner.
VALID
ERROR
BOOL
BOOL
If TRUE, connection ID is valid.
If TRUE, new non-zero status received.
STATUS
ID
DINT
DINT
Last detected status.
Identification of the communication Channel.
Description:
Creates a connection with a remote or local Resource (of current Project or another Project)
and manages the exchanges (for blocks USEND_S and URCV_S).
It creates a communication channel identifier (ID).
This identifier is required in all others communication function blocks (URCV_S or
USEND_S).
PARTNER parameter is a string with the following format:
'ResourceNumber@Address'
Example
Connection with the driver to Resource 1 at address 123.45.67.89.
ISaGRAF 5.2
- Language Reference 763
If the Resource is on the same Configuration, its number is enough to identify it (e.g. '1').
On a rising edge of EN_C parameter, the CONNECT Block establishes the communication with the remote partner.
The VALID parameter is set to TRUE until the communication is available.
Every time the status changes, the output parameter ERROR is set to TRUE during one cycle and the new status is set in the STATUS parameter.
STATUS can take following values:
STATUS
3
4
0
2
5
6
Description
Connection successfully completed.
Too many CONNECT FB instances
Not ready for a new connection
Connect failed
Bad or lost partner
Dialog with partner failed
If the connection failed, a new connection is not automatically done, a rising edge must be detected on EN_C parameter.
Example
The following is a program of Resource 3 that sends a string to Resource 4 on the same
Configuration:
764
ISaGRAF 5.2
- Language Reference
The following is the corresponding program in Resource 4 that receives the string:
CTD
Arguments:
CD BOOL Counting input
(down-counting when CD is TRUE)
LOAD BOOL Load command (dominant)
(CV = PV when LOAD is TRUE)
PV
Q
CV
DINT
BOOL
DINT
Programmed initial value
Underflow: TRUE when CV <= 0
Counter result
Warning:
The CTD Block does not detect the rising or falling edges of the counting input
(CD). It must be associated with an "R_TRIG" or "F_TRIG" block to create a pulse counter.
Description:
Count (integer) from a given value down to 0 1 by 1
ISaGRAF 5.2
- Language Reference 765
Example
(* FBD Program using "CTD" Block *)
(* ST Equivalence: We suppose F_TRIG1 is an instance of F_TRIG block and CTD1 is an instance of CTD block*)
F_TRIG1(command);
CTD1(F_TRIG1.Q,load_cmd,100); underflow := CTD1.Q; result := CTD1.CV;
CTU
Arguments:
CU BOOL Counting input (counting when CU is TRUE)
RESET BOOL Reset command (dominant)
PV
Q
CV
DINT
BOOL
DINT
Programmed maximum value
Overflow: TRUE when CV >= PV
Counter result
Warning:
The CTU Block does not detect the rising or falling edge of the counting input (CU).
It must be associated with an "R_TRIG" or "F_TRIG" block to create a pulse counter.
766
ISaGRAF 5.2
- Language Reference
Description:
Count (integer) from 0 up to a given value 1 by 1
Example
(* FBD Program using "CTU" Block *)
(* ST Equivalence: We suppose R_TRIG1 is an instance of R_TRIG block and CTU1 is an instance of CTU block*)
R_TRIG1(command);
CTU1(R_TRIG1.Q,NOT(auto_mode),100); overflow := CTU1.Q; result := CTU1.CV;
ISaGRAF 5.2
- Language Reference 767
CTUD
Arguments:
CU
CD
RESET
LOAD
PV
QU
QD
CV
BOOL Up-counting (when CU is TRUE)
BOOL Down-counting (when CD is TRUE)
BOOL Reset command (dominant)
(CV = 0 when RESET is TRUE)
BOOL
DINT
Load command (CV = PV when LOAD is TRUE)
Programmed maximum value
BOOL Overflow: TRUE when CV >= PV
BOOL Underflow: TRUE when CV <= 0
DINT Counter result
Warning:
The CTUD Block does not detect the rising or falling edge of the counting inputs
(CU and CD). It must be associated with an "R_TRIG" or "F_TRIG" Block to create a pulse counter.
Description:
Count (integer) from 0 up to a given value 1 by 1 or from a given value down to 0 1 by 1
768
ISaGRAF 5.2
- Language Reference
Example
(* FBD Program using "CTUD" Block *)
(* ST Equivalence: We suppose R_TRIG1 and R_TRIG2 are two instances of R_TRIG Block and CTUD1 is an instance of CTUD block*)
R_TRIG1(add_elt);
R_TRIG2(sub_elt);
CTUD1(R_TRIG1.Q, R_TRIG2.Q, reset_cmd, load_cmd,100); full := CTUD1.QU; empty := CTUD1.QD; nb_elt := CTUD1.CV;
ISaGRAF 5.2
- Language Reference 769
DERIVATE
Arguments:
RUN
XIN
BOOL
REAL
CYCLE TIME
Mode: TRUE=normal / FALSE=reset
Input: any real value
Sampling period. Possible values range from 0ms to
23h59m59s999ms.
Differentiated output XOUT
Description:
REAL
Differentiation of a real value.
If the "
CYCLE
" parameter value is less than the cycle timing of the execution of the resource
in the target, the sampling period is forced to this cycle timing.
Example
(* FBD Program using "DERIVATE" Block: *)
(* ST Equivalence: DERIVATE1 instance of DERIVATE block *)
DERIVATE1(manual_mode, sensor_value, t#100ms); derivated_value := DERIVATE1.XOUT;
770
ISaGRAF 5.2
- Language Reference
F_TRIG
Arguments:
CLK
Q
BOOL Any Boolean Variable
BOOL TRUE when CLK changes from TRUE to FALSE
FALSE if all other cases
Description:
Detects a falling edge of a Boolean Variable
Example
(* FBD Program using "F_TRIG" Block *)
(* ST Equivalence: We suppose F_TRIG1 is an instance of F_TRIG block *)
F_TRIG1(cmd); nb_edge := ANY_TO_DINT(F_TRIG1.Q) + nb_edge;
ISaGRAF 5.2
- Language Reference 771
FC_GET_STAT
Note:
This function block is for use only with the Advanced Options.
Arguments:
DriverID
ResetStatistics
772
DINT
BOOL
Driver ID number, used to access the statistics
Resets the statistics when changes from FALSE to
TRUE
ISaGRAF 5.2
- Language Reference
ReturnCode
FCMVersion
FCMLogName
FCMCmdCnt
FCMIdletime
FCMRunTime
FCMStatus
FCMPollingDelay DINT
FCMPriority
AttachName
Version
MaxIO
IOCnt
BlockCnt
MinRefresh
SINT
STRING
STRING
DINT
DINT
DINT
DINT
SINT
STRING
STRING
DINT
DINT
DINT
STRING
Status of the function:
0 = statistics are valid
1 = connection to the Field Communication Manager failed
2 = invalid driver ID
Version number of the field communication manager
Log name of the field communication manager
Command count, the number of requests sent to the field communication manager by the Resource
Total idle time since the field communication manager was started (in milliseconds)
Total run time of the field communication manager since it was started (in milliseconds)
Status of the field communication manager:
OK
Run-time Error
Communication Error
Configuration Error
Out of Memory
Warning, Non-fatal
Polling delay, the time interval between the completion of polled requests and the next polling session (in milliseconds)
Priority of the field communication manager in the target operating system
Attach name, attaching the driver to the target operating system
Current version of the driver
Maximum number of I/Os being read in one request
Total number of I/Os defined for the driver
Total number of blocks of I/Os. These blocks are defined in the field communication manager.
Minimum refresh, the fastest scan period defined in the running I/Os (in milliseconds)
ISaGRAF 5.2
- Language Reference 773
MaxRefresh
ScanPeriod
DINT
DINT
NormQueueMaxCnt DINT
HiPrioQueueMaxCnt DINT
SendRespMaxTime DINT
SendRespMinTime DINT
SendRespMeanTime DINT
FlowControlCnt DINT
RequestPerMin DINT
CmdCnt
ScanCnt
ShMemReadCnt
DelayedPollingCnt
RestartCnt
WriteReqCnt
DINT
DINT
DINT
DINT
DINT
DINT
Maximum refresh, the slowest scan period defined in the running I/Os (in milliseconds)
Time interval between two refreshes of I/Os in the field (in milliseconds)
Normal queue maximum count, the number of requests in the normal priority queue
High priority maximum count, the number of requests in the high priority queue
Send response maximum time, the slowest reponse time between a request and a response (in milliseconds)
Send response minimum time, the fastest reponse time between a request and a response (in milliseconds)
Send response mean time, the average reponse time between a request and a response (in milliseconds)
Flow control count, the number of times the driver is in high level request queue
Requests per minute, the average number of exchanges between the driver and the field equipment per minute
Command count, the total number of requests sent to the driver
Scan count, the number of scans performed by the driver
Shared memory read count
Delayed polling count, the number of times a poll has waited to be refreshed
Restart count, the number of times the field communication manager has restarted the driver
Write request count, the total number of write requests to the driver
774
ISaGRAF 5.2
- Language Reference
ReadReqCnt
CommTimeoutCnt
EventTimeoutCnt
ChecksumCnt
RetryCnt
EventCnt
BadEventCnt
TotalRequests
TotalResponses
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
DINT
Read request count, the total number of read requests to the driver
Communication timeout count, the number of requests conducted by the field communication manager that did not bring forth responses
Event timeout count, the number of event replies the field communication manager sent out that were not acknowledged
Checksum count, the total number of Checksum errors in frames
Retry count, the number of retries for read/write requests
Event count, the total number of events received from the driver
Bad event count, the total number of bad events received from the driver
Total number of requests sent to the driver
Total number of reponse events from the driver
Description:
Accesses the field communication statistics
ISaGRAF 5.2
- Language Reference 775
GET_TIME_STRUCT
Arguments:
SEC
NSEC
DINT Number of seconds since 1970/01/01 00:00:00:000
DINT Number of nanoseconds from the beginning of the second indicated by SEC
YEAR DINT Year of the date, in a four-digit format
MONTH DINT Month of the date (1-12)
DAY
HOUR
DINT
DINT
Day of the date (1-31)
Hour of the date (0-23)
MINUTE DINT Minute of the date (0-59)
SECOND DINT Second of the date (0-29)
MSEC DINT Millisecond of the date, from the beginning of SECOND (0-999)
Description:
Converts a date into a series of DINT values representing the date's parts. The
GET_TIME_STRING function and NOW function block also perform time-related
operations.
776
ISaGRAF 5.2
- Language Reference
Example
(* ST equivalence: NOW1 is an instance of the NOW block; GET_TIME_STRUCT1 is an instance of the GET_TIME_STRUCT block. *)
NOW1(); number_seconds := NOW1.SEC; number_nanos := NOW1.NSEC;
GET_TIME_STRUCT1(number_seconds, number_nanos); cur_year := GET_TIME_STRUCT1.YEAR; cur_month := GET_TIME_STRUCT1.MONTH; cur_day := GET_TIME_STRUCT1.DAY; cur_hour := GET_TIME_STRUCT1.HOUR; cur_minute := GET_TIME_STRUCT1.MINUTE; cur_second := GET_TIME_STRUCT1.SECOND; cur_msec := GET_TIME_STRUCT1.MSEC;
ISaGRAF 5.2
- Language Reference 777
HYSTER
Arguments:
XIN1 REAL Any real value
XIN2 REAL To test if XIN1 has overpassed XIN2+EPS
EPS
Q
REAL Hysteresis value (must be greater than zero)
BOOL TRUE if XIN1 has overpassed XIN2+EPS and is not yet below
XIN2-EPS
Description:
Hysteresis on a real value for a high limit.
Example
Example of a timing diagram:
INTEGRAL
Arguments:
RUN
R1
XIN
X0
BOOL
BOOL
REAL
REAL
CYCLE TIME
Mode: TRUE=integrate / FALSE=hold
Overriding reset
Input: any real value
Initial value
Sampling period. Possible values range from 0ms to
23h59m59s999ms.
Not R1
Integrated output
Q
XOUT
Description:
BOOL
REAL
Integration of a real value.
If the "
CYCLE
" parameter value is less than the cycle timing of the execution of the resource
in the target, the sampling period is forced to this cycle timing.
ISaGRAF 5.2
- Language Reference 779
Example
(* FBD Program using "INTEGRAL" Block: *)
(* ST Equivalence: INTEGRAL1 instance of INTEGRAL block *)
INTEGRAL1(manual_mode, NOT(manual_mode), sensor_value, init_value, t#100ms); controlled_value := INTEGRAL1.XOUT;
780
ISaGRAF 5.2
- Language Reference
LIM_ALRM
Arguments:
H
X
L
EPS
QH
Q
QL
Description:
REAL
REAL
REAL
REAL
High limit value
Input: any real value
Low limit value
Hysteresis value (must be greater than zero)
BOOL "high" alarm: TRUE if X above high limit H
BOOL Alarm output: TRUE if X out of limits
BOOL "low" alarm: TRUE if X below low limit L
Hysteresis on a real value for high and low limits.
A hysteresis is applied on high and low limits. The hysteresis delta used for either high or low limit is one half of the EPS parameter.
Example
Example of timing diagram:
ISaGRAF 5.2
- Language Reference 781
NOW
Arguments:
SEC DINT Number of seconds since 1970/01/01 00:00:00:000
NSEC DINT Number of nanoseconds from the beginning of the second indicated by
SEC
Description:
Gets the current time since 1970/01/01 00:00:00:000, in seconds. The GET_TIME_STRING
function and GET_TIME_STRUCT function block also perform time-related operations.
The ANY_TO_DATE function enables the conversion of NSEC to a date format.
Example
(* ST equivalence: NOW1 is an instance of the NOW block. *)
NOW1(); number_seconds := NOW1.SEC; number_nanos := NOW1.NSEC;
782
ISaGRAF 5.2
- Language Reference
R_TRIG
Arguments:
CLK
Q
BOOL Any Boolean Variable
BOOL TRUE when CLK rises from FALSE to TRUE
FALSE in all other cases
Description:
Detects a Rising Edge of a Boolean Variable
Example
(* FBD Program using "R_TRIG" Block *)
(* ST Equivalence: We suppose R_TRIG1 is an instance of R_TRIG Block *)
R_TRIG1(cmd); nb_edge := ANY_TO_DINT(R_TRIG1.Q) + nb_edge;
ISaGRAF 5.2
- Language Reference 783
RS
Arguments:
SET
RESET1
Q1
Description:
BOOL If TRUE, sets Q1 to TRUE
BOOL If TRUE, resets Q1 to FALSE (dominant)
BOOL Boolean memory state
Reset dominant bistable:
Set Reset1 Q1 Result
1
1
1
1
0
0
0 0
0 0
1
1
1
1
0
0
0
1
0
1
0
1
0
1
0
1
0
0
1
1
0
0
Example
(* FBD Program using "RS" Block *)
784
ISaGRAF 5.2
- Language Reference
(* ST Equivalence: We suppose RS1 is an instance of RS block *)
RS1(start_cmd, (stop_cmd OR alarm)); command := RS1.Q1;
SEMA
Note:
This operator is only available for
ISaGRAF
3
configurations.
Arguments:
CLAIM BOOL "test and set" command
RELEASE BOOL Releases the semaphore
BUSY BOOL State of the semaphore
Description:
Manipulates a software semaphore.
(* "x" is a Boolean variable initialized to FALSE *) busy := x;
If claim Then x := True;
Else
If release Then busy := False; x := False;
End_if;
End_if;
ISaGRAF 5.2
- Language Reference 785
SR
Arguments:
SET1 BOOL If TRUE, sets Q1 to TRUE (dominant)
RESET BOOL If TRUE, resets Q1 to FALSE
Q1 BOOL Boolean memory state
Description:
Set dominant bistable:
Set1 Reset
1
1
1
1
0
0
0 0
0 0
1
1
1
1
0
0
1
1
1
1
0
0
0
1
Q1 Result
0
1
0
1
0
1
0
1
Example
(* FBD Program using "SR" Block *)
786
ISaGRAF 5.2
- Language Reference
(* ST Equivalence: We suppose SR1 is an instance of SR block *)
SR1((auto_mode & start_cmd), stop_cmd); command := SR1.Q1;
SIG_GEN
Arguments:
RUN
PERIOD
BOOL Mode: TRUE=running / FALSE=reset to false
TIME Duration of one sample. Possible values range from 0ms to
23h59m59s999ms.
MAXIMUM DINT
PULSE BOOL
Maximum counting value
Inverted after each sample
UP
END
SINE
DINT
BOOL
REAL
Up-counter, increased on each sample
TRUE when up-counting ends
Sine signal (period = counting duration)
Description:
Generates various signal: blink on a boolean, a integer counter-up, and real sine wave.
When counting reaches maximum value, it restarts from 0 (zero). So END keeps the TRUE value only during 1 PERIOD.
ISaGRAF 5.2
- Language Reference 787
Timing diagram:
788
ISaGRAF 5.2
- Language Reference
STACKINT
Arguments:
PUSH
POP
BOOL
Push command (on Rising Edge only)
add the IN value on the top of the stack
BOOL Pop command (on rising edge only) delete in the stack the last value pushed (top of the stack)
R1
IN
BOOL Resets the stack to its empty state
DINT Pushed value
N DINT Application defined stack size
EMPTY BOOL TRUE if the stack is empty
OFLO
OUT
BOOL Overflow: TRUE if the stack is full
DINT Value at the top of the stack
Description:
Manage a stack of integer values.
The "STACKINT" Function Block includes a rising edge detection for both PUSH and POP commands. The maximum size of the stack is
128
. The application defined stack size
N
cannot be less than 1 or greater than 128.
Note:
OFLO value is valid only after a reset (R1 has been set to TRUE at least once and back to FALSE).
ISaGRAF 5.2
- Language Reference 789
Example
(* FBD Program using "STACKINT" Block: error management *)
(* ST Equivalence: We suppose STACKINT1 is an instance of STACKINT Block *)
STACKINT1(err_detect, acknoledge, manual_mode, err_code, max_err); appli_alarm := auto_mode AND NOT(STACKINT1.EMPTY); err_alarm := STACKINT1.OFLO; last_error := STACKINT1.OUT;
790
ISaGRAF 5.2
- Language Reference
TOF
Arguments:
IN BOOL
If Falling Edge, starts increasing internal timer
If Rising Edge, stops and resets internal timer
PT TIME Maximum programmed time
Q BOOL If TRUE: total time is not elapsed
ET TIME Current elapsed time
Description:
Increase an internal timer up to a given value.
Timing diagram:
ISaGRAF 5.2
- Language Reference 791
TON
Arguments:
IN BOOL
If Rising Edge, starts increasing internal timer
If Falling Edge, stops and resets internal timer
PT TIME Maximum programmed time
Q BOOL If TRUE, programmed time is elapsed
ET TIME Current elapsed time. Possible values range from 0ms to 23h59m59s999ms.
Description:
Increase an internal timer up to a given value.
Timing diagram:
792
ISaGRAF 5.2
- Language Reference
TP
Arguments:
IN BOOL
If Rising Edge, starts increasing internal timer (if not already increasing)
If FALSE and only if timer is elapsed, resets the internal timer
Any change on IN during counting has no effect.
PT TIME Maximum programmed time
Q BOOL If TRUE: timer is counting
ET TIME Current elapsed time. Possible values range from 0ms to 23h59m59s999ms.
Description:
Increase an internal timer up to a given value.
Timing diagram:
ISaGRAF 5.2
- Language Reference 793
URCV_S
Arguments:
EN_R
ID
R_ID
NDR
BOOL
DINT
Enable to receive data
Identification of the communication Channel
STRING Identification of the remote SFB inside the Channel
BOOL If TRUE, new string received in RD
ERROR BOOL
STATUS DINT
RD
If TRUE, new non-zero STATUS received
Last detected status
STRING Received string
Description:
Receive a string from a remote or local resource (of current Project or another Project).
Warning:
Connect block must have been called in current cycle before the URCV_S call. This
CFB receives a string from one USEND_S instance. Previously received string is overwritten.
If string is successfully received then NDR is set to TRUE during one cycle. If an error occurs, the ERROR output parameter is set to TRUE and the status is set in the STATUS parameter.
STATUS can have the following values:
STATUS
2
3
0
1
Description
Receive successfully completed
Waiting for message
Invalid identifier
Not ready for receive
794
ISaGRAF 5.2
- Language Reference
6
7
Waiting for message
Dialog has failed
See example in the description of the CONNECT Block.
USEND_S
Arguments:
REQ
ID
R_ID
SD
BOOL
DINT
Send request on rising edge
Identification of the communication channel
STRING Identification of the remote CFB inside the channel
STRING String to send
DONE
ERROR
BOOL
BOOL
STATUS DINT
If TRUE, function performed successfully
If TRUE, new non-zero STATUS received
Last detected status
Description:
Send a string to a remote or local Resource (of current Project or another Project).
Warning:
Connect block must have been called in current cycle before the USEND_S call.
This CFB sends a string to one URCV_S instance on rising edge of REQ. If string is successfully sent then DONE is set. If an error occurs, the output parameter ERROR is set to
TRUE and the status is set in the STATUS parameter.
ISaGRAF 5.2
- Language Reference 795
STATUS can have the following values:
STATUS
2
3
0
1
6
7
Description
Send successfully completed
Send in progress
Invalid identifier
Not ready to send
Dialog has failed
Send has failed
If the send failed, a new send is not automatically done, a rising edge must be detected on REQ parameter.
See example in the description of the CONNECT block.
796
ISaGRAF 5.2
- Language Reference
Advanced Control
Advanced Control function blocks perform various process control operations:
Alarms management
Boolean operations
Comparator
Process control
Provides a flip-flop function
Compares an input signal with a value and indicates when the value is exceeded
Eliminates overshoot during startup conditions
when using the IPIDController function block
Integrates an analog input with alarms on presets and provides a pulse output to drive a remote counter
Provides a means to bias a signal, such as the setpoint in an external set application
Calibrates a Bias value while tracking an input signal
Provides segments that can characterize an input signal
An interacting PID controller
LeadLagController A lead/lag controller
Provides alarm conditions for an analog input
Provides alarm conditions for a digital input
Limits an input value to a range between a low and high limit
To be defined
Limits the rate of change for an input signal
Provides a means of setting a ratio in an external setpoint application
Calibrates Ratio by tracking an input signal
Performs an on-delay timing function with output states determined by input values used to start and enable a timer
ISaGRAF 5.2
- Language Reference 797
Scales an input value according to an output range
Multi-action setpoint command having six different settings and adjustments of setpoint for controller
Selects either the highest or lowest signal value from three input signals
Holds an initial value transferred to an output on first scan then either tracks the input signal or holds the last output value
Selects a signal between two input signals
798
ISaGRAF 5.2
- Language Reference
AnalogAlarm
Arguments:
INA
INB
ENB
ACK
SET
REAL
REAL
BOOL[0..2]
Input signal A
Input signal B for deviation alarms calculation
OutputEnable. For each entry, possible values are True or False:
BOOL[0..2]
1
2
0 High/Low Limit, High/Low Alarm,
High/Low Warning
Deviation High and Deviation Low
Rate of Change Up and Rate of Change
Down
Acknowledge. For each entry, possible values are True or False:
0
1
2
High/Low Limit, High/Low Alarm,
High/Low Warning
Deviation High and Deviation Low
Rate of Change Up and Rate of Change
Down
ALARMSETTING AlarmSetting. See ALARMSETTING structure
ISaGRAF 5.2
- Language Reference 799
ERR
OUTA
OUTB
OUTC
DINT
DINT
DINT
DINT
ErrorMode. Mode used to handle errors of the different types:
RateOfChangePeriod <= 0.0. Possible values are:
1 prints message in ErrorLog and stops
0 resource sets RateOfChangeUpEnable and
RateOfChangeDownEnable to FALSE
RateOfChangeUp <= 0.0. Possible values are:
1 prints message in ErrorLog and stops resource
0 sets RateOfChangeUpEnable to FALSE
RateOfChangeDown <= 0.0. Possible values are:
1 prints message in ErrorLog and stops resource
0 sets RateOfChangeDownEnable to FALSE
HighDeviation < 0.0. Possible values are:
1 prints message in ErrorLog and stops resource
0 sets HighDeviationEnable to FALSE
LowDeviation < 0.0. Possible values are:
1 prints message in ErrorLog and stops resource
0 sets LowDeviationEnable to FALSE
(OutputA) Output for High/Low Limit, High/Low
Alarm, High/Low Warning alarms
(OutputB) Output for Deviation High and Deviation
Low alarms
(OutputC) Output for Rate of Change Up and Rate of
Change Down alarms
Description:
Provides 10 alarm conditions for an analog input. There are three outputs, one for each alarm category: High/Low alarms, deviation alarms, and rate of change alarms.
800
ISaGRAF 5.2
- Language Reference
ALARMSETTING structure:
HighLimit
HighAlarm
HighWarning
LowWarning
LowAlarm
LowLimit
DeadBand
HighDeviation
LowDeviation
RateOfChangePeriod
RateOfChangeUp
RateOfChangeDown
DelayInTime
DelayOutTime
HighLimitEnable
HighAlarmEnable
REAL Value for which InputA exceeds the maximum range
REAL Value above which InputA is in high alarm condition
REAL Value above which InputA is in warning alarm condition
REAL Value below which InputA is in warning alarm condition
REAL Value below which InputA is in high alarm condition
REAL Value for which InputA exceed is out of minimum range
REAL Value for which InputA must be changed to get out of alarm condition
REAL Maximum acceptable difference in value from
InputA to InputB
REAL Maximum acceptable difference in value from
InputB to InputA
REAL Time interval used to calculate RateOfChange alarms, in seconds
REAL Maximum increase in value of InputA during the
RateOfChangePeriod triggering a rate of change up alarm
REAL Minimum decrease in value of InputA during the
RateOfChangePeriod triggering a rate of change down alarm
REAL Minimum period of time, in seconds, during which a condition is present before activating alarms (High and Low Limit, Alarm, Warning, and Deviation)
REAL Minimum period of time, in seconds, during which a condition is absent before deactivating alarms (High and Low Limit, Alarm, Warning and Deviation)
BOOL Bit enabling HighLimit alarm check
BOOL
Bit enabling
High
Alarm alarm check
ISaGRAF 5.2
- Language Reference 801
HighWarningEnable
LowWarning Enable
LowAlarmEnable
LowLimitEnable
BOOL Bit enabling HighWarning alarm check
BOOL Bit enabling LowWarning alarm check
BOOL Bit enabling LowAlarm alarm check
BOOL Bit enabling LowLimit alarm check
HighDeviationEnable
LowDeviationEnable
BOOL Bit enabling HighDeviation alarm check
BOOL Bit enabling LowDeviation alarm check
RateOfChangeUpEnable BOOL Bit enabling RateOfChangeUp alarm check
RateOfChangeDown Enable BOOL Bit enabling RateOfChangeDown alarm check
RingBack BOOL Bit enabling the Not-Present Not-Acknowledge state when a condition alarm goes out
High/Low Alarms
Conditions making high/low alarms switch from not present to present
High Limit HighLimitEnable is TRUE and InputA has been greater than
HighLimit for a period of time greater than DelayInTime
High Alarm
High Warning
HighAlarmEnable is TRUE and InputA has been greater than
HighAlarm and lower than HighLimit for a period of time greater than
DelayInTime
HighWarningEnable is TRUE and InputA has been greater than
HighWarning and lower than HighAlarm for a period of time greater than DelayInTime
Low Warning
Low Alarm
Low Limit
LowWarningEnable is TRUE and InputA has been lower than
LowWarning and higher than LowAlarm for a period of time greater than DelayInTime
LowAlarmEnable is TRUE and InputA has been lower than
LowAlarm and higher than LowLimit for a period of time greater than
DelayInTime
LowLimitEnable is TRUE and InputA has been lower than LowLimit for a period of time greater than DelayInTime
802
ISaGRAF 5.2
- Language Reference
Conditions making high/low alarms switch from present to not present
High Limit HighLimitEnable is TRUE and InputA has been lower than HighLimit minus DeadBand for a period of time greater than DelayOutTime
High Alarm
High Warning
HighAlarmEnable is TRUE and InputA has been lower then
HighAlarm minus DeadBand for a period of time greater than
DelayOutTime
HighWarningEnable is TRUE and InputA has been lower than
HighWarning minus DeadBand for a period of time greater than
DelayOutTime
Low Warning
Low Alarm
Low Limit
LowWarningEnable is TRUE and InputA has been greater than
LowWarning plus DeadBand for a period of time greater than
DelayOutTime
LowAlarmEnable is TRUE and InputA has been greater than
LowAlarm plus DeadBand for a period of time greater than
DelayOutTime
LowLimitEnable is TRUE and InputA has been greater than LowLimit plus DeadBand for a period of time greater than DelayOutTime
OutputA Values:
State
No Alarm
Value
0
Present
yes
Acknowledged
no
HighLimit
HighAlarm
HighWarning
3
LowWarning
4
1
2
LowAlarm
LowLimit
5
6 yes yes
11
12
13
14
15
16 no(1) no(1)
21
22
23
24
25
26
ISaGRAF 5.2
- Language Reference 803
When OutputEnable[0] is FALSE, then the value of OutputA equals 0 (no alarm). The alarm is still processed but the value is kept internally.
If RingBack is TRUE, when an alarm state is Present-Acknowledge, the next step is
Not-Present-Not-Acknowledge instead of no alarm. This causes a previously acknowledged alarm to require acknowledgment when the alarms clears.
Alarm Priority
High Priority High Limit – Low Limit
High Alarm – Low Alarm
Low Priority High Warning – Low Warning
If the condition of a higher priority alarm is met while the current alarm is not acknowledged, the value of Output will be changed to reflect the higher alarm state.
Conditions making deviation alarms switch from not present to present
DeviationHigh HighDeviationEnable is TRUE and InputA has been greater than
InputB plus HighDeviation for a period of time greater than
DelayInTime
DeviationLow LowDeviationEnable is TRUE and InputA has been lower than InputB minus LowDeviation for a period of time greater than DelayInTime
Conditions making deviation alarms switch from present to not present
DeviationHigh HighDeviationEnable is TRUE and InputA has been lower than
InputB plus HighDeviation minus DeadBand for a period of time greater than DelayOutTime
DeviationLow LowDeviationEnable is TRUE and InputA has been greater than
InputB minus LowDeviation plus DeadBand for a period of time greater than DelayOutTime
OutputB values:
State
No Alarm
Present
Acknowledged
Value
0 yes no yes yes no(1) no(1)
804
ISaGRAF 5.2
- Language Reference
State Value
DeviationHigh
1
DeviationLow
2
11
12
21
22
When OutputEnable[0] is FALSE, then the value of OutputB equals 0 (no alarm). The alarm is still processed but the value is kept internally.
(1) If RingBack is TRUE, when an alarm state is Present-Acknowledge the next step is
Not-Present-Not-Acknowledge instead of no alarm. This causes a previously acknowledged alarm to require acknowledgment when the alarms clears.
Rate of Change Alarms
Conditions making rate of change alarms switch from not present to present
RateOfChangeUp RateOfChangeUpEnable is TRUE and InputA increases more than the value of RateOfChangeUp during RateOfChangePeriod
RateOfChangeDown RateOfChangeDownEnable is TRUE and InputA decreases more than the value of RateOfChangeDown during RateOfChangePeriod
Conditions making rate of change alarms switch from present to not present
RateOfChangeUp RateOfChangeUpEnable is TRUE and InputA up variation over a period of RateOfChangePeriod is lower then RateOfChangeUp
RateOfChangeDown RateOfChangeDownEnable is TRUE and InputA down variation over a period of RateOfChangePeriod is lower then RateOfChangeDown
OutputC Values:
State
No Alarm
Present
Acknowledged
Value
0 yes no
RateOfChangeUp
1
RateOfChangeDown
2 yes yes
11
12 no(1) no(1)
21
22
ISaGRAF 5.2
- Language Reference 805
When OutputEnable[0] is FALSE, then the value of OutputC equals 0 (no alarm). The alarm is still processed but the value is kept internally.
(1) If RingBack is TRUE, when an alarm state is Present-Acknowledge, the next step is
Not-Present-Not-Acknowledge instead of no alarm. This will causes a previously acknowledged alarm to require acknowledgment when the alarms clears.
Example
(* ST equivalence: AnalogAlarm1 is an instance of AnalogAlarm block *)
AnalogAlarm1( Signal_InA, Signal_InB, Enable, Ack, AlarmSetting, 0);
CASE AnalogAlarm.OutputA OF
1: Message1 := 'Alarm High Limit for Signal_InA';
2: Message1 := 'Alarm High Alarm for Signal_InA';
3: Message1 := 'Alarm High Warning for Signal_InA';
4: Message1 := 'Alarm Low Warning for Signal_InA';
5: Message1 := 'Alarm Low Alarm for Signal_InA';
6: Message1 := 'Alarm Low Limit for Signal_InA';
11: Message1 := 'Alarm High Limit for Signal_InA Acknowledged';
12: Message1 := 'Alarm High Alarm for Signal_InA Acknowledged';
13: Message1 := 'Alarm High Warning for Signal_InA Acknowledged';
14: Message1 := 'Alarm Low Warning for Signal_InA Acknowledged';
15: Message1 := 'Alarm Low Alarm for Signal_InA Acknowledged';
16: Message1 := 'Alarm Low Limit for Signal_InA Acknowledged';
21: Message1 := 'Alarm High Limit for Signal_InA Done';
22: Message1 := 'Alarm High Alarm for Signal_InA Done';
23: Message1 := 'Alarm High Warning for Signal_InA Done';
24: Message1 := 'Alarm Low Warning for Signal_InA Done';
25: Message1 := 'Alarm Low Alarm for Signal_InA Done';
26: Message1 := 'Alarm Low Limit for Signal_InA Done';
END_CASE;
806
ISaGRAF 5.2
- Language Reference
BatchSwitch
Arguments:
IN
HLIM
LLIM
PREL
GAIN
OUT
Description:
REAL Input signal
REAL High limit for input signal
REAL Low limit for input signal
REAL (PreLoad) Limit on adjusting controller feedback signal
REAL Gain value
REAL Output signal
Eliminates overshoot during startup conditions when using the IPIDController function block.
When placed in the feedback path of the controller it causes the reset component of the controller to be reduced (if controller action is Reverse). Without the use of batch switch during startup, the controller output will equal full output since the reset will wind up. This requires the process to overshoot the setpoint in order to bring the controller output back down. With a batch switch in the feedback oath, a lower reset value will be present when crossover occurs, thus reducing or eliminating overshoot.
As input equals or exceeds the high or low limit setting, the output of the batch switch will either be decreased (HighLimit) or increased (LowLimit), changing the feedback signal and therefore the controller reset signal. This maintains controller output at the batch switch limit setting and eliminates reset windup.
If a controller has a large proportional gain setting, the reset can be modified too much, such that the process may undershoot the setpoint during a startup condition. The PreLoad is
ISaGRAF 5.2
- Language Reference 807
adjusted to optimize the controller for startup conditions by limiting how much the batch switch to add additional compensation, very similar to derivative action, only during start up.
Example
(* ST equivalence: BatchSwitch1 is an instance of BatchSwitch block *)
BatchSwitch1(Feedback_Out_Process, 250.0, 0.0, 50.0, 2.0);
Feedback_In_Pid := BatchSwitch1.Output;
808
ISaGRAF 5.2
- Language Reference
BatchTotalizer
Arguments:
IN
INIT
PRE1
PRE2
REAL
REAL
REAL
REAL
Input signal
Initial value
(Preset1) Value used to activate Alarm1 when Total equals Preset1
(Preset2) Value used to activate Alarm2 when Total equals Preset2
ZERO REAL (ZeroDropOut) Small positive value used as zero point for Input to stop totalling
PSCL REAL (PulseScaling) Value to scale Pulse output
TBAS DINT TimeBase. Possible values are:
1 second
2
3 minute hour
4
5 day week
STOP
RST
DA
BOOL
BOOL
Stops totalling
(Reset) Reinitialize Total to InitialValue
BOOL (DirectActing) The indication of whether totalling is incremental or decremental:
TRUE
FALSE totalling is incremental totalling is decremental
ISaGRAF 5.2
- Language Reference 809
ERR DINT (ErrorMode) Mode used to handle errors of type TimeBase < 1 or
TimeBase > 5. Possible values are:
1
0 prints message in ErrorLog and stops resource sets Total to 0.0, Alarm1 to TRUE, and Alarm2 to
TRUE
TOT REAL (Total) Batch total value
ALM1 BOOL (Alarm1) TRUE when Preset1 is reached
ALM2 BOOL (Alarm2) TRUE when Preset2 is reached
PULS BOOL Pulse output integrates the input signal using TimeBase and output pulse at the rate determined by PulseScaling. The Pulse output operates on the absolute value of Input.
Description:
Integrates an analog input with alarms on presets and provides a pulse output to drive a remote counter.
Example
(* ST equivalence: BatchTotalizer1 is an instance of BatchTotalizer block *)
BatchTotalizer1(Signal_In,
Init_Val,
PreSet1,
PreSet2,
0.0,
10.0,
1,
Stop_Batch,
Reset_Batch,
TRUE,
810
ISaGRAF 5.2
- Language Reference
0);
Pulse_Out := BatchTotalizer1.Pulse ;
Batch_Tot := BatchTotalizer1.Total ;
Done_1 := BatchTotalizer1.Alarm1 ;
Done_2 := BatchTotalizer1.Alarm2 ;
Bias
Arguments:
INA
INE
BIAS
OUT
Description:
REAL Input signal A
REAL Input signal E
REAL Bias value
REAL Output value. Output = (Bias) + InputA + InputB.
Provides a means to bias a signal, such as the setpoint in an external set application. Input signal A and input signal E are summed and then added to the operator adjustable bias BIAS.
The BiasCalibration function block calibrates Bias using a tracked input signal.
Example
(* ST equivalence: Bias1 is an instance of Bias block and
BiasCalibration1 is an instance of BiasCalibration block *)
Bias1(Signal_InA, Signal_InE, BiasCalibration1.Bias);
Out_Value := Bias1.Output ;
ISaGRAF 5.2
- Language Reference 811
BiasCalibration
Arguments:
INA
INE
INIT
HLIM
LLIM
TV
TC
BIAS
TO
REAL Input signal A
REAL Input signal E
REAL (Initial) Bias value at first scan
REAL High Limit for Ratio
REAL Low Limit for Ratio
REAL (TrackVariable) Input Signal to track
BOOL (TrackCommand) Indication of whether the value of TrackVariable is tracked:
TRUE
FALSE
TrackVariable’s value is tracked
TrackVariable’s value is not tracked
REAL Bias value
REAL (TrackOutput) Value of TrackOutput dependent on whether
TrackCommand is initiated. When TrackCommand is FALSE,
TrackOutput equals 0.0. When TrackCommand is TRUE,
TrackOutput equals (TrackVariable) - (InputA + Bias)
Description:
Calibrates Bias using TrackVariable. When TrackCommand is FALSE, Bias equals the last
Bias value and TrackOutput is 0.0. When TrackCommand is TRUE, Bias = (TrackVariable) -
(InputA + InputE); TrackOutput = (TrackVariable) - (InputA + Bias) also Bias will be limited
by HighLimit and LowLimit. The Bias function block provides a means to bias a signal such
as the setpoint in an external set application.
812
ISaGRAF 5.2
- Language Reference
Example
(* ST equivalence: Bias1 is an instance of Bias block and
BiasCalibration1 is an instance of BiasCalibration block *)
BiasCalibration1(Signal_InA,
Signal_InE,
0.2,
300.0,
10.0,
Flow_Water,
TK);
Bias1(Signal_InA, Signal_InE, BiasCalibration1.Bias);
Out_Value := Bias1.Output ;
ISaGRAF 5.2
- Language Reference 813
Characterizer
Arguments:
IN
X
Y
OUT
Description:
REAL Input X signal
REAL[0..10] (X0_X10) Inputs coordinates segments
REAL[0..10] (Y0_Y10) Outputs coordinates segments
REAL Output Y signal
Provides 10 segments that can characterize the input signal. Segments are configured by entering the Xn, Yn, Xn+1, and Yn+1 points. All Xn+1 points must be greater than the Xn points.
Example
(* ST equivalence: Characterizer1 is an instance of Characterizer block, Table_X and Table_Y are defined as REAL with dimension [0..10] in dictionary *)
Characterizer1( Signal_In, Table_X, Table_Y) ;
Characterized_Value := Characterizer1.Output ;
814
ISaGRAF 5.2
- Language Reference
Comparator
Arguments:
IN
LIM
DB
DIR
OUT
Description:
REAL Input signal
REAL Limit value
REAL Dead band value depending on setting of DirectActing. When
DirectActing is TRUE, the Output switches from TRUE to FALSE when the input is lower than Limit – DeadBand. When DirectActing is FALSE, the Output switches from TRUE to FALSE when the input is more than Limit + DeadBand.
BOOL (DirectActing) The indication of whether the function block operates in direct acting or reverse acting mode:
TRUE block is in direct acting mode and Output is TRUE when
Input >= Limit
FALSE block is in reverse acting mode and Output is TRUE when Input <= Limit
BOOL Output signal
Compares the input with a limit value and gives a TRUE output when the limit is exceeded.
Example
(* ST equivalence: Comparator1 is an instance of Comparator block *)
Comparator1(Signal_In , Limit, 5.0 , TRUE ) ;
Limit_Exceeded := Comparator1.Output ;
ISaGRAF 5.2
- Language Reference 815
DigitalAlarm
Arguments:
INA
ENB
BOOL
BOOL
ACK BOOL
MODE DINT
RB
PER
BOOL
REAL
Input signal A
(OutputEnable) Enable alarm processing
Acknowledge signal when TRUE
The conditions triggering an alarm for Output. Possible values are:
0 Output goes in alarm when input signal A is TRUE
1
(High state)
Output goes in alarm when input signal A is FALSE
2
3
(Low state)
Output goes in alarm when input signal A changes from FALSE to TRUE (Rising edge)
Output goes in alarm when input signal A changes
4
5
6 from TRUE to FALSE (Falling edge)
Output goes in alarm when input signal A changes from FALSE to TRUE or TRUE to FALSE
(change of state)
Output goes in alarm when input signal A changes from FALSE to TRUE more than once during Period
(Raising Rate Of Change)
Output go in alarm when input signal A changes from
TRUE to FALSE more than once during Period
(Falling Rate Of Change)
(RingBack) Bit enabling the Not-Present Not-Acknowledge state when a condition alarm goes out
Period of time to calculate Rate Of Change alarms, in seconds
816
ISaGRAF 5.2
- Language Reference
ERR
OUT
DINT
DINT
1
0
(ErrorMode) Mode used to handle errors of type invalids Mode.
Possible values are: prints message in ErrorLog and stops resource sets Output to zero
(Output) Alarm value = 0 when no alarm and 1 or 11 or 21 in alarm
(see Output values below).
Description:
Provides six alarm conditions for a digital input. Alarm conditions are High state, Low state,
Rising edge, Falling edge, Change of state, Rising Rate of change, and Falling Rate of change.
Output values:
State
No Alarm
Present
Acknowledged
Value
0 yes no
DigitalAlarm Output
1 yes yes
11 no(1) no(1)
21
When OutputEnable is FALSE, then Output equals 0 (no alarm). The alarm is still processed but the value is kept internally.
(1) If RingBack is TRUE, when an alarm state is Present-Acknowledge, the next step is
Not-Present-Not-Acknowledge instead of no alarm. This causes a previously acknowledged alarm to require acknowledgment when the alarms clears.
Example
(* ST equivalence: DigitalAlarm1 is an instance of DigitalAlarm block*)
DigitalAlarm1(Digit_InA, Enable, Ack, Mode, RingBack, 10, 0);
ISaGRAF 5.2
- Language Reference 817
CASE Mode OF
0:
CASE DigitalAlarm1.Output OF
1: Message2:= 'Alarm High State for Digit_InA';
11:Message2:= 'Alarm High State for Digit_InA Acknowledged';
21:Message2:= 'Alarm High State for Digit_InA Done';
END_CASE;
1:
CASE DigitalAlarm1.Output OF
1: Message2:= 'Alarm Low State for Digit_InA';
11:Message2:= 'Alarm Low State for Digit_InA Acknowledged';
21:Message2:= 'Alarm Low State for Digit_InA Done';
END_CASE;
2:
CASE DigitalAlarm1.Output OF
1: Message2:='Alarm Rising edge for Digit_InA';
11:Message2:='Alarm Rising edge for Digit_InA Acknowledged';
21:Message2:='Alarm High edge for Digit_InA Done';
END_CASE;
3:
CASE DigitalAlarm1.Output OF
1: Message2:='Alarm Falling edge for Digit_InA';
11:Message2:='Alarm Falling edge for Digit_InA Acknowledged';
21:Message2:='Alarm Falling edge for Digit_InA Done';
818
ISaGRAF 5.2
- Language Reference
END_CASE;
4:
CASE DigitalAlarm1.Output OF
1: Message2:='Alarm C.O.S. for Digit_InA';
11:Message2:='Alarm C.O.S. for Digit_InA Acknowledged';
21:Message2:='Alarm C.O.S. for Digit_InA Done';
END_CASE;
5:
CASE DigitalAlarm1.Output OF
1: Message2:='Alarm Rising ROC for Digit_InA';
11:Message2:='Alarm Rising ROC for Digit_InA Acknowledged';
21:Message2:='Alarm Rising ROC for Digit_InA Done';
END_CASE;
6:
CASE DigitalAlarm1.Output OF
1: Message2:='Alarm Falling ROC for Digit_InA';
11:Message2:='Alarm Falling ROC for Digit_InA Acknowledged';
21:Message2:='Alarm Falling ROC for Digit_InA Done';
END_CASE;
END_CASE;
ISaGRAF 5.2
- Language Reference 819
FlipFlop
Arguments:
SET
RES
OUT
Description:
BOOL Set input signal
BOOL Reset input signal
BOOL Output signal
Provides a Flip-Flop function as detailed in the truth table below:
R
1
0
0
0
S = Set input
X = any state
¸ = rising edge
S
X
¸
¸
0
0 0
R = Reset input
LO
X
1
0
0
1
O
0
0
1
0
1
Example
(* ST equivalence: FlipFlop1 is an instance of FlipFlop block *)
FlipFlop1(Reset, Set) ;
Out_Value := FlipFlop1.Output ;
820
ISaGRAF 5.2
- Language Reference
IPIDController
Arguments:
P
SP
FB
AUTO
INIT
GNS
ATUN
ATPA
ERR
OUT
AERR
REAL
REAL
REAL
BOOL
Process value
Set point
Feed Back signal
The operation mode of the PID controller:
TRUE controller runs in normal mode
FALSE controller causes reset R to track (F-GE)
BOOL (Initialize) A change in value (TRUE to FALSE or FALSE to
TRUE) causes the controller to eliminate any proportional gain during that cycle. Also initializes AutoTune sequences.
GAIN_PID
Gains PID for IPIDController (see GAIN_PID structure)
BOOL (AutoTune) When set to TRUE and Auto and Initialize are
FALSE, the AutoTune sequence is started
AT_Param
(ATParameters) Auto Tune Parameters (see AT_Param structure)
DINT (ErrorMode) Mode used to handle errors. Possible values are:
0
1
2 no error messages ErrLog file prints error messages level 1 in ErrLog file prints error messages level 1 and level 2 in
ErrLog file
REAL Output value from controller
REAL Absolute Error (Process – SetPoint) from controller
ISaGRAF 5.2
- Language Reference 821
ATW
OGNS
DINT
0
1
(ATWarning) Warning for Auto Tune sequence. Possible values are: no auto tune done in auto tune mode
2
-1
-2 auto tune done
ERROR 1 input Auto set to TRUE, no auto tune possible
ERROR 2 auto tune error, ATDynaSet expired
GAIN_PID (OutGains) Gains calculated after AutoTune sequences, see
GAIN_PID structure:
DirectActing BOOL
ProportionalGain REAL
TimeIntegral REAL
TimeDerivative
DerivativeGain
REAL
REAL
AT_Param structure:
The type of acting:
TRUE direct acting
FALSE reverse acting
Proportional gain for PID (>= 0.0001)
Time integral value for PID (>= 0.0001)
Time derivative value for PID (> 0.0)
Derivative gain for PID (> 0.0)
Load
Deviation
Step
ATDynamSet
ATReset
REAL
REAL
REAL
REAL
BOOL
Load parameter for auto tuning. This is the output value when starting AutoTune.
Deviation for auto tuning. This is the standard deviation used to evaluate the noise band needed for AutoTune.
Step value for AutoTune. Must be greater than noise band and less than ½ Load.
Waiting time before abandoning auto tune
The indication of whether the Output value is reset to zero after an AutoTune sequence:
TRUE
FALSE resets Output to zero leaves Output at Load value
822
ISaGRAF 5.2
- Language Reference
Description:
The Interacting PID controller (IPIDController) is based on the following function block: with A: Acting (+/- 1)
PG: Proportional Gain
DG: Derivative Gain
ã
D
: Time Derivative
ã
I
: Time Integral
In the HMI, the IPID faceplate is available for use with the IPIDController function block.
When Input Auto is TRUE, the IPIDController runs in normal auto mode. When Input Auto is
FALSE, this causes reset R to track (F-GE). This forces the IPIDcontroller Output to track the
Feedback within the IPIDcontroller limits and allows the controller to switch back to auto without bumping the Output.
For Input Initialize, changing from FALSE to TRUE or TRUE to FALSE when AutoTune is
FALSE causes the IPIDcontroller to eliminate any proportional gain action during that cycle
(i.e Initialize). This can be used to prevent bumping the Output when changes are made to the
SetPoint using a switch function block.
ISaGRAF 5.2
- Language Reference 823
To run an AutoTune sequence, the input ATParameters must be completed. The input Gain and
DirectActing must be set according to the process and DerivativeGain set, typically, to 0.1. The
AutoTune sequence is started with this sequence:
Put input Initialize to TRUE
Put input Autotune to TRUE
Put back Initialize to FALSE
Wait output ATWarning going to 2
Transfer values for output OutGains to input Gains
To finalize the tuning, some fine tuning may be needed depending on the processes and needs.
When setting TimeDerivative to 0.0, the IPIDController forces DerivativeGain to 1.0 then works as a PI controller.
The IPIDController was developed by independent engineering services and has not been certified by
ICS Triplex ISaGRAF
.
Example
(* ST equivalence: IPIDController1 is an instance of IPIDController block *)
IPIDController1(Proc,
SP,
FBK,
Auto,
Init,
G_In,
A_Tune,
A_TunePar,
Err );
Out_process := IPIDController1.Output ;
A_Tune_Warn := IPIDController1.ATWarning ;
Gain_Out := IPIDController1.OutGains ;
824
ISaGRAF 5.2
- Language Reference
LeadLagController
Arguments:
IN
LEAD
A
LAG
B
ENB
ERR
REAL
REAL
REAL
REAL
REAL
BOOL
DINT
Input signal
(TimeLead) Time constant for lead controller, in seconds
Gain for lead controller (a > 1 and a x b = 1)
(TimeLag) Time constant for lag controller, in seconds
Gain for lag controller (b < 1 and a x b = 1)
Enables the LeadLagController. If set to FALSE, Output = 0.0
(ErrorMode) Mode used to handle the various types of errors: a < 1.0
1
0 b > 1.0
1
0 prints message in ErrorLog and stops resource sets a to 1.0001
prints message in ErrorLog and stops resource sets b to 0.9999
TimeLag < 0
1 prints message in ErrorLog, stops resource, and sets
0
Status output to 1 sets Status output to 1
ISaGRAF 5.2
- Language Reference 825
OUT
STAT
REAL
DINT
(Output) LeadLagController output
1
2
Status for LeadLagController. Possible values are:
0 OK
3
TimeLag < 0.0
Divided by zero
Square root error (negative argument)
Description:
The LeadLagController is based on the transfer function from
Automatic control systems by
Benjamin C.Kuo
:
The lead controller gain a must be greater than 1.0, the lag controller gain b must be less than 1.0, and a multiplied by b must equal 1.0. If a x b does not equal 1.0, the controller will use b = 1/a.
With TimeLead set to zero, the controller will act as a Lag controller.
For entry errors, ErrorMode gives you the possibility to stop the resource.
For error of type division by zero or square root with negative argument, the controller sets the
Status output to 2 or 3 respectively. The Output for those cases will be 0.0.
Example
(* ST equivalence: LeadLagController1 is an instance of
LeadLagController block *)
LeadLagController1(Signal_In, T_Lead, Gain_a, T_Lag, Gain_b, Enable,
0);
Signal_Output := LeadLagController1.Output;
Status1 := LeadLagController1.Status;
826
ISaGRAF 5.2
- Language Reference
Limiter
Arguments:
IN
HLIM
LLIM
ERR
OUT
HSTS
LSTS
Description:
REAL (Input) Real value on which to limit the value
REAL High limit value
REAL Low limit value
DINT (ErrorMode) Mode used to handle errors of type HighLimit <=
LowLimit. Possible values are:
1
0 prints message in ErrorLog and stops resource sets Output = Input if HighLimit <= LowLimit
REAL (Output) Tracks Input up to HighLimit and down to LowLimit
BOOL (HighStatus) TRUE when Input > HighLimit
BOOL (LowStatus) TRUE when Input < LowLimit
Tracks Input value and limits it to a value between LowLimit and HighLimit
Example
(* ST equivalence: Limiter1 is an instance of Limiter block *)
Limiter1( InputA, 250.0, 25.0, 0 );
OutputB := Limiter1.Output ;
High_Limit := Limiter1.HighStatus ;
Low_Limit := Limiter1.LowStatus ;
ISaGRAF 5.2
- Language Reference 827
PDController
To be defined
RateLimiter
Arguments:
IN
UP
DOWN
ENB
OUT
RL
FL
Description:
REAL (Input) Real value on which to limit the rate variation
REAL (UpRate) The upper limit rate, in units/minute
REAL (DownRate) The lower limit rate, in units/minute
BOOL (Enable) TRUE enables rate limitation action
REAL (Output) When Enable is FALSE, Output equals Input. When Enable is TRUE, Output rate is limited by UpRate or DownRate.
BOOL (RisingLimit) TRUE when block limits a rising Input
BOOL (FallingLimit) TRUE when block limits a falling Input
Limits the rate of change for an input signal:
Enable = TRUE:
When the Input signal increases, the RisingLimit is TRUE and Output changes at the UpRate rate. When the Input signal decreases, the FallingLimit is TRUE and Output changes at the
DownRate rate. When the Input signal changes at a rate between UpRate and DownRate,
Output tracks Input.
Enable = FALSE:
The Output tracks the Input.
828
ISaGRAF 5.2
- Language Reference
Example
(* ST equivalence: RateLimiter1 is an instance of the RateLimiter block; *)
RateLimiter1( InputA, 5.0 , 1.0 , Enable_Bit) ;
OutputB := RateLimiter1.Output ;
Limiting_Up_Rate := RateLimiter1.RisingLimit ;
Limiting_Down_Rate := RateLimiter1.FallingLimit ;
Ratio
Arguments:
INA
INE
RAT
OUT
Description:
REAL Input signal A
REAL Input signal E
REAL Ratio value
REAL Output value. Output = (Ratio) x InputA x InputE
Provides a means of setting a ratio in an external setpoint control. For example, controlling a captive flow while maintaining the ratio between a wild flow and the captive flow at the desired value. Input signal A, input signal E (external ratio), and the operator set ratio Ratio values are
multiplied and become the function block Output. The RatioCalibration function block
calibrates Ratio using a tracked input signal.
ISaGRAF 5.2
- Language Reference 829
Example
(* ST equivalence: Ratio1 is an instance of Ratio block and
RatioCalibration1 is an instance of RatioCalibration block *)
Ratio1(Signal_InA, Signal_InE, RatioCalibration1.Ratio);
Out_Value := Ratio1.Output ;
RatioCalibration
Arguments:
INA
INE
INIT
HLIM
LLIM
TV
TC
RAT
TO
REAL Input signal A
REAL Input signal E
REAL (Initial) Ratio value at first scan
REAL High Limit for Ratio
REAL Low Limit for Ratio
REAL (TrackVariable) Input Signal to track
BOOL (TrackCommand) Command to initiate TrackVariable tracking
REAL Ratio value
REAL (TrackOutput) When TrackCommand = FALSE , TrackOutput = 0.0
When TrackCommand = TRUE, TrackOutput = (TrackVariable) /
(InputA * Ratio)
830
ISaGRAF 5.2
- Language Reference
Description:
Calibrates Ratio using TrackVariable. When TrackCommand is FALSE, Ratio equals last
Ratio value and TrackOutput is 0.0. When TrackCommand is TRUE, Ratio equals
(TrackVariable) / (InputA * InputE); TrackOutput = (TrackVariable) / (InputA * Ratio) also
Ratio will be limited by HighLimit and LowLimit. The Ratio function block provides a means
of setting a ratio in an external setpoint application.
Example
(* ST equivalence: Ratio1 is an instance of Ratio block and
RatioCalibration1 is an instance of RatioCalibration block *)
RatioCalibration1(Signal_InA,
Signal_InE,
0.2,
300.0,
10.0,
Flow_Water,
TK);
Ratio1(Signal_InA, Signal_InE, RatioCalibration1.Ratio);
Out_Value := Ratio1.Output ;
ISaGRAF 5.2
- Language Reference 831
RetentiveOnTimer
Arguments:
INO
INE
DTIM
ERR
BOOL (InputOn) Input to start timer
BOOL (InputEnable) Input to enable timer
REAL Delay time in seconds
DINT (ErrorMode) Mode used to handle errors of type: DelayTime < 0.0:
1 prints message in ErrorLog and stops resource
0 sets Output to TRUE, OutputNot to FALSE,
ElapseTime to 0.0, and RemainingTime = 0.0
OUT BOOL (Output) Signal = TRUE when RemainingTime >= 0.0
ONOT BOOL (OutputNot) Signal = FALSE when RemainingTime >= 0.0
ETIM
RTIM
REAL
REAL
(ElapseTime) Time elapsed since the timer started
(RemainingTime) Time remaining before Output changes to TRUE.
Description:
Performs an on-delay timing function with output states determined by InputOn and
InputEnable. When InputEnable is FALSE, Output and OutputNot are FALSE,
RemainingTime equals DelayTime. When InputEnable is TRUE, Output and OutputNot are determined by InputOn and RemainingTime.
When InputOn is TRUE, ElapseTime starts to increase and RemainingTime starts to decrease.
Output changes to TRUE after RemainingTime <= 0.0. If InputOn changes to FALSE,
RemainingTime and ElapseTime stop at their current value and continue when InputOn returns to TRUE. ElapseTime returns to 0.0 when InputEnable is FALSE. OutputNot is TRUE if
InputEnable is TRUE and Output is FALSE.
832
ISaGRAF 5.2
- Language Reference
Example
(* ST equivalence: RetentiveOnTimer1 is an instance of RetentiveOnTimer block *)
RetentiveOnTimer1(On_Tmr, En_Tmr, 300.0, 0);
Timer_Done := RetentiveOnTimer1.Output ;
Timer_Not_Done := RetentiveOnTimer1.OutputNot ;
Time_To_Count := RetentiveOnTimer1.RemainingTime ;
Time_Counted := RetentiveOnTimer1.ElapseTime ;
Scaler
Arguments:
IN
IMIN
IMAX
OMIN
OMAX
OUT
REAL Input signal
REAL (InputMin) Minimum value of Input
REAL (InputMax) Maximum value of Input
REAL (OutputMin) Minimum value of Output
REAL (OutputMax) Maximum value of Output
REAL Output value
ISaGRAF 5.2
- Language Reference 833
Description:
Scales the input value according to the output range:
Example
(* ST equivalence: Scaler1 is an instance of Scaler block *)
Scaler1(Signal_In, 4.0, 20.0 , 0.0 , 150.0 ) ;
Out_Temp := Scaler1.Output ;
Setpoint
Arguments:
TV
TS
RR
REAL
REAL
REAL
(TrackVariable) Variable to track
(TargetSetpoint) Value to attain for setpoint
(RampRate) Ramp rate value, per second
834
ISaGRAF 5.2
- Language Reference
RT
CMD
PU
PD
PR
ERR
REAL
DINT
BOOL
BOOL
DINT
DINT
(RampTime) Ramp time value, in seconds
1
2
Command for Setpoint. Possible values are:
0 Output equals last output
Output equals TrackVariable
Output changes from current value to TargetSetpoint at
3
RampRate rate
Output changes from current value to TargetSetpoint at
(TargetSetpoint – Initial value) /RampTime rate
(PulseUp) Increment output for PulseRate value upon detection of upward pulses
(PulseDown) Decrement output for PulseRate value upon detection of downward pulses
(PulseRate) Pulse rate value, per second
1
0
(ErrorMode) Mode used to handle errors of type negative RampRate and negative RampTime. Possible values are: prints message in ErrorLog and stops resource sets output to zero
(Output) Current setpoint value OUT REAL
Description:
Multi-action setpoint command having six different settings and adjustment of setpoint for controller. On first scan, output equals TrackVariable. Using a different Command, the setpoint can be adjusted to last Output, TrackVariable, or TargetSetpoint. At any time, the two pulse entries can be used to increment or decrement the output (for example, via an HMI or a pulse switch).
Example
(* ST equivalence: Setpoint1 is an instance of Setpoint block *)
Setpoint1(Signal_In, SetPointValue, 10.0, 25.0, UserCommand, RemoteUp,
RemoteDown, 5, 0);
ProcessSetpoint := Setpoint1.Output ;
ISaGRAF 5.2
- Language Reference 835
Signal Selector
Arguments:
INA
INB
INC
SEL
OUT
Description:
REAL Input signal A
REAL Input signal B
REAL Input signal C
BOOL (Selector) Indication of whether the highest or lowest signal value is selected. Possible values are:
TRUE
FALSE selects highest signal value selects lowest signal value
REAL (Output) Selected signal
Selects either the highest or lowest signal value from three input signals. When Selector is
FALSE, the lowest signal value between input A, input B, and input C is sent to Output. When
Selector is TRUE, the highest signal value between input A, input B, and input C is sent to Output.
Example
(* ST equivalence: SignalSelector1 is an instance of SignalSelector block *)
SignalSelector1( InA, InB, InC, Sel ) ;
Selected_Signal := SignalSelector1.Output ;
836
ISaGRAF 5.2
- Language Reference
TrackAndHold
Arguments:
INIT
TV
TC
REAL Initial value to transfer to Output
REAL (TrackVariable) Input signal to track
BOOL (Track command) When TRUE, Output tracks the TrackVariable.
When FALSE, Output stays the same as the last Output value.
REAL Output signal OUT
Description:
Holds an initial value transferred to output on first scan. Tracks the TrackVariable when
TrackCommand is TRUE and holds the last output value when FALSE.
Example
(* ST equivalence: TrackAndHold1 is an instance of TrackHold block *)
TrackAndHold1(25.0, Signal_To_Track, Command);
Out_Value := TrackAndHold1.Output ;
ISaGRAF 5.2
- Language Reference 837
TransferSwitch
Arguments:
INA
INB
CMD
OUT
Description:
REAL Input signal A
REAL Input signal B
BOOL (Command) Indication of which signal to select:
FALSE selects InputA
TRUE selects InputB
REAL Output signal
Selects a signal between two inputs with the switch Command
Example
(* ST equivalence: TransferSwitch1 is an instance of TransferSwitch block *)
TransferSwitch1( Signal_A, Signal_B, Switch_Command);
Out_value := TransferSwitch1.Output;
838
ISaGRAF 5.2
- Language Reference
Matrix Operations
A matrix is a two-dimensional array made up of rows and columns. It is mainly used to perform complex calculations involving the data of the running application. The matrix function block performs all of these operations. However, each operation has a specific identifier and requires different inputs. The outputs other than those specified for the function do not contain valid information.
The intersection of a row and a column is called a cell; cells hold the matrix values. The number of the first row of a matrix is 0; the number of its first column is also 0.
The Workbench offers built-in function blocks for creating, filling, and manipulating matrices.
Each of the functions has an operation number ranging from 0 to 20.
You can create as many matrices as required per program.
The available Matrix operations are the following:
Creates a matrix
Closes a matrix
Inserts an integer into a cell of an integer matrix
Reads the value of a cell in an integer matrix
Inserts a float value into a cell of a float matrix
Reads the value of a cell in a float matrix
Creates a duplicate of an existing matrix
Copies the contents of a matrix into an existing matrix having the same row-column structure and cell value type
Copies a row from a matrix into a row of the same size in another matrix or into the same matrix
Copies a column from a matrix into a row of the same size in another matrix or into the same matrix
ISaGRAF 5.2
- Language Reference 839
Returns the data type of the cell values of a matrix
Returns the number of rows in a matrix
Returns the number of columns in a matrix
Swaps the rows and columns of an existing matrix into another matrix
Computes the inverse of a matrix
Adds up two existing matrices
Subtracts an existing matrix from another existing matrix
Multiplies two existing matrices
Multiplies each cell value of an integer matrix by an integer value
Multiplies each cell value of a float matrix by a float value
Sends the contents of a matrix to the errlog
840
ISaGRAF 5.2
- Language Reference
NEW_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. This operation number is 0.
IDX_1 DINT Number of rows. The possible values range from 0 to N-1, N being the total number of rows.
IDX_2 DINT Number of columns. The possible values range from 0 to M-1, M being the total number of rows.
INT DINT Number indicating the type of matrix:
0 = Integer
1 = Float
RES
ERR
DINT Handle of the new matrix
DINT Status of the operation:
1 = Not enough memory
2 = Invalid type
ISaGRAF 5.2
- Language Reference 841
Description:
Warning:
This function uses the Malloc dynamic memory allocation at run time.
Creates a matrix. The data type of all cells is the same for any matrix. Therefore, an
integer matrix
contains only integer values, and a
float matrix
, float values.
Examples
To create a float-type matrix having three columns and three rows: matrix_fbl(0, 0, 0, 0, 3, 3, 1, 0.0); (* new float matrix 3 x 3*) if matrix_fbl.ERROR_CODE = 0 then mat[1] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to allocate matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if;
To create an integer-type matrix having two columns and two rows: matrix_fbl(0, 0, 0, 0, 2, 2, 0, 0.0); (* new integer matrix 2 x 2*) if matrix_fbl.ERROR_CODE = 0 then mat[2] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to allocate matrix
' + any_to_string(matrix_fbl.ERROR_CODE)); end_if;
842
ISaGRAF 5.2
- Language Reference
FREE_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT
MAT_1 DINT
ERR DINT
Number indicating the operation. The value of this operation is 1.
Handle of the matrix
Status of the operation:
0 = No error
6 = Index out of range
Description:
Closes a matrix.
Example
To close the matrix having the handle indicated by the index
variable:
FOR index := 1 TO 10 BY 1 DO if mat[index] > 0 then matrix_fbl(1, mat[index], 0, 0, 0, 0, 0, 0.0); (* free mat[index] *) if matrix_fbl.ERROR_CODE > 0 then
RESULT := log_msg('ErrLog','unable to free matrix ' + any_to_string(matrix_fbl.ERROR_CODE));
ISaGRAF 5.2
- Language Reference 843
end_if; end_if;
END_FOR;
GET_I_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. This operation number is 3.
MAT_1 DINT Handle of the matrix
IDX_1
IDX_2
INT
DINT
DINT
Row number of the cell. The possible values range from 0 to N-1, N being the total number of rows.
Column number of the cell. The possible values range from 0 to M-1,
M being the total number of columns.
DINT Integer value contained in the cell
Description:
Reads the value of a cell in an integer matrix.
844
ISaGRAF 5.2
- Language Reference
Example
To get the integer value held in the cell located in the first column and first row of the matrix having the handle 2 and place it into the ivalue
variable: matrix_fbl(3, mat[2], 0, 0, 1, 2, 0, 0.0); (* ivalue = mat[1][1,2] *) ivalue := matrix_fbl.out_integer_value;
PUT_I_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. This operation number is 2.
MAT_1 DINT Handle of the matrix
IDX_1 DINT Row number of the cell. The possible values range from 0 to N-1, N being the total number of rows.
IDX_2 DINT Column number of the cell. The possible values range from 0 to M-1, M being the total number of rows.
ISaGRAF 5.2
- Language Reference 845
INT
ERR
DINT Value to be inserted
DINT Status of the operation:
0 = No error
3 = Type mismatch
6 = Index out of range
Description:
Inserts an integer into a cell of an integer matrix.
Example
To set the values of the cells in the first and second columns of the first row to 2 and -1 respectively: matrix_fbl(2, mat[2], 0, 0, 0,0, 2, 0.0); matrix_fbl(2, mat[2], 0, 0, 0,1, -1, 0.0)
846
ISaGRAF 5.2
- Language Reference
GET_F_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. This operation number is 5.
MAT_1 DINT Handle of the matrix
IDX_1
IDX_2
FLT
DINT Row number of the cell. The possible values range from 0 to N-1, N being the total number of rows.
DINT Column number of the cell. The possible values range from 0 to M-1,
M being the total number of rows.
REAL Returns the float value contained in the cell
Description:
Reads the value of a cell in a float matrix.
Example
To get the float value from the cell in the second row and third column of the matrix having the handle 1 and place it in the fvalue variable: matrix_fbl(5, mat[1], 0, 0, 1, 2, 0, 0.0); (* fvalue =mat[1][1,2]*) fvalue := matrix_fbl.out_float_value;
ISaGRAF 5.2
- Language Reference 847
PUT_F_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. This operation number is 4.
MAT_1 DINT Handle of the matrix
IDX_1
IDX_2
FLT
ERR
DINT Row number of the cell. The possible values range from 0 to N-1, N being the total number of rows.
DINT Column number of the cell. The possible values range from 0 to M-1,
M being the total number of rows.
REAL Value to be inserted
DINT Status of the operation:
0 = No error
3 = Type mismatch
6 = Index out of range
Description:
Inserts a float value into a cell of a float matrix.
848
ISaGRAF 5.2
- Language Reference
Example
To place the value 2.0 into the cell in the first row and first column in the matrix having the handle 1: matrix_fbl(4, mat[1], 0, 0, 0, 0, 0, 2.0)
DUP_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 6.
MAT_1 DINT Handle of the matrix
RES
ERR
DINT Handle of the new matrix
DINT Status of the operation:
0 = No error
1 = Not enough memory
7 = Out of range
ISaGRAF 5.2
- Language Reference 849
Description:
Warning:
This function uses the Malloc dynamic memory allocation at run time.
Creates a duplicate of an existing matrix. The duplicate matrix will have the same structure and contents as the original one. The duplicate matrix will be created with the required row-column structure and data type. If the matrix already exists, it will be deleted then recreated.
Example
To duplicate the matrix having the handle 1: matrix_fbl(6, mat[1], 0, 0, 0, 0, 0, 0.0); (* duplicate mat[1] *) if matrix_fbl.ERROR_CODE = 0 then mat[3] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to duplicate matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
850
ISaGRAF 5.2
- Language Reference
COPY_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 7.
MAT_1 DINT Handle of the source matrix
MAT_2 DINT Handle of the destination matrix. This must not be the source matrix.
ERR DINT Status of the operation:
0 = No error
3 = Type mismatch
4 = Row mismatch
5 = Column mismatch
6 = Dimension mismatch
7 = Index out of range
Description:
Copies the contents of a matrix into an existing matrix having the same row-column structure and cell value type.
ISaGRAF 5.2
- Language Reference 851
Example
To copy the contents of the matrix having the handle 1 and place it into the matrix having the handle 3: matrix_fbl(7, mat[1], mat[3], 0, 0, 0, 0, 0.0); (* mat[3]=mat[1] *) if matrix_fbl.ERROR_CODE = 0 then mat[3] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to duplicate matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
COPY_ROW_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT
MAT_1 DINT
IDX_1 DINT
MAT_2 DINT
Number indicating the operation. The value of this operation is 8.
Handle of the source matrix
Number of the row, in the source matrix, that is copied. The possible values range from 0 to N-1, N being the total number of rows.
Handle of the destination matrix. This must not be the source matrix.
852
ISaGRAF 5.2
- Language Reference
IDX_2
ERR
DINT
DINT
Number of the row, in the destination matrix, that receives a row. The possible values range from 0 to N-1, N being the total number of rows.
Status of the operation:
0 = No error
3 = Type mismatch
5 = Column mismatch
6 = Index out of range
Description:
Copies a row from a matrix into a row of the same size in another matrix or into the same matrix. The cell value type must be the same in both matrices.
Example
To copy the contents of the second row of the matrix having the handle 1 and place it into the third row of the matrix having the handle 3: matrix_fbl(8, mat[1], mat[3], 1, 2, 0, 0, 0.0); (* mat[3][2,0..M] = mat[1][1,0..M] *) if matrix_fbl.ERROR_CODE > 0 then
RESULT := log_msg('ErrLog','unable to copy row matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
ISaGRAF 5.2
- Language Reference 853
COPY_COL_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 9.
MAT_1 DINT Handle of the source matrix
IDX_1 DINT Number of the column, in the source matrix, that is copied. The possible values range from 0 to M-1, M being the total number of columns.
MAT_2 DINT Handle of the destination matrix. This must not be the source matrix.
IDX_2 DINT Number of the row, in the destination matrix, that receives a column.
The possible values range from 0 to M-1, M being the total number of columns.
ERR DINT Status of the operation:
0 = No error
2 = Invalid type
3 = Type mismatch
4 = Row mismatch
6 = Index out of range
854
ISaGRAF 5.2
- Language Reference
Description:
Copies a column from a matrix into a row of the same size in another matrix or into the same matrix. The cell value type must be the same in both matrices.
Example
To copy the contents of the second column of the matrix having the handle 1 and place it into the third column of the matrix having the handle 3: matrix_fbl(9, mat[1], mat[3], 1, 2, 0, 0, 0.0); (* mat[3][0..N,2] = mat[1][0..N,1] *) if matrix_fbl.ERROR_CODE > 0 then
RESULT := log_msg('ErrLog','unable to copy col matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
ISaGRAF 5.2
- Language Reference 855
TYPE_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP
TYPE
DINT Number indicating the operation. The value of this operation is 10.
MAT_1 DINT
Handle of the matrix. This number is the result of the NEW_MATRIX
operation, when the matrix was created.
DINT Data type of the cells:
0 = Integer
1 = Float
Description:
Returns the data type of the cell values of a matrix.
Example
To get the type of cells contained in the matrix having the handle 1 and place it in the mat_type
variable: matrix_fbl(10, mat[1], 0, 0, 0, 0, 0, 0.0); (* get mat[1] type
(integer/float)*) mat_type := matrix_fbl.matrix_type
856
ISaGRAF 5.2
- Language Reference
ROWS_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 11.
MAT_1 DINT Handle of the matrix
ROWS DINT Number of rows in the matrix. The possible values range from 0 to N-1,
N being the total number of rows.
Description:
Returns the number of rows in a matrix.
Example
To get the number of rows contained in the matrix having the handle 1: matrix_fbl(11, mat[1], 0, 0, 0, 0, 0, 0.0); (* get mat[1] number of rows *) rows := matrix_fbl.matrix_rows
ISaGRAF 5.2
- Language Reference 857
COLS_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 12.
MAT_1 DINT Handle of the matrix
COLS DINT Number of columns in the matrix. The possible values range from 0 to
M-1, M being the total number of columns.
Description:
Returns the number of columns in a matrix.
Example
To get the number of columns contained in the matrix having the handle 1: matrix_fbl(12, mat[1], 0, 0, 0, 0, 0, 0.0); (* get mat[1] number of columns *) cols := matrix_fbl.matrix_cols
858
ISaGRAF 5.2
- Language Reference
TRANSPOSE_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 13.
MAT_1 DINT Handle of the matrix to be transposed (source)
MAT_2 DINT Handle of the matrix to receive the resulting transposed matrix. This must not be the source matrix. A value of 0 indicates that a new matrix will be created.
RES
ERR
DINT Handle of the resulting transposed matrix
DINT Status of the operation:
0 = No error
1 = Not enough memory
6 = Dimension mismatch
7 = Index out of range
Description:
Swaps the rows and columns of an existing matrix into another matrix called a transpose. For instance, the transpose of a matrix having three rows and five columns has five rows and three columns. The transpose matrix will be created with the required row-column structure and data type. You can choose to place the transposed matrix into an existing matrix or create a new one.
ISaGRAF 5.2
- Language Reference 859
Example
To swap the rows and columns of the matrix having the handle 1 and place the result in a new matrix: matrix_fbl(13, mat[1], 0, 0, 0, 0, 0, 0.0); (* transpose mat[1] *) if matrix_fbl.ERROR_CODE = 0 then mat[4] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to transpose matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
860
ISaGRAF 5.2
- Language Reference
INVERT_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 14.
MAT_1 DINT Handle of the matrix to be inverted (source)
MAT_2 DINT Handle of the matrix to receive the resulting inverted matrix. This must not be the source matrix. A value of 0 indicates that a new matrix will be created.
RES
ERR
DINT Handle of the resulting inverted matrix
DINT Status of the operation:
0 = No error
1 = Not enough memory
2 = Invalid type
3 = Type mismatch
6 = Dimension mismatch
7 = Index out of range
8 = Not square
9 = Mathematical error
Description:
Warning:
This function uses the Malloc dynamic memory allocation at run time.
ISaGRAF 5.2
- Language Reference 861
Computes the inverse of a matrix. The source matrix must be square (i.e., have the same number of rows and columns) and its cell value type must be float. The inverse matrix will be created with the required row-column structure and data type.
You can choose to place the inverted matrix into an existing matrix or create a new one.
Note:
Not all matrices are invertible. Invertible matrices are those whose determinant is not equal to 0.
Example
To invert the matrix having the handle 1 and place the result in a new matrix: matrix_fbl(14, mat[1], 0, 0, 0, 0, 0, 0.0); (* invert mat[1] *) if matrix_fbl.ERROR_CODE = 0 then mat[4] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to inverse matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
862
ISaGRAF 5.2
- Language Reference
ADD_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 15.
MAT_1 DINT Handle of the first matrix in the addition
MAT_2 DINT Handle of the other matrix in the addition
MAT_3 DINT Handle of the existing matrix that will receive the operation result. This must not be one of the matrices indicated in MAT_1 or MAT_2. A value of 0 indicates that result of the operation is sent to a new matrix.
RES
ERR
DINT Handle of the resulting matrix
DINT Status of the operation:
0 = No error
1 = Not enough memory
2 = Invalid type
3 = Type mismatch
4 = Row mismatch
5 = Column mismatch
6 = Dimension mismatch
7 = Index out of range
ISaGRAF 5.2
- Language Reference 863
Description:
Adds up two existing matrices then places the result in a third matrix. The summation is performed cell by cell, with the result occupying the same cell position in the third matrix. The matrices that are added up must have the same dimensions and cell value type.
You can choose to place the result into an existing matrix or create a new one.
Example
To add the matrix having the handle 1 and another having the handle 4 then place the result in a new matrix: matrix_fbl(15, mat[1], mat[4], 0, 0, 0, 0, 0.0); (* mat[1]+mat[4]*) if matrix_fbl.ERROR_CODE = 0 then mat[5] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to add matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
864
ISaGRAF 5.2
- Language Reference
SUBTRACT_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 16.
MAT_1 DINT Handle of the first matrix in the subtraction
MAT_2 DINT Handle of the other matrix in the subtraction
MAT_3 DINT Handle of the existing matrix that will receive the operation result. This must not be one of the matrices indicated in MAT_1 or MAT_2. A value of 0 indicates that result of the operation is sent to a new matrix.
RES
ERR
DINT Handle of the resulting matrix
DINT Status of the operation:
0 = No error
1 = Not enough memory
2 = Invalid type
3 = Type mismatch
4 = Row mismatch
5 = Column mismatch
6 = Dimension mismatch
7 = Index out of range
Description:
ISaGRAF 5.2
- Language Reference 865
Subtracts an existing matrix from another existing matrix then places the result in a third matrix. The difference is performed cell by cell, with the result occupying the same cell position in the third matrix. The matrices involved in the subtraction must have the same dimensions and cell value type.
You can choose to place the result into an existing matrix or create a new one.
Example
To subtract the matrix having the handle 4 from the matrix having the handle 1 then place the result in a new matrix: matrix_fbl(16, mat[1], mat[4], 0, 0, 0, 0, 0.0); (* mat[1]-mat[4]*) if matrix_fbl.ERROR_CODE = 0 then mat[6] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to sub matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
866
ISaGRAF 5.2
- Language Reference
MULTIPLY_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 17.
MAT_1 DINT Handle of the first matrix in the multiplication
MAT_2 DINT Handle of the other matrix in the multiplication
MAT_3 DINT Handle of the existing matrix that will receive the operation result. This must not be one of the matrices indicated in MAT_1 or MAT_2. A value of 0 indicates that result of the operation is sent to a new matrix.
RES
ERR
DINT Handle of the resulting matrix
DINT Status of the operation:
0 = No error
1 = Not enough memory
2 = Invalid type
3 = Type mismatch
6 = Dimension mismatch
7 = Index out of range
ISaGRAF 5.2
- Language Reference 867
Description:
Multiplies two existing matrices then places the result in a third matrix. The number of columns in the first matrix must be equal to the number of rows in the second matrix. The resulting matrix has the same number of rows as the first matrix and the same number of columns as the second matrix. For example, you can multiply a 3x4 matrix with a 4x2 matrix; the result will be a 3x2 matrix; however, you cannot multiply two 3x4 matrices. The matrices being multiplied must have the same cell value type.
The resulting matrix will be created with the required row-column structure and data type. You can choose to place the result into an existing matrix or create a new one.
Example
To multiply the matrix having the handle 1 and the matrix having the handle 4 then place the result in a new matrix: matrix_fbl(17, mat[1], mat[4], 0, 0, 0, 0, 0.0); (* mat[1]*mat[4]*) if matrix_fbl.ERROR_CODE = 0 then mat[7] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to multiply matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
868
ISaGRAF 5.2
- Language Reference
SCALAR_I_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT
MAT_1 DINT
MAT_2 DINT
MAT_3 DINT
INT
RES
ERR
DINT
DINT
DINT
Number indicating the operation. The value of this operation is 18.
Handle of the first matrix in the scalar operation
Handle of the other matrix in the scalar operation
Handle of the existing matrix that will receive the operation result. This must not be one of the matrices indicated in MAT_1 or MAT_2. A value of 0 indicates that result of the operation is sent to a new matrix.
Number by which cell values are multiplied
Handle of the resulting matrix
Status of the operation:
0 = No error
1 = Not enough memory
3 = Type mismatch
6 = Dimension mismatch
7 = Index out of range
ISaGRAF 5.2
- Language Reference 869
Description:
Warning:
This function uses the Malloc dynamic memory allocation at run time.
Multiplies each cell value of an integer matrix by an integer value then places the result in another matrix. This operation is called scalar multiplication.
You can choose to place the result into an existing matrix or create a new one.
Example
To multiply each cell of the matrix having the handle 2 by the value 4 then place the result in a new matrix: matrix_fbl(18, mat[2], 0 , 0, 0, 0, 4, 0.0); (* mat[2] * 4 *) if matrix_fbl.ERROR_CODE = 0 then mat[8] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to scalar i matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
870
ISaGRAF 5.2
- Language Reference
SCALAR_F_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT
MAT_1 DINT
MAT_2 DINT
MAT_3 DINT
FLT
RES
ERR
FLT
DINT
DINT
Number indicating the operation. The value of this operation is 19.
Handle of the first matrix in the scalar operation
Handle of the other matrix in the scalar operation
Handle of the existing matrix that will receive the operation result. This must not be one of the matrices indicated in MAT_1 or MAT_2. A value of 0 indicates that result of the operation is sent to a new matrix.
Number by which cell values are multiplied
Handle of the resulting matrix
Status of the operation:
0 = No error
1 = Not enough memory
3 = Type mismatch
6 = Dimension mismatch
7 = Index out of range
ISaGRAF 5.2
- Language Reference 871
Description:
Warning:
This function uses the Malloc dynamic memory allocation at run time.
Multiplies each cell value of a float matrix by a float value then places the result in another matrix. This operation is called scalar multiplication.
You can choose to place the result into an existing matrix or create a new one.
Example
To multiply each cell of the matrix having the handle 1 by the value 5.0 then place the result in a new matrix: matrix_fbl(19, mat[1], 0 , 0, 0, 0, 0, 5.0); (* mat[2] * 5.0 *) if matrix_fbl.ERROR_CODE = 0 then mat[9] := matrix_fbl.MATRIX_RESULT; else
RESULT := log_msg('ErrLog','unable to scalar f matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if
872
ISaGRAF 5.2
- Language Reference
PRINT_MATRIX
Arguments:
You need to enter a value for each input parameter that appears blank. All blank inputs require a 0 except for the FLT which requires 0.0. The outputs other than those specified for the function do not contain valid information.
OP DINT Number indicating the operation. The value of this operation is 20.
MAT_1 DINT Handle of the matrix
ERR DINT Status of the operation:
0 = No error
2 = Invalid type
Description:
Sends the contents of a matrix to the errlog. The default errlog for
ISaGRAF
is e.log.
ISaGRAF 5.2
- Language Reference 873
Example
To send the contents of the matrix having the handle held in the index
variable to the ErrLog file:
FOR index := 1 TO 10 BY 1 DO if mat[index] > 0 then
RESULT := log_msg('ErrLog','print matrix ' + any_to_string(index)); matrix_fbl(20, mat[index], 0 , 0, 0, 0, 0, 0.0); (* print mat[index] *) if matrix_fbl.ERROR_CODE > 0 then
RESULT := log_msg('ErrLog','unable to print matrix ' + any_to_string(matrix_fbl.ERROR_CODE)); end_if; end_if;
END_FOR
874
ISaGRAF 5.2
- Language Reference
Optional Function Blocks
Optional Function Blocks are specialized packages, also known as packs, of function blocks.
The available packs and their function blocks are listed below.
Note:
The Optional Function Block packs are available separately.
Smart PID Pack
A self-modeling controller modeling the relationship between the feedforward and process it controls
IEC61499
Event-driven up counter
Periodic (cyclic) generation of an event
D (Data latch) bistable
Delayed propagation of an event
Generation of a finite train of separate events
(table driven)
Boolean falling edge detection
Merge (OR) of multiple events
Generation of a finite train of separate events
(table driven)
Permissive propagation of an event
Boolean rising edge detection
Rendez-vous of two events
Generation of restart events
Event-driven bistable (Reset dominant)
Selection between two events
ISaGRAF 5.2
- Language Reference 875
Split an event
Event-driven bistable (Set dominant)
Switching (demultiplexing) an event
Generation of a finite train of events (table driven)
Generation of a finite train of events (table driven)
Generation of a finite train of events
Automatically assigned to IEC 61499 function block arguments having the event input direction
876
ISaGRAF 5.2
- Language Reference
Smart PID Function Block
The Workbench offers the Smart PID, a self-modeling controller modeling the relationship between the feedforward and process it controls.
Note:
The Smart PID Function Block Pack is sold separately.
Arguments:
SP
PV
FF
UA
REAL Setpoint, the target value of the process variable. Possible values range from 0 to 100.
REAL Process Variable, the value of the controlled process (e.g. level flow pressure). Possible values range from 0 to 100.
REAL Feedforward, the anticipated output for a given condition. The Smart
PID automatically characterizes the relation between the feedforward input and the Smart PID output. Possible values range from 0 to 100.
BOOL The PID operation mode:
TRUE Automatic mode where the Smart PID controls the PID output
FALSE value.
to maintain the value of the process variable equal to the setpoint’s value
Manual mode where the output tracks the Track input
While in manual mode, the Smart PID compensates for changes to feedforward.
Mode changes are bumpless.
ISaGRAF 5.2
- Language Reference 877
TRK
R_I
L_I
UDA
REAL Track, the value that is sent to the output in manual mode. This input could be connected to the output for a single Smart PID loop. In a cascade loop, the Track input would be connected to the down stream process variable.
BOOL Raise Inhibit input, the indication of whether the output of the Smart
PID stops increasing when its value reaches its upper limit. This does not stop the Smart PID from decreasing the output. This input is normally used when the down stream control has reached its upper limit.
This keeps the Smart PID from winding up when down stream control cannot further increase the output to the process it is controlling.
TRUE stops the output of the Smart PID from increasing when the output value reaches its upper limit
FALSE does not stop the output of the Smart PID from increasing when the output value reaches its upper limit
BOOL Lower Inhibit input, the indication of whether the output of the Smart
PID stops decreasing when its value reaches its lower limit. This does not stop the Smart PID from increasing the output. This input is normally used when the down stream control has reached its lower limit.
The Lower Inhibit keeps the Smart PID from winding up when down stream control cannot further decrease the output to the process it is controlling.
TRUE stops the output of the Smart PID from decreasing when the output value reaches its upper limit
FALSE does not stop the output of the Smart PID from decreasing when the output value reaches its upper limit
BOOL Direct/Indirect Action, the type of control performed by the PID. Direct action, is for a loop like spraying superheat steam. A greater demand for spray water causes the superheat temperature to decrease. If the steam temperature (process) is higher than the setpoint then the Smart PID will increase the control output.
Indirect action is the most common type of control. This is like a flow valve. When the valve opens, the flow increases. If the flow (process) is higher than setpoint then the Smart PID will decrease the control output.
TRUE Direct action
FALSE Indirect action
878
ISaGRAF 5.2
- Language Reference
G_O
PID
R_O
L_O
REAL Gain Override, used on extremely difficult to control loops. Usually,
Gain Override is not needed and should beset to zero. Possible values are:
0
> 0
0.8
4
5 automatic tuning with no override gain override is constraining automatic tuning most restrictive (slowest) same gain, slower integral
25 percent gain boost
REAL Output, the output to control the process or a down stream cascade controller. Possible values range from 0 to 100.
BOOL Raise Inhibit output, the indication of whether the PID output has reached demand or the Raise Inhibit input is TRUE or FALSE:
TRUE PID output has reached 100 percent of the demand or the
Raise Inhibit input is TRUE
FALSE the
PID output has not reached 100 percent of the demand or
Raise Inhibit input is FALSE
BOOL Lower Inhibit output, the indication that either PID output has reached zero percent demand or the Lower Inhibit input is true:
TRUE PID output has reached zero percent of the demand or the
Lower Inhibit input is TRUE
FALSE the
PID output has not reached 100 percent of the demand or
Lower Inhibit input is FALSE
Description:
The Smart PID is a self-modeling controller because it actually models the relationship between the feedforward and the process that it is controlling. The Smart PID builds both the feedforward curves and the feedforward timing. The feedforward timing can cause the feedforward to lead or lag the feedforward input.
In the HMI, the Smart PID faceplate is available for use with the Smart PID function block.
ISaGRAF 5.2
- Language Reference 879
The feedback controller continuously changes the tuning parameters so that as the process approaches the setpoint fast and settles out quickly. The Smart PID does not require tuning by the end user for the majority of loops that it is controlling. The Smart PID does not use the normal Proportional-Integral-Derivative calculations that a PID does and so does not require the same type of tuning.
The Smart PID uses gain (proportional) and this gain may change many times before a process upset is brought back to the setpoint. The Smart PID does not use the same type of integral calculation as a PID. The Smart PID combines the integral and the derivative into one calculation. This allows the integral to unwind as the process approaches the setpoint preventing the process from overshooting. This results in the process settling out quickly as it approaches the setpoint. We call this calculation Smart Integral. The Smart Integral is continuously changing during a process upset. The Smart PID behaves differently for different situations. For example, when the process is moving away from the setpoint, the Smart PID goes after this upset aggressively. Once the process has turned the corner, the Smart PID works to slow the process down so that it will not oscillate.
The Smart PID will not control every existing process loop, but will control the majority of them better that a PID. The continuous automatic tuning is totally transparent to the process and the operator.
The Smart PID was developed by independent engineering services and has not been certified by
ICS Triplex ISaGRAF
. It is protected under United States Patent 5,504,672.
880
ISaGRAF 5.2
- Language Reference
IEC 61499 Function Blocks
The Workbench offers IEC 61499 standard function blocks. The IEC 61499 language enables the distribution of individual IEC 61499 function blocks belonging to an IEC 61499 program across multiple resources.
Note:
The IEC 61499 function blocks pack is available separately.
The IEC 61499 implementation in
ISaGRAF
is based on the
Function blocks - Part 1:
Architecture
and
Function blocks - Part 2: Software Tools Requirements
documents available from the ANSI webstore.
E_CTU
Event-driven up counter
Interface ECC/Algorithms/Service sequences
ALGORITHM R IN ST: (* Reset *)
CV:= 0;
Q:= 0;
END_ALGORITHM
ALGORITHM CU IN ST: (* Count up *)
CV:= CV+1;
Q:= (CV=PV);
END_ALGORITHM
ISaGRAF 5.2
- Language Reference 881
E_CYCLE
Periodic (cyclic) generation of an event
Interface ECC/Algorithms/Service sequences
An event occurs at
EO
at an interval
DT
after the occurrence of an event at
START
, and at intervals of
DT
thereafter until the occurrence of an event at
STOP
.
IEC 61499 FBD Definition
882
ISaGRAF 5.2
- Language Reference
E_D_FF
D (Data latch) bistable
Interface ECC/Algorithms/Service sequences
ALGORITHM LATCH IN ST :
Q := D ;
END_ALGORITHM
ISaGRAF 5.2
- Language Reference 883
E_DELAY
Delayed propagation of an event
An event at EO is generated at a time interval DT after the occurrence of an event at the
START input. The event delay is cancelled by an occurrence of an event at the STOP input. If multiple events occur at the START input before the occurrence of an event at EO, only a single event occurs at EO, at a time DT after the first event occurrence at the START input.
E_DEMUX
Generation of a finite train of separate events (table driven)
Interface ECC/Algorithms/Service sequences
Implementation using the E_DEMUX function block type as shown is not a normative requirement. Equivalent functionality may be implemented by various means.
884
ISaGRAF 5.2
- Language Reference
E_F_TRIG
Boolean falling edge detection
Interface ECC/Algorithms/Service sequences
IEC 61499 FBD Definition
ISaGRAF 5.2
- Language Reference 885
E_MERGE
Merge (OR) of multiple events
Interface ECC/Algorithms/Service sequences
The occurrence of an event at any of the inputs EI1, EI2,...,EIn causes the occurrence of an event at EO (n=2 in the above example).
886
ISaGRAF 5.2
- Language Reference
E_N_TABLE
Generation of a finite train of separate events (table driven)
Interface ECC/Algorithms/Service sequences
An event occurs at
EOO
at an interval DT[0] after the occurrence of an event at
EI
. An event occurs at
EO2
an interval DT[1] after the occurrence of the event at
EO1
, etc., until
N occurrences have been generated or an event occurs at the
STOP
input.
NOTE - In this example implementation,
N
<= 4.
IEC 61499 FBD Definition
ISaGRAF 5.2
- Language Reference 887
E_PERMIT
Permissive propagation of an event
Interface ECC/Algorithms/Service sequences
888
ISaGRAF 5.2
- Language Reference
E_R_TRIG
Boolean rising edge detection
Interface ECC/Algorithms/Service sequences
IEC 61499 FBD Definition
ISaGRAF 5.2
- Language Reference 889
E_REND
Rendezvous of two events
Interface ECC/Algorithms/Service sequences
890
ISaGRAF 5.2
- Language Reference
E_RESTART
Generation of restart events
Interface ECC/Algorithms/Service sequences
1.
An event is issued at the COLD output upon "cold restart" of the associated resource.
2.
An event is issued at the WARM output upon "warm restart" of the associated resource.
3.
An event is issued at the STOP output (if possible) prior to "stopping" of the associated resource.
ISaGRAF 5.2
- Language Reference 891
E_RS
Event-driven bistable (Reset dominant)
The output
Q
is set to 1 (TRUE) upon the occurrence of an event at the
S
input, and is reset to 0 (FALSE) upon the occurrence of an event at the
R
input. If simultaneous
S
and
R
events occur, the
R
input is dominant. An event is issued at the
EO
output when the value of
Q
changes.
Interface ECC/Algorithms/Service sequences
NOTE - Algorithms SET and RESET are the same as for E_SR.
892
ISaGRAF 5.2
- Language Reference
E_SELECT
Selection between two events
Interface ECC/Algorithms/Service sequences
ISaGRAF 5.2
- Language Reference 893
E_SPLIT
Split an event
Interface ECC/Algorithms/Service sequences
The occurrence of an event at
EI
causes the occurrence of events at
EO1
,
EO2
,...,
EOn
(n=2 in the above example).
However,
ISaGRAF
automatically performs the E_SPLIT operation during compilation for all event and data outputs. Therefore, the diagram on the left, without the E_SPLIT function block, is equivalent to the diagram on the right.
894
ISaGRAF 5.2
- Language Reference
E_SR
Event-driven bistable (Set dominant)
The output
Q
is set to 1 (TRUE) upon the occurrence of an event at the
S
input, and is reset to
0 (FALSE) upon the occurrence of an event at the
R
input. If simultaneous
S
and
R
events occur, the
S
input is dominant. An event is issued at the
EO
output when the value of
Q changes.
Interface ECC/Algorithms/Service sequences
ALGORITHM SET IN ST : (* Set Q *) ALGORITHM RESET IN ST : (* Reset Q *)
Q := TRUE ;
END_ALGORITHM
Q := FALSE ;
END_ALGORITHM
ISaGRAF 5.2
- Language Reference 895
E_SWITCH
Switching (demultiplexing) an event
Interface ECC/Algorithms/Service sequences
896
ISaGRAF 5.2
- Language Reference
E_TABLE
Generation of a finite train of events (table driven)
Interface ECC/Algorithms/Service sequences
An event occurs at EO at an interval DT[0] after the occurrence of an event at EI. A second event occurs at an interval DT[1] after the first, etc., until N occurrences have been generated or an event occurs at the STOP input. The current event count is maintained at the CV output.
In this example implementation, N <= 4.
IEC 61499 FBD Definition
ISaGRAF 5.2
- Language Reference 897
E_TABLE_CTRL
Generation of a finite train of events (table driven)
Interface ECC/Algorithms/Service sequences
This implementation using the E_TABLE_CTRL function block type is not a normative requirement. Equivalent functionality may be implemented by various means.
898
ISaGRAF 5.2
- Language Reference
E_TRAIN
Generation of a finite train of events
Interface ECC/Algorithms/Service sequences
An event occurs at EO at an interval DT after the occurrence of an event at EI, and at intervals of DT thereafter, until N occurrences have been generated or an event occurs at the
STOP input.
IEC 61499 FBD Definition
ISaGRAF 5.2
- Language Reference 899
LocalEventInput
IEC 61499 function block arguments having the event input direction are automatically assigned an instance of the
LocalEventInput
function block. The
LocalEventInput function block is defined as an IEC function block in the standard 61499 library.
LocalEventInput
{ input SINT counter local SINT LocalCounter; output BOOL Trigger;
If counter <> LocalCounter then
LocalCounter = counter;
Trigger = true;
Else
Trigger = false;
End_if;
}
900
ISaGRAF 5.2
- Language Reference
Glossary
The Glossary contains terms used in the Workbench and their definitions.
Access Control
Access Method
Action
Activity of a Step
Address
Alias
Array
Attribute
Automatic Instance (of a function block)
The use of password-protection to control access to projects, resources, POUs, and targets. For projects, resources, and
POUs, access control can also limit access to read-only mode.
Methods to access the Virtual Machine database from a client
application (programmed in C): SMA, MIB, SID.
In SFC: an action can be on a Boolean variable or a child SFC,
or a collection of operations (written in ST, IL, LD) to perform with an associated SFC step. The action is executed when the
In FC: an action is a collection of operations (written in ST, IL,
LD) to perform.
Attribute of a Step (SFC) which is activated by an SFC token.
Optional hexadecimal address freely defined for each variable.
This address can be used by an external application to access the value of the variable when the resource is executed by the
The property of a variable indicating a short name for a variable. For FBD and LD diagrams, aliases indicate the parameters in functions and function blocks.
Set of elements of the same type referenced by one or more
indexes enclosed in square brackets and separated by commas.
The index is an integer. Examples: tabi[2] or tabij[2,4].
The property of a variable indicating whether a variable is read-only, write-only, or free (read and write).
A function block having no assigned instances. Automatic instances of function blocks cannot be added to a POU during online changes.
See also Declared Instance (of a function block)
ISaGRAF 5.2
- Workbench 901
Basic Function Block
Binding
Binding Error Variable
Variables enabling the management of binding errors at the consumer resource level.
Boolean (Bool)
Basic type that can be used to define a variable, a Parameter
(POU) or a device. A Boolean can be TRUE (1) or FALSE (0).
Boolean Action
Breakpoint
SFC Action: a Boolean variable is assigned with the activity of
SFC POU: Mark placed by the user at debug time, on an SFC
Step (SFC) or Transition. The Target system stops when an
SFC token is moved on a breakpoint.
Step-by-step mode: For ST and IL POUs, you set breakpoints
to specific lines of code. For LD POUs, you set breakpoints to rungs. When running an application in Debug mode, the application stops when it encounters a breakpoint.
BYTE
The IEC 61499 function block type that cannot be decomposed into other function blocks and that utilizes an execution control chart (ECC) to control the execution of its algorithms.
Bindings are directional links, i.e., access paths, between variables located in different resources. The Workbench enables two types of bindings: internal bindings and external bindings. Internal bindings are between resources within the same project. External bindings are between resources belonging to different projects.
C Function
C Language
Call Stack
Cell
Unsigned integer 8-bit format. Basic type that can be used to
define a Variable, a Parameter (POU) or a Device.
Function written with the "C" language, called from POUs, in
a synchronous manner.
High level literal language used to access particularities of the
target system. C language can be used to program C functions,
function blocks and conversion functions.
Information which tracks stepping between POUs and called functions. Debug information includes call stack. You can only generate debug information for resources producing TIC code.
Elementary area of the graphic matrix for graphic languages such as SFC, FBD or LD or for the Dictionary Grid View.
902
ISaGRAF 5.2
- Glossary
CFB
CFU
Channel
Check In
Child
Clearing a Transition
CMG
Coil
Common Scope
Complex Equipment
Composite Function
Block
Condition
Configuration
Indicates a C function block
Indicates a C function
A channel of a device represents a hardware I/O point. It can
be an input or an output. A variable is generally connected to a
channel in order to be used in POUs. Directly represented
variables can also be used in POUs.
For SFC and FC, program which is activated by its father. The child has only one father. Only its father can start or kill it. A father can have more than one child.
The forcing of the clearing of a transition whether the latter is valid or not (i.e all previous steps are active or not). Tokens are moved and actions are executed as for a usual transition
clearing. All tokens existing in the preceding steps are
removed. A token is created in each of the following steps.
Short name for the configuration manager
Graphic component of an LD Program representing the assignment of an output or an internal variable.
Scope of a declaration applying to all POUs within a Project.
(Only defined words and types can have common scope).
The IEC 61499 function block type whose algorithms and the control of execution is expressed entirely in terms of interconnected IEC 61499 function blocks, events, and parameters.
A Boolean expression attached to an SFC Transition or an FC
test. In case of an SFC transition, the transition cannot be cleared when its condition is false.
A software object made up of one or more resources. A
configuration becomes a target when it is downloaded onto a
target.
ISaGRAF 5.2
- Workbench 903
Configuration Manager
(ConfigurationManager.exe) The executable file providing communication services between the Workbench and target.
Responsible for launching, killing, and giving the status of
Connection
Constant Expression
The link between networks and configurations, displayed in
the hardware architecture view.
Literal expression used to describe a constant value.
Consumer Group
Consumption Error
Behavior
Contact
Contextual Menu
Convergence
Conversion
Conversion Function
A group holding external producer variables having bindings with consumer variables defined in the project.
Indication of the value to use when an error occurs for an internal binding. Possible values are either the last value issued from the binding or a specified default value.
Graphic component of an FBD or LD diagram. Depending on the type of contact, it represents the value or function of an
input or an internal variable.
Menu that is displayed under the mouse cursor by right-clicking the mouse.
Multiple connection link from multiple SFC symbols (steps or transitions) to a single symbol. Convergences can be single or double. A single convergence (OR) is a multiple link from multiple transitions to the same step. A double convergence
(AND) is a multiple link from multiple steps to the same transition.
Filter attached to an input or output variable. The conversion is
automatically applied each time the input variable is read or the output variable is refreshed.
"C" written Function which describes a conversion. Such a
conversion can be attached to any input or output, integer or
real variable.
Cyclic redundancy checking
CRC
Cross References
Browser
A tool that finds all references to variables, i.e., cross references, defined in the POUs of a project. The browser provides a total view of the declared variables in the programs of the project and where these are used.
904
ISaGRAF 5.2
- Glossary
CSV File Format
Current Result (IL)
Cycle
Cycle Time
Cycle-to-cycle Mode
Database
Data Connection
Data Input
Data Output
Data Link
(Comma Separated Values) A delimited data format having each piece of information separated by commas and each line ending with a carriage return. The CSV file format can be used
for importing or exporting variables data.
Result of an instruction in an IL POU. The current result can be modified by an instruction, or used to set a variable.
order defined by the user, from the first program to the last and again and again. Before the execution of the first program,
inputs are read. After the execution of the last program, the
The time between two input scans on the target. It represents the time to execute one cycle. The cycle time can differ at each
cycle if none is programmed. When the cycle time is shorter,
inputs but signals with the "overflow" that the programmed
time has been exceeded. When the Trigger cycles option is
unchecked or the cycle time is 0, the Virtual Machine does not
wait to start a new cycle.
Execution mode: In this mode, cycles are executed one by one,
according to the orders given by the user of the debugger.
The collection of definitions making up a Workbench project.
The version source control feature stores checked-in information in a separate database.
The link conveying data between a data output of an
IEC 61499 function block and a data input of another.
The interface of an IEC 61499 function block which receives data from a data connection.
The interface of an IEC 61499 function block which supplies data to a data connection.
A directional link between resources across which variable bindings data is conveyed.
ISaGRAF 5.2
- Workbench 905
Data Types
DATE
Debug Information
Declared Instance (of a function block)
Data types are defined for many items in
ISaGRAF
projects:
- variables
-function or function block parameters
- devices
See Standard IEC 61131-3 Types, User Types.
The format of a date is year-month-day, separated by hyphens.
Basic type that can be used to define a Variable, a Parameter
For use when debugging using the step-by-step mode with ST,
IL, and LD POUs (programs, functions, and function blocks).
Debug information includes call stack information which tracks stepping between POUs and called functions. You can only generate debug information for resources producing TIC code.
A function block having assigned instances, i.e., declared in the dictionary. Declared instances of function blocks can be added to a POU during online changes.
Defined Word
See also Automatic Instance (of a function block)
Word that is an expression. This word can be used in POUs. At
compiling time the word is replaced by the expression. A defined word can not use a defined word.
Delayed Operation (IL)
Operation of an IL Program, executed when the ")" instruction occurs, later in the Program.
Dependency (on a library)
The state where a project uses, i.e., depends, on functions or
function blocks defined in a library.
Device
Dictionary
Dimension
The view displaying the variables, function and function block
parameters, types, and defined words used in the programs of a
The size (number of elements) of an array. For example:
[1..3,1..10] - represents a two-dimensional array containing a total of 30 elements.
906
ISaGRAF 5.2
- Glossary
Direction
Directly Represented
Variable
Variables and devices have a direction. For the property of a
A variable is generally declared before its use in one POU.
Inputs and outputs can be used without any declaration respecting a defined syntax. It corresponds to direct represented variables. Example: %QX1.6, %ID8.2
Divergence
Multiple connection link from a single SFC symbol (steps or transitions) to multiple SFC symbols. Divergences can be single or double. A single divergence (OR) is a multiple link from one step to many transitions. A double divergence
(AND) is a multiple link from one transition to many steps.
Double Integer (DINT)
Signed double integer 32-bit format. Basic type that can be
used to define a variable, a Parameter (POU) or a Device.
Double Word (DWORD)
Unsigned double word 32-bit format. Basic type that can be
used to define a variable, a Parameter (POU) or a Device.
Driver
See IO driver, Network Driver.
Edge
See Falling Edge, Rising Edge.
(.exe)
ISaGRAF
network driver that uses the TCP / IP stack.
Event Connection
Event Input
Event Output
Events Logger
Events Viewer
The link conveying events between an event output of an
IEC 61499 function block and an event input of another.
The interface of an IEC 61499 function block which can receive events from an event connection.
The interface of an IEC 61499 function block which can issue events to an event connection.
A logger that receives events from
ISaGRAF
targets. You view these events using the Events Viewer. Events are stored in a log file, in Unicode format. A new log file is automatically created each day at 00:00:00 hours
A viewer that displays run-time system events logged with the
Events Logger.
ISaGRAF 5.2
- Workbench 907
Execution Control Chart
(ECC)
Execution Control Initial
State (EC initial state)
Execution Control State
(EC state)
Execution Control
Transition (EC transition)
Execution Mode
External Binding List
Expression
Falling Edge
Father Program
FBD
FC
File Mode
In IEC 61499 basic function blocks, the graphical or textual representation of the causal relationships among events at the event inputs and event outputs and the execution of the function block's algorithms, using execution control states, execution control transitions, and execution control actions.
The execution control state that is active upon initialization of an execution control chart. An EC initial state corresponds to
The situation in which the behavior of a basic function block
with respect to its variables is determined by the algorithms associated with a specified set of execution control actions. An
EC state corresponds to an SFC step.
The means by which control passes from a predecessor execution control state to a successor execution control state.
An EC transition corresponds to an SFC transition.
The mode in which a resource is executed: real-time,
cycle-to-cycle, and step-by-step.
The list of consumer groups, holding external producer variables having bindings with consumer variables defined in the project, and producer groups, holding outgoing producer variables for consumption in external bindings defined in another project.
Set of operators and identifiers.
A falling edge of a Boolean variable corresponds to a change
from TRUE (1) to FALSE (0).
For SFC and FC, program which controls other programs,
called its children. See Child.
Function Block Diagram. Programming language.
Flow Chart. Programming language.
The mode where you save version source control information to a repository located on a local or remote computer. See also
908
ISaGRAF 5.2
- Glossary
Function
Function Block
POU which has input parameters and one output parameter. A
function can be called by a program, a function or a function
block. A function has no instance. It means that local data are
not stored, and are generally lost from one call to the other. A function can be written in ST, IL, LD, FBD and "C".
POU which has input and output parameters and works on
a function (no internal data for a function). A function block can call another function block (instantiation mechanism is extended to the function blocks called). A function block can be written in ST, IL, LD, FBD and "C".
Scope of a declaration applying to all POUs of one resource.
A variable whose scope is global.
Global Scope
Global Variable
Hardware Architecture
The view graphically displaying the configurations of a project and the network links between them.
Hidden Parameter
Input parameters of a function block that are not displayed in
FBD diagrams. Hidden parameters are set in the Parameters tab of the Select Block dialog.
Hierarchy
Identifier
Architecture of a Project, divided into several POUs. The
hierarchy tree represents the links between father programs and
children programs. See Father Program, Parent Program.
Unique word used to represent a variable or a constant expression in the programming.
IEC 61499 Function
Block
IEC 61499 Library
IFB
A function block for use with the IEC 61499 language. These function blocks have execution control charts handling events and algorithms handling data. Function blocks in IEC 61499 programs can be distributed across multiple resources.
The library containing the IEC 61499 standard function blocks
for use in IEC 61499 distributed programs.
Indicates an IEC 61131-3 function block
IFU
IL
Indicates an IEC 61131-3 function
Instruction List. Programming language.
ISaGRAF 5.2
- Workbench 909
Initial Situation
Initial Step
Initial Value
Input
Input Parameter
Instance (of a Function
Block)
Instruction
Integer (INT)
Internal
Internal Binding List
I/O Binding
I/O Channel
Set of the initial steps of an SFC Program, which represents
the context of the program when it is started.
Special Step (SFC) of an SFC Program, which is activated
when the program starts. For an IEC 61499 ECC, an initial
step corresponds to an execution control initial state (EC initial state).
Value which has a variable when the Virtual Machine starts the
execution of the resource. The initial value of a variable can be
the default value, a value given by the user when the variable is
defined or the value of the retain variable after the Virtual
Direction of a variable or a Device. An input variable is
connected to an input channel of an input Device.
parameter is characterized by a type.
Copy of the internal data of a function block which persists
from one call to the other. This word is used, by extension, to say that a program calls a function block instance and not the function block itself.
Elementary operation of an IL program, entered on one line of
text.
Signed integer 16-bit format. Basic type that can be used to
define a variable, a Parameter (POU) or a Device.
Attribute of a variable, which is not linked to an input or
output device. Such a variable is called an internal variable.
The view displaying the resource links and internal variable bindings defined for a project.
A virtual connection between two software elements.
910
ISaGRAF 5.2
- Glossary
I/O Complex Device
I/O Simple Device
I/O Driver
IO Variable
IO Wiring
ISaRSI
ITA
ITS
IXLSma Server
Element grouping several "simple devices". This provides the
means for manufacturers to mix types and directions. The
implementation of the I/O Driver of a complex device
corresponds to the implementation of the drivers of all the devices composing it. Parameters are also attached to a
complex device, OEM parameters.
Element grouping several channels of the same type and same
direction (INPUT, OUTPUT). An Array can be connected to a
device if all elements are connected to contiguous channels,
the type of the array must be the type of the Device. Variables
of the same type can also be connected to channels of a device.
A device corresponds to a hardware device and an I/O Driver
in (or linked to) the Virtual Machine. Parameters are also
attached to a device: the OEM parameters. I/O devices are
defined by the integrator.
"C" code which makes the interface between a Virtual
Machine and the hardware devices. The driver can be statically
linked to the Virtual Machine or in a separate DLL (such as for
the Windows NT target). Two types of drivers are available for use in the Workbench: generic and advanced.
Variable connected to an input or output device. An IO
variable must be connected on a channel of an IO device.
Definition of the links between the variables of the Project and
the channels of the devices existing on the Target system.
(IsaRSI.exe) Enhanced serial port driver. The network driver that provides communication with the workbench on a serial
Indicates an IEC 61131-3 type array
Indicates an IEC 61131-3 type structure
(IxlSmaServer.exe) Provides service for performing IXL read operations, using the HSD driver with the SMA method. This method is independent from the virtual machine cycle and is thus faster.
ISaGRAF 5.2
- Workbench 911
Jump to a Step
Keyword
Label
LD
Level 1 of the FC
Level 1 of the SFC
Level 2 of the FC
Level 2 of the SFC
Library
Link
Link Architecture
Literal
Local scope
SFC graphic component representing a link from a Transition
to a Step (SFC). The graphic symbol of a jump is an arrow,
identified with the reference of the destination step.
Reserved identifier of the language.
For FBD, IL, or LD, identifier identifying an instruction.
Labels can also be used for jump operations.
Ladder Diagram. Programming language.
Main description of an FC program. Level 1 groups the chart
(actions and tests), and the attached comments.
Main description of an SFC program. Level 1 groups the chart
(steps and transitions), and the attached comments.
Detailed description of an FC program. It is the description of
the actions and tests. Level 2 programming for FC elements can
be developed with ST or LD.
Detailed description of an SFC program. It is the description of
the actions within the steps, and the Boolean conditions
attached to the transitions. Level 2 programming for SFC elements can be developed with ST or LD or call an SFC child.
Special projects made up of configurations and resources in which you define functions and function blocks for reuse throughout
ISaGRAF
projects. Libraries also enable you to modularize projects and to isolate functions and function blocks so that these can be validated separately.
For FBD, SFC, or LD diagrams, a graphic component
connecting elements in a diagram. For an IEC 61499 ECC,
links correspond to data connections and event connections.
The view graphically displaying the resources of a project and the resource data links, used for internal bindings, between them. This is the default view of the Workbench providing a main entry point to all editors.
A lexical unit that directly represents a value.
Scope of a declaration applying to only one POU.
912
ISaGRAF 5.2
- Glossary
Locked I/O
Long Integer (LINT)
Long Real (LREAL)
Long Word (LWORD)
Maximum time
Memory for Retain
Message
Method
Modifier (IL)
Network
Network Driver
Non-stored Action
OEM
OEM Parameter
Operand (IL)
Input or output variable, disconnected logically from the
corresponding I/O device, by a "Lock" command sent by the user from the debugger.
Signed integer 64-bit format. Basic type that can be used to
define a variable, a Parameter (POU) or a Device.
Type of a variable, stored in a floating IEEE single precision
64-bit format. Basic type that can be used to define a variable,
a Parameter (POU) or a Device.
Unsigned long word 64-bit format. Basic type that can be used
to define a variable, a Parameter (POU) or a Device.
Time of the longest cycle since the Virtual Machine has started
the execution of the programs of a resource.
Run-time setting for a resource indicating the location where retained values are stored (the required syntax depends on the implementation).
Single character put at the end of an IL operation keyword,
which modifies the meaning of the operation.
The means of communication between configurations and
their clients.
"C" code which makes the interface between the Target
network layer and the network.
SFC Action: it is a list of statements, executed at each Target
cycle, when the corresponding Step (SFC) is active.
Original Equipment Manufacturer
Parameters attached to an IO device or an I/O Complex
Device. A parameter is characterized by a type. An OEM
parameter is defined by the designer of the Device. It can be a
constant, or a variable parameter entered by the user during the
I/O connection.
Variable or constant expression processed by an elementary IL
ISaGRAF 5.2
- Workbench 913
Operation (IL)
Operator
Output
Output Parameter
Overflow
Package
Parameter (POU)
Parent Program
PLC
POU
Power Rail
Producer Group
Program
914
Basic instruction of the IL language. An operation (or operator)
is generally associated to an operand in an instruction.
Basic logical operation such as arithmetic, boolean, comparator, and data conversion.
Direction of a variable or a device. An output variable is
connected to an output channel of an output Device.
A function has only one output parameter. A parameter is characterized by a type.
Integer value which corresponds to the number of times the
cycle time has been exceeded. Always 0, if cycle time is 0.
ISaGRAF
has many specialized function and function block packages (also known as packs) which are available
separately: ODBC Functions and Matrix Operations.
The Target Definition Builder enables OEMs to provide
packages containing the drivers of several I/O devices and/or
"C" functions and function blocks available for a specific
See Input Parameter, Output Parameter, OEM Parameter, and
It can be a Father Program or an FC program that call an FC
Programmable Logic Controller
Program Organization Unit: set of instructions written in one of
the following languages: SFC, FC, IL, ST, FBD, LD. A POU
can be a program, a function or function block.
Main left and right vertical rails at the extremities of a ladder diagram.
A group holding outgoing producer variables for consumption in external bindings defined in another project.
See POU. A program belongs to a resource. It is executed by
the Virtual Machine, depending on its location (order) in the
ISaGRAF 5.2
- Glossary
Project
Project Updater
PROPI
Pulse Action
Qualifier
Real
Real Device
Real Time Mode
Reference Name (SFC)
Register (IL)
Resource
Resource Name
Retain
Return
Return Parameter
Rising Edge
Set of configurations and links between their resources.
A program allowing to convert projects developed using previous versions for use within the latest version. Each time you upgrade to a newer version, you need to update projects.
PROPI is an interface enabling you to send commands directly to the Workbench via a custom application. For instance, you could use the PROPI interface when using the Workbench in the background.
SFC Action: it is a list of statements executed only once when
the corresponding Step (SFC) is activated.
Determines the way the action of a step is executed. The qualifier can be N, S, R, P0 or P1.
Type of a variable, stored in a floating IEEE single precision
32-bit format. Basic type that can be used to define a variable,
a Parameter (POU) or a Device.
I/O Device physically connected to an I/O device on the target
Run time normal execution mode: the Target cycles are triggered by the programmed cycle timing.
Name which identifies an SFC Step (SFC) or Transition in an
SFC program.
Current result of an IL sequence.
The POUs and definitions making up a Virtual Machine.
The unique identifier of a resource within a configuration.
Attribute of a variable. The value of a retain variable is saved
by the Virtual Machine at each cycle. The value stored is
restored if the Virtual Machine stops and restarts.
Graphic component of an LD program representing the
conditional end of a program.
A rising edge of a Boolean variable corresponds to a change
from FALSE (0) to TRUE (1).
ISaGRAF 5.2
- Workbench 915
SFB
SFC
SFU
916
Separator
Sequential
Server
Server Mode
Rung
Run-time Error
Scope
Section
Security State
Selection List
Graphic component of an LD program representing a group of
circuit elements leading to the activation of a coil in an
LD diagram.
Application error detected by the Target system at run time.
See Global Scope, Common Scope, Local scope.
Program, function and function block sections are where are
localized POU of a resource. POUs located in the Program
section are executed by the Virtual Machine.
The indication of the level of access control that is applied to a
resource, a POU, or a target.
Also known as a 'combo-box'.
When a Selection List is provided for a particular cell, clicking
on its right part (down arrow), displays the available choices.
To make a selection, perform one of the following operations:
- click on the item (use the scroll bar first if the required choice is not visible)
- move in the list using the cursor keys and press Enter
- type the first letter (if more than one item starts with this letter, press the letter again to select the next occurance).
Special character (or group of characters) used to separate the
identifiers in a literal language.
Attribute of a program. A sequential program gives an order to
operations of a process and conditions between operations.
Generally, it is programmed with SFC or FC.
Part of the target that receives requests from IXL to retrieve
information about the resource run by the Virtual Machine.
(Client/server mode) The mode where you save version source control information in a server repository. Before using this mode, you need to set up the repository server and connect
with the server. See also File Mode.
Indicates a standard function block
Sequential Function Chart. Programming language.
ISaGRAF 5.2
- Glossary
Short Integer (SINT)
Single Resource Mode
SIT
ST
Standard IEC 61131-3
Types
Statement
Step (SFC)
Step (FC)
Step-by-step Mode
STRING
Structure
Signed integer 8-bit format. Basic type that can be used to
define a Variable, a Parameter (POU) or a Device.
The project editing mode limiting access for an individual user to one resource and its POUs. Other users can access other resources of the same project.
Indicates a Standard IEC 61131-3 type.
Structured Text. Programming language.
Boolean (Bool), Short Integer (SINT), Unsigned Short Integer
(USINT), BYTE, Integer (INT), Unsigned Integer (UINT),
WORD, Double Integer (DINT), Unsigned Double Integer
(UDINT), Double Word (DWORD), Long Integer (LINT),
Unsigned Long Integer (ULINT), Long Word (LWORD), Real,
Long Real (LREAL), Timer (TIME), DATE, STRING. See
Basic ST complete operation.
Basic graphic component of the SFC language. A step represents a steady situation of the process, and is drawn as a square. A step is referenced by a name. The activity of a step is
used to control the execution of the corresponding actions. For
an IEC 61499 ECC, a step corresponds to an execution control
state (EC state).
The word step may be used for Flow Chart actions.
A mode used while debugging ST, IL, and LD POUs where you set breakpoints at specific lines of code or rungs causing the application to stop when reached.
Character string. Basic type that can be used to define a
Variable, a Parameter (POU) or a Device.
Corresponds to a type which has previously been specified to
be a data structure, i.e. a type consisting of a collection of named elements (or fields). Each field can be a basic type, a basic structured type, a structure or an array. A field of a variable with a structure type can be accessed using the following syntax: VarName.a, VarName.b[3], VarName.c.d
ISaGRAF 5.2
- Workbench 917
Sub-program
Symbol Table
Symbols Monitoring
Information
System Events
System Variable
Target
Target Definition
Builder
TIC Code
Timer (TIME)
Programs written in SFC or FC language and called by a father
program. A sub-program is also called a child program. To call
sub-programs written in another language, use a function. A
function can be called by any POU.
The file corresponding to the variables and function blocks defined for a resource. This file is downloaded onto the target.
The symbol table is set to one of two formats: complete table or reduced table. The complete table contains all defined variables, whereas, the reduced symbol table only contains the names of variables having a defined Address cell.
When debugging or simulating, code required to enable graphically displaying the output values of functions and operators in FBD and LD diagrams.
Events occurring on the development platform. Such events can be logged using the Events Logger and viewed using the
Events Viewer.
System variables hold the current values of all system variables for a resource. You can read from or write to system variables. These variables are defined in the dsys0def.h file.
For example, the current cycle time is a system variable that
can only be read by a program.
The hardware platform on which Virtual Machines run
resources of a project. You download configurations
(Configs), onto a target.
The Target Definition Builder enables the description of targets (main definition and options of the embedded software), complex data types (such as defined in IEC languages), "C" functions, function blocks and conversion functions, I/O devices or network drivers for IXL communication and/or data binding.
Target Independent Code produced by the
ISaGRAF
compiler
for execution on virtual machines.
Unit of a timer is the millisecond. Basic type that can be used
to define a Variable, a Parameter (POU) or a Device.
918
ISaGRAF 5.2
- Glossary
Token (SFC)
Top Level Program
Transition
Graphical marker used to show the active steps of an SFC
Program put at the top of the hierarchy tree. A top level
program is activated by the system. See also Parent Program,
Basic graphic SFC component. A transition represents the
condition between different SFC steps. A transition is
referenced by a name. A Boolean Condition is attached to each
transition. For an IEC 61499 ECC, a transition corresponds to
an execution control transition (EC transition).
Type
Unsigned Double Integer
(UDINT)
Unsigned double integer 32-bit format. Basic type that can be
used to define a variable, a Parameter (POU) or a Device.
Unsigned Integer (UINT)
Unsigned integer 16-bit format. Basic type that can be used to
define a variable, a Parameter (POU) or a Device.
Unsigned Long Integer
(ULINT)
Unsigned integer 64-bit format. Basic type that can be used to
define a variable, a Parameter (POU) or a Device.
Unsigned Short Integer
(USINT)
Unsigned integer 8-bit format. Basic type that can be used to
define a Variable, a Parameter (POU) or a Device.
User Data
User Data are any data of any format (file, list of values) which have to be merged with the generated code of the resource in order to download them into the target PLC. Such data are not
directly operated by the Virtual Machine and is commonly
dedicated to other software installed on the target PLC.
User Types
Types that the user can define using basic types or other user
types. User types can be arrays or structures.
Validity of a Transition
Attribute of a Transition. A transition is validated (or enabled)
when all the preceding steps are active.
Variable
Unique identifier of elementary data which is used in the
Variable Binding
ISaGRAF 5.2
- Workbench 919
Variable Group
Variable Name
Version Information
Grouping of variables enabling managing and logically sorting these within a resource. Variable groups are displayed in the dictionary’s variables tree.
A unique identifier, defined in the Workbench, for a storage location containing information used in exchanges between resources.
The information indicating the compilation version number,
the compilation date, and the CRC of the data the resource
works on for three sources of resource code:
- the compiled code for the resource in the Workbench project
- the code for the resource running on the target
- the code for the resource stored on the target
Version Source Control
A tool that manages the changing versions of Workbench elements including projects, configurations, resources, and
POUs by saving them to a version source control database.
Saving these elements to a control database enables you to retrieve older versions of the elements at a later time.
Virtual Device
Virtual Machine
I/O Device which is not physically connected to an I/O device
of the Target machine. See Real Device.
(IsaVM.exe) The instantiation of a resource on a Target.
Wiring
WORD
Zip Source
The property of a variable indicating the I/O channel to which the variable is wired.
Unsigned word 16-bit format. Basic type that can be used to
define a variable, a Parameter (POU) or a Device.
An exchange file (.PXF) holding all data from Workbench elements. From the compilation options for a resource, you can choose to embed a zip source file for resources, configurations, or projects onto the target. This source file can be uploaded from the target at a later time.
920
ISaGRAF 5.2
- Glossary
Index
Symbols
) operator for IL
* operator
+ operator
- operator
/ operator
< operator
<= operator
<> operator
= operator
> operator
>= operator
__SYSVA_KVBCERR, consumption error variables
__SYSVA_KVBPERR, production error variables
Numerics
1 gain operator
A
ABS function
access control for configurations
for POUs
for projects
for resources
accessing configuration properties
contextual menus
diagnostic information
events viewer, run-time system events
history details, previous versions of
Workbench elements
internal binding list, the
resource properties
the cross references browser
the Dictionary view
the external binding list
ISaGRAF 5.2
– Workbench 921
ACOS function
action blocks adding in SFC charts
attaching to SFC steps
calling functions and function blocks from
deleting in SFC charts
moving in execution order
actions, Flow Chart described
inserting
actions within steps boolean
described
list of instructions for
non-stored
pulse
SFC
ADD_MATRIX function block
adding action blocks in SFC charts
descriptions for configurations
descriptions for POUs
descriptions for resources
FC sub-programs
I/O devices for I/O wiring
POUs in resources
rows to the Dictionary grid
SFC child programs
variables to spy list
addition operator
addresses, renumbering in the Dictionary grid
adjusting zoom, workspace
advanced control blocks
AnalogAlarm
BatchSwitch
BatchTotalizer
Bias
BiasCalibration
Characterizer
Comparator
DigitalAlarm
FlipFlop
IPIDController
LeadLagController
Limiter
RateLimiter
Ratio
RatioCalibration
RetentiveOnTimer
Scaler
Setpoint
SignalSelector
summary of
TrackAndHold
TransferSwitch
alarm management
LIM_ALRM function block
aligning coils on rungs (LD elements)
AnalogAlarm function block
AND operator
AND_MASK function
ANY_TO_BOOL operator
ANY_TO_BYTE operator
ANY_TO_DATE operator
ANY_TO_DINT operator
ANY_TO_DWORD operator
ANY_TO_INT operator
ANY_TO_LINT operator
ANY_TO_LREAL operator
ANY_TO_LWORD operator
ANY_TO_REAL operator
ANY_TO_SINT operator
ANY_TO_STRING operator
ANY_TO_TIME operator
ANY_TO_UDINT operator
ANY_TO_UINT operator
ANY_TO_ULINT operator
ANY_TO_USINT operator
ANY_TO_WORD operator
appearance of I/O wiring view
of language editors
922
ISaGRAF 5.2
– Index
of simulator
of the Dictionary view
ARCREATE function
arithmetic operations
1gain operator
ABS function
ACOS function
addition operator
ASIN function
ATAN function
COS function
division operator
EXPT function
LOG function
MOD function
multiplication operator
NEG operator
POW function
RAND function
SIN function
SQRT function
subtraction operator
TAN function
TRUNC function
array management
ARCREATE function
ARREAD function
ARWRITE function
arrays basic or user types, described
checking indexes of
initializing elements in
ARREAD function
ARWRITE function
AS_AE function block
AS_SEND_EVENT function
ascending order, sorting for Dictionary grid
ASCII function
ASIN function
assignment, ST basic statement
ATAN function
attaching action blocks, SFC steps
attributes, variables
auto input of names, variables or blocks
automatic instances of function blocks, debugging
available programming languages for function blocks
for functions
for programs
AVERAGE function block
B
background colors, customizing for views and editors
basic operations blocks
AS_AE
AVERAGE
BLINK
CMP
CONNECT
CTD
CTU
CTUD
DERIVATE
F_TRIG
FC_GET_STAT
GET_TIME_STRUCT
HYSTER
INTEGRAL
LIM_ALRM
NOW
R_TRIG
RS
SEMA
SIG_GEN
SR
STACKINT
summary of
TOF
TON
TP
ISaGRAF 5.2
– Workbench 923
URCV_S
USEND_S
BatchSwitch function block
BatchTotalizer function block
begin, Flow Chart component
Bias function block
BiasCalibration function block
binary operations
NOT_MASK function
OR_MASK function
ROL function
ROR function
SHL function
SHR function
XOR_MASK function
bindings between variables, described
error variables for
external, between projects
external, defining
internal, defining
internal, within a project
BLINK function block
blocks (functions and function blocks) in LD on the left, inserting
on the right, inserting
usage of
BOO operator
boolean actions within steps
constant expressions
negations in FBD, described
variables
boolean operations
AND operator
AND_MASK function
F_TRIG function block
NOT operator
ODD function
OR operator
R_TRIG function block
RS function block
924
SR function block
XOR operator
BREAK resource state
breakpoints on step activation (SFC)
on step deactivation (SFC)
on transition (SFC)
removing, step-by-step mode
setting, step-by-step mode
setting/removing for steps and transitions
(SFC)
viewing (step-by-step mode)
browser for cross references
manipulating in simulator
browsing POUs of a project
building code for POUs
for projects
for resources/projects
builds, stopping (projects, resources, and POUs)
BYTE constant expressions
variables
C
C source code, implications of generating
CAL operator for IL
calculating cross references
calling function blocks from IL (CAL operator)
function blocks from transitions
function blocks in FBD
functions from IL
functions from transitions
functions in FBD
CASE, OF, ELSE, END_CASE, ST basic statements
CAT operator
ISaGRAF 5.2
– Index
cell-level validation
changing, coils and contacts types (LD elements)
channels in I/O devices freeing
mapping
wiring
CHAR function
Characterizer function block
checking array indexes
checking in Workbench elements, version source control
child SFC POUs, described
cleaning code stored on targets
projects and resources
clearing the contents of output window
transitions (SFC)
transitions, forcing of
clearing VSC status
closing projects
CMP function block
code building/rebuilding for projects
cleaning from targets
downloading to targets for resources
generating for resources
sequences of, particular cases for online changes
stopping builds of
coils (LD elements) aligning on rungs
changing types of
inserting in FBD POUs
inserting in Ladder diagrams
collapsing grid components, Dictionary grid
COLS_MATRIX function block
command lines importing and exporting target definitions
opening projects
starting events logger
comments displaying or hiding for variables
in FC charts, described
inserting in FBD
inserting in FC charts
inserting in literal languages
communications
CONNECT function block
URCV_S function block
USEND_S function block
Comparator function block
comparison operations
CMP function block
equal operator
greater than operator
greater than or equal operator
less than operator
less than or equal operator
not equal operator
compilation options for resources
stopping in progress
verifying for POUs
compiling
POUs
projects
resources/projects
complex structures (examples of), Flow Chart
complex variables, wired elements to read/write
composite IEC 61499 editor described
displaying cursor coordinates
inserting corners
inserting function blocks
inserting links, connection
inserting variables
ISaGRAF 5.2
– Workbench 925
managing guideline areas
menu bar options for
selecting elements
toolbars
working with IEC 61499 POUs
computer allocated hidden variables, effect on online changes
concatenation operation, CAT operator
conditions attached to transitions
for downloading resource code
in FC charts, described
configurations accessing details for previous versions of
accessing the properties window for
checking in
comparing versions of
controlling development access for
controlling target access for
creating history reports for
creating in project
defining identification properties for
defining target properties for
deleting from a project
editing descriptions of
getting previous versions of
identification of
inserting resources in
managing
moving in hardware architecture view
moving resources between
viewing the history of
CONNECT function block
connection lines in Ladder diagrams
connections (configurations to networks) creating
deleting
described
connectors (Flow Chart) described
linking elements
constant expressions boolean
BYTE
date
double integer
double integer, unsigned
DWORD
integer
integer, unsigned
long integer
long integer, unsigned
long real
LWORD
real
short integer
short integer, unsigned
string
timer
WORD
consuming variables, viewing for internal bindings
consumption error variables
contacts (LD elements) changing types of
inserting in FBD POUs
on the left, inserting
on the right, inserting
contextual menus, accessing
convergences (SFC elements) deleting branches from
double, described
inserting new branches in
linking and placing in chart
single, described
conversions, deleting from I/O wiring
COPY_COL_MATRIX function block
COPY_MATRIX function block
COPY_ROW_MATRIX function block
copying
POUs
resources
variables (Dictionary grid elements)
926
ISaGRAF 5.2
– Index
corners, inserting (composite IEC 61499 elements)
corners, inserting (FBD elements)
COS function
counters
CTD function block
CTU function block
CTUD function block
cover page, adding as printing option
CRC (Cyclic Redundancy Checking), viewing for resources
creating configurations
connections between configurations and networks
data links
FC sub-programs
history reports, version source control
libraries
networks
POUs in resources
projects
resources
SFC child programs
structures in the types tree
variable groups
cross references browser for
browsing POUs of a project
calculating
defining search options for finding
csv files, importing variables data using
CTD function block
CTU function block
CTUD function block
current step, locating for step-by-step mode
CURRENT_ISA_DATE function
cursor coordinates, displaying for composite IEC
61499 editor
cursor coordinates, displaying in FBD and LD editors
custom parameters, resources
customizing, colors/fonts of views and editors
cutting
POUs
variables (Dictionary grid elements)
cycle time execution of IEC 61499 programs
setting for resources, debug mode
setting for resources, edition mode
cycle-to-cycle execution mode, resources
cycles execution control chart
SFC execution
cyclic and sequential operations
D
data conversion
ANY_TO_BOOL operator
ANY_TO_BYTE operator
ANY_TO_DATE operator
ANY_TO_DINT operator
ANY_TO_DWORD operator
ANY_TO_INT operator
ANY_TO_LINT operator
ANY_TO_LREAL operator
ANY_TO_LWORD operator
ANY_TO_REAL operator
ANY_TO_SINT operator
ANY_TO_STRING operator
ANY_TO_TIME operator
ANY_TO_UDINT operator
ANY_TO_UINT operator
ANY_TO_ULINT operator
ANY_TO_USINT operator
ANY_TO_WORD operator
BOO operator
ISA3_ANA operator
ISA3_REAL operator
MSG operator
OPERATE operator
TMR operator
ISaGRAF 5.2
– Workbench 927
data links (internal bindings) creating
deleting
hiding and showing
data manipulation
AVERAGE function block
LIMIT function
MAX function
MIN function
MUX4 function
MUX8 function
SEL function
database-level validation
date constant expressions
variables
DAY_TIME function
debug information, generating at program level
information, generating at resource level
mode, starting for the project
toolbar in language editors
toolbar in main environment
debugging instances of function blocks
modes for a project
declared instances of function blocks, debugging
variables, modifying in online changes
defined words described
grid for, Dictionary
parameters component for
defining external bindings
internal bindings
printing options for project items
producer groups, external bindings
search options for finding cross references
delayed operations (IL elements)
DELETE function
deleting action blocks from SFC charts
configurations from a project
connections between configurations and networks
data links, internal bindings
external bindings
I/O devices and conversions from I/O wiring
internal bindings
POUs
producer groups, external bindings
resources
structures
variables (Dictionary grid elements)
demoting SFC child programs
dependencies projects on libraries
DERIVATE function block
descending order, sorting for Dictionary grid
description languages, programs
descriptions adding to projects
adding to resources
editing for configurations
diagnostic information, accessing
diagram format, FBD
Dictionary accessing the
adding and inserting rows
appearance of the
cutting, copying, and deleting elements
(variables) in the
defined words grid, described
described
duplicating rows in the
editing contents of cells and rows in the
expanding/collapsing grid components in the
finding and replacing elements in the
moving rows in the
parameters grid, described
928
ISaGRAF 5.2
– Index
parameters tree, described
pasting elements (variables) in the
printing the grid of the
renumbering addresses in the
resizing columns and rows in the
selecting rows and elements in the
sorting the grid of the
types grid, described
types tree, described
variables grid, described
variables tree, described
working with the grids of the
DigitalAlarm function block
direct coils in Ladder diagrams, described
contacts in Ladder diagrams, described
direction, variables
directly represented variables
directory structure, installation
displaying errors and information, output window
I/O device window headers
the status bar, the
tooltips for function blocks
tooltips for variables
variable comments
distribution view, IEC 61499 programs
divergences (SFC elements) deleting branches from
double, described
inserting new branches in
linking and placing
single, described
division operator
DO-WHILE structures, inserting (FC elements)
docking toolbars
double convergences, described
divergences, described
integer constant expressions
integer variables
WORD variables
downloading resources code onto targets
DUP_MATRIX function block
duplicating rows, Dictionary grid
DWORD constant expressions
dynamic behavior for Flow Chart diagrams
setting SFC limits
SFC charts, described
E
E_CTU function block
E_CYCLE function block
E_D_FF function block
E_DELAY function block
E_DEMUX function block
E_F_TRIG function block
E_MERGE function block
E_N_TABLE function block
E_PERMIT function block
E_R_TRIG function block
E_REND function block
E_RESTART function block
E_RS function block
E_SELECT function block
E_SPLIT function block
E_SR function block
E_SWITCH function block
E_TABLE function block
E_TABLE_CTRL function block
E_TRAIN function block
editing descriptions for configurations
descriptions for POUs
descriptions for resources
external bindings
internal bindings
level 2 programming, SFC elements
links between resources, external bindings
ISaGRAF 5.2
– Workbench 929
producer groups, external bindings
resource properties
the contents of cells and rows, Dictionary grid
transition code, SFC elements
editing modes for projects, normal and single-resource
for the Dictionary, grid and line
elements moving in FBD POUs
resizing in composite IEC 61499 POUs
resizing in FBD POUs
Workbench, uploading from targets
enabling compilation verification of POUs
state information, functions
end, Flow Chart component
equal operator
error detection
ERROR resource state
events logger, starting
execution cycles of execution control charts, IEC
61499 programs
cycles, SFC
order, moving action blocks in (SFC POUs)
order, showing for FBD programs
rules for resource cycles
starting and stopping for resources
execution modes, resources cycle-to-cycle
real-time
step-by-step
EXIT, ST basic statement
expanding grid components, Dictionary
exporting target definitions
variables data
Workbench elements between projects
expressions in ST programs
EXPT function
extended properties, resources
extensions, ST
external bindings accessing the list of
defining
defining producer groups for
deleting
deleting producer groups for
editing
editing links between resources for
editing producer groups for
linking resources for
overview of
F
F_CLOSE function
F_EOF function
F_ROPEN function
F_TRIG function block
F_WOPEN function
FA_READ function
FA_WRITE function
FAILOVER function
falling edge detection contacts, described
negative coils, described
FBD (Function Block Diagram) boolean negation, described
displaying cursor coordinates
inserting comments
inserting corners
inserting function blocks
inserting jumps to labels
inserting labels
inserting links, connection
inserting returns
inserting variables
jumps and labels, described
main diagram format
managing guideline areas
930
ISaGRAF 5.2
– Index
monitoring output values
return statement, described
showing execution order
toolbar, language editor
FC (Flow Chart) actions, described
begin component, described
comments, described
complex structures, examples of
conditions, described
connectors, described
creating sub-programs
dynamic behavior of
end component, described
execution of sub-programs
flow link, described
I/O specific actions, described
inserting actions
inserting comments
inserting connector links
inserting DO-WHILE structures
inserting flow links
inserting I/O specific actions
inserting IF-THEN-ELSE structures
inserting sub-programs
inserting tests
inserting WHILE-DO structures
language editor, menu bar options for
programs, hierarchy restrictions for
renumbering in charts
sub-programs, vertical structures of
syntax verification rules, main
toolbar, language editor
using goto symbols
viewing level 2 windows for
working with charts
FC_GET_STAT function block
file management
F_CLOSE function
F_EOF function
F_ROPEN function
F_WOPEN function
FA_READ function
FA_WRITE function
FM_READ function
FM_WRITE function
filenames, projects
FIND function
finding matching coils (LD POUs)
matching names (LD POUs)
variables (elements) in POUs
variables (elements) in the Dictionary
FlipFlop function block
flow links described
inserting
FM_READ function
FM_WRITE function
fonts changing for printing options
customizing for views and editors
FOR, TO, BY, DO, END_FOR, ST basic statement
forcing transition clearing
values of variables in a spy list
values of variables in the Dictionary
foreground colors, customizing for views and editors
format (IEC61499) basic function blocks, described
composite function blocks, described
function blocks, main
FREE_MATRIX function block
freeing channels, I/O wiring
function blocks
ADD_MATRIX
advanced control, summary of
AnalogAlarm
AS_AE
AVERAGE
basic operations, summary of
BatchSwitch
ISaGRAF 5.2
– Workbench 931
932
BatchTotalizer
Bias
BiasCalibration
BLINK
calling from action blocks
calling from IL (CAL operator)
calling from ST programs
calling from transitions
Characterizer
CMP
COLS_MATRIX
Comparator
CONNECT
COPY_COL_MATRIX
COPY_MATRIX
COPY_ROW_MATRIX
creating in resources
CTD
CTU
CTUD
debugging instances of
defining access control for
DERIVATE
described
DigitalAlarm
displaying tooltips for
DUP_MATRIX
E_CTU
E_CYCLE
E_D_FF
E_DELAY
E_DEMUX
E_F_TRIG
E_MERGE
E_N_TABLE
E_PERMIT
E_R_TRIG
E_REND
E_RESTART
E_RS
E_SELECT
E_SPLIT
E_SR
E_SWITCH
E_TABLE
E_TABLE_CTRL
E_TRAIN
F_TRIG
FC_GET_STAT
FlipFlop
FREE_MATRIX
GET_F_MATRIX
GET_I_MATRIX
GET_TIME_STRUCT
HYSTER
inserting, composite IEC 61499 elements
inserting in FBD diagrams
inserting in POUs
INTEGRAL
INVERT_MATRIX
IPIDController
LeadLagController
LIM_ALRM
Limiter
manipulating in resources
matrix operations, summary of
modifying instances of, in online changes
MULTIPLY_MATRIX
NEW_MATRIX
NOW
optional, summary of
PRINT_MATRIX
PUT_F_MATRIX
PUT_I_MATRIX
R_TRIG
RateLimiter
Ratio
RatioCalibration
RetentiveOnTimer
reusing through libraries
ROWS_MATRIX
RS
ISaGRAF 5.2
– Index
SCALAR_F_MATRIX
SCALAR_I_MATRIX
Scaler
SEMA
Setpoint
SIG_GEN
SignalSelector
Smart PID
SR
STACKINT
standard, types of
SUBTRACT_MATRIX
TOF
TON
TP
TrackAndHold
TransferSwitch
TRANSPOSE_MATRIX
TYPE_MATRIX
URCV_S
USEND_S
working with
functions
ABS
ACOS
AND_MASK
ARCREATE
ARREAD
ARWRITE
AS_SEND_EVENT
ASCII
ASIN
ATAN
calling from action blocks
calling from IL
calling from ST programs
calling from transitions
CHAR
COS
creating in resources
CURRENT_ISA_DATE
DAY_TIME
ISaGRAF 5.2
– Workbench defining access control for
DELETE
described
EXPT
F_CLOSE
F_EOF
F_ROPEN
F_WOPEN
FA_READ
FA_WRITE
FAILOVER
FIND
FM_READ
FM_WRITE
GET_TIME_STRING
INSERT
inserting in POUs
IOCTRL
ISA_SERIAL_CLOSE
ISA_SERIAL_CONNECT
ISA_SERIAL_DISCONNECT
ISA_SERIAL_OPEN
ISA_SERIAL_RECEIVE
ISA_SERIAL_SEND
ISA_SERIAL_SET
ISA_SERIAL_STATUS
LEFT
LIMIT
LOG
LOG_MSG
manipulating in resources
MAX
MID
MIN
MLEN
MOD
MUX4
MUX8
NOT_MASK
ODD
OR_MASK
POW
933
RAND
RIGHT
ROL
ROR
SEL
SHL
SHR
SIN
TAN
SQRT
TRUNC
REPLACE
reusing through libraries
SET_PRIORITY standard, summary of
SUB_DATE_DATE
working with
XOR_MASK
goto steps or transitions, SFC elements
symbols, FC elements
greater than operator
greater than or equal operator
grid displaying for language editors
editing mode for the Dictionary
view for I/O Wiring
groups creating for variables
managing for variables
of variables, opening
GRST statement
GSTART statement
GSTATUS statement
guideline areas managing in FBD editor
managing in the composite IEC 61499 editor
G
general properties for configurations
for resources
generating
C source code, implications of
debug information, program level
debug information, resource level
symbols monitoring information
TIC code
GET_F_MATRIX function block
GET_I_MATRIX function block
GET_TIME_STRING function
GET_TIME_STRUCT function block
getting previous versions of Workbench elements
GFREEZE statement
GKILL statement
go to line, ST and IL POUs
H
hardware architecture view
headers/footers, including as printing option
hidden variables, computer allocated, effect on online changes
hiding resource links, internal bindings
the status bar, Workbench
toolbars, Workbench
variable comments in language editors
hierarchy changing for SFC child programs
restrictions for SFC and FC programs
history reports, creating
HSD network parameter
HYSTER function block
934
ISaGRAF 5.2
– Index
I
I/O devices adding for I/O wiring
deleting conversions
deleting from I/O wiring
freeing channels of
mapping channels of
modifying with online changes
opening for I/O wiring
setting the real or virtual attribute for
wiring channels of
I/O specific actions described
inserting in charts
I/O variable comments, displaying or hiding
I/O wiring adding I/O devices to
appearance of
deleting I/O devices and conversions from
freeing channels in devices
grid view of
mapping channels of devices
opening I/O devices in
overview of
parameters component for
setting the real or virtual attribute, devices
tool, working with the
toolbar, main environment
tree view, described
wiring channels of devices
I/Os, simulating a panel of
identification defining for configurations
defining for resources
identifiers inserting in POUs
using defined words as
IEC 61499 basic function blocks, described
composite function blocks, described
cycle execution time of programs
distribution view of programs
E_CTU function block
E_CYCLE function block
E_D_FF function block
E_DELAY function block
E_DEMUX function block
E_F_TRIG function block
E_MERGE function block
E_N_TABLE function block
E_PERMIT function block
E_R_TRIG function block
E_REND function block
E_RESTART function block
E_RS function block
E_SELECT function block
E_SPLIT function block
E_SR function block
E_SWITCH function block
E_TABLE function block
E_TABLE_CTRL function block
E_TRAIN function block
execution control chart cycles
function blocks, main format of
graphical representation of WITH qualifier
programs, main format of
IF, THEN, ELSE, ELSIF, END_IF, ST basic statements
IF-THEN-ELSE structures, inserting (FC elements)
IL (Instruction List)
) operator for
calling function blocks from (CAL operator)
calling functions from
delayed operations, described
go to line for POUs
JMP operator for
ISaGRAF 5.2
– Workbench 935
labels, described
LD operator for
operator modifiers, described
R operator for
RET operator for
S operator for
ST operator for
summary of operators
syntax of programs in
toolbar, language editor
working with POUs, multi-language editor
importing
ISaGRAF 3 projects
target definitions
variables data
Workbench elements between projects
initial steps (SFC elements), described
steps (SFC elements), inserting
values for variables
initializing array elements
structure fields
INSERT function
inserting actions (FC elements)
blocks on the left (LD elements)
blocks on the right (LD elements)
coils (LD elements for FBD POUs)
coils (LD elements)
comments (FBD elements)
comments (FC elements)
connector links (FC elements)
contact on the left (LD elements)
contact on the right (LD elements)
contacts (LD elements for FBD POUs)
corners (composite IEC 61499 elements)
corners (FBD elements)
DO-WHILE structures (FC elements)
flow links (FC elements)
936 function blocks (composite IEC 61499 elements)
function blocks (FBD elements)
I/O specific actions (FC elements)
identifiers in POUs
IF-THEN-ELSE structures (FC elements)
initial steps (SFC elements)
jumps (SFC elements)
jumps to labels (FBD elements)
jumps to labels (LD elements)
labels (FBD elements)
labels (LD elements)
LD vertical connections (FBD POUs)
left power bars (LD elements for FBD
POUs)
links (LD elements)
links (SFC elements)
links, connection (composite IEC 61499 elements)
links, connection (FBD elements)
networks
operators, functions, and function blocks in
POUs
parallel blocks (LD elements)
parallel contacts (LD elements)
resources in configurations
resources in the link architecture view
returns (FBD elements)
returns (LD elements)
right power bars (LD elements for FBD
POUs)
rows in the Dictionary grid
rungs (LD elements)
steps (SFC elements)
sub-programs (FC elements)
tests (FC elements)
transitions (SFC elements)
variables (composite IEC 61499 elements)
variables (FBD elements)
WHILE-DO structures (FC elements)
ISaGRAF 5.2
– Index
installation, directory structure of
instance symbols extra bytes
integer constant expressions
variables
INTEGRAL function block
internal bindings accessing the list of
defining
deleting
deleting resource links for
described
editing the contents of
viewing for a resource
internal variable comments, displaying or hiding
INVERT_MATRIX function block
inverted coils, described
contacts, described
IOCTRL function
IPIDController function block
ISA_SERIAL_CLOSE function
ISA_SERIAL_CONNECT function
ISA_SERIAL_DISCONNECT function
ISA_SERIAL_OPEN function
ISA_SERIAL_RECEIVE function
ISA_SERIAL_SEND function
ISA_SERIAL_SET function
ISA_SERIAL_STATUS function
ISA3_ANA operator
ISA3_REAL operator
ISA3_SYSTEM operator
ISaGRAF 3, importing projects from
J
JMP operator for IL
jumps described (FBD elements)
described (LD elements)
K
keywords, list of reserved
L
described (SFC elements)
inserting (FBD elements)
inserting (LD elements)
inserting (SFC elements)
labels described (FBD elements)
described (IL elements)
described (LD elements)
inserting (FBD elements)
inserting (LD elements)
language editors appearance of
composite IEC 61499, described
debug toolbar in
FBD toolbar in
Flow Chart toolbar in
for SFC, described
IL toolbar in
LD toolbar in
managing the workspace of
multi-language, described
opening POUs from
options toolbar in
SFC breakpoints toolbar in
SFC toolbar in
ST toolbar in
ISaGRAF 5.2
– Workbench 937
standard toolbar in
toolbars, summary of available
layers toolbar, main environment
LD (Ladder Diagram) aligning coils on rungs
applying paste special in POUs
changing coils and contacts types
connection lines, described
direct coils, described
direct contacts, described
displaying cursor coordinates
falling edge detection (negative) coils, described
falling edge detection (negative) contacts, described
finding matching coils in POUs
finding matching names in POUs
inserting block on the left
inserting block on the right
inserting coils
inserting contact on the left
inserting contact on the right
inserting jumps to labels
inserting labels
inserting links
inserting parallel blocks
inserting parallel contacts
inserting returns
inserting rungs
inverted coils, described
inverted contacts, described
jumps, described
labels, described
monitoring output values in POUs
multiple connections, described
power rails, described
reset coils, described
return statements, described
rising edge detection (positive) coils, described
rising edge detection (positive) contacts, described
set coils, described
toolbar, language editor
usage of blocks (functions and function blocks), described
working with POUs, multi-language editor
LD elements (for FBD POUs) inserting coils
inserting contacts
inserting LD vertical connections
inserting left power bar
inserting right power bar
LD operator for IL
LeadLagController function block
LEFT function
left power bars (LD elements for FBD POUs), inserting
less than operator
less than or equal operator
level 2 windows editing, SFC elements
viewing, FC elements
levels of programming, SFC editor
libraries creating
described
licensing third-party
using in projects
licensing third-party libraries
LIM_ALRM function block
LIMIT function
Limiter function block
line editing mode, Dictionary
link architecture view
linking configurations and networks
resources for external bindings
resources for internal bindings
links inserting, composite IEC 61499 elements
inserting, FBD elements
938
ISaGRAF 5.2
– Index
list inserting, LD elements inserting, SFC elements
of external bindings
of instructions for actions within steps
of internal bindings
locating current step, step-by-step mode
locked variables locking
unlocking
locking, values of variables in a spy list
LOG function
LOG_MSG function
logging system events opening log file
starting
viewing
long integer constant expressions
variables
long real constant expressions
variables
long word (LWORD) constant expressions
variables
M
magnification factor, adjusting in workspace
main format of IEC 61499 programs
of SFC programs
managing configurations
external bindings
I/O wiring
internal bindings
POUs (Program Organization Unit)
projects
resources
the hardware architecture view of a project
the link architecture view of a project
the workspace for language editors
manipulating POUs in resources
manual input of names, variables or blocks
mapping channels, I/O wiring
margins, including as printing option
matrix operations blocks
ADD_MATRIX
COLS_MATRIX
COPY_COL_MATRIX
COPY_MATRIX
COPY_ROW_MATRIX
DUP_MATRIX
FREE_MATRIX
GET_F_MATRIX
GET_I_MATRIX
INVERT_MATRIX
MULTIPLY_MATRIX
NEW_MATRIX
PRINT_MATRIX
PUT_F_MATRIX
PUT_I_MATRIX
ROWS_MATRIX
SCALAR_F_MATRIX
SCALAR_I_MATRIX
SUBTRACT_MATRIX
summary of
TRANSPOSE_MATRIX
TYPE_MATRIX
MAX function
memory defining size for on-line changes
requirements for online changes
menu bar options for composite IEC 61499 editor
for FC editor
for main environment
for multi-language editor
for SFC editor
for simulator
ISaGRAF 5.2
– Workbench 939
MID function
MIN function
MLEN function
MOD function
modes for debugging a project
for editing a project
for edition the Dictionary
for resources execution
monitoring information, generating for symbols
output values of FBD/LD POUs
moving action blocks in execution order (SFC elements)
configurations
elements in FBD POUs
networks
POUs between sections and resources
resources between configurations
rows, Dictionary grid
toolbars
MSG operator
multi-language editor described
menu bar options for
programming languages used with the
selecting elements in the
working with FBD POUs
working with LD POUs
working with ST/IL POUs
multiple connections in Ladder diagrams
multiplication operator
MULTIPLY_MATRIX function block
MUX4 function
MUX8 function
N
naming conventions for defined words
for directly represented variables
for variables
NEG operator
networks creating
described
moving
properties for resources
NEW_MATRIX function block
ngs
non-stored actions, within steps
not equal operator
NOT operator
NOT_MASK function
NOW function block
O
ODD function
OEM specific options
online changes declared variables, options for modifying using
function block instances, options for modifying using
I/O devices, options for modifying using
memory requirements for
modifying running resources using
particular cases for
performing
types, bindings, and resource properties, options for modifying using
variables, options for modifying using
940
ISaGRAF 5.2
– Index
online mode for debugging
opening
I/O devices in I/O wiring
level 2 windows (FC elements)
POUs in language editors
projects
spy lists
the I/O wiring tool
variable groups
OPERATE operator
operative states of resources
operator modifiers (IL elements), described
operators
) for IL programs
1 gain
addition
AND
ANY_TO_BOOL
ANY_TO_BYTE
ANY_TO_DATE
ANY_TO_DINT
ANY_TO_DWORD
ANY_TO_INT
ANY_TO_LINT
ANY_TO_LREAL
ANY_TO_LWORD
ANY_TO_REAL
ANY_TO_SINT
ANY_TO_STRING
ANY_TO_TIME
ANY_TO_UDINT
ANY_TO_UINT
ANY_TO_ULINT
ANY_TO_USINT
ANY_TO_WORD
BOO
CAL for IL
CAT
division
equal
greater than
greater than or equal
inserting in POUs
ISA3_ANA
ISA3_REAL
ISA3_SYSTEM
JMP for IL programs
LD for IL programs
less than
less than or equal
MSG
multiplication
NEG
NOT
not equal
OPERATE
OR
R for IL programs
RET for IL programs
S for IL programs
ST for IL programs
subtraction
summary of IL
summary of standard
TMR
XOR
optional function blocks, summary of
options for printing of project items
toolbar in language editors
toolbar in main environment
OR operator
OR_MASK function
oriented links, description of
output values, monitoring (FBD/LD POUs)
output window clearing the contents of the
displaying errors and build information
ISaGRAF 5.2
– Workbench 941
P
page numbering, specifying in printing options
panel of I/Os, simulating a
parallel blocks, inserting (LD elements)
parallel contacts, inserting (LD elements)
parameters grid, described
I/O wiring and defined words components of
network, for resources
tree, described
parentheses in ST programs
password protection for configuration access control
for POU access control
for project access control
for resource access control
paste special, applying in LD POUs
pasting elements (variables) in the Dictionary grid
POUs
resources
performing online changes
popup menus, accessing
POUs (Program Organization Unit) accessing details for previous versions of
building/rebuilding code for
checking in
cleaning
comparing versions of
creating history reports for
creating in resources
defining access control for
editing descriptions of
finding and replacing elements in
getting previous versions of
inserting identifiers in
inserting operators, functions, and function blocks in
managing
manipulating in resources
opening from language editors
stepping in
stopping builds
unlocking
verifying compilation of
viewing the history of
POW function
power rails for Ladder diagrams
preferences, setting for opening and exiting
previewing project printing
previous versions, accessing history details for
PRINT_MATRIX function block
printing defining options for
previewing project document before
project items
projects
selecting project items for
specifying document range for
the Dictionary grid
process control
DERIVATE function block
HYSTER function block
INTEGRAL function block
STACKINT function block
producer groups, external bindings defining
deleting
editing
producing variables, viewing for internal bindings
production error variables
programming languages for use with function blocks
for use with functions
for use with programs
used with the multi-language editor
942
ISaGRAF 5.2
– Index
programming levels, SFC editor
programs changing hierarchy level for SFC child
creating in resources
defining access control for
described
hierarchy in the SFC language
inserting comments in literal language
manipulating in resources
working with
project architecture child SFC POUs
cyclic and sequential operations
description languages for programs
execution rules for cycles
FC sub-programs
function blocks
functions
overview of
programs
project tree view
projects accessing details for previous versions of
adding descriptions to
browsing POUs of
building/rebuilding code for
checking in
cleaning
closing
comparing versions of
controlling access for
creating
creating history reports for
defining dependencies on libraries for
editing modes for
filenames for
getting previous versions of
hardware architecture view of
importing from ISaGRAF 3
link architecture view of
managing
modes for testing
opening
opening with a command line
previewing printing documents for
printing
printing items in
renaming
saving changes to
security state of resources within
selecting items for printing
stopping builds
storage location of
templates for
using libraries in
viewing the history of
promoting SFC child programs
properties for configuration identification
for resource custom parameters
for resource identification
for target access, configurations
for target definition, configurations
target for resources
pulse actions, within steps
PUT_F_MATRIX function block
PUT_I_MATRIX function block
R
R operator for IL
R_TRIG function block
RAND function
RateLimiter function block
Ratio function block
RatioCalibration function block
real attribute, setting for I/O devices
constant expressions
variables
real-time execution mode, resources
rearranging variables in spy list
ISaGRAF 5.2
– Workbench 943
rebuilding code for projects
POUs
refresh rate, setting for resources
refreshing status of resources
reloading of last project when starting, setting
removing breakpoints for steps and transitions (SFC)
breakpoints, step-by-step mode
code stored on targets
variables from spy list
renaming projects
resources
SFC elements
structures
renumbering addresses in the Dictionary grid
elements in FC charts
elements in SFC charts
REPEAT, UNTIL, END_REPEAT, ST basic statements
REPLACE function
replacing elements, Dictionary grid
repository path for version source control
reserved keywords, list of
reset coils, described
resizing columns and rows in the Dictionary
elements in composite IEC 61499 POUs
elements in FBD POUs
resource links (internal bindings) deleting
hiding and showing
resources accessing details for previous versions of
adding descriptions to
appearance of
building code for
checking in
944 cleaning
comparing versions of
compilation options for
copying
creating
creating history reports for
cycle-to-cycle execution mode for
defining access control for
defining custom parameters for
defining the identification (general) properties of
defining the network parameters for
deleting
deleting data links between (internal bindings)
downloading code to targets for
editing links for external bindings
editing the properties of
executing in step-by-step mode
execution modes for
getting previous versions of
inserting in configurations
inserting in the link architecture view
linking for external bindings
linking for internal bindings
managing
moving between configurations
operative states of
pasting
properties, options for modifying using online changes
real-time execution mode for
renaming
run-time settings for
running, modifying using online changes
setting cycle time, debug mode
setting cycle time, edition mode
starting and stopping execution of resources
status information for
stopping builds
ISaGRAF 5.2
– Index
target options
unlocking
viewing the history of
window workspace of, described
RET operator for IL
RetentiveOnTimer function block
return statements for FBD
for LD
for ST
return symbols inserting, FBD elements
inserting, LD elements
reusing functions and function blocks
RIGHT function
right power bars (LD elements for FBD POUs), inserting
rising edge detection (positive) coils, described
contacts, described
ROL function
ROR function
row-level validation
rows, duplicating in the Dictionary grid
ROWS_MATRIX function block
RS function block
rules for variables
RUN resource state
run-time logging of system events
settings for resources
viewing of system events
rungs, inserting (LD elements)
S
S operator for IL
saving before exiting, setting to prompt
changes to projects
changes to spy lists
SCALAR_F_MATRIX function block
SCALAR_I_MATRIX function block
Scaler function block
search options, defining for finding cross references
security for configurations
for POUs
for projects
for resources
state of resources within projects
SEL function
selecting elements, composite IEC 61499 editor
elements in the multi-language editor
project items for printing
rows and elements in the Dictionary
variables in a spy list
SEMA function block
semaphore manipulation, SEMA function block
sequential operations
serial communications
ISA_SERIAL_CLOSE
ISA_SERIAL_CONNECT
ISA_SERIAL_DISCONNECT
ISA_SERIAL_OPEN
ISA_SERIAL_RECEIVE
ISA_SERIAL_SEND
ISA_SERIAL_SET
ISA_SERIAL_STATUS
set coils, Ladder diagrams
SET_PRIORITY function
ISaGRAF 5.2
– Workbench 945
Setpoint function block
setting access control for resources
breakpoints for steps and transitions (SFC)
breakpoints, step-by-step mode
cycle time of resources, debug mode
prompting to save before exiting
real or virtual attributes for I/O devices
refresh rate for resources
reloading of last project when starting
SFC (Sequential Function Chart) actions within steps, described
adding action blocks to level 2 programming
breakpoints on step activation
breakpoints on step deactivation
breakpoints on transition
breakpoints toolbar in language editors
changing hierarchy level of child programs
creating child programs
deleting action blocks from level 2 programming
deleting branches from convergences/divergences
dynamic behavior, described
editing code for transitions
editing level 2 programming
editor, described
execution cycles of
GFREEZE statement in actions
GKILL statement in actions
goto steps or transitions
GRST statement in actions
GSTART statement in actions
GSTATUS statement in actions
hierarchy of programs
hierarchy restrictions for programs
inserting initial steps
inserting jumps
inserting links
inserting new branches in convergences/divergences
inserting steps
inserting transitions
linking and placing convergences/divergences
main format of programs
menu bar options for editor
programming levels of editor
renaming elements
renumbering elements in charts
setting/removing breakpoints for steps and transitions
toolbar for language editors
SHL function
short integer constant expressions
variables
showing resource links, internal bindings
toolbars in the main environment
SHR function
SIG_GEN function block
signal generation
BLINK function block
SIG_GEN function block
SignalSelector function block
simulating a panel of I/Os
simulation mode for debugging a project
starting for a project
simulator appearance of
displaying I/O device window headers in the
manipulating the browser of the
menu bar options for the
toolbar options for the
SIN function
single convergences, described
single divergences, described
single-resource editing mode
946
ISaGRAF 5.2
– Index
Smart PID function block
sorting run-time system events
the Dictionary grid
source control, for versions of Workbench elements
splitting workspace of language editors
spreadsheets, importing variables data using
spy lists accessing variables list for
adding variables to
forcing, locking, unlocking values of variables in
opening
rearranging variables in
removing variables from
saving
selecting variables in
SQRT function
SR function block
ST (Structured Text) assignment basic statements for
calling function blocks from
calling functions from
CASE, OF, ELSE, END_CASE basic statements for
EXIT basic statements for
expressions and parentheses in
extensions for SFC child execution
FOR, TO, BY, DO, END_FOR basic statements for
go to line for POUs
IF, THEN, ELSE, ELSIF, END_IF basic statements for
main syntax of programs in
REPEAT, UNTIL, END_REPEAT basic statements for
return basic statements for
toolbar in the language editors
WHILE, DO, END_WHILE basic statements for
working with POUs in the multi-language editor
ST operator for IL
STACKINT function block
standard function blocks
ADD_MATRIX
advanced control blocks, summary of
AnalogAlarm
AS_AE
AVERAGE
basic operations blocks, summary of
BatchSwitch
BatchTotalizer
Bias
BiasCalibration
BLINK
Characterizer
CMP
COLS_MATRIX
Comparator
CONNECT
COPY_COL_MATRIX
COPY_MATRIX
COPY_ROW_MATRIX
CTD
CTU
CTUD
DERIVATE
DigitalAlarm
DUP_MATRIX
F_TRIG
FC_GET_STAT
FlipFlop
FREE_MATRIX
GET_F_MATRIX
GET_I_MATRIX
GET_TIME_STRUCT
HYSTER
INTEGRAL
INVERT_MATRIX
ISaGRAF 5.2
– Workbench 947
IPIDController
LeadLagController
LIM_ALRM
Limiter
matrix operations blocks, summary of
MULTIPLY_MATRIX
NEW_MATRIX
NOW
PRINT_MATRIX
PUT_F_MATRIX
PUT_I_MATRIX
R_TRIG
RateLimiter
Ratio
RatioCalibration
RetentiveOnTimer
ROWS_MATRIX
RS
SCALAR_F_MATRIX
SCALAR_I_MATRIX
Scaler
SEMA
Setpoint
SIG_GEN
SignalSelector
SR
STACKINT
SUBTRACT_MATRIX
TOF
TON
TP
TrackAndHold
TransferSwitch
TRANSPOSE_MATRIX
TYPE_MATRIX
URCV_S
USEND_S
standard function blocks, types of
standard functions
ABS
ACOS
AND_MASK
948
ARCREATE
ARREAD
ARWRITE
AS_SEND_EVENT
ASCII
ASIN
ATAN
CHAR
COS
CURRENT_ISA_DATE
DAY_TIME
DELETE
EXPT
F_CLOSE
F_EOF
F_ROPEN
F_WOPEN
FA_READ
FA_WRITE
FAILOVER
FIND
FM_READ
FM_WRITE
GET_TIME_STRING
INSERT
IOCTRL
ISA_SERIAL_CLOSE
ISA_SERIAL_CONNECT
ISA_SERIAL_DISCONNECT
ISA_SERIAL_OPEN
ISA_SERIAL_RECEIVE
ISA_SERIAL_SEND
ISA_SERIAL_SET
ISA_SERIAL_STATUS
LEFT
LIMIT
LOG
LOG_MSG
MAX
MID
MIN
MLEN
ISaGRAF 5.2
– Index
MOD
MUX4
MUX8
NOT_MASK
ODD
OR_MASK
POW
RAND
REPLACE
RIGHT
ROL
ROR
SEL
SET_PRIORITY
SHL
SHR
SIN
SQRT
SUB_DATE_DATE
summary of
TAN
TRUNC
XOR_MASK
standard IEC 61131 types, available for programming
standard operators
1 gain
addition
AND
ANY_TO_BOOL
ANY_TO_BYTE
ANY_TO_DATE
ANY_TO_DINT
ANY_TO_DWORD
ANY_TO_INT
ANY_TO_LINT
ANY_TO_LREAL
ANY_TO_LWORD
ANY_TO_REAL
ANY_TO_SINT
ANY_TO_STRING
ANY_TO_TIME
ISaGRAF 5.2
– Workbench
ANY_TO_UDINT
ANY_TO_UINT
ANY_TO_ULINT
ANY_TO_USINT
ANY_TO_WORD
BOO
CAT
division
equal
greater than
greater than or equal
ISA3_ANA
ISA3_REAL
ISA3_SYSTEM
less than
less than or equal
MSG
multiplication
NEG
NOT
not equal
OPERATE
OR
subtraction
summary of
TMR
XOR
standard toolbar in language editors
in main environment
starting events logger for run-time system events
status execution of resources
bar, displaying and hiding
information, displaying for resources
of elements for version control
step-by-step mode executing resources in
locating current step of
949
removing breakpoints for
setting breakpoints for
stepping in POUs for
STEPPING resource state
STEPPING_ERROR resource state
steps (SFC elements) actions within, described
attaching action blocks to
described
inserting
STOP resource state
stopping builds of projects, resources, and POUs
execution of resources
storage location of projects
string constant expressions
variables
string manipulation
ASCII function
CHAR function
DELETE function
FIND function
GET_TIME_STRING function
INSERT function
LEFT function
MID function
MLEN function
REPLACE function
RIGHT function
structures basic or user types, described
initializing fields of
sub-programs (Flow Chart) described
inserting
SUB_DATE_DATE function
SUBTRACT_MATRIX function block
subtraction operator
switching to the Dictionary view
to the distribution view
to the hardware architecture view
to the link architecture view
symbols downloading complete or reduced table of
generating monitoring information for
syntax of IL programs
of ST programs
verification rules for Flow Chart
system accessing variables for
events, logging of run-time
events, viewing of run-time
system parameters, ISA3_SYSTEM operator
T
TAN function
target control
AS_AE function block
AS_SEND_EVENT function
FAILOVER function
FC_GET_STAT function block
IOCTRL function
LOG_MSG function
SET_PRIORITY function
target definitions importing and exporting
target options
target options, resources
targets cleaning code stored on
defining compilation options for
defining control access for
specifying for configurations
templates, for libraries
templates, specifying for projects
testing projects
tests, inserting (FC elements)
third-party libraries, licensing
950
ISaGRAF 5.2
– Index
TIC code, generating
time operations
CURRENT_ISA_DATE function
DAY_TIME function
GET_TIME_STRUCT function block
NOW function block
SUB_DATE_DATE function
TOF function block
TON function block
TP function block
timer constant expressions
variables
timing information, accessing
title bar of main environment
TMR operator
TOF function block
TON function block
toolbars available in language editors
composite IEC 61499 editor
debugging, main environment
docking, moving, and showing
I/O wiring, main environment
layers view, main environment
options, main environment
simulator
standard, main environment
version source control, main environment
window buttons, main environment
tooltips displaying for function blocks
displaying for variables
TP function block
TrackAndHold function block
TransferSwitch function block
transitions clearing in SFC
conditions attached to (ST or LD), described
editing code for (SFC elements)
forcing clearing of in SFC
in SFC, described
inserting in SFC
programming for conditions in LD
programming for conditions in ST
TRANSPOSE_MATRIX function block
tree view for a project
for I/O wiring
TRUNC function
TYPE_MATRIX function block
types arrays, described
available standard IEC 61131 types
grid in the Dictionary
modifying for online changes
structures, described
tree, creating structures in
tree, deleting structures from
tree, described
tree, renaming structures in
U
unlocking
POUs with access control
resources with access control
values of variables in a spy list
variables
unsigned double integer constant expressions
variables
unsigned integer constant expressions
variables
unsigned long integer constant expressions
variables
unsigned short integer constant expressions
variables
ISaGRAF 5.2
– Workbench 951
unwiring channels in I/O devices
uploading Workbench elements from targets
URCV_S function block
USEND_S function block
user types arrays, described
structures, described
using libraries in projects
V
validation at cell level
at database level
at row level
values, forcing for variables
variable bindings defining for external bindings
defining for internal bindings
deleting for external bindings
deleting for internal bindings
described
editing for external bindings
editing for internal bindings
external, described
internal, described
linking resources for internal bindings
modifying for online changes
variable groups creating
managing
opening
producing for external bindings
variables accessing spy list for
adding to spy list for
attributes and directions for
Boolean
BYTE
computer allocated hidden, effect on online changes
952 date
declared, modifying in online changes
directly represented
displaying comments for
displaying tooltips for
double integer
double word (DWORD)
for binding errors
forcing, locking, unlocking values of, spy list
forcing the values of
grid, described
importing and exporting
initial values for
inserting, composite IEC 61499 elements
inserting, FBD elements
inserting in POUs
integer
locking and unlocking
long integer
long real
long word (LWORD)
modification of during online changes
opening a spy list with
real
rearranging in spy list
removing from spy list
rules for
saving spy list with
selecting in spy list
short integer
string
system, accessing
timer
tree, described
unsigned double integer
unsigned integer
unsigned long integer
unsigned short integer
WORD
ISaGRAF 5.2
– Index
verifying compilation of POUs
version information, viewing
version source control accessing history details for previous versions
checking in Workbench elements for
clearing the status of
creating history reports
described
getting previous versions of Workbench elements
repository path for
toolbar in main environment
viewing history of Workbench elements
view for variable bindings
of the Dictionary
of the hardware architecture
of the I/O wiring
of the link architecture
viewing breakpoints (step-by-step mode)
history of Workbench elements from version source control
internal bindings
level 2 windows of FC chart elements
run-time system events
the lock status of variables
the project tree
version information
virtual attribute, setting for I/O devices
wiring channels in I/O wiring
tool, opening
WITH qualifier, IEC 61499 graphical representation of
WORD constant expressions
variables
Workbench elements exporting between projects
importing between projects
uploading from targets
Workbench, overview of
working with function blocks
functions
programs
workspace adjusting zoom in
managing for language editors
of a resource window
X
X-Y ratio, setting for language editors
XOR operator
XOR_MASK function
W
WHILE, DO, END_WHILE, ST basic statements
WHILE-DO structures, inserting (FC charts)
window buttons toolbar in main environment
headers, displaying for I/O devices
ISaGRAF 5.2
– Workbench 953
Copyright
Information in these pages is subject to change without notice and does not represent a commitment on the part of
ICS Triplex ISaGRAF
. No part of these pages may be reproduced in any form or by any means, electronic or mechanical, for any purpose without the express written permission of
ICS Triplex ISaGRAF
.
© 1999-2009
ICS Triplex ISaGRAF
. All rights reserved.
Product or company names included in these pages are trademarks or registered trademarks of their respective holders.
All logos and links used in this guide are, to the best of our knowledge, included with the permission of the owner - if this is not the case, please let us know immediately.
Any changes made to documentation issued by
ICS Triplex ISaGRAF
without prior permission of
ICS Triplex ISaGRAF
(in writing) will void any responsibilities and liabilities normally associated with its contents.
522090706ENGFM72WWP70HC13
ISaGRAF 5.2
- Workbench 955
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Related manuals
advertisement
Table of contents
- 23 Workbench
- 25 Appearance
- 26 Title Bar
- 27 Menu Bar
- 36 Toolbars
- 37 Standard Toolbar
- 39 Debug Toolbar
- 41 Window Buttons Toolbar
- 42 Layers Toolbar
- 42 Version Source Control Toolbar
- 42 Options Toolbar
- 43 I/O Wiring Toolbar
- 45 Workspace
- 47 Output Window
- 48 Contextual Menus
- 49 Status Bar
- 50 Customization
- 53 Directory Structure
- 58 Working with Projects
- 61 Creating Projects
- 62 Opening and Closing Projects
- 65 Saving Projects
- 65 Renaming Projects
- 66 Adding a Project Description
- 66 Printing Projects
- 67 Project Access Control
- 69 Importing and Exporting Workbench Elements
- 72 Uploading Workbench Elements from Targets
- 74 Link Architecture View
- 75 Resources
- 76 Resource Window Workspace
- 76 Creating Resources
- 77 Renaming Resources
- 77 Copying Resources
- 78 Pasting Resources
- 79 Deleting Resources
- 80 Editing Resource Properties
- 81 Resource Identification
- 82 Target Options
- 83 Compilation Options
- 86 Run-time Settings
- 89 Resource Network Parameters
- 90 Custom Resource Parameters
- 91 Resource Access Control
- 93 Resource Description
- 94 Variable Bindings
- 98 Internal Bindings
- 101 Linking Resources
- 103 Deleting Resource Links
- 104 Viewing the Internal Bindings Defined for Resources
- 105 Hiding and Showing Resource Links
- 105 Defining Internal Variable Bindings
- 108 Editing Internal Variable Bindings
- 108 Deleting Internal Variable Bindings
- 109 External Bindings
- 111 Defining Producer Variable Groups
- 113 Editing Producer Variable Groups
- 113 Deleting Producer Variable Groups
- 114 Linking Resources for External Bindings
- 115 Editing External Resource Links
- 116 Defining External Variable Bindings
- 117 Editing External Variable Bindings
- 117 Deleting External Variable Bindings
- 118 Parameters
- 119 Variable Groups
- 119 Creating Variable Groups
- 120 Opening Variable Groups
- 121 Importing or Exporting Variables and Defined Words
- 125 Importing or Exporting Target Definitions
- 127 3 Projects
- 133 POUs (Program Organization Units)
- 133 Programs
- 135 Functions
- 136 Function Blocks
- 136 Creating POUs
- 137 Manipulating POUs
- 139 Creating FC Sub-programs
- 139 Creating SFC Child POUs
- 140 Changing Hierarchy Level
- 141 Controlling Access to POUs
- 144 Generating Debug and Monitoring Information
- 146 Editing a POU Description
- 147 Hardware Architecture View
- 148 Configurations
- 148 Creating Configurations
- 150 Deleting Configurations
- 150 Moving Configurations
- 151 Inserting Resources
- 152 Moving Resources Between Configurations
- 153 Configuration Properties
- 154 Configuration Identification
- 155 Configuration Target Definitions
- 156 Target Access Control
- 158 Configuration Description
- 159 Networks
- 160 Creating Networks
- 161 Moving Networks
- 162 Connections
- 163 Creating Connections
- 164 Deleting Connections
- 165 Dictionary View
- 166 Appearance
- 167 Variables Tree
- 168 Parameters Tree
- 169 Types Tree
- 169 Creating Structures
- 170 Renaming Structures
- 170 Deleting Structures
- 171 Defined Words Tree
- 171 Working with the Grids
- 172 Resizing Columns
- 173 Selecting Rows and Elements
- 174 Editing the Contents of the Grid
- 175 Adding or Inserting Rows
- 176 Moving Rows
- 176 Expanding or Collapsing Grid Components
- 177 Cutting, Copying, and Deleting Elements
- 178 Finding and Replacing Elements
- 179 Pasting Elements
- 179 Sorting the Grid
- 180 Duplicating Rows
- 181 Renumbering Addresses
- 182 Printing a Grid
- 183 Variables Grid
- 184 Parameters Grid
- 185 Types Grid
- 186 Defined Words Grid
- 187 Initial Values
- 190 Validation
- 190 Cell-level Validation
- 191 Row-level Validation
- 192 Database-level Validation
- 193 I/O Wiring View
- 194 Appearance
- 195 I/O Wiring Tree View
- 197 I/O Wiring Grid View
- 197 Working with the I/O Wiring Tool
- 198 Adding I/O Devices
- 199 Opening Devices
- 200 Deleting Devices and Conversions
- 201 Setting the Real or Virtual Attribute
- 201 Wiring Channels
- 202 Mapping Channels
- 204 Freeing Channels
- 205 Naming Conventions and Limitations
- 213 IEC 61499 Distribution View
- 214 Run-time System Events
- 214 Logging Events
- 216 Viewing Events
- 219 Language Editors
- 219 Common Editor Features
- 220 Appearance
- 221 Menu Bar
- 222 Toolbars
- 224 Standard Toolbar
- 225 Options Toolbar
- 226 Debug Toolbar
- 228 SFC Breakpoints Toolbar
- 229 SFC Tools
- 231 Flow Chart Tools
- 232 ST Tools
- 233 IL Tools
- 234 LD Tools
- 235 FBD Tools
- 237 Workspace
- 239 Contextual Menus
- 240 Output Window
- 240 Status Bar
- 241 Inserting Identifiers
- 243 Inserting Blocks
- 245 Printing POUs
- 245 Opening the Dictionary
- 246 Opening Another POU
- 247 Finding and Replacing in POUs
- 249 SFC Editor
- 250 Appearance
- 251 Menu Bar
- 254 Working with the Editor
- 255 SFC Elements
- 255 Initial Step
- 257 Transition
- 258 Divergence/Convergence
- 259 Creating New Branches
- 260 Deleting Branches
- 264 Managing Elements
- 264 Select
- 265 Rename
- 267 Paste
- 268 Delete
- 269 Level
- 270 Coding Action Blocks for Steps
- 272 Coding Conditions for Transitions
- 273 Moving Action Blocks Up or Down
- 274 Deleting an Action Block
- 275 Renumbering Charts
- 277 FC Editor
- 278 Appearance
- 279 Menu Bar
- 282 Working with Flow Charts
- 283 Flow Chart Elements
- 283 Action
- 284 IF-THEN-ELSE
- 285 DO-WHILE
- 286 WHILE-DO
- 288 Connector
- 289 I/O Specific
- 289 Comment
- 290 Sub-Program
- 291 Managing Elements
- 291 Select
- 293 Paste
- 293 Delete
- 295 Renumber
- 296 Level
- 297 Level 2 Window
- 298 Edit the Level
- 299 Multi-language Editor
- 300 Appearance
- 302 Menu Bar
- 306 Multi-Language Elements
- 306 ST/IL Elements
- 307 LD Elements
- 307 Contact on the Left
- 307 Contact on the Right
- 308 Parallel Contact
- 308 Block on the Left
- 308 Block on the Right
- 308 Parallel Block
- 309 Label
- 309 Return
- 309 Change Coil/Contact Type
- 310 Insert New Rung
- 310 Other Operations
- 311 FBD Elements
- 313 Variable
- 314 Function Block
- 315 Corner
- 316 Label
- 316 Return
- 317 LD Elements
- 317 Left Power Bar
- 317 Contacts
- 317 LD Vertical "OR" Connection
- 318 Coils
- 318 Right Power Bar
- 319 Comment
- 320 Managing Elements
- 320 Select
- 321 Resize
- 321 Undo/Redo
- 323 Paste
- 324 Paste Special
- 325 Delete
- 325 Select All
- 325 Find Matching Name
- 326 Find Matching Coil
- 326 Go to Line
- 327 Display/Hide Comments
- 329 Composite IEC 61499 Editor
- 330 Appearance
- 332 Menu Bar
- 335 Toolbars
- 335 Standard Toolbar
- 337 Options Toolbar
- 337 Debug Toolbar
- 339 IEC61499 Tools
- 340 IEC 61499 Elements
- 341 Variable
- 342 Function Block
- 342 Corner
- 342 Comment
- 343 Managing Elements
- 343 Select
- 343 Resize
- 344 Undo/Redo
- 346 Paste
- 346 Delete
- 346 Select All
- 347 Libraries
- 348 Creating Libraries
- 349 Using Libraries in a Project
- 355 Debug
- 356 Status Information
- 359 Download
- 361 Debug/Simulate
- 363 Start / Stop a Resource
- 364 Resource Execution Mode
- 364 Real-time Mode
- 365 Cycle-to-cycle Mode
- 366 Step-by-step Mode
- 368 Setting Breakpoints
- 368 Removing Breakpoints
- 370 Stepping in POUs
- 371 Set Cycle Time
- 372 Write / Lock / Unlock
- 375 Diagnosis
- 380 SFC Breakpoints
- 382 Breakpoint on Step Activation
- 383 Breakpoint on Step Deactivation
- 384 Breakpoint on Transition
- 385 Transition Clearing Forcing
- 386 Spying Variables
- 386 Adding Variables to the Spy List
- 388 Selecting Variables in the Spy List
- 388 Removing Variables from the Spy List
- 389 Rearranging the Spy List
- 389 Saving a Spy List
- 389 Opening an Existing Spy List
- 390 Forcing / Locking / Unlocking the Value of a Spy List Variable
- 391 Simulate a Panel of I/Os
- 393 Appearance
- 394 Menu Bar
- 395 Toolbar
- 396 Contextual Menu
- 396 Displaying I/O Device Window Headers
- 397 Moving or Hiding the Browser
- 398 Online Changes
- 400 Code Sequences
- 402 Variables
- 402 Declared Variables
- 403 Function Block Instances
- 403 Compiler Allocated Hidden Variables
- 404 I/O Devices
- 404 Memory Requirements
- 405 Miscellaneous Limitations
- 406 Operations
- 408 Debug Function Block Instances
- 410 Clean Stored Code
- 411 Document Generator
- 412 Table of Items
- 414 Printing Options
- 416 Preview
- 419 Code Generator
- 419 Build
- 421 Build a POU
- 422 Building Resources / Projects
- 423 Stopping Builds
- 424 Cleaning Projects
- 425 Compiler Options
- 428 C Source Code
- 429 Project Tree View
- 431 Cross References Browser
- 433 Calculating Cross References
- 433 Browsing the POUs of a Project
- 434 Defining Search Options
- 435 Version Source Control
- 439 Performing a Check in of a Workbench Element
- 440 Viewing the History of Workbench Elements
- 441 Getting a Previous Version
- 442 Comparing Current and Previous Versions
- 442 Accessing Details for a Previous Version
- 443 Creating a History Report
- 445 Language Reference
- 446 Project Architecture
- 447 Programs
- 448 Cyclic and Sequential Operations
- 449 Child SFC POUs
- 450 FC Sub-Programs
- 451 Functions
- 453 Function Blocks
- 455 Description Language
- 456 Execution Rules
- 457 Common Objects
- 457 Data Types
- 457 Standard IEC 61131-3 Types
- 459 User Types: Arrays
- 460 User Types: Structures
- 461 Constant Expressions
- 461 Boolean Constant Expressions
- 462 Short Integer Constant Expressions
- 463 Unsigned Short Integer and BYTE Constant Expressions
- 464 Integer Constant Expressions
- 465 Unsigned Integer and WORD Constant Expressions
- 466 Double Integer Constant Expressions
- 467 Unsigned Double Integer and Double Word Constant Expressions
- 468 Long Integer Constant Expressions
- 469 Unsigned Long Integer and Long Word Constant Expressions
- 470 Real Constant Expressions
- 471 Long Real Constant Expressions
- 472 Timer Constant Expressions
- 473 Date Constant Expressions
- 473 String Constant Expressions
- 475 Variables
- 475 Reserved Keywords
- 477 Directly Represented Variables
- 479 Information on Variables
- 480 Boolean Variables (BOOL)
- 480 Short Integer Variables (SINT)
- 480 Unsigned Short Integer (USINT) or BYTE Variables
- 481 Integer Variables (INT)
- 481 Unsigned Integer (UINT) or WORD Variables
- 482 Double Integer Variables (DINT)
- 483 Long Integer Variables (LINT)
- 484 Real Variables (REAL)
- 484 Long Real Variables (LREAL)
- 485 Timer Variables (TIME)
- 485 Date Variables (DATE)
- 485 String Variables (STRING)
- 486 Comments
- 487 Defined Words
- 489 SFC Language
- 489 SFC Main Format
- 490 SFC Basic Components
- 490 Steps and Initial Steps
- 492 Transitions
- 492 Oriented Links
- 493 Jump to a Step
- 494 Divergences and Convergences
- 494 Single Divergences (OR)
- 496 Double Divergences (AND)
- 498 Actions within Steps
- 499 Boolean Actions
- 500 Pulse Actions
- 501 Non-stored Actions
- 502 SFC Actions
- 503 List of Instructions
- 503 Calling Functions and Function Blocks
- 504 Conditions Attached to Transitions
- 504 Condition Programmed in ST
- 505 Condition Programmed in LD
- 505 Calling Functions from a Transition
- 506 Calling Function Blocks from a Transition
- 507 SFC Execution Cycles
- 509 SFC Program Hierarchy
- 511 FC Language
- 511 FC Basic Components
- 512 FC BEGIN
- 512 FC END
- 513 FC Flow Links
- 514 FC Actions
- 514 FC Conditions
- 516 Other FC Components
- 516 FC Sub-Program
- 517 FC I/O Specific Actions
- 518 FC Connectors
- 518 FC Comments
- 519 FC Complex Structure Examples
- 520 FC Dynamic Behavior
- 520 FC Checking
- 521 FC Examples
- 523 FBD Language
- 523 FBD Diagram Main Format
- 525 RETURN Statement
- 526 Jumps and Labels
- 527 Boolean Negation
- 528 Calling Functions and Function Blocks
- 529 LD Language
- 530 Power Rails and Connection Lines
- 531 Multiple Connections
- 532 Basic LD Contacts and Coils
- 533 Direct Contact
- 534 Inverted Contact
- 535 Contact with Rising Edge Detection
- 536 Contact with Falling Edge Detection
- 537 Direct Coil
- 538 Inverted Coil
- 539 SET Coil
- 540 RESET Coil
- 541 Coil with Rising Edge Detection
- 542 Coil with Falling Edge Detection
- 543 RETURN Statement
- 544 Jumps and Labels
- 545 BLOCKS in LD
- 547 IEC 61499 Language
- 548 IEC 61499 Program Main Format
- 551 Basic IEC 61499 Function Block Format
- 553 Composite IEC 61499 Function Block Format
- 554 IEC 61499 Function Block Main Format
- 556 Implementation of the WITH Qualifier
- 557 Execution Control Chart Cycles
- 558 Cycle Execution Time in IEC 61499 Programs
- 559 ST Language
- 559 ST Main Syntax
- 561 Expressions and Parentheses
- 562 Functions or Function Block Calls
- 562 Calling Functions
- 564 Calling Function Blocks
- 565 ST Operators
- 565 ST Basic Statements
- 565 Assignment
- 566 RETURN Statement
- 567 IF-THEN-ELSIF-ELSE Statement
- 568 CASE Statement
- 569 WHILE Statement
- 570 REPEAT Statement
- 571 FOR Statement
- 572 EXIT Statement
- 573 ST Extensions
- 574 GSTART Statement in SFC Action
- 575 GKILL Statement in SFC Action
- 576 GFREEZE Statement in SFC Action
- 577 GRST Statement in SFC Action
- 578 GSTATUS Statement in SFC Action
- 579 IL Language
- 579 IL Main Syntax
- 580 Labels
- 580 Operator Modifiers
- 581 Delayed Operations
- 582 IL Operators
- 583 LD Operator
- 584 ST Operator
- 584 S Operator
- 585 R Operator
- 586 JMP Operator
- 587 RET Operator
- 588 ) Operator
- 589 Calling Functions
- 591 Calling Function Blocks: CAL Operator
- 593 Standard Operators
- 602 1 GAIN
- 605 ANY_TO_BOOL
- 607 ANY_TO_SINT
- 609 ANY_TO_USINT
- 611 ANY_TO_BYTE
- 613 ANY_TO_INT
- 615 ANY_TO_UINT
- 617 ANY_TO_WORD
- 618 ANY_TO_DINT
- 620 ANY_TO_UDINT
- 622 ANY_TO_DWORD
- 624 ANY_TO_LINT
- 625 ANY_TO_ULINT
- 627 ANY_TO_LWORD
- 628 ANY_TO_REAL
- 630 ANY_TO_LREAL
- 631 ANY_TO_TIME
- 633 ANY_TO_DATE
- 634 ANY_TO_STRING
- 639 Equal
- 641 Greater Than or Equal
- 643 Greater Than
- 644 ISA3_ANA
- 646 ISA3_REAL
- 648 ISA3_SYSTEM
- 650 Less Than or Equal
- 652 Less Than
- 657 Not Equal
- 659 OPERATE
- 665 Standard Functions
- 671 AND_MASK
- 672 ARCREATE
- 674 ARREAD
- 675 ARWRITE
- 677 ASCII
- 679 AS_SEND_EVENT
- 686 CURRENT_ISA_DATE
- 688 DAY_TIME
- 689 DELETE
- 692 F_CLOSE
- 694 F_EOF
- 697 F_ROPEN
- 698 F_WOPEN
- 700 FA_READ
- 703 FA_WRITE
- 707 FM_READ
- 710 FM_WRITE
- 712 FAILOVER
- 716 GET_TIME_STRING
- 717 IOCTRL
- 718 INSERT
- 720 ISA_SERIAL_CLOSE
- 721 ISA_SERIAL_CONNECT
- 723 ISA_SERIAL_DISCONNECT
- 724 ISA_SERIAL_OPEN
- 725 ISA_SERIAL_RECEIVE
- 727 ISA_SERIAL_SEND
- 728 ISA_SERIAL_SET
- 730 ISA_SERIAL_STATUS
- 733 LIMIT
- 736 LOG_MSG
- 748 NOT_MASK
- 750 OR_MASK
- 755 REPLACE
- 757 RIGHT
- 763 SET_PRIORITY
- 769 SUB_DATE_DATE
- 771 TRUNC
- 773 XOR_MASK
- 775 Standard Function Blocks
- 775 Basic Operations
- 777 AS_AE
- 782 AVERAGE
- 783 BLINK
- 785 CONNECT
- 792 DERIVATE
- 793 F_TRIG
- 794 FC_GET_STAT
- 798 GET_TIME_STRUCT
- 800 HYSTER
- 801 INTEGRAL
- 803 LIM_ALRM
- 805 R_TRIG
- 809 SIG_GEN
- 811 STACKINT
- 816 URCV_S
- 817 USEND_S
- 819 Advanced Control
- 821 AnalogAlarm
- 829 BatchSwitch
- 831 BatchTotalizer
- 834 BiasCalibration
- 836 Characterizer
- 837 Comparator
- 838 DigitalAlarm
- 842 FlipFlop
- 843 IPIDController
- 847 LeadLagController
- 849 Limiter
- 850 PDController
- 850 RateLimiter
- 851 Ratio
- 852 RatioCalibration
- 854 RetentiveOnTimer
- 855 Scaler
- 856 Setpoint
- 858 Signal Selector
- 859 TrackAndHold
- 860 TransferSwitch
- 861 Matrix Operations
- 863 NEW_MATRIX
- 865 FREE_MATRIX
- 866 GET_I_MATRIX
- 867 PUT_I_MATRIX
- 869 GET_F_MATRIX
- 870 PUT_F_MATRIX
- 871 DUP_MATRIX
- 873 COPY_MATRIX
- 874 COPY_ROW_MATRIX
- 876 COPY_COL_MATRIX
- 878 TYPE_MATRIX
- 879 ROWS_MATRIX
- 880 COLS_MATRIX
- 881 TRANSPOSE_MATRIX
- 883 INVERT_MATRIX
- 885 ADD_MATRIX
- 887 SUBTRACT_MATRIX
- 889 MULTIPLY_MATRIX
- 891 SCALAR_I_MATRIX
- 893 SCALAR_F_MATRIX
- 895 PRINT_MATRIX
- 897 Optional Function Blocks
- 899 Smart PID Function Block
- 903 IEC 61499 Function Blocks
- 903 E_CTU
- 904 E_CYCLE
- 905 E_D_FF
- 906 E_DELAY
- 906 E_DEMUX
- 907 E_F_TRIG
- 908 E_MERGE
- 909 E_N_TABLE
- 910 E_PERMIT
- 911 E_R_TRIG
- 912 E_REND
- 913 E_RESTART
- 915 E_SELECT
- 916 E_SPLIT
- 918 E_SWITCH
- 919 E_TABLE
- 920 E_TABLE_CTRL
- 921 E_TRAIN
- 922 LocalEventInput
- 923 Glossary
- 977 Copyright