myPROJECT Designer Manual PDF
myPROJECT Designer Manual PDF
myPROJECT Designer Manual PDF
USER MANUAL
Version 7
2
16.4 View type .........................................................................................................................................................................230
17 Write/Set Command ..................................................................................................................... 240
17.1 Using Batches .................................................................................................................................................................242
17.2 Specifying Set Command Parameters ..................................................................................................................243
17.3 Value Options .................................................................................................................................................................247
18 Scaling Set Values ......................................................................................................................... 253
18.1 Set Example: ...................................................................................................................................................................253
19 Key Shortcuts ................................................................................................................................ 255
20 On Touch ...................................................................................................................................... 257
20.1 On Touch in Views........................................................................................................................................................ 257
20.2 On Touch in Component ............................................................................................................................................258
20.3 On Touch Example ....................................................................................................................................................... 259
20.4 Lock Element ..................................................................................................................................................................261
20.5 Lock Key ...........................................................................................................................................................................264
20.6 Slider ..................................................................................................................................................................................266
21 Parametric Views .......................................................................................................................... 269
21.1 Opening Parametric Views ....................................................................................................................................... 269
21.2 Symbolic Text Replacements ...................................................................................................................................272
21.3 Symbolic Tag Creation ................................................................................................................................................ 273
21.4 Replacing Connections ............................................................................................................................................... 274
21.5 Nesting Parametric Views.........................................................................................................................................275
21.6 Usage Example: .............................................................................................................................................................275
22 View Scripts .................................................................................................................................. 278
22.1 Using Script in Views ..................................................................................................................................................278
22.2 Declaring Variables...................................................................................................................................................... 281
22.3 Script Writing .................................................................................................................................................................281
22.4 Using variables in animations and effects ..........................................................................................................282
22.5 Debugging View Scripts .............................................................................................................................................286
22.6 Using debug screen on your view ..........................................................................................................................286
22.7 Using web browsers integrated debugger .........................................................................................................288
22.8 Using JavaScript Libraries - Includes ...................................................................................................................290
22.9 Linking External JavaScript Libraries – Remote Includes ...........................................................................292
23 View and Server Side Scripts – Common tasks................................................................................ 293
23.1 Graphical guides............................................................................................................................................................293
23.2 Read/Write data from/to PLC.................................................................................................................................299
23.3 Generating Report ........................................................................................................................................................ 301
23.4 Other Guides ...................................................................................................................................................................301
24 Documents ................................................................................................................................... 305
25 Reports ......................................................................................................................................... 307
25.1 Creating Report Templates ...................................................................................................................................... 307
25.2 Designing Report ..........................................................................................................................................................308
25.3 Inserting Text .................................................................................................................................................................309
25.4 Adding Picture – logo ..................................................................................................................................................310
25.5 Table Data ........................................................................................................................................................................ 311
25.6 Table Summary .............................................................................................................................................................314
25.7 Previewing Report during design ..........................................................................................................................316
25.8 Showing Report in Runtime .....................................................................................................................................317
25.9 Creating Custom Report in Runtime.....................................................................................................................317
25.10 Creating Report on Demand ............................................................................................................................... 319
26 CAS Alarms ................................................................................................................................... 322
26.1 Digital Alarms.................................................................................................................................................................322
3
26.2 Analog Alarms ................................................................................................................................................................ 322
26.3 Alarm Window............................................................................................................................................................... 327
26.4 Alarm History .................................................................................................................................................................327
26.5 CAS Alarms in View - Example ................................................................................................................................ 329
27 Data Logging ................................................................................................................................. 332
27.1 Data-logs ..........................................................................................................................................................................332
27.2 Defining Connection ....................................................................................................................................................334
27.3 Defining Data Points ....................................................................................................................................................334
27.4 Continuous Data Logging ..........................................................................................................................................337
27.5 Triggered Data Logs ....................................................................................................................................................338
27.6 Triggered Logging Example .....................................................................................................................................339
27.7 Simple Periodic Export to CSV and Microsoft Power BI ............................................................................... 340
27.8 Data-logs Properties....................................................................................................................................................342
28 Data-Log Views ............................................................................................................................. 346
28.1 Data Points Selection ..................................................................................................................................................347
28.2 Data Grouping ................................................................................................................................................................ 348
28.3 Filtering Data..................................................................................................................................................................350
29 Aggregated Data logs .................................................................................................................... 353
29.1 Creating aggregated data log ...................................................................................................................................353
29.2 Aggregated Values: ...................................................................................................................................................... 354
29.3 Time Aggregates ...........................................................................................................................................................357
29.4 Value Change Aggregates ..........................................................................................................................................358
29.5 Aggregates based on Alarm Activation................................................................................................................ 360
29.6 Running the Aggregation Periodically .................................................................................................................362
30 Advanced Trends .......................................................................................................................... 363
30.1 Using Multiple Axes .....................................................................................................................................................367
30.2 Advanced Trends – Visual Appearance ............................................................................................................... 368
31 Connections .................................................................................................................................. 372
31.1 Creating New Connection..........................................................................................................................................373
31.2 Creating PLC Type Connection ............................................................................................................................... 374
31.3 Creating Database Type Connection.....................................................................................................................374
31.4 Creating IoT Type Connection.................................................................................................................................378
31.5 Deleting Connections ..................................................................................................................................................378
31.6 Advanced Options - Optimizations........................................................................................................................ 379
32 User Accesses ............................................................................................................................... 381
32.1 Access Levels ..................................................................................................................................................................381
32.2 Access Groups ................................................................................................................................................................ 381
32.3 User Accounts ................................................................................................................................................................ 381
32.4 Limiting Access for Whole Project.........................................................................................................................383
32.5 Limited Access for Views and Trends ..................................................................................................................384
32.6 Limited Access of Arbitrary Object in Views .....................................................................................................385
33 Multi-language support ................................................................................................................. 388
33.1 Providing translations inside a Project ............................................................................................................... 390
33.2 Translating Names of Views.....................................................................................................................................391
33.3 Translating Data-logs..................................................................................................................................................392
33.4 Translating CAS Alarms .............................................................................................................................................393
33.5 Translating Advanced Trends .................................................................................................................................394
34 Server-side Scripts......................................................................................................................... 396
34.1 Introduction ....................................................................................................................................................................396
34.2 Server-side Scripts folder..........................................................................................................................................396
34.3 Server-side Scripts Folder Structure ....................................................................................................................397
34.4 Variables Tables ............................................................................................................................................................397
4
34.5 Script Data-logs .............................................................................................................................................................399
34.6 Global Variables ............................................................................................................................................................400
34.7 Sources Folder ............................................................................................................................................................... 402
34.8 Organizing Project into Modules............................................................................................................................402
34.9 Importing Modules ...................................................................................................................................................... 403
34.10 Using the Event-driven Asynchronous Callbacks ...................................................................................... 405
34.11 Creating Server Side Reports .............................................................................................................................406
34.12 mySCADA Specific Functions.............................................................................................................................. 411
34.13 Debugging...................................................................................................................................................................412
34.14 Script Status (on myBOX Devices Only).........................................................................................................414
34.15 Ser2Net (on myBOX Devices Only) ..................................................................................................................415
35 View and Server Side Scripts – Common tasks................................................................................ 417
35.1 Graphical guides............................................................................................................................................................417
35.2 Read/Write data from/to PLC.................................................................................................................................424
35.3 Generating Report ........................................................................................................................................................ 426
35.4 Other Guides ...................................................................................................................................................................426
35.5 Server Side Scripts – Examples ............................................................................................................................... 428
35.6 Reading data from PLC ............................................................................................................................................... 429
35.7 Writing data into PLC..................................................................................................................................................432
35.8 Timers – eg. Run code in given time intervals ..................................................................................................432
35.9 Scheduled Execution e.g run code every Monday at 2:00 PM....................................................................433
35.10 Generating a report at given time interval ...................................................................................................434
35.11 Limiting Access to Generated Files ..................................................................................................................437
35.12 Processing data-log data ...................................................................................................................................... 437
35.13 Exporting data-log data into CSV files ............................................................................................................439
35.14 Using Virtual PLC.....................................................................................................................................................441
35.15 Sending Data from View Script into Server Side Scripts .........................................................................447
36 Devices ......................................................................................................................................... 451
37 EtherNet/IP Driver ........................................................................................................................ 397
38 MicroLogix and SLC Driver ............................................................................................................. 399
39 Modbus Driver .............................................................................................................................. 400
39.1 Tag name syntax ...........................................................................................................................................................400
39.2 32-bit registers in Modbus ....................................................................................................................................... 401
39.3 Floating point numbers.............................................................................................................................................. 402
39.4 32-bit Integers ............................................................................................................................................................... 403
39.5 Address mapping ..........................................................................................................................................................403
39.6 Signed and unsigned numbers ................................................................................................................................ 404
40 Siemens S7 family PLCs Driver ....................................................................................................... 406
40.1 Memory types ................................................................................................................................................................ 406
40.2 S7 Data types ..................................................................................................................................................................406
40.3 S7 1200/1500 notes....................................................................................................................................................407
40.4 Protection ........................................................................................................................................................................ 408
40.5 LOGO! 0BA7/0BA8 configuration ..........................................................................................................................409
40.6 S7-200 (via CP243-1) configuration.....................................................................................................................409
41 OPC UA Driver............................................................................................................................... 410
41.1 Connection configuration..........................................................................................................................................410
41.2 Tag Name Syntax ..........................................................................................................................................................412
42 MELSEC-Q Driver ........................................................................................................................... 413
42.1 Tag name syntax ...........................................................................................................................................................413
42.2 Connection Settings .....................................................................................................................................................415
43 SigFox Driver ................................................................................................................................. 417
5
43.1 datatype ............................................................................................................................................................................418
43.2 Reverse order.................................................................................................................................................................419
44 Databases Driver........................................................................................................................... 421
44.1 Reading values from SQL database ....................................................................................................................... 422
44.2 Examples ..........................................................................................................................................................................423
44.3 Writing values to SQL database .............................................................................................................................. 424
44.4 Using SQL connectivity in Server Side Scripts ..................................................................................................425
45 Download/Upload from/to Device ................................................................................................ 426
45.1 Download to Device.....................................................................................................................................................426
45.2 Upload from Device .....................................................................................................................................................428
6
1 About myDESIGNER
myDESIGNER, part of the mySCADA bundle, is an integrated development environment
used for configuring, developing, and managing HMI/SCADA applications. In this manual,
you will find everything you need to create a full-feature SCADA (Supervisory Control and
Data Acquisition) project. With this tool, you can create and manage mySCADA projects;
configure connections with devices; and enter tags, alarms, and trends. It also allows you
to design advanced mimic graphics with specific animations, corresponding with PLC tag
values.
An easy-to-use interface allows for simple manipulation of the project’s configuration and
data processing. The project data are stored in a single directory for easy backup and
restoration.
myDESIGNER has an integrated GUI (Graphical User Interface) visualization editor for easy
creation of professional looking mimic graphics. The graphics are based on the Scalable
Vector Graphic (SVG) format, which means that your controlled technology will always
look sharp.
Key Features
Free for personal and business use
Simple to use
GUI design in Scalable Vector Graphics (SVG)
Animations and effects can be added to any shape or object
Support for background images (JPEG, GIF, and PNG)
Ability to attach PDF documents to the project
Ability to attach MP3 sound files to the project
Built-in script editor
Available for Mac OS X, Windows, and Linux
Drawing Possibilities
Shape tools: rectangles, circles, ellipses, paths, texts, and images
Path tools: Bezier curves, conversion to a path, union, subtraction, intersection, merge
Group editing
Advanced text support
Images import (.jpg, .png)
Transformations: resize, rotate, skew, align, distribute
Properties manager
Resource manager: gradients, patterns, and markers
Layers
Smart Guidelines, snap to points, grid
Project Management
Key components of mySCADA projects are the visualization screen views. This is where
the schematic visualizations of controlled devices are displayed. Single objects or groups
of objects can be created and defined especially for communication with connected PLCs.
These specified objects can then be animated, changing their visual appearance based on
the PLC tag values.
The graphic screens are internally represented as SVG files, defined project connections
as configuration JSON files, and alarm states and trends stored in separate JSON files.
The configuration files can be edited directly in myDESIGNER, so you do not have to edit
them individually. The visual and server side scripts are also stored into external files with
7
the .js extension. Complete mySCADA projects consist of configuration files, SVG files,
scripts, documents
and sound files, and they are saved directly to your hard drive. For more information about
exact project structure, see the following table:
File Description
settings.json Complete settings of project
*.dlg.json Data-log definition file
datalogs.json Settings for data-logs such as its names, translations, size
distribution, etc.
trends.json Settings for trends such as its names, translations, etc.
views.json Settings for views such as its names, translations, etc.
*.trnd Advanced trend definition file
cas.json CAS Alarms definition file
*.svg Mimic diagram (view) definition.
*.svg.js View Script. Has the same name as the corresponding view. Contains
a list of functions in JavaScript language.
scripts Directory containing all server side scripts. Can be empty if no server-
side scripts are defined.
In the following sections, you will learn how to create a project; add, configure, or delete
connections; define alarms and trends; and manage other project settings.
8
2 Tutorial Videos
To get you started using myDESIGNER quickly and efficiently, we have prepared a set of
tutorial videos. These videos cover most of myDESIGNER’s functionalities. Here is the list of
all tutorial videos:
2.1 myDESIGNER
Creating a New Project https://://www.youtube.com/watch?v=IpxeE13HyzI
Exporting/Importing Projects https://://www.youtube.com/watch?v=d8jVR75eGz0
Creating PLC Connections https://www.youtube.com/watch?v=9_jUEjRtFAc
Creating Views https://www.youtube.com/watch?v=HtLLUt3O5dc
Layout Views https://www.youtube.com/watch?v=sVvFPCMYUZ8
Customizing the look https://www.youtube.com/watch?v=So78T1730KY
Drawing primitives https://www.youtube.com/watch?v=ryduKCgzFr0
Active Areas [part1] https://www.youtube.com/watch?v=q_V91pm8C1c
Active Areas [part2] https://www.youtube.com/watch?v=uq-hHTbrwrs
Creating Custom Component https://www.youtube.com/watch?v=tYh4jD-2f2M
Master Components https://www.youtube.com/watch?v=jeJNHUKfWEk
Rulers and Guides https://www.youtube.com/watch?v=jiTpwXYE__I
Layers https://www.youtube.com/watch?v=uogOzykIuA0
Animations https://www.youtube.com/watch?v=_cPPysaTWKc
Effects https://www.youtube.com/watch?v=GTOFCwrRTPM
Entering Tags https://www.youtube.com/watch?v=XNrNiTUPFDk
Commands https://www.youtube.com/watch?v=7z_0_DcmvSQ
2.2 myREPORTS
8
2.3 myMOBILE
9
3 Getting Started with myDESIGNER
Watch video describing this functionality: https://www.youtube.com/watch?v=hJT0--o1ub8
The first screen you will see after opening the application is the Start Page.
Click on the blue arrow in the bottom left-hand corner for a brief tutorial to get to know
the capabilities of myDESIGNER. The Start Page always opens up upon the start of the
application - if you wish to prevent this, click on the Show On Startup button at the
bottom. You can close the Start Page by clicking on the cross in the header tab. If you
wish to display the Start Page again, go to the main menu, Help section, and select Start
Page.
10
Getting Started with myDESIGNER
Look at the picture below to get to know the myDESIGNER interface:
Main Menu
File: manipulation of project files and printing
Project: has the same structure as the Project Window
Projects: manipulation of projects
View: working with views
Layouts: viewing Layout definitions
Documents: loading, copying, and deletion of attached PDF documents
Advanced Trends: opening up and closing trends
CAS Alarms: opening up and closing complex alarms
Data-logs: defining data logging
Tag Database: managing your tags
Connections: connections to your PLCs
Server-side Scripts: managing JavaScript in mySCADA
Sound: loading and deletion of MP3 files
Users: managing users
Devices: equipment with installed mySCADA application, accessible from editor
Tools: language selection
Window: direct access to different editor tabs and window control
Help: opens the help menu
11
Getting Started with myDESIGNER
Main Toolbar
The basic toolbar consists of the following functions:
Upload from a Device – downloads a project from the selected mySCADA device
New Project – creates a new empty project or from the wizard, opens existing
projects, and imports projects from .mep file
The main toolbar content may change depending on a selected project element (i.e.
project, view, sound, script, document, alarm, etc.).
The set of described icons only concerns the project elements; other possible sets are
described in the chapters devoted to the relevant elements.
12
Getting Started with myDESIGNER
1) Click on the New Project icon in the main toolbar or use the command New Project
from the main menu Project-> Projects.
Empty Project
2) If the selected directory is not empty, all its files will be deleted.
13
Getting Started with myDESIGNER
Import Project
This option imports another project from an MEP file (all exported projects of mySCADA
Designer use this extension).
1) Choose the directory where the project to be imported should be located and click
Next.
2) Click on Import File (suffix *.mep) and then on the Finish button - an imported project
will be created in the selected directory.
Project Wizard
This feature helps you step-by-step to create a functional base for your new project. It will
create a connection to the PLC, set up a simple screen with animations, and pre-configure
alarms and data logging.
1) Select the directory where you want your new project to be located and then click
Next.
Note: You have to click on Clear Directory first if the selected directory is not empty.
15
Getting Started with myDESIGNER
4) You can now set the Tag Value Range and Alarm limits.
16
Getting Started with myDESIGNER
Existing Project
With this feature, you can open an already existing project:
Navigate to the project directory and click on “select project directory.” It the directory
contains project files, the project will be opened in myDESIGNER.
17
Getting Started with myDESIGNER
All myDESIGNER windows are organized into panes. You can move the windows arbitrarily
as the designer remembers the positions of both automatically and manually closed
windows until the next time they are opened.
Each window can be dragged away from the workspace and will stay undocked until you
dock them again using the key combination Alt+Shift+D. You may resize the windows as
well.
If you wish to return all the windows to their default state, use the Reset Windows
command from the menu Window –> Reset Windows.
Moving windows
18
Getting Started with myDESIGNER
Some windows appear only when you are performing a task to which they are related. For
example, the Layers window appears only when you are designing a screen view. In the
Window menu, you can select which windows will appear automatically.
Useful shortcuts
Project Window
This window displays a tree structure of all opened projects and the list of devices running
mySCADA.
Devices – list of available devices from/to which you can load a project
Here you can find all iPods, iPhones, iPad Touches, Android devices, Raspberry PI devices,
mySCADA Boxes, mySCADA Pros, and server PCs to which you can connect. You can also
specify the device manually to access remote network devices. Note that it may take a
few minutes to find all devices available in the local network.
19
Getting Started with myDESIGNER
Overview Window
This window shows a preview of the selected view; otherwise, it is blank.
Properties Window
This window allows access to object and project properties. The properties of specific
objects are described in the relevant chapters.
Main Window
This window is your main working area where the content of all project elements is
displayed. It gives you the ability to draw graphic visualizations, change connection details,
and alter alarms or trend details. The script editor also uses this window.
This button expands the list of all opened projects and selects one of them. The
arrow next to the project name will point to the project that is currently being
displayed.
This button maximizes the main window by docking all other open windows.
These buttons are used to switch between different opened tabs when the tabs do
not fit into the main window.
20
4 Checking Project
If you want to make sure your mySCADA applications run properly, you have to comply
with certain rules when creating a project. For this purpose, you can use the Check Project
function, which checks if your project complies with these rules.
Use the command Check Project from Project->Projects or click on the Check Project icon
in the main toolbar.
Example:
2) The Syntax Settings button opens the error list, where you can set the errors to be
ignored:
21
Checking Project
3) The Check button starts checking the project syntax. If the check is successful, a
confirmation dialog box will show up:
If the check finds errors, an error dialog box will show up:
22
Checking Project
Note: All errors are divided into categories on the left; selected error categories such as
View, Documents, etc. are displayed on the right. If you wish to correct the errors
that were found, click on Repair.
23
5 Projects’ Visual Appearance
mySCADA is a very flexible tool that allows you to modify the visual appearance of your
project in a runtime environment freely. You are free to change the fonts, colors, and icons
to fit your company’s visual guidelines.
For visual appearance set up, click on your project and then click on the color palette icon
in the Main Toolbar.
In the dialog, you can see options for the visual appearance of your project in a runtime
environment. If you change any color or visual option, you can immediately see how this
option is displayed in the runtime environment.
24
Projects’ Visual Appearance
Changing the Default Color
The simplest way to change the default visual appearance is to set a new default color. To
do so, click on a corresponding color in the “Default Colors” section.
25
Projects’ Visual Appearance
Changing Master Colors
You can very easily change the color scheme to any colors you like. Just click and change
the Primary, Secondary, and Text colors.
Fine Tuning
You can fine-tune the visual appearance of any on-screen element. To do so, click on the
option “Show Color Tables.” The color tables for your project are shown:
26
Projects’ Visual Appearance
They are split into two parts: Alarms and Other Colors. In the Alarms section, you can set
the colors of the text for any type of alarm. In the Other Colors section, you can fine-tune
the appearance of almost any element in the runtime environment.
When you press the “Save to Custom” Button, all your changes are saved under a given
name. Your custom appearance settings are automatically added to the combo box
selection:
You can delete your custom saved appearance by clicking the “Delete” button.
27
6 GUI/HMI Editor
The GUI editor is a drawing interface based on Scalable Vector Graphics (SVG).
To create views for visualization, open the Views folder in the Project Window; the main
toolbar will show you these options: Open View, Add View, Duplicate View, Delete View,
Print View, and Show Used Tags.
1) Click on the Add View icon located above the main screen or use the command from
the main menu Project->Views->New View.
A new dialog window opens to allow you to set the visualization parameters:
Parametric Window: option to create a parametric view - use parametric views when
you need multiple views different only in a data source; such
sources are specified by the received index when a parametric
28
GUI/HMI Editor
view is prompted (see Commands – Open command and Parametric window).
Page Orientation:
Portrait predefined vertical display
Landscape predefined horizontal display
Note: If your device uses a pop-up menu toolbar (iPhone, Smartphones, etc.) you can
set up its width in pixels, and it will be automatically subtracted from the final screen
size.
Note: You can change the screen dimensions at a later time if you right-click on the
canvas and select ’Resize canvas’ from the pop-up menu.
2) Click on Add to create a view with the selected parameters or press Cancel to exit
without creating or saving the view.
In the Project Window, you can see all the views listed in the Views folder. In the
Properties window, you can see the parameters of the currently selected view. To open an
existing view, simply double click on its name. You can also click on the Open View icon or
on select Open View from the Project->Views menu. You may also use the other options
such as copy, delete, import a view, etc.
29
GUI/HMI Editor
Menu
File
This menu allows you to manipulate an opened view:
Export – exports the current view into other formats: JPG, PNG, BMP, and PDF
Print – prints the current file (shortcut Ctrl+P).
Check – performs a check of your view; use this if you experience malfunctions, and
it will check for possible duplicity of IDs, objects misplaced outside of the
canvas, etc.
Close – closes the current file (shortcut Ctrl+W).
Edit
This menu provides basic operations like undo, redo, copy, cut, delete, group, lock, select,
etc.
Undo – erases the last change made in the program (shortcut Ctrl+Z)
Redo – reverts the change (shortcut Ctrl+Y)
Copy – creates a copy of a selected object or area on the clipboard (shortcut Ctrl+C)
Paste – pastes the object or area from the clipboard (shortcut Ctrl+V)
Paste on the same location – pastes the copied or cut object to the same location as the
source.
Cut – cuts a selected object and places it on the clipboard (shortcut Ctrl+X)
30
GUI/HMI Editor
Delete – deletes a selected object (shortcut Ctrl +D)
Paste dimensions – transfers certain parameters of a selected object:
Paste size – modifies selected objects, setting the size to that of the
object being copied
Paste width – modifies selected objects, setting the overall width to the
size of the object being copied
Paste height – modifies selected objects, setting the overall height to the
size of the object being copied
Paste size separately – resizes selected objects one by one
Paste width separately – changes the width of selected objects one by
one
Paste height separately – changes the height of selected objects one by
one
Group – groups multiple objects together (shortcut Ctrl+G)
Ungroup – splits the grouped objects
Enter group – allows access to individual objects inside an object group (shortcut Ctrl+E)
Exit group – returns to normal selection mode, i.e. the whole group will be selected at
once (shortcut Ctrl+Shift+E)
Select all – selects all objects on the canvas (shortcut Ctrl+A)
Deselect all – deselects all objects on the canvas
31
GUI/HMI Editor
Drawing
In this menu you can create figures, lines, and curves; add pictures and texts; etc.
It contains the same features as the main toolbar; for detailed information, see the toolbar
section of this chapter.
Transforms
In this menu you can align, center, distribute, order, flip, and rotate objects and resize the
canvas.
Display
In this menu, you can enable grid and rulers; different zoom options are available too.
Dialogs
This menu includes the Memory Monitor utility.
Help
This menu offers additional information about myDESIGNER.
TIP: The most frequently used functions from these menus are also available in the main
toolbar or in the right-click menu.
GUI Toolbar
In the upper part of the GUI editor window, there is a secondary GUI toolbar where you
can find all of the necessary functions for designing and animating the views.
Properties Bar
This bar is located right below the GUI toolbar. It allows you to view and change the
properties of selected objects or set default drawing properties such as fill and stroke
color; line type and line thickness; font family, type, and size.
If there is no object selected, you can specify the default properties for new objects to be
created. If you click on an existing object, you will see its current properties that you can
modify.
In the following example, all of the new objects will have transparent fill and black solid
line stroke:
32
GUI/HMI Editor
With the Properties bar, you can easily change the properties of multiple objects at once:
stroke width, stroke style, stroke color, fill color, and also the font family and size.
Options Bar
This bar is located in the left lower part of the Main window.
Here you can activate the repeat action mode; turn on/off the smart guidelines, snap-to-
points, and square mode function; enable the grid; set the discrete rotation step; force
horizontal/vertical line drawing; and automatically close the drawn paths. Detailed
explanations of each function will follow.
33
GUI/HMI Editor
6.2 Selecting Objects
Click on the canvas and drag the mouse to select object(s). If the objects are selected
correctly, the selection border shows up and the object properties will be displayed in the
Properties window. To add objects to your current selection, press and hold the Shift key
and click on more objects.
Note: If you drag the mouse from the left to the right, only the objects fully enclosed in the
selection window will be selected. If you drag the mouse from the right to the left, all the
objects that intersect with the selection window will be selected.
In the DRAW section of the GUI toolbar, you can choose the type of object you want to
draw (line, polyline, square, rectangle, circle, ellipse, text) or insert an active area window,
picture, or ready-made components.
34
GUI/HMI Editor
35
GUI/HMI Editor
Type in the text to be displayed and click on OK. The text is now placed on the canvas and
can be moved, resized, rotated, etc., like any other object.
Note: The text in the element can be changed at a later time - select Properties on the
right side of the window and look at the Text cell.
Click on the Insert Image icon in the main toolbar, then click on the canvas, drag the
mouse to set the picture size, and release the mouse button.
36
GUI/HMI Editor
In this dialog, you can see all pictures that you have used in your project. You can add new
pictures by clicking on the From File button.
TIP: When you want to remove pictures that are not used anywhere in your project, you
can use the button “Remove Unused”.
37
GUI/HMI Editor
If your project does not have any imported pictures yet, an open File dialog will be shown.
If you already have pictures in your project, they will be listed in the Picture Chooser
Dialog. Either select pictures that have already been imported or import new ones by
clicking on the button “From file”.
The picture is now on the canvas and can be moved, resized, rotated, etc. like any other
object.
Note: You can import images in their original size by a single-click on the canvas.
38
GUI/HMI Editor
6.6 Poly-lines
With this function you can create independent and continuous lines, arcs, splines, or any
combination of these elements.
Line
Click to set the start point, move the mouse to the end point of the line, and then click
again.
Arc
Click and hold the mouse button while moving from the start point, release the button at
the control vertex point, and then click again to set the end point.
Spline
Click on the start point and move the mouse to the endpoint, then click again and hold down the
mouse button while forming the curve, and release the mouse button to finish the drawing.
39
GUI/HMI Editor
When you finish drawing the object, you will see all the control, end, and vertex points,
which you can modify.
Editing Segments
You can add, remove, or delete segments from a spline you have created. Click on the
arrow on the right side of the Create Spline / Bezier Curves icon (you can also use the
right-click) to display the Options menu.
40
GUI/HMI Editor
Add segment
Select a segment you would like to add from the options menu. Click on the control
point of the polyline where you want to add the new segment.
Delete segment
Select Delete segment from the options menu. Click on the end control point of the
segment you want to delete.
Close path
If this option is active, all the polylines being drawn will close automatically.
1) Select an object you want to resize – you will see the blue arrows selection border.
41
GUI/HMI Editor
If you drag using the arrows at the corners, the object will retain its aspect ratio. If you use
the arrows on the sides, the object will change its horizontal / vertical size only.
42
GUI/HMI Editor
2) Drag the corner arrows until you get the desired angle of rotation.
Note: You can also change the center of rotation for the selected object. To do so, move
the blue circle located at the geometric center of the object.
43
GUI/HMI Editor
6.10 Skewing Objects
1) Double-click on the object you want to skew
2) Drag the blue arrow in the middle to get the desired skew.
6.11 Filleting
The rectangles and squares can have their corners filleted.
2) Click on the blue corner point, hold, and drag the mouse to get the desired shape.
44
GUI/HMI Editor
6.12 Combining Objects
You can combine multiple simple objects that overlap; together with the Merge, Subtract,
Intersect, and Turn-to-Path functions, you can create one complex object of arbitrary
shape and color.
Merge
This feature can merge two objects into one, including the contours:
3) Go to the menu Drawing –> Path operations and select Merge selected objects
together - the two objects will merge into one. You can also select the desired
function from the GUI Toolbar.
45
GUI/HMI Editor
Subtract
This feature is opposite to the Merge function. You can subtract portions of a bigger object
to create a new object of the desired shape.
1) Select objects and make sure the outline is in the desired shape of the final object.
2) Go to the menu Drawing –> Path operations and select Subtract objects. You can also
select the desired function from the GUI Toolbar.
3) Now you have a new cutting that can be modified – use the same steps as described
for shaping objects.
Intersect
This feature creates a new object from an overlapped area of two different objects.
1) Arrange two arbitrary objects so their overlapping pieces make a desired shape, and
then select the objects.
46
GUI/HMI Editor
2) Go into the menu Drawing –>Path operations and select Intersect. You can also select
the desired function from the GUI Toolbar.
Now you have a new cutting ready to be formed into a desired shape by clicking and
dragging the surrounding dots.
Turn-to-Path
This feature allows you to transform the objects e.g. Changing primitive objects to
complex paths. Go to Drawing->Path operations->Convert Selected Objects to General
Path Objects. You can also select the desired function from the GUI Toolbar. You will see a
series of points appear around the object.
47
GUI/HMI Editor
6.13 Fill and Stroke
Graphic objects can be filled (or stroked) with a solid color, linear gradient, radial
gradient, or complex pattern.
2) Click on the Color, Gradients, and Patterns button in the GUI Toolbar.
48
GUI/HMI Editor
Solid Color
Navigate to the Colors tab in the Resources tab where you will see a few options for solid
colors:
49
GUI/HMI Editor
HSV – mix your desired color by determining the Hue, Saturation, and Value and setting
Transparency
HSL – mix your desired color by determining the Hue, Saturation, and Lightness values
and setting Transparency
50
GUI/HMI Editor
RGB – mix your desired color by determining the Red Green and Blue values and setting
Alpha level
51
GUI/HMI Editor
CMYK – select your color from the Cyan, Magenta, Yellow, Key (Black) color palette and
set Alpha
SVG – select your color from the pre-defined SVG standard colors palette
52
GUI/HMI Editor
Gradients
Using gradients enables you to create your own custom color blends and give your objects
a plastic look. You can create smooth color gradations over one or more objects and save
them for later use on other objects.
53
GUI/HMI Editor
The Resources tab contains pre-defined linear and radial gradients and patterns. You may
create new gradients and patterns or modify the existing ones.
Linear gradient
The linear gradient function enables you to create horizontal, vertical, and diagonal
gradient fills.
You can choose from pre-defined linear gradients in the Resources tab:
When you click on a pre-defined gradient, you will see its properties in the right side
panel.
You can see the gradient preview in the small top window, and if you click on the tab
Preview, you will see how the object will look.
54
GUI/HMI Editor
The bottom part of the panel is divided into two tabs, Basic and Advanced:
Basic - you will find all defined colors for a selected gradient
On the basic tab panel, each color has its own controls.
55
GUI/HMI Editor
Position - specifies the starting point of this color. Move the slider to the side to change
the color position.
56
GUI/HMI Editor
To add a new color, press the + Add Color button.
Advanced - you can fine-tune your custom gradient and define the id, angle, and fill
options
Angle - you can change the angle of the gradient from horizontal to a custom angle
x1, y1, x2,y2 - linear gradients are defined by the bounding box of an object they fill;
x1 and y1 specify the initial point of the gradient of the bounding box; x2 and y2
represent the end point of the gradient
57
GUI/HMI Editor
Radial gradients
This function operates with circular gradient fills; this is the same principal as for the linear
gradients, only the Advanced section is slightly different:
cx, cy, and r define the outermost circle of the radial gradient
Patterns
Different objects or images can be used as a pattern for other objects. myDESIGNER lets
you choose from pre-defined patterns or create new ones, either by modification of the
existing ones or by importing a file (jpg, png, jpeg) or selection. Patterns can be either
raster images or vectors. If you use raster images, you might experience pixelation on
tighter zoom, so if you can choose, use vector image where possible.
58
GUI/HMI Editor
Predefined Patterns
Predefined patterns are simple but effective patterns for you to use. Please keep in mind
that you can very easily change color or rotate gradients to suit your requirements. Usage
is quite simple; select a pattern you wish to use, and if necessary, modify the parameters
and hit the save button.
59
GUI/HMI Editor
User Defined Patterns
All the patterns used in your view are listed here. You can also create new ones from
predefined patterns or import them from files or selections.
Buttons on the bottom allow you to create new patterns, either from a file or from a
selection, as well as delete and duplicate existing patterns.
Pattern Import
From File
Click on the + From Picture button and select the source raster image file in the dialog
window, then click on the OK button.
From Selection
Click on the + From Selection button to create a new pattern from the selection in your
current view.
60
GUI/HMI Editor
1. Draw the objects you would like to use as a pattern and select them.
2. Now open the resources dialog. Navigate to the Pattern tab. Now click on the +
From Selection button. The new gradient has been created:
Parameters
The parameters of the selected gradients can be easily modified. You can, for example,
change the main color of the gradient, rotate, or scale it. Please find a list of
parameters below, including explanations for each one.
Parameter Description
Id Unique ID of the pattern. Each object has its own unique id.
Scale You can scale the gradient so it appears smaller or larger. You
might need to scale the gradient to fit your object’s size. You can
preview the result in the Preview window.
Translate Move the position of the gradient along the X and Y coordinates.
61
GUI/HMI Editor
Example of using a pattern
We will show you a simple example of how to use a pattern in your design. We will create
a simple progress bar by using and modifying a predefined pattern.
1. First, we will create tree rectangles. The top one will be used as a border, the middle
one will be used as our progress indicator, and the last one will be used in the
foreground to give our progress bar a plastic look.
2. Now select the middle rectangle and click on the Colors, gradients, and patterns
Icon. In the pattern section, select a bar pattern.
62
GUI/HMI Editor
3. In the properties on the right side of the window, click on the color chooser
rectangle and select a different color. Then use the Rotate slider to rotate the
pattern by 45 degrees.
5. Now put all of the rectangles together to finish the progress bar.
63
GUI/HMI Editor
Rulers
Rulers help you to accurately place and measure objects on the canvas. The common ‘0’
point of the horizontal and vertical rulers is the root. You can show and hide rulers in the
options menu located in the left lower corner of your view.
Guides
Guides help you to align text and graphic objects. You can create ruler guides (straight
vertical or horizontal lines) to align the objects. To create a new guide, click on any point
on the ruler; the created guide can be moved later. You can set its exact location or delete
it by using the right-click menu.
64
GUI/HMI Editor
Smart Guides
Smart guides are temporary orthogonal snap-to-point guides that appear when you are
creating or manipulating objects. They help you align, edit, and transform objects in
respect to other objects.
To enable/disable the smart guides, please click on the Smart Guides icon in the options
menu located in the left lower corner of your view.
Snap-to-Point
Snap-to-point guides are temporary bullet points that appear when you are creating or
manipulating objects. They help you to align your object to other objects.
65
GUI/HMI Editor
To enable/disable the snap-to-point guides, please click on the snap-to-point icon in the
Grid
The grid is displayed behind your graphics on the canvas but does not print with
the project visualization – objects align automatically when the grid is active. You
can activate or deactivate it from the Display menu or the Options bar.
66
GUI/HMI Editor
To enable/disable the grid, please click on the grid icon in the options menu located in the
left lower corner of your view.
When you right-click on the Grid Icon in the Options bar, the Grid settings dialog is shown.
Grid settings
Here you can set the grid parameters like color, stroke style, and the grid step.
Go to the menu Display –> Grid settings or right-click on the grid icon in the Options bar.
67
GUI/HMI Editor
6.15 Layers
When you are creating complex visualizations, you might find it challenging to keep track
of all of the graphic objects on the canvas. The smaller items might be hidden under the
larger ones and thus working with them could get difficult. Layers can help you to keep
track of your items.
Think of the layers as transparent planes, each containing graphic items that are glued
together. If you change the order of the layers, you also change the position (visibility) of
the items on the canvas. You can move items within a single layer, or you can group
together multiple items spread throughout several layers. If you copy objects, then a new
object is copied into the layer of the original object.
Layers can be controlled from two different places. There is a Layer window located above
the properties window (toggle its visibility in the main menu – section Windows), and there
is a Layer Combo Item located on the GUI Toolbar.
Layer Combo
The Layer Combo option is located on the right side of the GUI Toolbar:
With the Layer Combo option, you can control all aspects of Layers. An explanation of the
controls is in the following picture.
68
GUI/HMI Editor
Layer Window
The Layer window is activated in the main menu. Go to Window and toggle Layer Window
visibility on/off.
The Layer Window and the Layer Combo option are complementary elements; both of
them allow you to access all functions of Layers. The Layer window occupies more space,
and so it allows for more comfortable control of layers than the Layer Combo option.
An explanation of the controls is in the following picture:
69
GUI/HMI Editor
Layer is visible
Layer is invisible
Locking selection
You can lock a selection for a given layer by clicking on the Lock icon. If the layer is locked,
you will not be able to select any of its elements.
Layer Locked
Layer Unlocked
70
GUI/HMI Editor
To select a new active layer:
1. Make sure you have no object selected in your view. If you have selected objects, use
the escape key to unselect all objects or click on a canvas)
2. Click on the Layer Combo control, and list of layers is shown.
3. Click on a layer name, which you want to set as the new Active Layer.
To select a new active layer, simply check the checkbox next to the desired layer.
Removing Layer
To remove an existing layer, click on its name and press the “–” button. If the layer you are
about to delete contains any graphical objects, you will be presented with a warning:
If you continue, the layer will be deleted along with all the graphical objects it contains.
WARNING: If you delete a layer, all graphical objects contained in the layer will be
removed as well. This action cannot be undone.
71
GUI/HMI Editor
Selecting all items in given layer
To select all items in given layer, click on the select all items icon.
. 1 The selected object is on the layer named "Middle Layer". You can see the name of the layer in the Layer
Combo control panel. Note that the name is in bold.
72
GUI/HMI Editor
. 2 The selected object is on the layer with the name "Middle Layer." This is shown in the Layer Window by a
green highlight and bold font.
If you select multiple objects belonging to different Layers, the Layer controls will highlight
all corresponding layers in green.
Note: The Layer Combo box will show the name of the top layer in the selection; its name
will not be in bold.
73
GUI/HMI Editor
Layers at the top of the list overlap the layers at the bottom of the list. Therefore, if you
move a layer up, it will overlap all the layers below it in the list.
74
GUI/HMI Editor
75
GUI/HMI Editor
The layer settings dialog has two parts; on the left side, there is a list of layers. You can add,
delete, change position, and merge layers with the buttons at the bottom of the list. On
the right side, there is a settings pane for the selected layer.
76
GUI/HMI Editor
For more information about zoom visibility animation, please refer to the chapter
Animations.
For more info about User Access Rights, please refer to the chapter User Accesses.
Begin by creating an object and click on Edit -> Copy. Now paste the object being copied
by clicking on Edit -> Paste to same location (you can also right-click on the object and
select this function). This operation can be repeated as many times as you need.
Note: You can verify that an object has been pasted successfully by moving it aside and
then moving back by clicking on Edit -> Undo.
Paste Dimensions
This feature allows you to paste specific dimensions of currently selected objects. Select an
object whose dimensions you want to copy. Then select the object to which you want to
apply the dimensions by clicking on Edit –> Paste dimensions.
77
GUI/HMI Editor
Paste width - this function will paste only the width of an object
Paste height - this function will paste only the height of an object
When the function Past dimensions is being applied to multiple selected objects, the
dimensions are transferred to the selection bounding box and the space around the
objects is accordingly scaled.
In the following example, we will copy the square on the left and then resize the
rectangles:
1) Create multiple objects and then copy the size of the object you want to apply to the
remaining objects.
78
GUI/HMI Editor
2) Select the remaining objects.
3) Open the Edit menu and select Paste dimensions - Paste size separately (you can also
right-click on the object and select this function). All objects are now the same size.
Example:
1) Create a new object and use Edit -> Copy and Edit -> Paste on same location twice.
Now you have three rectangles of the same size. For easier visualization, fill each object
with a different color (function Properties – Fill – Color) and drag the objects so they
partially overlap.
2) Now click on Transforms -> Order to change the objects’ order and use one of the
functions below:
Lower to the background - moves a selected object into the background so that all
other objects are on top of it
79
GUI/HMI Editor
Raise to the top - moves a selected object to the top so that all other objects are
beneath it
6.18 Grouping
Grouping Elements
You can compose your graphics from multiple elements. Moving or copying these
graphics might be difficult, but to simplify these operations you can group multiple
objects together so you can use them as a single unit.
80
GUI/HMI Editor
Enter group – allows changes to objects inside the group
without ungrouping
Select the objects to be grouped and click on the icon in the toolbar (or select it from
the menu Edit). The objects are now grouped and behave as one object; the group can be
moved, resized, rotated, skewed, etc.
Ungrouping Elements
This function is used to divide grouped objects back into independent elements.
Select the group of objects and click on the icon in the toolbar (or select it from the Edit
menu), and the object will divide into its elements.
Enter Group
With this function, you can work with individual objects that are grouped without needing
to ungroup them first. Therefore, you can work with each object individually without
ungrouping.
2) Click on Edit (shortcut Ctrl+E) and select Enter group (or use the appropriate icon in
the GUI Toolbar).
81
GUI/HMI Editor
3) Now you can work with any object in the group individually.
Exit Group
Once you have finished working with the objects in the group, you can leave the group by
clicking on Edit -> Exit group (or shortcut Ctrl+Shift+E or by using the appropriate icon in
the GUI Toolbar).
Click on the Repeated actions mode icon in the lower options bar and select an object to
draw.
82
GUI/HMI Editor
The Script icon has a context menu with which you can open a current view script in the
editor, delete an existing script, or clear all defined script variables. Use the right-click to
activate the menu.
A detailed description of View Scripts can be found in the corresponding chapter: View
Scripts.
83
GUI/HMI Editor
If you click on the item in the Element ID column, the graphical object with this ID will be
automatically selected.
The Redo button allows you to redo an action after using the Undo function. You
can find it in the toolbar or in the Edit menu. You can also right-click on an object
and select this function.
Note: If these buttons are grayed out, then it is not possible to use them at that
moment.
84
GUI/HMI Editor
View Properties
Default Zoom: Default zoom for this view. Options are Fit to Page, Full Width,
and Original Size
85
GUI/HMI Editor
Access Rights Levels
View Access Group: minimal level of access for viewing. Enter a level between zero
and nine: None, 0, 1,…, 9. For more info, please look at the section
UserAccesses.
Write Access Group: level of access for writing to the PLC. Enter a level between zero
and nine: None, 0, 1, …, 9. For more info, please look at the
section UserAccesses.
Groups Write Access: List of user groups to allow write access. For more info, please
look at the section UserAccesses.
Communications
Persistent Read: If this option is enabled, mySCADA will read all the data
from the PLCs, even if the view is not being viewed by anyone.
This option is useful for fast view refresh when loaded; however,
heavy usage can lead to a slower overall reaction of the system
as more data is read from the PLCs continuously.
Connection: List of PLC connections defined in the current project. This is a
default connection - if you enter the tag and do not specify the
connection, this connection will be assumed as default.
Refresh: Refresh rate of the View in milliseconds.
Parameters
Size: Displays the view size in kilobytes [kB].
Has JavaScript: Checks if the view contains script functions.
Has Variables: Checks if the view has view script variables.
Key Shortcuts: Allows use of key shortcuts in the view (see the chapter
Commands)
Lock Keys: If enabled, set commands will be active only if the lock key is
pressed.
Sounds: Specifies the sound animations used in the view (see the
chapter Commands)
Translations
Language You can provide language translations for the view name and
description. To see this option, you must activate at least one
language in the Languages option in your project. For more details,
please see chapter Multilanguage support
86
GUI/HMI Editor
Error Box Properties
You can define a graphic representation of an “offline” error for objects tied with the tags
for animation. When such tags cannot be read from the PLCs, mySCADA will display an
error box around such objects.
In the Error Box properties, you can define the look of the error boxes in your project.
Select the Views folder and its properties will appear in the Properties window:
Set the fill color, fill opacity, frame color, frame thickness, and opacity of the Error Box.
With the parameters Rx and Ry, you can change the softness of the Error Box corners.
For example, if you fill the Error Box properties with the parameters below, the
communication error will be displayed as follows:
87
GUI/HMI Editor
88
7 Components
The Components library is a collection of high-quality artwork and ready-made graphic
symbols that you can simply edit and integrate into your views. Each component
represents a fully functional graphical object with easily editable properties, including the
ability to be directly connected to the PLC tags without the need to use animations.
The Components library icon is located in the DRAW section of the main toolbar.
Upon opening the Component library, you will see a dialog window consisting of three
main section tabs:
Default – contains original factory components that you can choose from and
customize to your needs
Custom – contains all your already customized components
Used – contains all the components you have used in your project (i.e. you can
change the component properties for all used components in the project at
one time)
89
Components
Click on the components group of your interest and select the component you need for
your visualization.
After you have selected your component, you will see its preview on the right side of the
dialog window. Below the component preview, there are editable properties of the
component such as Tag, Min and Max limits, background color, pointer color, text size, etc.
Note that each component has slightly different properties to edit.
90
Components
If you navigate to the bottom right corner of the dialog window, you will see three buttons:
Cancel – closes the component dialog window without saving the changes
Save – saves the customized component in the user’s Custom section
Insert – inserts your component into the View
Example:
1) Let us navigate to the Gauges group and select the analog gauge called Gauge Analog
Full, and then navigate to the Properties section in the right part of the dialog window.
91
Components
Write the name of the new category in the Category field, fill in the name of your
customized component, and click on OK.
This section contains all your custom components. Here you can find all of your saved
components, create new components, or import new ready-made components from SVG
files.
92
Components
Creating Components
This feature allows you to create, customize, and implement your own components.
1) Click on the New Component tab and enter the name of your new component, then
click on OK.
2) Select the new empty component from the list and click on the Edit button to prompt
a new edit window (identical to the drawing canvas, see more in the chapter Drawing).
93
Components
In the very bottom part of the editing window, you can set the component variables,
which will later become its settable properties (i.e. tag, background color, min & max
values, etc.)
3) When you have finished creating your component, click on the Save button at the
bottom and close the editing window. Your component will now be stored in the
Custom section. All components in the Custom section can be duplicated, deleted, or
edited later with the use of the buttons located in the right bottom corner of the
Components dialog window.
94
Components
Note:
All created and edited components in the Custom section are stored as SVG files, and
you can find them in your user folder on the hard-drive.
Importing Components
The components can also be stored as individual SVG files, so you can import new
components from outside resources. (They have to be in SVG format!)
1) Navigate to the Custom tab and click on Import, which will prompt the dialog window
Import Component.
95
Components
2) Select the SVG file from the source folder and click on OPEN to integrate the new
component into to your custom components list.
Renaming Components
3) Select the component you want to rename. Click on the Rename button. A new dialog
will appear:
This section shows all master components used in the whole project. If you change
properties of the master components, then all subordinate components will change too.
96
Components
If you navigate to the bottom right corner of the dialog window, you will see these buttons:
Usage – shows details about a selected component, including its location, view name,
id, used colors, min & max values, units, and format
Replace - with this feature you can replace master components with components
with similar properties (i.e. buttons to buttons, gauges to gauges, etc.)
Replacing Components
1) In the Component Library navigate to the tab Used, select the master component you
want to replace, and click on Replace.
97
Components
2) In the next dialog window, select the component to which you want to change.
4) Once you have selected the replacement component, myDESIGNER will check if the
aspect ratio matches for both components:
98
Components
Sizes match Sizes do not match
If the sizes do not match, the system can automatically scale the size of the
replacement component to the size of the component being replaced.
5) In the properties below you can also select the parameters to remain unchanged and
the ones to be changed.
When you are satisfied with the settings, click on the Replace button.
99
Components
The Graphical designer opens, and you can design your component.
As you can see, the GUI Designer is exactly same as when you design your view. You can
use all the functions you are used to. There is a new window: it is the Component Variables
Window.
Component Variables
100
Components
This window contains all variables that control the visual appearance and behavior of the
component. All variables you create here will be presented to the user as properties.
In the component variables window, you define all variables by specifying a name, short
description, and type for each variable. These variables can contain tag values read from
the PLC, color, and fill values for different elements, calculation results, etc.
Each component can have as many local variables as you need. You have to save your
progress after the addition of each new variable by clicking on Save in the tab toolbar. The
Color button opens the color palette when an appropriate type of variable is selected.
Property Description
Name Name of the variable as seen by the user: this will be shown in the
component properties.
Value Variable default value: for tag type variable, please leave empty.
101
Components
Property Description
1. Tag
2. String
3. Int
4. Double (Float)
5. Color
6. Boolean
7. Object
8. Combo Box
You can refer to the local variable anywhere in the animations, effects, or properties across
the edited component.
Example
To explain how to use Component Variables, we will present you with a simple example.
We will animate a handle of a gauge.
102
Components
Save
The complete process is shown in the following picture. You can see how we used the
component variables directly in the Animation fields.
103
Components
Now return to the view and test the new component. To do so, open your view, click
on the Components Icon in the toolbar, and select your component. After pressing the
Insert button, your component should be added to the view.
In the Properties window you can see the parameters of the component (e.g. the variables
you have defined in the component variables window) - the name of the component
variable “Tag”, Min and Max.
TIP: To check if the tag address in the animation has been changed, right-click on the
component and click on Enter group. Select the handle again, open its properties in the
Properties window, and look at the Rotate animation.
104
Components
You can see that the tag address used for this animation has changed to the requested
value.
7.5 Replacements
This feature should ease replacement of a predefined text in a component. You can
change the text, font size, color, stroke, or opacity of the text element.
1) Start with the component variables again and create the following variables:
105
Components
The Opacity here is similar to Opacity animation, which means that the text will be
visible if the value of Opacity formula is within the Opacity min/max range.
4) Fill in the Replacement -> Text in the Properties window. Note: The variable names
are case sensitive.
106
Components
To set the Fill Replacement, you are presented with the dialog:
107
Components
6) The text will change according to the value of an attached component variable.
After saving the component, import it into your view.
Replacements are important for complex components where you can replace the
component text (button text, for example) with just one click.
You can modify visibility, fill, and stroke color of any object in your component. Select the
object you would like to modify based on user touch and, in Properties, fill in the On Touch
section:
Example:
We will create a simple button that will change the background color on touch.
108
Components
Click on the rectangle and in Properties set the color to red in On Touch -> Fill
109
Components
In the following example, we will create a simple slide bar showing the variable progress and its Min and
Max values.
Create a new component and draw a rectangle, as seen in the picture below.
Copy the selected rectangle and apply Paste on same location to it.
Set the Fill property to “none” then put the element in the background with the function Lower to the
background. We have now created a frame of the scale.
Now create 3 text fields; your component will look like this:
110
Components
As you can see, we have created 3 local variables. For the tag value, you have used a variable tag; for
specifying the minimum and maximum values, you have used the min and max variables.
You can make indicator out of the rectangle by resizing it according to the value read from the PLC; set the
Scale animation as shown in the following picture:
We also want to show the actual value in the middle of the slide bar. Click on the text field in the
middle of the rectangle, select the Anim tab in the Properties window and click on the Tag (Address) field
in the Show Value section. Then, fill in the Tag field with “tag,” which corresponds to our local variable
name.
111
Components
As you can see, we have used one of our local variables. You can use the same variable (especially the tag
type) for multiple animations/effects to achieve a better effect.
We will also show the Min and Max limits of our tag. Click on the right text field, then select the Rep. tab
from the Properties window and set “max” for Text in the Replacements.
7) Now do the same for the other text field but place the min variable there.
Testing Component
Create a new view and open it, then navigate to the Library. Select your component and
press the Insert button.
112
Components
In the Component section, you can see all the local variables that you have defined.
Set the Tag (address) and the Minimum and Maximum values:
Now, save the view and send to a supported device; the screen should look as follows:
Formulas are evaluated with JavaScript, so you can enter any formula that is a valid
JavaScript expression. You can also include any of the Component Variables that you have
defined.
To show the functionality, we will extend our example by implementing the scale along
the slide bar we have just created.
Open the slide bar created in the previous chapter and adjust as follows:
113
Components
Delete the Min and Max fields and stretch the blue rectangle, including the frame.
After that, insert additional lines with the Drawing-Line tool to divide the rectangle
into thirds. With Transforms -> Order -> Lower to background send both lines and
the frame into the background
For each text field we need to specify the Text in the Replacement in the Rep. tab:
The left text field will show the value of the variable min.toFixed(x), which is a function that
rounds the result to x decimal places. In our case, the value will be formatted to show one
decimal place.
The second text field from the left should show 1/3 of the scale; therefore, we have used
the formula min+(min+max)/3 to get 1/3 of the scale. We will use the toFixed(1) function to
round the result.
The other two text fields are similar to those two; we can add units and a label to our
component to finish:
114
Components
To use the Label and Units text fields, we need to create two new variables. Both will be of
the type ‘string’. The first variable will be named label, and the second will be named unit.
For the text field label, add Text Replacement equal to the variable label. For Units text
field, add Text Replacement equal to variable units. Finally, click on the Save button to see
the changes
115
8 Combo Box, List Box and Text Box
Combo Box, List Box and Text Box elements are essential components when designing
your GUI with forms or multiple entry. mySCADA provides these components to use in two
different scenarios. One is to use the components along with the View Script to achieve
the desired functionality. The second usage is as standalone components connected
directly to a PLC or database.
To insert a Combo box, list box or Text box into your view, please click on the Library icon
and select the Combo box, list box and Text box category.
Then select a component, fill in the parameters (such as the number of elements) and
click on insert.
116
Combo Box, List Box and Text Box
TIP: change the size of the component by dragging it to the desired size. Please use the
horizontal and vertical sliders only.
117
Combo Box, List Box and Text Box
Combo Box
Parameter Explanation
Font Font name
Font Size Size of the text
Text Color Text Color
Fill Color Fill Color
No. of unfold items When is combo box unfolded, specify
how many items you want to see.
Callback Fcn. When user selects an item, you can run
a custom function. Define a function in
the View script and write here its name.
Number of elements Total number of elements in the
Combo box.
List Box
118
Combo Box, List Box and Text Box
Parameter Explanation
Font Font name
Font Size Size of the text
Text Color Text Color
Text Anchor Text align, to the left, center or to the
right.
Text Border Select to show border around each
item.
Text Border Color Color of the border around an item.
Fill Color Fill Color
Border Select to show border around whole
component.
Border Color Color of the border around whole
component.
Callback Fcn. When user selects an item, you can run
a custom function. Define a function in
the View script and write here its name.
Number of elements Total number of elements in the
Combo box.
119
Combo Box, List Box and Text Box
Text Box
Parameter Explanation
Type Specify if user should enter only
numbers, strings, or custom values into
the text box. If you specify number,
please fill also the Limit and decimal
places values. If specifying custom,
please fill in the regex function for input
check.
Max Length Maximum number of characters
entered
Decimal Pieces Maximum number of decimal pieces
entered.
Lower Limit For numbers only: minimum number
allowed
Upper Limit For numbers only: maximum number
allowed
Regex for custom For custom type only: enter regex by
which is user input checked.
Text Default text or number.
Font Font name
Font Size Size of the text
Text Color Text Color
Fill Color Fill Color
Border Select to show border around whole
component.
Round Corner If you want rounded corners, please
specify a radius.
Callback Fcn. When user selects an item, you can run
a custom function. Define a function in
the View script and write here its name.
120
Combo Box, List Box and Text Box
8.3 Using Components In View Scripts
You can easily use the List box, combo box and text box in view scripts.
We will start with a simple example showing how to use the combo box
programmatically:
2. We will create a button next to the combo box, on its press we will call view script
function getItem
121
Combo Box, List Box and Text Box
4. Now we will create a new button. On its press we will call view script function
setItem where we will set item in combo box to second item.
As you can see, into your callback function, you will get 2 arguments, first is a
selected item and second is an index of the selected item.
2. Click on your component in view and fill in the callback function name
122
Combo Box, List Box and Text Box
You can easily change the items in your component programmatically. To do so,
you can use function setItems:
List box allow you to fine tune appearance of each item by specifying the colors and
bold face of the font. To do so, use function setItems. Passed items in array will not be
strings but objects with additional properties. Simple Example:
Following script
123
Combo Box, List Box and Text Box
124
9 Active Area
9.1 Introduction
Active areas are the regions in views where you can show dynamic content. It can be
another view, trend, alarm window, datalog, or even an external HTML page or a live video
stream. Active areas act as an active container for all those multiple options. Aside from of
mySCADA’s specific functions (views, trends, etc.), you can use the active areas to show any
content that conforms to HTML 5 standards. That way you can show an external web page
or code an HTML page directly in mySCADA. You can also combine the active area with
view scripts (JavaScript based) to achieve dynamic interaction. That way you can, for
example, show Google Maps or create your own HTML component with SCADA options.
Note: One of the main benefits is that you can change the active area content at any time
using the Open command (for more, see the Commands section).
125
Active Area
3) Click on the Init State in the Properties window and select the content you wish to
display.
In this dialog, you can set up the type of Active Area. In other words, you can set up how
the Active Area will be initialized when the view is shown.
Note: If you do not activate the initial state (e.g. you leave the Active check box
unchecked), the Active area will not be visible. You can set a new state later when using
open command.
126
Active Area
View type
If you select this option, you can specify the view to be shown in the active area. You can
display any view you have previously designed. For best results, use a window with the
same resolution or at least the same aspect ratio as your active area. If you need to change
the active area size to an exact width and height, you can do so in the Properties window.
TIP: If you specify the option “Previous View,” open command will jump back to previously
open window.
Aside from the Parametric View name, you can also specify the Indexes and Connection
indexes.
For more details on how to deal with parametric views, please see chapter Parametric
Views.
Document type
You can show a PDF document linked to the project in an active area. The PDF document
will be automatically scaled to the size of the active area.
127
Active Area
Select a PDF document. You can also specify on which page to open the document.
Alarms type
This feature can show online alarms and alarm history in the active area. There are several
parameters you can use to set up the specific visual appearance of the alarm table that
will be shown in the active area. You can also limit shown data using filters.
Show Top Toolbar check box allows you to show or hide the top toolbar with filters
and alarm settings.
Show Bottom Toolbar check box allows you to show or hide the bottom toolbar
(e.g., the date selection controls).
Parameters allow you to specify which columns will be visible in the alarm table. In
addition, you can set a filter for severity and text filters for the message, area, and
device.
128
Active Area
Time Scale [min] parameter specifies the time interval that will be shown in the
alarm history table. Units are in minutes.
Background Color can be set to transparent or to a specific color. If you set this
parameter to color, you can specify which color will be shown as the background.
Row Click Callback is a neat feature: when a user selects a row in a table, you will
get a callback in the specified JavaScript function. This function must be defined in
View Script.
129
Active Area
1. Create alarm definitions in CAS Alarm Windows. To designate which alarms belong
to the view you plan to show, specify the name of the view in the Area column.
2. Create a new view and insert an Active area into it. (If you want to show filtered and
unfiltered data in one view, insert two active areas.)
130
Active Area
131
Active Area
1. Create a new view and insert an Active area into it.
132
Active Area
4. Now whenever a user clicks in the alarm table, the function you have defined will
be called. You can retrieve the row and column on which the user has clicked
133
Active Area
(variable arguments[1] is the row number and variable arguments[2] is the column
number). In addition, you will get all values in the selected row; they are in the
variable arguments[0].
http://nsa.myscada.org/projects/example/Row_Click_CallBack_Alarms_Histor
y.mep
134
Active Area
Show Top Toolbar check box allows you to show or hide the top toolbar with filters
and advanced trend settings.
Show Bottom Toolbar check box allows you to show or hide the bottom toolbar
(e.g., the date selection controls).
Filters allow you to set a time range for the advanced trend shown. You can specify
Time From value (in UNIX UTC time; e.g. seconds since the year 1970), Time To value,
or Time Scale value. You can use constants, or you can use tags from PLCs or
variables from View Scripts.
If you use variables or tags in the bellow fields, you can change the time interval
of the advanced trend dynamically.
Time Scale [min] parameter specifies the time interval that will be shown by the
Advanced Trend. Units are minutes.
Background Color can be set to transparent or to a concrete color. If you set this
parameter to color, you can specify the color that will be shown as the background.
Row Click Callback is a neat feature. When a user selects a row in a table, you will get a
callback in the specified JavaScript function. This function must be defined in View
Script.
135
Active Area
Showing Trend in active area with time interval specified by the user
This example demonstrates how to use the dynamic filters in Advanced trend shown in an
active area. The goal is to create the simple view with Advanced Trend shown. Users can
specify the interval shown by the Advanced Trend using multiple buttons.
136
Active Area
137
Active Area
3. Now open View Scripts and create the following variables:
dateFrom
dateTo
4. Each button will set the corresponding variable dateFrom and dateTo to specify the
Advanced trend interval.
138
Active Area
6. The Filter will be set as follows:
7. Now when the user clicks on the button, the new time interval is shown in the
Advanced trend.
http://nsa.myscada.org/projects/example/Trend_active_area_with_time_interval.me
p
139
Active Area
Data-log View type
You can show data-log view, as defined in the Data-log section. The size of the data-log
view will be automatically adjusted to the size of the active area.
Show Top Toolbar check box allows you to show or hide the top toolbar with filters
and data-log view settings.
Show Bottom Toolbar check box allows you to show or hide the bottom toolbar
(e.g. the date selection controls).
Filters allow you to limit the data shown by time, number of records, or by
parameters.
140
Active Area
Time filter allows you to set time ranges for records shown. You can specify a Time
From value (in UNIX UTC time; e.g. seconds since the year 1970), Time To value, or
Time Scale value. You can use constants, or you can use tags from PLCs or variables
from View Scripts.
1. Using constants: just write the value in seconds in the text field
2. Using Tag: enter the tag value or use “…” button to specify a tag.
3. Using Variable: enter an = followed by the variable name.
Row Filter limits the total number of records shown. Again, you can use constants,
or you can use tags from PLCs or variables from View Scripts.
Key Filter can limit the data shown by specifying filters for data items. Keys must be
enabled in data-log definition to show up in the filter. For each defined key, you can
specify the value. To specify a value, you can use constants, or you can use tags from
PLCs or variables from View Scripts.
Time Scale [min] parameter specifies the time interval that will be shown by the
Advanced Trend. Units are minutes.
Background Color can be set to transparent or to a specific color. If you set this
parameter to color, you can specify which color will be shown as the background.
Row Click Callback is a neat feature: when a user selects a row in a table, you will
get a callback in the specified JavaScript function. This function must be defined in
View Script.
142
Active Area
143
Active Area
4. Set up data filter as follows:
144
Active Area
DOWNLOAD DEMO PROJECT HERE:
ftp://nsa.myscada.org/history/projects/example/Showing_filtered_data_log_data.me
p
Show Top Toolbar check box allows you to show or hide the top toolbar with filters.
Show Bottom Toolbar check box allows you to show or hide the bottom toolbar
(e.g. the date selection controls).
Time Scale [min] parameter specifies the time interval that will be shown in the
alarm history table. Units are minutes.
Background Color can be set to transparent or to color. If you set this parameter to
color, you can specify which color will be shown as the background.
Row Click Callback is a neat feature: when a user selects a row in a table, you will
get a callback in the specified JavaScript function. This function must be defined in
View Script.
SQL Table
The SQL Table feature allows you to show values from the SQL database in a table. To get
data from the database, specify your connection first. In the connection settings, you can
modify the SQL selection to suit your requirements.
145
Active Area
TIP: You can create a new SQL connection specifically for use with this table.
Parameters:
Once is your connection set up, you can use parameters to modify your SQL query.
In the Parameters, you can put multiple parameters. Each parameter can be a constant or
you can use tag or variable from View Scripts.
using constants: just write the value into the text field
using Tag: enter the tag value or use the “…” button to specify a tag.
using Variable: enter an = followed by the variable name.
Connections:
By passing the connection parameters, you can override the connection that will be used
to show the SQL table. This option is especially useful if you are working with parametric
views. To set your connection parameters, click on the “…” button next to the Connections
field.
Show Header
This option enables you to show the header row. If you select this option, you can fine-tune
the parameters by pressing the “Customize” button.
146
Active Area
The default option is “Columns from SQL.” If you use this option, your table will show a top
row with a description of columns taken directly from the SQL.
You can also set custom columns to set up names of columns manually. In addition, with
this option, you can specify the Width of the column in pixels. If you leave with=-1, column
width will be set to auto-scale. The final option is Alignment, where you can specify
whether a given column should be aligned on the left, right, or in the center.
Background Color
The background Color can be set to transparent or to a given color. If you set this
parameter to color, you can specify which color will be shown as the background.
Modifying Query
Specifying parameters enables mySCADA to modify an SQL query and insert the specified
parameters into the SQL query during communication. To do so:
1. Create a connection to be used with the SQL Table. Put $1$, $2$, … into the SQL
query whenever you want to replace the parameter.
147
Active Area
2. Now set up Parameters and pass those parameters to the query.
3. When mySCADA processes the SQL Query, it will replace $1$ for valve1 and $2$ for
the value of the variable dateFrom.
148
Active Area
Example:
Let’s say you need to read data from a database in a given time interval. The time range is
specified by the View Script variables timeFrom and timeTo. The SQL command could
look like this:
149
Active Area
2. Now create a new view. Insert it into the active area.
4. Now open the view script and create two variables dateFrom and dateTo:
5. Create a set command for the dateFrom and dateTo buttons. We will set the date
into the view script variables dateFrom and dateTo:
150
Active Area
6. Now use the show buttons to open SQL table into Active Area:
As you can see, we are using two parameters that are automatically placed into SQL
before the readout.
151
Active Area
9.3 External Web Page in Active Area
To show an external web page in the active area, select HTML -> External. Enter the HTML
address you want to open in the Link field.
152
Active Area
Select HTML -> Div Element. Fill in the ID of your DIV (active area) component. With this ID
you can access your component in the View Scripts using the function
document.getElementById ("ID").
Example:
In the following example, we will use the Active Area to display a Google map. First of all,
create a view and insert it into the active area. Then set the type to HTML -> Div Element in
the Init Value. Type in ‘googlemap’ into the ID type field.
Now all we need to do is to initialize the DIV element with Google maps. This can be done
in View Scripts. Open the view script and enter the code for initialization into the Init
function field.
153
Active Area
1) This part dynamically loads external JavaScript from the Internet - in our case Google
map API:
var script = document.createElement('script'); //create script element
script.src =
"http://maps.google.com/maps/api/js?sensor=true&callback=gmap_
draw"; //url to the script
document.head.appendChild(script); //load and append js
2) This piece of code will find our DIV element (e.g. Active area) with googlemap id
document.getElementById("googlemap")
154
Active Area
ftp://nsa.myscada.org/history/projects/example/DIV_Google_maps.mep
155
10 Layout Views
Note: You can create new layouts at any time during the creation of your project.
You can see all the options that your layout can have in the following picture:
Header top section that can be used, for example, to display a logo, name,
logged user, main menu, etc.
Main Content section displaying your views; it sits prominently in the middle of the
page
Left/Right Sidebar columns on both sides of the main content section; useful for
displaying additional menus, pictures, etc. or can be used for control
156
Layout Views
buttons and gauges. Sidebars can be visible or shown upon user action.
Note: To use the Layouts, first you have to create Layout Views. The Layout Views behave
exactly the same as regular views; therefore, you can apply any functionality to them, such
as animations, effects, or view scripts.
157
Layout Views
For each section, you can select a corresponding Layout View. After you have selected a
required view, do not forget to check the Enabled box to activate it.
Overlay Section
In this section, you can put one or more layout views above existing ones. This can be
useful for showing messages or images tied to a visibility animation – instead of copying
158
Layout Views
these messages or images into all views, you just add them to a layout view and use it as
an overlay for all of the views.
159
Layout Views
2. Create a horizontal view in Layout views; it will be used for our top menu. Now add
buttons “View1.” “View2,” and “Overlay.”
3. On the button “View1” add the open action to open view1. Do the same for the other
button.
4. Now create the left side view in Layout Views. Again, add two buttons to it. Create
them the same way as you did in the menu view.
5. Now create the overlay view in Layout Views. Make it the same resolution as your
views. Add a text message to this view. Set the visibility animation for the text
message.
160
Layout Views
6. Now create your layout. For the top section, select the menu view. For the left
section, select the left side view and check the sliding check box to add the overlay
menu.
161
Layout Views
ftp://nsa.myscada.org/history/projects/example/Layout_view.mep
162
11 Entering Tags and Math
Expressions
11.1 Entering Tags
Before linking your visualizations with PLCs, first, you have to enter the name or address of
the tags from which you wish to read/write data.
The tag syntax depends on the PLC type that you want to access.
Note: You don’t need to enter full tag syntaxes all the time. Instead, you can use a
simplified link to your tag, called an Alias. The Aliases can be defined in the Tag Database.
You can type the tag directly into the tag edit field:
You can call the tag editor by clicking on the ... button on the right side of the tag edit field
- a new dialog window will show up:
163
The Tag Dialog will guide you through entering your tag and will check if the syntax is
correct.
You can also choose your tag directly from the tag database. To do so, please click on the
Tag database. The dialog will present you with all the tags entered in the tag database.
On the left side of the dialog, you can select connection. After you select it, you can select
a tag on the right side of the window.
In the equations you can use operators + - * / and common mathematical functions such
as sin, cos, exp, etc... You can also do a binary comparison and much more. To get the
complete list of options, call the Tag Dialog and click on the tab Equation.
164
Entering Tags and Math Expressions
Example:
|| or ∨ l_or logical or
! or ¬ l_not logical not
Degree operator °
The degree operator (°) is very useful when converting user input. Because all of the
trigonometric functions require their parameters to be in radians, the degree operator will
convert its operand into radians. Thus, 45° is equivalent to dtor(45).
Percentage sign %
10 % 3 ... evaluates to 1 (the remainder after 10 is divided by 3); however, if you flip the
switch to make the % sign stand for percentage, then it becomes:
250 + 10%
By default, the percentage sign % is usually shorthand for "/100". In other words, 42%
becomes 42/100 or 0.42.
However, if the % term on the right-hand side of subtraction or addition (such as in "250 +
10%"), then the percent is evaluated as a percentage of the left-hand side (i.e. "250 plus
10% of 250").
If you choose to interpret the percent sign as the modulo operator, you can still request a
percentage by using the function name directly:
Differentiating between factorial (!) and logical NOT (!) is more difficult.
Supported Functions
phi() - returns the value of ϕ (the Golden Ratio), also recognized as ϕ()
pi() - returns the value of π. Also recognized as π()
pi_2() - returns the value of π/2
pi_4() - returns the value of π/4
tau() - returns the value of . Also recognized as ()
sqrt2() - returns the value of the square root of 2
e() - returns the value of e
log2e() - returns the value of the log base 2 of e
log10e() - returns the value of the log base 10 of e
167
Entering Tags and Math Expressions
ln2() - returns the value of the log base e of 2
ln10() - returns the value of the log base e of 10
The parentheses are used for grouping sub-expressions and setting the order of execution,
and they can be nested to any depth. All computation is carried out with a double
precision floating point. In the case of error, the editor shows a warning, and the error
expressions will not be evaluated.
You can always check the validity of the entered expression Clicking on the Test button.
sin(adr(N100:0))+cos(adr(F30:10))
median(adr(N100:0),adr(F30:10),adr(N20:5),adr(F10:10))
Note: Multiple arguments should be separated with commas 2>=1. Logical operations
always return binary result (0 or 1).
168
12 Tag Database
This feature is very useful for management of all tags and connections. You can start
creating your project by creating the tag database and then design the visualizations
afterward.
169
3. Equation – you can apply a mathematical equation for more complex situations
Scaling tags
To scale a tag, please fill in the equation in the dialog. You can multiply the tag by a
constant, divide it, and set the offset. The equation is as follows:
Applying equation
To apply the equation to your tag, select the Equation tag. Here you can use
multiple mathematical operations in your formula. The tag value should be inserted
into the equation as the word tag. The following dialog shows how to compute the
sinus value of the tag multiplied by 10.
1. Select your tag in the tag database and click on the Eng. Units cell
170
Tag Database
3. Now your value will be automatically scaled by 10. So if you will read, for example,
the value 235, it will be represented as 23.5
The connection filter lists all connections in your project. You can specify which
connections you want to see in the table.
171
Tag Database
Data filters allow for even more precise data filtering. You can filter based on any column
in the tag database table. Just enter the expression into the Filter at the given column. You
will see immediately filtered data in the table.
172
Tag Database
main toolbar:
Select a file for import and confirm. The MS Excel file should have all tags in the first sheet
in a plain table. The table should have columns with the following names:
173
Tag Database
Alias Tag@Conn/*Alias Description Unit Format Eng. Unit
Once you import the tags, myDESIGNER will go over your existing tag database. If you
import a tag with the same alias as one that is already in the tag database, it will be
overwritten.
1. Export tags from RSLogix/Studio 5000. To do so, Select Tools and Export:
2. Click on the Import button in the Tag Database window. Select Rockwell
Automation import.
3. In the following dialog, select the .csv file you exported in step 1. In addition, choose
the connection you wish to associate the imported tags with:
174
Tag Database
4. A new dialog showing all the tags you can import is shown:
TIP: In the dialog, you can select multiple rows/tags; click on Change Selected to
select them.
175
Tag Database
Step One: Exporting From TIA Portal
First of all, to be able to export variables defined as "Program blocks," you need to
configure DB as "Not optimized." To check or change DB optimization, you need to
enter DB Properties:
176
Tag Database
Then in General > Attributes uncheck "Optimized block access" as shown below:
If checkbox "optimized block access" is grayed out, the given DB is an "instance DB"
linked to an "optimized access FB."
Now, before exporting tags, you need to compile your project to ensure that the TIA
Portal calculates tags offsets:
Exporting DB tags
For every Program block, you need to perform the following steps:
Double click on the DB name:
177
Tag Database
Then highlight all row in this view (for example, using CTRL + A) and copy to
clipboard:
178
Tag Database
Now open an empty text file (with notepad, for example) and paste the content.
Now save the file as "DBxxx.tia" where xxx is the number of DB.
Important: Make sure your file is saved with extension .tia otherwise it might not be
visible for import.
Repeat the above steps for all defined program blocks. For each DB, a new ".tia" file
must be created.
179
Tag Database
How to export PLC tags
2. Then click on the "Export" icon and browse for path file:
3. Define the file name for export and confirm with "Save"
180
Tag Database
2. Now select the directory where your exported files are located.
181
Tag Database
3. After selection of the directory, click on Import. myDESIGNER will scan all files
in the provided directory. It will process all .xlsx files for Program tags imports and
all .tia files for DB tags imports. You will be presented with a table of tags to import:
TIP: In the dialog, you can select multiple rows/tags and click on Change Selected
to select them.
All tags with reference count = 0 (e.g. not used) will be removed.
182
Tag Database
12.8 Restoring tag database
In rare cases, the tag database can become corrupted. If you experience strange behavior
when dealing with tags, you can regenerate the tag database. To do so, you have two
options:
Add Project Tags: will scan your project and add all tags that are missing from the
tag database.
Clean and Add Project Tags: will delete all tags from the tag database, then it will
scan your project and add all tags that are missing to the tag database.
Note: Instead of writing ‘mytag@PLC’ you can use the alias ‘motorName_A1’ anytime.
Click on OK to confirm adding the tag to the database. Once the tag is created, you can
use its Alias as a reference.
183
13 Formatting Numerical values
Numerical values can be formatted according to a specified format. To specify a format,
please use # as a formatter.
The following table will show you how values will be formatted according to a specified
formatter. Value 23.89323232 will be formatted as follows:
Formatter Result
# 23
### 023
#.# 23.9
##.## 23.89
###.## 023.89
184
14 Linking Views with PLC
14.1 Introduction
There are two options to link your visualization with the PLC:
Animations
With animations, you link the visual appearance of graphic objects with real values read
from the PLC. The visual change is reflected immediately, e.g. you can show PLC
tag/variable values in a text element, change the fill and stroke color of an object, etc.
Effects
With effects, you add dynamic effects to graphic objects. An effect is the visual appearance
of an object in a specified time sequence and can be triggered either by a tag/variable
from the PLC or by a user’s action, i.e., finger tap or mouse click.
Imagine you want to display a blinking motor on your visualization if the tag/variable read
from the PLC is equal to 1.
1) Set the Blinking effect on the motor by specifying the blinking speed and infinite
repeat. This way the motor will be blinking as long as the tag read from the PLC is
equal to 1.
2) If you use the Color animation instead, the motor will change its color if the value read
from the PLC equals 1 and return back to normal when the value is 0.
14.2 Animations
If you select an object and navigate to the Anim section in the Properties window, you will
find all available animations for that object.
185
Linking Views with PLC
In the Type section, you can select how the data will be displayed. There are three options:
Value
String
Date
Value
Value shows the read PLC values in the Decimal, Hexadecimal, Octal, and Binary
numerical systems.
186
Linking Views with PLC
By default, Value type shows values in Decimal format. If you are showing a floating-point
number, you can specify how the value will be presented by using formatting. For more
info about formatting, please see Formatting Numerical values.
String type
String type reads string data type from the PLC and shows the resulting value as a string.
You can specify special conditions such as maximum string length or string type.
Automatic
The PLC type used in the tag definition selects the string type automatically. You need
to specify only the maximum string length.
EtherNet/IP
Rockwell family string type. The string is automatically encoded according to the RA
standard. Please specify the maximum length of the string. The provided maximum
length must not be longer than the definition in PLC.
Siemens - Siemens family string. Please specify the maximum length of the string. The
provided maximum length must not be longer than the definition in PLC.
187
Linking Views with PLC
General - User defined. You have complete control of converting a PLC data array into
a string. First of all, you should specify the maximum length of the string. The provided
maximum length must not be longer than the definition in PLC. Then you can specify
which character terminates the string or specify at which position the length of the
string is encoded.
Modbus – Modbus protocol definition does not define the string type. Most of the PLC
makers, however, allow the use of the string in Modbus protocol by providing the
values in an array. As there is no given standard for use in Modbus protocol, the user
has complete control over how the string is defined. It allows you to convert a PLC
data array into a string. First of all, you should specify the maximum length of the
string. The provided maximum length must not be longer than the definition in PLC.
Then you can specify which character terminates the string or specify at which
position the length of the string is encoded. If your PLC encodes two characters into
one register, please choose 8-bit characters; otherwise, choose 16-bit characters.
OPC – OPC UA family string. The OPC has defined a standard for reading strings. Please
specify the maximum length of the string. The provided maximum length must not be
longer than the definition in OPC UA server.
188
Linking Views with PLC
Date type
Date type enables you to read date value from the PLC and convert it to the date.
mySCADA assumes the date is in unix time – the number of seconds since 1 January 1970.
You can choose to show only date, only time, or both date and time.
1) Let’s assume there are three tags in ControlLogix PLC, representing the water levels –
level1, level2, and level3.
2) Create the text elements for these three water levels using the Create Text Element
tool .
3) Continue adding the text elements responsible for reading values from the PLC. This
process is exactly the same as creating the text elements. The text written in the text
element specifies how the value read from the PLC will be formatted on the screen.
The format specification is described in the following figure:
189
Linking Views with PLC
Note: Any value received from the PLC that does not follow the format specification will be
automatically transformed to a set format. For example, if the PLC returns a value of 3.47
and the visualization expects only one decimal place with the format (##.#), then the
number displayed will be rounded to one decimal place, showing the value of 3.5.
Click on the text element that should be animated, according to the data received
from the PLC. You will see the animations properties in the Properties window. Select
the Anim tab in the Show Value animation section; enter the specific tag
address from which the text element will read.
Note: If the entered tag address is invalid, the text will be marked in red.
You can also combine a static text element with PLC values.
5) Upload the view to your supported device - the screen should look like the following:
In the example above, we have used the tags from ControlLogix. You can generally use the
tags for all supported PLCs, as long as you use the proper syntax (for a brief description of
proper tag syntax, see the chapter Basic Tag Syntax).
190
Linking Views with PLC
14.4 Value to Text Mapping Animation
This animation converts numerical values from the PLC into text values. The tag value is
automatically converted to the string based on the definition table:
To animate visibility based on the discrete (Boolean) value, set both Min and Max to 1; this
way the object will become visible when the tag value equals 1 (TRUE).
191
Linking Views with PLC
Example:
1) Click on the object that you want to animate (this will prompt the properties in the
Anim tab of the Properties window) and navigate to the Visibility section.
2) Set the Tag (Address) and the Minimum and Maximum; if the tag value is within this
range, the object will be visible, otherwise, it will be hidden.
192
Linking Views with PLC
To animate colors based on a discrete (Boolean) value, set Min and Max to 1. This way, an
object will change its color when the linked tag value is equal to 1 (TRUE).
Example:
1) Select the object you want to animate and click on the Color tab in the Anim section
in the Properties window and then click on the … button.
2) You will see a new dialog window; click on Add and fill in the Tag, Min, and Max values.
You can define multiple conditions. If the tag value is 0, the object will be red; if the
value is 1, it will be black. Click on OK to confirm.
193
Linking Views with PLC
Specifying the Fill and Stroke.
For each condition (item in the table), you can specify if the condition applies to fill, stroke,
or both.
1) Create an object and a path to move this object along. To add the Move animation,
select the object and click on the Active button in the Move animation tab of the
Properties window, as indicated in the picture below:
2) Fill the tag address in the dialog window and select one of the available paths.
Start by filling the Tag, Min, and Max values. Then fill in the length of the movement in
pixels. If you would like to reverse the movement, check the Reverse check box.
Note: A typical use of the Move animation might be moving goods on a conveyor belt, etc.
195
Linking Views with PLC
1) Select the object you want to animate; navigate to the Properties window, Anim tab,
and section Scale.
Horizontal
Vertical
Both
If you want to change the orientation of the movement, simply rotate the object by 180
degrees. You can do so by right clicking on the object and selecting rotate -> by a 180-
degree angle
196
Linking Views with PLC
197
Linking Views with PLC
14.10 Scale Animation
This animation type is used to scale an object, corresponding to the entered value.
1) Select the object you want to animate; navigate to the Properties window, Anim
tab, and section Scale.
2) Set the tag, Min, and Max limits; percentage of scaling; and the reference point.
If the tag value is at its minimum value, the object will be scaled to the defined scaled
minimum. When the tag value is at its maximum value, the object will be scaled to the
defined scaled maximum.
198
Linking Views with PLC
Enter the tag name and the minimum tag value, which correlates to the 0th degree, and
then enter the maximum tag value, which correlates to the 360th degree.
By default, the axis of rotation is set in the geometric center of an object or a group. You
can change the rotation axis by double-clicking on the object and setting its axis, which is
marked as a blue dot. Move the selected point to the desired position, as shown in the
picture below:
Go to the Rotate section of the Anim tab in the Properties window and fill in the Tag
(Address), Minimum, and Maximum values.
Center Offset X (Y) shows the difference between the custom and geometric rotation
center.
Center X (Y) shows the absolute coordinates of the selected rotation center.
Range property defines the total revolution angle, which is 360 degrees by default.
199
Linking Views with PLC
14.12 Circular Sector Animation
This animation is applicable to circular objects. This animation creates a circular
intersection on circles and ellipses.
1. Select a circle or ellipse and navigate to the Anim -> Circular Sector
2. Fill in the Tag, Minimum, and Maximum values
3. Specify Angle From and Angle To values
When the tag value is equal to the specified minimum, the object will be invisible, as the
angle of the circular section will be equal to 0. As the tag value increases, the circular
section will grow from the specified Angle From up to the Angle To. When the tag value is
equal to the specified maximum, the circular sector will be between the Angle From and
Angle To values.
Other parameters
Reverse: reverse the orientation of the section.
Is Arc: if not selected, makes a circular section from the whole object. If selected, leaves
only the Arc from the object.
200
Linking Views with PLC
With zoom visibility animation, you can show and hide objects or even layers based on the
zoom level in runtime. This animation can be used in many scenarios. Imagine the
following situation: you would like to give your user an overview of your complete
technology, but it needs to fit on one screen. As the user zooms in, he will see more details.
You can achieve this by using zoom visibility animation.
2. Fill in the minimum zoom level where the layer will be visible; accordingly,
fill in the maximum zoom level where the Layer will be visible.
201
Linking Views with PLC
14.14 Sounds
You can create a sound animation, which will play loaded MP3 files upon notification of
non-standard situations or voice announcements. You need to import the sound files
before you start creating the Sound animation.
Sound import
1) Select the Sounds folder from the Project window and click on Import in the main
toolbar or right – click on the folder and select Import from the context menu.
2) Select the MP3 file from the available folders in the Import Sound dialog. Please note
the maximum size of the file is 3.5 MB!
202
Linking Views with PLC
Deleting Sound
If you wish to delete a sound file, select it from the Sound folder and click on the Delete
Sound icon in the toolbar or select the Delete command from the right-click menu.
203
Linking Views with PLC
2) In the dialog window you can set:
1) Select the view from the Project window in which you want to play the sounds.
2) Navigate to the Parameters section in the Properties window and click on the ‘…’
button.
204
Linking Views with PLC
3) In the dialog window, click on the button +Add to add the triggering tag, and then
select the sound file you want to play.
4) Set Severity, Repeat Count, Volume, and Min & Max tag range and click on the Set
button to confirm.
14.16 Effects
With effects, you can add dynamic effects to your graphic objects, as described
in the previous chapter (see the difference between Animations and Effects).
205
Linking Views with PLC
Effects make the graphic visualization less static, and their function is similar to
animations. However, they do not reflect the real state of a technological process. We
advise using the animations for visualization of a precious technology state and use the
effects to visualize the real-time change of objects.
The states of objects during animating are based on actual values obtained from the PLC.
For example, the motor rotation visualized through the Animations behaves according to
the values obtained from the PLC, but the rotation visualized with the Effects is based on
the values set by you and will use the “hard” data only as a trigger.
1) Select the object you want to set effects on and click on the Effects button in the GUI
toolbar.
206
Linking Views with PLC
This window has two sections:
Default – here you can find useful effects provided by mySCADA Team
Custom – here you can create your own effects or modify default ones
Effects are grouped together into categories. When you open the effects window, you are presented
with the selection of those categories. Click on a corresponding category to see all effects under this
category.
Selecting an effect.
To select an effect, simply click on it. When you click on effect, it is highlighted and you
are presented with effects’ properties on the right side of the effects window:
207
Linking Views with PLC
Effects’ Properties:
Effect name:
Each effect has its own name; you can change the name of an effect by double clicking on
the effect icon.
Timing:
208
Linking Views with PLC
Preserve attributes after the finish: when the effect ends, all attributes changed are reverted
to the original state as it was before the effect started. If you would like to preserve
attribute changes after the end of the effect, check this option.
Property changes
The mySCADA effects engine enables you to animate different properties for any element.
You can change, for example, color, size, move element, and much more. The properties
table shows you which properties will be modified when the effect is run.
This properties table has just one section and one property change. When this effect is run,
it will change the element color to red.
You can change multiple properties at once, or you can change different properties during
a time. For example, you can create multiple entries per section (Duration), and you can
have multiple sections. The following properties table will show how to change multiple
properties at once and have multiple sections.
In this example, the fill and stroke color of output elements will be changed to red and
yellow. The change will take time in first half of time (Specified by Duration 50.0 %). Then,
the element will start to rotate and will rotate by 90 degrees. At the end of the effect, the
209
Linking Views with PLC
element will disappear; this is due to the “Reset” section where we have specified opacity =
0.0.
To modify a property, double click on it. The Modify Property Dialog will be shown:
If you wish to modify a Time Section (Duration), double click on Duration label; a new
Modify Duration Dialog will be shown:
Modify parameters:
Time: this is the duration of the time section shown as a percentage. If you specify
the overall time of effect to be 1000 milliseconds and then set the time duration to
20 %, the animated change will take exactly 200 milliseconds.
Easing: specifies the rate of change of a parameter over time. You can choose from
several easing functions. To see them all, click on the ? button next to the easing
combo box.
To add a new property or section, click on Add Button, and a new dialog will be shown:
210
Linking Views with PLC
Select a property you would like to add and set its value.
If you would like to create a new Time Section (Duration), check “Add New Time Group,”
and additional properties will be shown:
Time: this is the duration of the time section shown as a percentage. For example, if
you specify the overall time of effect to be 1000 milliseconds and then set time
duration to 20 %, the animated change will take exactly 200 milliseconds.
Easing: specifies the rate of change of a parameter over time. You can choose from
several easing functions. To see them all, click on the ? button next to the easing
combo box.
If you would like to create a Finish Time Section, check the appropriate checkbox:
The Finish section is useful if you would like to set some properties for a given value at the
animation end. If you use the Finish section, you should check “Preserve attributes after
finish”.
211
Linking Views with PLC
Trigger
A trigger specifies how an effect will be started.
If you select Tag or Tag Trigger from the trigger menu, set the tag address and the range of
the Min and Max values.
212
Linking Views with PLC
Inputs
The Inputs section specifies the elements that trigger the effect action. If you, for example,
set the action to on Click and then specify multiple Input elements, any of them will act as
a trigger effect when a user clicks it.
The “+” and “-” buttons allow you to add or remove Input elements from the list.
Outputs
The Outputs section specifies the action elements to which the effect is applied. Usually,
you want to apply an effect to the same element you have for the action trigger. In this
case, you can leave the default settings as “ThisElement.” If you want to have different or
multiple elements, use the “+” and “-“ buttons to select the corresponding elements.
Saving Effect
If you have modified effect properties and would like to save them for later use, press the
“Save” button.
Applying Effect
If you would like to set/apply an effect, press the “Apply” button.
213
15 Time Sequence
Time Sequence is an easy to use and extremely powerful function that adds timed
animations to the views. The Time Sequence editor is part of the GUI editor and allows you
to change graphic properties of your objects for specified time intervals. myDESIGNER
automatically computes the transitions between these time intervals.
You can open the time sequence editor by clicking on the Time Sequence icon, located in
the GUI toolbar.
The GUI editor automatically adds the Time Sequence toolbar to the Main Window.
Creating a time-sequenced animation is very easy. You just move the time slider and
modify the graphic objects for each time position, as you want them to appear at these
time positions. The smart algorithm inside the mySCADA runtime will compute the
animation so that it is time-fluent.
214
Time Sequence
15.2 Example
2. Now you are presented with the Time Sequence Editor. All of the controls are
located in the red square.
215
Time Sequence
3. Now move the time slider to the first time point.
4. Now modify your objects in the way you want them to appear at this time point.
6. Add more time positions and save the time sequence to complete it.
216
Time Sequence
7. Now, if you play the animation, the object on the conveyor will move.
To set a trigger, select the required action in the Trigger combo box.
Trigger by Time
Trigger by time will play your time sequence after the view is shown. It can be delayed in
the Timing settings.
Trigger by Tag
If you set trigger by tag value, you should specify the tag, minimum, and maximum values.
If the tag is between the minimum and maximum values, your time sequence will be
triggered. To modify the values, please click on the Tag button:
217
Time Sequence
Once the tag value is between the specified Min and Max values, your time sequence will
start playing. It will stop after the specified time duration (see Time Settings). If you want to
stop your animation immediately after the tag is out of the Min/Max range, please check
“Stop when condition not valid:.”
1. Select all the graphical objects you want to trigger your time sequence. Now click
on the “Click” button.
218
Time Sequence
In the Time Settings dialog, you can specify the overall time duration (this is also the
reason why the time scale is shown as a percentage). You can also specify the time offset.
If the time offset is greater than 0, the time sequence will start after the specified number
of seconds. Set the repeat count to repeat the series or click on Continuous to repeat it
forever.
Tip: Use the “Continuous” option in combination with the tag triggered option “Stop when
condition not valid” to play your time sequence continuously when your tag value is within
the limits.
Preserve state on finish activated: leave all graphical objects as they were at the end of
animation
Preserve state on finish deactivated: reset your objects to the initial state (e.g. set them as
they were at the beginning of the time sequence)
219
Time Sequence
Put in a new sequence name and confirm using the Set button.
Once you change the time sequence, your view will change to the given time sequence,
and you can start editing it.
220
Time Sequence
You can modify the timing by moving these time tags to the side. You can also specify the
exact value by right clicking on the time tag. To delete the time tag, right click on it and
select Remove.
You can combine multiple time sequences. Imagine you have a production line where you
need to perform 10 different operations, and each operation must start one after another.
This can be easily achieved by combining multiple time sequences. You can simply nest
one animation after another. To do so, change the Start after option to your previous
animation.
Example:
Let’s say you need to animate three consequent operations:
1. Object moving on the belt to the desired position
2. Object being pressed
3. Object leaving
2. We will create the start sequence by creating the first time sequence.
221
Time Sequence
You can see that we have moved the time slider to the end. We have also moved
the object under the press.
222
Time Sequence
3. Now we will create the second time sequence. This one will start after the first one,
so we will set the Start after:
223
Time Sequence
In the timing settings, we have checked Preserve State on finish.
4. And now we will create the final time sequence. This one will start after our previous
one, so we will once again set the Start After:
224
Time Sequence
In the timing settings, we have disabled Preserve State on finish. This will allow our
view to return to its starting condition.
225
16 Open Command
This command is used to navigate between the HMI screens, e.g. you can open other
project views from currently open ones. In addition, you can use the open command to
change the content of the Active Area. The Open Command can be applied to any
graphical object.
Views
Parametric View
Advanced Trends
Data-log views
User actions
External web-pages
To use the open command, please navigate to Properties -> Commands and click on the
Open “…” button.
226
Key Shortcuts
227
Open Command
16.1 Open Type
Select from the available options the entity type that should be opened by the command:
View – can open a previous screen or any arbitrary view of your project
Parametric View – parametric window will be opened
Document – opens one of the project documents, Index property sets the
page number the document will open on
Advanced Trend – advanced trend will be opened
Alarms – you can choose between Online alarms or History alarms
Data-log – opens a data-log of your choice
User Actions – opens a window with the user actions manager
HTML – opens any web content you define in the dialog window
SQL Table – shows SQL table
Login/Logout – shows login dialog
16.2 Target
In Target you can specify if you wish to use the open command to replace the current
view, open content in the Popup window, or show content in the active area. The Target
option is only visible if you have Active Area in your view.
Set “This view” option to open the content in this window. Select “Active area” to set
content in the Active area with a given number.
If you wish to open content in a new popup window, click on the “…” button. You will be
presented with a new dialog to set up the parameters of the newly opened window.
228
Open Command
16.3 Popup (Face Plate) Window
Popup Windows allow you to show a new window on top of your current window. The
popup window can be useful to show multiple views at once, or you can use popup
windows as a Face Plate.
1) Click on the “…” button in the Target area to set the popup window. You will be
presented with the Popup Window Settings dialog.
Location
Location sets the location on the screen where a new window will pop-up.
Size
Size of a newly open window
Default: original size of the window. A window will be shown with the same resolution
as is defined in the designer.
Scaled: scale window to given percentage
User Defined: specify new dimensions of opened window
Resizable
If resizable is selected, the user can resize the view. Otherwise, the size will be fixed.
229
Open Command
16.4 View type
If you select this option, you can specify the view to be shown. You can display any view
you have previously designed. For best results, use a window with the same resolution or at
least the same aspect ratio as your active area.
TIP: If you specify the option “Previous View,” open command will jump back to previously
open view.
Aside from the Parametric View name, you can also specify the Indexes and Connection
indexes.
For more details on how to deal with parametric views, please see chapter Parametric
Views.
Document type
You can show a PDF document linked to the project. The PDF document will be
automatically scaled to the size of your view.
230
Open Command
Select a PDF document. You can also specify on which page to open the document.
Alarms type
This feature can show online alarms and alarm history. There are several parameters you
can use to set up the specific visual appearance of the alarm table that will be shown. You
can also limit shown data using filters.
Show Top Toolbar check box allows you to show or hide the top toolbar with filters
and alarm settings.
Show Bottom Toolbar check box allows you to show or hide the bottom toolbar
(e.g., the date selection controls).
231
Open Command
Parameters allow you to specify which columns will be visible in the alarm table. In
addition, you can set a filter for severity and text filters for the message, area, and
device.
Time Scale [min] parameter specifies the time interval that will be shown in the
alarm history table. Units are in minutes.
Background Color can be set to transparent or to a specific color. If you set this
parameter to color, you can specify which color will be shown as the background.
1. Create alarm definitions in CAS Alarm Windows. To designate which alarms belong
to the view you plan to show, specify the name of the view in the Area column.
232
Open Command
3. On the button set up an on click open command.
233
Open Command
Show Top Toolbar check box allows you to show or hide the top toolbar with filters
and advanced trend settings.
Show Bottom Toolbar check box allows you to show or hide the bottom toolbar
(e.g., the date selection controls).
Filters allow you to set a time range for the advanced trend shown. You can specify
Time From value (in UNIX UTC time; e.g. seconds since the year 1970), Time To value,
or Time Scale value. You can use constants, or you can use tags from PLCs or
variables from View Scripts.
If you use variables or tags in the bellow fields, you can change the time interval
of the advanced trend dynamically.
Time Scale [min] parameter specifies the time interval that will be shown by the
Advanced Trend. Units are minutes.
Background Color can be set to transparent or to a concrete color. If you set this
parameter to color, you can specify the color that will be shown as the
background.
234
Open Command
Show Top Toolbar check box allows you to show or hide the top toolbar with filters
and data-log view settings.
Show Bottom Toolbar check box allows you to show or hide the bottom toolbar
(e.g. the date selection controls).
Filters allow you to limit the data shown by time, number of records, or by
parameters.
235
Open Command
Time filter allows you to set time ranges for records shown. You can specify a Time
From value (in UNIX UTC time; e.g. seconds since the year 1970), Time To value, or
Time Scale value. You can use constants, or you can use tags from PLCs or variables
from View Scripts.
4. Using constants: just write the value in seconds in the text field
5. Using Tag: enter the tag value or use “…” button to specify a tag.
6. Using Variable: enter an = followed by the variable name.
Row Filter limits the total number of records shown. Again, you can use constants,
or you can use tags from PLCs or variables from View Scripts.
Key Filter can limit the data shown by specifying filters for data items. Keys must be
enabled in data-log definition to show up in the filter. For each defined key, you can
specify the value. To specify a value, you can use constants, or you can use tags from
PLCs or variables from View Scripts.
Time Scale [min] parameter specifies the time interval that will be shown by the
Advanced Trend. Units are minutes.
Background Color can be set to transparent or to a specific color. If you set this
parameter to color, you can specify which color will be shown as the background.
1. Create data-log and data-log view. In the data-log tag definition, check the Key
check box to enable filtering using this tag value.
236
Open Command
237
Open Command
ftp://nsa.myscada.org/history/projects/example/Showing_filtered_data_log_data.me
p
238
Open Command
Show Top Toolbar check box allows you to show or hide the top toolbar with filters.
Show Bottom Toolbar check box allows you to show or hide the bottom toolbar
(e.g. the date selection controls).
Time Scale [min] parameter specifies the time interval that will be shown in the
alarm history table. Units are minutes.
Background Color can be set to transparent or to color. If you set this parameter to
color, you can specify which color will be shown as the background.
239
17 Write/Set Command
There are three types of triggers available for each object, and each of them can write its
own dataset. The data can be written using the on Click, on Up, and on Down actions. The
on Up and on Down triggers are independent, so you can write two different sets of data
with one button at the same time.
To use a write/set command, please select the graphical object you want to use for the
set/write command and then navigate to Properties -> Write/Set command.
Select either the Click, on Down, or on Up command and click on the “…” button. You will
be presented with the Write/Set Settings Dialog:
240
Write/Set Command
The dialog window is split into two sections. On the left, there is a Tree View showing all of your set
commands in hierarchical order; the right section shows the parameters of the selected set
command.
241
Write/Set Command
In the batches pane, you can see all your batches listed.
A Batch is:
A collection of set commands of the same type
Processed from top to bottom
Written to the PLC with one command
Add Batch
To add a new Batch, please click on an existing batch and then click on the button “+ Add”.
Remove Batch
To remove a Batch, select it and then click on the button “- Del”. All defined set commands in that
batch will be deleted along with the batch.
242
Write/Set Command
Remove Batch Item
To remove a batch item, please select a set command in the corresponding batch and then click on
the button “- Del”.
Batch Type
Each batch can be of exactly one type. All set command in the batch must be of the same type.
Available options are:
Type Description
Tag Write values to the PLCs
Memory Set View Script variables
Script Run custom function defined in View Script
SQL Write values to the database
To specify set command parameters, first, please select the batch in the corresponding batch list.
You will see its properties in the right pane of the dialog.
Tag Type
Select a Tag Type to write values to the PLC.
Tag – you can write the tag straight into the Tag field; you can also click on the ‘…’ button
to prompt the tag database.
Connection – set connection to the PLC. Connection parameter is same for all set
commands in the batch.
Title – Set title for this set command. If you require a response from the user in the form
of dialog, the title of the dialog will be this title.
243
Write/Set Command
Use translation button to provide a translation for this set command.
Lock Enable – check this option if you want to use On Touch Lock for this element.
Log – check this check box to log this user action. The user action will be logged with the
provided message.
Memory Type
Select a Memory Type to set View Script Variables.
Title – Set title for this set command. If you require a response from the user in the form
of dialog, the title of the dialog will be this title.
Lock Enable – check this option if you want to use On Touch Lock for this element.
Log – set this check box to log this user action. The user action will be logged with the
provided message.
SQL Type
Select SQL to write values to the database:
244
Write/Set Command
Connection – set connection to the database. Connection parameters are the same for
all set commands in the batch.
SQL – specify SQL that will be used to write values to the PLC. The SQL parameter is the
same for all set commands in the batch. When the batch is processed, all values from the
batch are inserted into the specified SQL. The top set command in the batch will replace
#1# keyword in the SQL; the second set command in the batch will replace #2# keyword,
and so on.
Title – Set title for this set command. If you require a response from the user in the form
of dialog, the title of the dialog will be this title.
Lock Enable – check this option if you want to use On Touch Lock for this element.
Log – check this check box to log this user action. The user action will be logged with the
provided message.
2. In your view, navigate to the button element and in Properties -> Commands,
select Write/Set Command.
245
Write/Set Command
3. Now in the set dialog, create two items in one batch like in the following picture:
4. Now test your project. If you click on the button, the user will be asked twice to
enter the value. Once the user has entered both values, mySCADA will execute the
SQL. #1# will be replaced with the first value; #2# will be replaced with the second
value.
Script Type
This very useful feature allows you to oversee, set up, and enrich the whole Write/Set
command functionality from the scripting level (i.e. you can freely create and add your
own new arbitrary functionalities). When the set command is processed, the
corresponding View Script is called.
246
Write/Set Command
For a detailed description of how View Scripts work, please see section View Scripts.
Please specify a value to send to PLC. It can be any numeric value (integer or
floating point). If you check the Prompt option, the user will be presented with a
confirmation dialog. The value will be written only after the confirmation.
247
Write/Set Command
variables.
If you check the Prompt option, the user will be presented with a confirmation
dialog. The value will be written only after the confirmation.
Numeric – prompts a dialog in the visualization where the user can enter any numeric
value.
There are options to treat such dialogs as password input (hiding input values)
and to set the allowed range of inputs with Min and Max limits and a number
with decimal places. You can choose from four numeral systems:
248
Write/Set Command
If you select the Cycle option, the increasing / decreasing process will repeat. If
the value goes over the Maximum value, it will automatically change to the
minimum value. If the value goes below the Minimum value, it will
automatically change to the maximum value.
If you check the Prompt option, the user will be presented with a confirmation
dialog. The value will be written only after the confirmation.
String – prompts a dialog in the visualization where the user can enter any string value
with other options such as password input (for hiding input values) and sets an
allowed number of characters with Min and Max limits; predefined text can also
be set with the Predef. Text option. You can also provide a translation of the
predefined text by clicking on the translation button next to the text entry.
249
Write/Set Command
Slider – prompts a dialog in the visualization where the user can select any numeric value
with a slider; additional options allow setting Min and Max outer slider value limits and the
number of decimal places with Dec. Places
250
Write/Set Command
Slider set dialog:
Multiple Choice – prompts a dialog in the visualization where the user can select one
of the predefined values, which should be entered as tag value/text
pairs during the animation setting
251
Write/Set Command
Date – with this feature you can write the current date, time value, or both (date + time)
in the visualization
252
18 Scaling Set Values
The Numeric and Slider options have both settable scale and offset values being sent to
the PLC.
Usage is quite straightforward: imagine you want the user to enter a value by percent, e.g.
between 0 and 100, but you need to have the value written to the PLC as a floating-point
value in the range 0 to 1. In this case, you would set the scale as follows:
The resulting value will be multiplied by 3 and increased by 33 before writing to the PLC as
a result of the Scale/Offset addition.
253
Key Shortcuts
Additionally, you can add a Title text, which will display during visualization in the dialog
window when using the Write/Set command. If you want no confirmation message to be
displayed upon the write action, unselect this field.
If you want to log the write command into the data-log, check the Log check box and fill
in the message field.
254
19 Key Shortcuts
This feature is a very useful part of the Commands and allows you to prompt certain
functions using set key shortcuts. On the key press, you can define write/set command or
open command. This way, you can change values in the PLC or open another view, just
using a simple press of a button.
1) Select the view you want to apply the shortcuts to and navigate to the section
Parameters in the Properties window.
2) Click on the ‘…’ icon to open the settings dialog window where you can set arbitrary
key shortcut combinations and assign the commands to them.
255
Key Shortcuts
3) Click on the Add button and select the functional keys you want to use for the
shortcut (Shift, Ctrl, Alt etc.), then click the Key box (or click on the ‘KBE’ button) and
press any arbitrary key on the keyboard (letters or numbers).
4) Now select the type of command the shortcut should prompt (Open or Write/Set) by
clicking on Set and set the properties of the command in the dialog window as
described earlier.
256
20 On Touch
This function brings user interactivity to your elements. It can change the object properties
like fill and stroke color or visibility when you touch / release the element in the run-time.
You can create interactive buttons where the user is notified of the press by a color
change. In addition, you can create more complex scenarios like showing/hiding an object
border and shadow when touched.
257
On Touch
In this dialog, you can add multiple graphical objects and change their properties. To do
so, click on the “+ Add” button. A new entry will be created. Please now look at the Settings
section on the right side of the dialog:
The first option is the “Target ID”. The target ID specifies which graphical object you wish to
apply settings to during the touch event. If you want to apply settings to the same
element as your graphical object, please leave the option This Element.
Next, parameters control visibility, Fill, and Stroke color of the given object.
As you can see, you can create a simple scenario like changing the fill color of an object
during a touch event, or you can create a complex scenario involving multiple different
objects.
To use On Touch animation in Component, please click on the component and navigate
to the Properties -> Commands. Now click on the On Touch “…” button. You will be
presented with the settings dialog:
258
On Touch
TIP: If you want to modify multiple elements during the On Touch action, simply set the
On Touch parameters for each of them.
The following Example will show you how to create a button component with an On
Touch action.
1. Create a new component and enter edit mode. If you don’t know how to create
components, please read the section Components first.
2. Now create a rectangle and put the text “Press me” over it.
3. Select the rectangle and click on Properties -> Commands -> On Touch
259
On Touch
When a user presses the button, its color will change to green
When the user releases the button, the color will return back to normal.
260
On Touch
If you want to apply this function, select the object you want to set as a lock, navigate to
the Commands tab of the Properties window, and check the box in the Lock section.
261
On Touch
Once you have set up your Lock element, you can use it anywhere in the Write/Set
Command. Simply apply the Write/Set Command to any element and check the “” check
box.
Example
In the following example, we will create a simple view with a lock element and a button.
The button will be enabled only if the user presses and holds the lock element
simultaneously.
1. Create a new view and insert the Lock icon and a button. You can also insert an
indicator to see if your button is working
262
On Touch
263
On Touch
3. Now navigate to the Write/Set command and create a toggle action. Check the
“Lock Enable” check box.
4. Now when you open your view, you will be able to press the button only if you
simultaneously press the Lock icon.
ftp://nsa.myscada.org/history/projects/example/LockEnable.mep
To enable this feature, please navigate to your view in the Project tree and press the Lock
Key in the Properties window.
264
On Touch
You will be presented with a new dialog window where you can register your Lock Key:
Now press the “KBE” button to register your new Lock Key. Now press the key you would
like to use as your Lock Key. Your new Lock Key is registered.
Once your Lock Key is registered, you can work with your Write/Set commands. The usage
is the same as described in the previous section.
265
On Touch
DOWNLOAD DEMO PROJECT HERE:
ftp://nsa.myscada.org/history/projects/example/LockEnable.mep
The right button will be unlocked by pressing and holding the space button.
20.6 Slider
This is another possibility for writing arbitrary values to the PLC. You can create a slider
control, enabling the user to move the slider and write values to the PLC. The slider can be
a simple object as shown below, or it can be a complex scenario like moving items on a
conveyor. Any graphical object on your screen can act as a slider.
To activate this control, select your graphical item, navigate to the Write/Set command
options in the Properties window, and select Slider.
266
On Touch
Tag – either manually or from the tag database by clicking on the ‘…’ button.
Type – you can choose the orientation of the slider from Left to Right, Top to Bottom,
or vice versa
267
On Touch
268
21 Parametric Views
Instead of designing multiple similar visualizations of multiple field technology that
differentiates only in operational parameters and not in appearance, you can use one
master view that is common for all. You can set and use operational parameters to link
the views with specific pieces of technology.
To create a Parametric View, click on the views in the Project tree and then click on the
New Window icon in the main toolbar. Then, when naming the view, check the
“Parametric” check box.
Click the “Add” button. Now your view is created. Once you have created your view, you
can use symbolic access instead of absolute addresses.
269
Parametric Views
For the Open command, use Parametric View and select your parametric view.
Parameters
To use symbolic addresses in your parametric view, you should specify parameters
in the Parameters options. To do so, click on the “…” button next to the Parameters field.
You will be presented with a Parameters selection dialog:
270
Parametric Views
As you can see in the dialog, you can specify multiple parameters. Each parameter can be
of the following types:
String
Value
Equation
If you set a Tag inside a parameter, mySCADA will pass the tag value as a parameter
during the open command. In addition, when you specify an equation, mySCADA will
evaluate the equation and pass the value as a parameter.
Connections
You can also specify a connection during the opening command. Imagine you have
multiple production lines, each controlled by one PLC. You can create one parametric
window for one production line; then, when opening your parametric view, you can pass
the connection to the given production line. This way you are able to have one view for all
lines by simply passing the connection.
To set the connection during the opening command, please specify it by clicking on the
“…” button next to Connections. You will be presented with a new dialog:
271
Parametric Views
2. Now in different view, select a button and use the open command
4. When you open your parametric view by clicking on the button, you will see that
$1$ is replaced with the value specified in Parameters.
272
Parametric Views
TIP: Download an example showing the Symbolic text replacement of the following
parameters:
string
value
tag value
equation
http://nsa.myscada.org/projects/example/Example_parametric_view.mep
http://nsa.myscada.org/projects/example/Parametric_view.mep
When you construct your tag, use $index$ as part of the tag. During the opening of the
parametric view, $index$ will be replaced by the parameter specified by the open
command.
Some examples:
Open command parameters are specified like this:
273
Parametric Views
Let’s look at the parameter $6$; here we use an equation to pass the value of variable
bitvariable as defined in the View Script. In parameter $7$ we pass the value read from the
PLC at address H:10.
Now some examples of how symbolic tag translates to hard link during the view opening:
Valve[$1$] Valve[5]
DB$2$ DB100
motor[$1$].$3$ motor[5].open
motor[$1$].$4$ motor[5].close
$5$ H:0
274
Parametric Views
As you can see, we are passing a connection to S7-1200 PLC by the first connection
parameter $1$.
tag@$1$
As you can see in the dialog, we are passing three parameters from the original view
to the parametric view.
275
Parametric Views
Now let’s see what will happen when you use your parametric view in runtime:
You can see that the text has been replaced as well:
276
Parametric Views
DOWNLOAD DEMO PROJECT HERE:
ftp://nsa.myscada.org/history/projects/example/Example_parametric_view.mep
277
22 View Scripts
myDESIGNER offers many tools for performing the most common data acquisition,
display, animation, and effects—and all of this without coding. For maximum flexibility
mySCADA also includes a complete scripting language based on JavaScript, which allows
you to interact programmatically with most of mySCADA functions with a high-level
scripting language.
Easy to learn
Scripting can be used for all sorts of tasks. The possibilities are endless, as it is designed to
be easy to use, extending the functions of mySCADA. You do not need to be an
experienced programmer to be able to use scripting. Using JavaScript as a scripting
language means you do not have to worry about memory allocations, leaks, or complex
programming issues. Using it is very simple and straightforward.
Features
mySCADA has many built-in features that can be extended with scripting. If you are
starting out, you can use all of the built-in features to acquire data, create graphics, make
dynamic animations, and conduct other tasks without writing any code. You can then pick
one area that needs a little extra flexibility and write some simple script while still using all
of other functions. As you get more experienced, you can take further advantage of
powerful scripting.
278
View Scripts
First, if you want to add a user-defined script, open your view and click on the Script
button in the main toolbar.
Then the script window will show up where you can insert your user-defined script:
279
View Scripts
Source Code: this is a window where you put the user-defined script
Variables: here you define your view variables
Useful Functions: in this window, you can find specific functions that help
you control your components in the corresponding
window.
280
View Scripts
Input variables: use these variables for reading data from the PLC; each time the
script is evaluated it first reads the PLC tags and stores them in the
input variables
Output variables: after the script evaluation, the output variable values are written
into the PLC; you can set whether it will write the value each time
the script is evaluated or only upon change - this is controlled via
the Update field (Always, On Change)
Value Memory: here you can declare your persistent variables; when a view is
loaded, memory variable has its default value; you can change this
value in the script and it will prevail until you switch to a different
view or close the application
String Memory: String Memory variables are the same as Value Memory variables,
but are of string type
Functions
You can declare your own functions using JavaScript function syntax. As you can see, when
you open View Script, there are some already created functions:
function init() {
This function is called upon opening the view. You can put initialization code here.
function destroy() {
281
View Scripts
}
This function is called when a user closes the view or navigates to a different view. Usually,
you don’t have to fill this function in.
function periodic() {
This function is called every time the view is refreshed. The refresh period (e.g. the period
this function is called) can be specified in view parameter – refresh
In periodic() function, you will probably write most (or all) of your code.
Example:
1) Let’s show the value of the Value Memory Variable in a text element in your view.
282
View Scripts
3) In the Value Memory tab of the Variables window, create ‘InternalVariable’ with a
default value of 10.0.
5) Create a text element in your view, click on it, and create an animation with a memory
variable by typing “=InternalVariable” or selecting memory variable with the equation
editor.
283
View Scripts
If you click on the category, you will see the list of all available functions:
284
View Scripts
Now select the function you are interested in, and you will see a description and help on
the right side of the window.
TIP: You can drag the selected function and drop it into your source code.
As you can see from the function list, most of the functions deal with your graphical
objects. To be able to address your graphical object, you need to know its ID. Every
graphical object in your view has its unique ID that can be found in properties. Click on the
graphical object and then look in Properties – ID:
You can control animations of your graphic object directly in the script with specific
mySCADA functions. To set the value of the element directly in the script, use the
following function:
myscadaSetText(‘text0001‘,internalMemory);
285
View Scripts
286
View Scripts
Now press SHIFT + D. You will be presented with the views’ debug screen:
As you can see in the section “View scripts info,” all functions are listed in the view script
along with the status. If you have errors in the code, you can see the error status along with
the description of the error:
In addition, you can watch the live status of system variables in your view scripts in the
section System variables:
287
View Scripts
1. In your code, at the place where you want to start debugging, enter the command
debugger;
2. Download your project to the device running mySCADA and navigate to your view
288
View Scripts
3. Now enter the debug mode in your browser (Chrome shown in the picture)
4. As you can see, your code has stopped where the keyword debugger was inserted.
Now you can start debugging;
289
View Scripts
22.8 Using JavaScript Libraries - Includes
You can easily use your JavaScript libraries in your project. You simply can create your
own library or include any JavaScript JavaScript library found on the internet. All the
JavaScript resources are included in two folders in your project:
You can directly add all your library files into those two folders. myDESIGNER will find
then automatically, and you can use them anywhere in your project.
To work with the JavaScript libraries directly in myDESIGNER, open a view script and
navigate to the “Includes” tab.
290
View Scripts
On the left side of the window, you can see all subdirectories. On the right side, you can
find all your source files. If you double click on the file, you can edit it easily.
Directory Deletion
To delete a directory, select it and press the “Del Dir” button.
Deleting File
To delete a file, select it and press the “Del File” button.
291
View Scripts
All JavaScript in the primary folder is automatically loaded in view. In
addition, all CSS files in the primary folder are added to your view
automatically.
All the files specified in this window will be automatically loaded to your view.
292
23 View and Server Side Scripts –
Common Tasks
This chapter will show you how to achieve common tasks using the View or Server Side
Scripts. You will learn how to simply create a timer, read historical data from data-logs and
alarms, use open command, generate reports and more.
Creating Timer
To create a timer, click on a Timer Icon in the toolbar.
293
View and Srever Side Scripts – Common Tasks
Select an time period and tick repeat if you want to trigger the timer periodically. Once
you press OK, myDESIGNER will automatically create a code for you and insert it into the
edited script.
Now select the dates and times, when you want your code to be run and press OK button.
myDESIGNER will automatically create a code for you and insert it into the edited script.
294
View and Srever Side Scripts – Common Tasks
Export to CSV and Microsoft Power BI
You can make periodic export of data-log data into CSV file. This file is easily readable by
Microsoft Power BI. To do so, please click on the button Export.
For detail description, please see section Simple Periodic Export to CSV and Microsoft
Power BI
in this manual.
In the provided dialog, please start by selecting a data-log from which you want to read
data. Then select an items you want to process, or leave all selected. Other options follow:
Limit by time: first you can limit the data by provided time. Time is specified in UTC
format in seconds since 1.1.1970. You can enter a value or provide a variable where
the value is stored.
295
View and Srever Side Scripts – Common Tasks
Filter: if the data-log contains a keyed value, you can limit results shown in your
project by specifying a filter value. Again this can be a hard value or variable.
Limit records to: please provide limits for the number of records loaded. You can
also specify if the limit is taken from the beginning eg. “from start” or from end.
Loop over results: if this option is checked, you will have an option to loop over the
retrieved records and process them in your script.
Export to CSV (Server side scripts only): if you choose this option, the retrieved
historical data will be exported into a CSV format and saved into a file. File is saved
under a provided name into user data folder accessible over FTP or HTTP and
HTTPS.
press OK button. myDESIGNER will automatically create a code for you and insert it into
the edited script.
296
View and Srever Side Scripts – Common Tasks
In this dialog, you can choose if to process Online or Historical alarms. We will start with
Historical alarms:
Historical alarms dialog has several sections. We will explain in details each section.
Columns:
Columns allows you to select all the data retrievable from the history. Please select what
columns you want to process.
Filters:
Currently, you can filter retrieved data based on time interval. Future versions will allow to
extend the filter for Message, Area and Device as well.
Aggregates:
If you need historical alarms in the form they have been stored, leave aggregates to none.
If you want to retrieve an aggregated data based on alarm occurrence count and overall
activation time, please tick the occurrence option.
Limit records to: please provide limits for the number of records loaded. You can
also specify if the limit is taken from the beginning eg. “from start” or from end.
Loop over results: if this option is checked, you will have an option to loop over the
retrieved records and process them in your script.
Export to CSV (Server side scripts only): if you choose this option, the retrieved
historical data will be exported into a CSV format and saved into a file. File is saved
under a provided name into user data folder accessible over FTP or HTTP and
HTTPS.
297
View and Srever Side Scripts – Common Tasks
press OK button. myDESIGNER will automatically create a code for you and insert it into
the edited script.
Online Alarms can be processed as well. To do so, click on the tab Online and dialog will
change accordingly:
This function will retrieve active or non-acknowledge alarms at the time script is run. You
can select which columns you want to process or maximum severity level. Other options
are:
Loop over results: if this option is checked, you will have an option to loop over the
retrieved records and process them in your script.
Export to CSV (Server side scripts only): if you choose this option, the retrieved
historical data will be exported into a CSV format and saved into a file. File is saved
298
View and Srever Side Scripts – Common Tasks
under a provided name into user data folder accessible over FTP or HTTP and
HTTPS.
press OK button. myDESIGNER will automatically create a code for you and insert it into
the edited script.
To read or write tags from PLC, you must create a PLC request table first. To do so, please
navigate to the PLC Variables Tables section and create a new table. You can call it
whatever you like.
In PLC Variables Table, you define what tags will be read or written from the PLC.
299
View and Srever Side Scripts – Common Tasks
In this example, we will be reading two numerical values and one string from the PLC with
alias M.
Once you create your request, you can proceed to the script. Click on the R/W Tags button
and you will be presented with the following dialog:
In the dialog, you can see, we have specified our created PLC variable table called temps.
You can see all the defined tags in the Tags section. If you wish to read/write only some
tags, please, uncheck the others. Once you are done, press OK button. myDESIGNER will
automatically create a code for you and insert it into the edited script.
As you can see, myDESIGNER has prepared a code for you, which will read your tags. For
each tag, you will get its value and also a status info if it was read or ended in error (for
example if you missed typed the tag address)
300
View and Srever Side Scripts – Common Tasks
As you can see, first we create object options and we put all the values we want to write
into the options -> values array. Then we call the function myscada.writeTags. On
successful write you will get the callback to your function.
For detailed explanation on how to generate report from server side scripts, please look at
the section Creating Report on Demand in Reports chapter in this manual.
To read history of user actions, please select the tab User Actions History.
301
View and Srever Side Scripts – Common Tasks
Limit by time: first you can limit the data by provided time. Time is specified in UTC
format in seconds since 1.1.1970. You can enter a value or provide a variable where
the value is stored.
Limit records to: please provide limits for the number of records loaded. You can
also specify if the limit is taken from the beginning eg. “from start” or from end.
Once you are done, press OK button. myDESIGNER will automatically create a code
for you and insert it into the edited script.
1. Firstly, we need to create a custom data-log definition. This is an data-log which will
hold our data. To do so, please navigate to Script Data Logs in server side scripts.
302
View and Srever Side Scripts – Common Tasks
As you can see, we have created data-log with 3 values, two numeric and one string.
As you can see, Script data-log has the same definition as regular data-log. Only
difference is, you don’t link script data log to any data source, but you fill in its values
from the server side scripts. Also, you can create a data-log views for this data-log as
you would do with regular data-log. Once you are done with definition, we will
proceed to data filling.
2. Filling the data-log with data. To fill our created script data-log with data, please
click on the Other button and select an Insert Datalog Row tab.
303
View and Srever Side Scripts – Common Tasks
In the provided dialog, please select our created data-log by its name. Then fill in
the time stamp of the record. Under this time, the record will be saved. Time has
two parts, first is UTC time in seconds (since 1.1.1970) and second part is the number
of milliseconds. If you leave the default values, new record will be logged at the
time when your script is called.
Finally, fill in the values for each defined tag in data-log. Those can be hard coded
values or variables.
Once you are done, press OK button. myDESIGNER will automatically create a code
for you and insert it into the edited script.
304
24 Documents
With this powerful function, you can link documents with your project. For example, you
can link user manuals with components on the HMI screen, or you can attach a schema or
picture to your project. As a result, you will have a complete project consisting of HMI
screens and linked documentation files in one package.
You can attach any documents directly to your project by using the function Import
Document.
Click on the Import document icon in the main menu or right-click on the
Documents in the Project Window menu and then select Import.
Once your documents are imported into your project, you can link them with any object
on HMI screens. This can be done with the Open command function.
1. Please select the graphical object you would like to use to open a document.
2. Go to Properties –> Commands -> Open Command and click on the “…” button. You
will be presented with the Open Command Window
305
Documents
You can find more info about open command in the chapter Open Command.
306
25 Reports
mySCADA provides a simple to use, convenient way for report creation and generation.
With integrated reporting, you can create rich reports including tables, charts, and visual
widgets. To get started with Reporting tools, please look at the explanatory video linked
here: LINK
2. Click on the Report section and select “Create new” on main Toolbar. You will be
presented with new report dialog.
4. New empty report template is created and report designer is automatically open.
307
Reports
Now, you can design your report. Once the report is designed, press save to save it.
a) Click on the Insert section in the ribbon and then click on Page Header. Then click
into your report to insert it.
308
Reports
25.3 Inserting Text
b) Now we will insert text into the header. Click on the Text icon and then click into
the header in your report.
You can position text and change its properties like size, color etc. in the Properties
section.
309
Reports
e) In the image insert dialog, click on the folder icon and select your image. Once you
select the image, you can preview it in the image select dialog and after you click
on OK button it will be inserted into your report.
f) Now your header section is done and we can continue to enter the historical data
table into the report. Every table has 3 sections: Header, data and footer. First we will
enter header into the report. To do so click on the Header button and then click on
the report. Also add texts into the header section as shown in the image.
310
Reports
g) Once we have header, we will insert data section. To do so, click on the Data button.
In the provided dialog, select the default data-log as data source.
Once you click on OK button, data section is inserted into your report.
311
Reports
h) Once you enter the data section, you should fill it values to be shown inside. You just
fill in one row template. Once the report is generated, there will be multiple rows
created from this one row template. To do so, click on the Text button and then
click inside the databand. Dialog to select value will open:
i) In the dialog, select the column from data-log you want to show. We will select and
insert a datetime showing a date and time of the record. Once entered, you should
format the text to show the time value. To do so, select Text Format in Properties.
312
Reports
j) You can also add border around the table cell. To do so, click on the border button
at the ribbon.
k) Now add additional columns same way as you have added the date time column.
You can leave the text format to general or change it to number and format as
required.
313
Reports
l) Now we will add an footer to the table showing computed average values. To do so,
click on the Footer button and then click into the report. The Footer Band will be
added.
Now we will add two texts showing the average values. Click on the Text button,
and then click inside the Footer Band. In the Text dialog, select Summary.
314
Reports
You need to fill in Summary function, Data Band and Data Column values. Then
click on OK button.
m) Same way as creating table filled with historical data from data-logs, you can show
list of historical alarms. To do so, follow the same steps as you have done when
creating table from data-logs, but as a data source select alarms.
315
Reports
316
Reports
25.8 Showing Report in Runtime
Once you create and save your report template, it is available during runtime.
2. Now you will see all available reports on the left side. Click on the report you would
like to render. You will be presented with time selection dialog:
3. Select desired start and end date and click OK. Your report will render
4. Now you can print your report or save it for later use.
317
Reports
In this section, user has the ability to create, modify, rename and delete user reports. All
the existing reports are located on the left side of the view. Each report has rename and
delete icon right next to its icon.
Deleting report
To delete existing report, click on the red cross icon next to the report.
Renaming report
To delete existing report, click on the pen icon next to the report.
318
Reports
Report designer will open. Now end user can create custom reports exactly same way as
done in myDESIGNER.
4 You will get the Report generation dialog. Select a report you want to generate, fill
in the required values and press OK button.
319
Reports
Limit by time: first you can limit the report generation by time. Time is specified in
UTC format in seconds since 1.1.1970. You can enter a value or provide a variable
where the value is stored.
Filter: if the data-log contains a keyed value, you can limit results shown in your
project by specifying a filter value. Again this can be a hard value or variable.
Limits: please provide limits for the number of records loaded. Each data-log or
alarm values used in reports are provided in the Limits table. Please fill in the limit
of rows to load. You can also specify if the limit is taken from the beginning eg.
“from start” or from end.
Save as: provide a file name under which report will be saved to. You have an option
to save a report in PDF format, in HTML format or pass it as JSON data object.
Report is saved into user data folder accessible over FTP or HTTP and HTTPS.
5 myDESIGNER will generate code template for you. When you run the code, the
system will generate a report for you and save it into the user directory.
320
Reports
321
26 CAS Alarms
A very important feature of mySCADA is the ability to signal any dangerous or other
important events with Alarms. They are an important part of most control applications as
they alert operators if something goes wrong.
https://www.youtube.com/watch?v=HwE-NMUmKxA
Alarms can signal that a device or process has ceased operating within acceptable,
predefined limits, or it can indicate breakdown, wear, or a process malfunction. Often it is
important to keep a record of the alarms to know if they have been acknowledged.
To define alarms for your project, double-click on the CAS Alarms in the Project window.
For your convenience, the alarm definitions are split into two tables: one for Analog and
second for Digital alarms:
Tag@Conn / *alias Tag (Address) or Equation specifying data read from PLCs
Enables hiding the alarm from the user; this is useful when
you are using alarms as a condition in the triggered data-log;
Hide
hidden alarms are not shown in the Alarm window and are
not logged in the database.
Specifies how often your alarm will be refreshed; you can use
Refresh default, fast, or slow. You can change the refresh values for
each group in the Properties window.
Defines how the value will be shown in the alarm table; use
Format
the ‘##.#’ format for specification
Unique ID
Each alarm has a Unique ID, which is created when you define a new alarm; its value is
fixed once the project is put into the runtime mode for the first time. This value is unique
for all alarms, meaning that each alarm has its own Unique ID that is saved in the alarms'
definition file. Once this ID has been created, it will remain until the alarm is removed from
the definition table.
Tag@Conn / *alias
Each alarm must be connected to a tag or equation. The Tag is the value read from PLC (or your computed
value from the script); with Equation, you can tie your alarm to multiple tags or evaluate complex formulas.
Specifying a tag:
324
CAS Alarms
You can create multiple alarms tied to one tag, as long as the alarm descriptions are
different so that alarms operate correctly.
Severity
Alarms can range in severity from 0 (most severe) up to an unsigned integer value (least
severe), to indicate different levels of importance.
For example, an alarm with severity 10 might warn that a tank is half full of liquid, while
another alarm with severity 5 indicates that the tank is about to overflow. Both alarms
monitor the same tag but have different severity levels.
When you set up the alarm severity, specify what the severity levels mean and what
actions they will trigger. Severity determines the order in which alarms are displayed in the
alarm list.
Alarm areas
The alarms can be grouped in different areas so that they can be displayed in the alarm
window based on the area to which they belong. This may be helpful and enable you to
divide the alarms according to the different plant zones they come from.
Message
Device
You can define multiple alarms for a single device. In the live alarm view or during a
browsing of alarm history, you can filter your data based on device value.
Minimum and maximum values are available for analog alarms only. By default, you
specify the region when the alarm will be active. So if you would like to activate an
alarm when the level in a tank is equal to 90 and stop the alarm at level 100, your
minimum value will be 90 and the maximum value will be 100.
325
CAS Alarms
Inv (Inverse)
This parameter lets you invert your alarm definition. For a digital alarm, the alarm is
activated when the value is equal to 0 and deactivated when equal to 1. For analog alarms,
when ‘inverse’ is active, you specify the minimum and maximum values of the region
when the alarm is NOT active.
Through these properties, you can select the recipient user group to which the message,
SMS, E-mail, etc. is to be sent. The user profile, which is defined through the 'Users’
settings, must contain a telephone number or E-Mail for sending messages.
Dead-band
With some measured values, such as line pressure, tag values can fluctuate rapidly above
and below a critical threshold. Where such conditions exist, you can create a dead band as
a buffer to prevent the fluctuations from triggering unnecessary alarms.
The system does not check for alarms more frequently than the Refresh update rate
specified in the alarm definition.
Match the maximum update rate to the rate at which you expect tag values to change.
For example, if you are monitoring temperatures that fluctuate slowly, check alarms less
frequently than when you have a manufacturing process that changes temperature
rapidly.
You can specify one of three possible refresh rates: default, slow, or fast. Each refresh rate
group can be changed in the Properties window.
326
CAS Alarms
26.3 Alarm Window
The alarm window allows the operator to perform complete management of the
technology alarms. This window allows you to visualize the alarms present in the
technology or in a restricted area of the technology.
The alarm window can display all the technological alarms or a set of alarms arranged by
the user-defined areas. If necessary, the user can click on the filter button and fill in the
area name.
Alarm acknowledgement
The operator can acknowledge the alarms displayed in the alarms summary. This does not
correct the alarm triggering condition but indicates that the operator is aware of it.
Alarm suppression
You can suppress alarm monitoring for one or multiple alarms. This is useful for testing,
repairing, or maintaining a piece of equipment. Click on the Suppress button to suppress
alarm monitoring. To view the list of the tags not being monitored, use the Suppressed list.
You can also turn monitoring back on from this list.
By default, alarm information in the alarm summary is sorted first by date and time, then
by severity, and finally by area name.
This means that alarms are presented in a chronological order: if two or more alarms have
the same time and date, they are presented in order of severity; if any alarms have the
same time and date and the same severity, they are presented by the area name.
327
CAS Alarms
You can also export the alarm history into an XLS file.
328
CAS Alarms
329
CAS Alarms
4. Specify which columns should be visible in the CAS Alarms table by clicking on the
Parameters button. We only want to show the alarm message, activation time, and
activation value.
330
CAS Alarms
ftp://nsa.myscada.org/history/projects/example/Cas_alarms_in_view.mep
331
27 Data Logging
You can log and access a complete alarm history, all user actions, and any technological
data you wish to log. The historical data are grouped into logical sections called Data-logs.
Data log has many options you can set up to fine tune your logging options. You can easily
optimize your data logs for speed and storage.
Using pre and post event buffers, you can save a collection of data before a specified event
has happened.
27.1 Data-logs
You can log any data or information available in mySCADA. For user convenience and easy
access, data are grouped in the data-logs. You can think of a data log as a collection of
similar data. It might be, for example, a set of temperatures read each second from the
PLC, motor start-up voltage and current logged every 100 milliseconds, the running hours
of machinery, operator actions, or computed production statistics. You can also log any
user-defined variables from Server-side Scripts via a virtual PLC.
332
Data-logs: data sets grouped together. Each data log has a set of parameters, such as log
period, pre and post event buffers, and so on. Data logs are defined by the data you wish
to read and log. Data is the collection of data points. Data points can be variables read
from the PLCs, user-defined variables, and computed statistics from Server-side Scripts.
Data point: can be either a numerical value, string, or date. Numerical values can be of any
numerical type such as Boolean, Integer, Float, Double, Signed, or Unsigned. Numerical
values are always automatically converted and logged as double values. This way you do
not have to worry about the data type and its conversions.
Continuous Data-logs log periodically without interruption; this type of data log is
useful mainly for persistent processes.
To create a data-log:
1) Go to the Data-Logs section in the Project Window, right-click on the Data logs, and
select Add New. You can also use the button “New Data-log” in the main toolbar.
2) A new dialog window will show up; fill in the data log name and click on OK.
3) Double-click on your newly created data-log in the Data-Logs folder. A new definition
window will show up. It is split into two horizontal sections: data log definition and
data log views.
333
Data Logging
334
Data Logging
Each data point can have the following properties:
Parameter Description
Id Unique ID. Each data point has an auto-generated unique ID. This ID is
used as a reference to find your record in the database.
Name Name of the data point – will be shown in Data-log view table as
column name.
Description Short description – will be shown as Tooltip when hovering over column
name.
Tag Specify a valid tag (address). All specified tags must be from the same
connection.
Hysteresis Check this option if you want to log data only if the value of the data
point changes. If you check this option, you must also set up the
following parameter “Delta abs”
Delta Abs Used when hysteresis is selected. Specify the rate of change in absolute
value to log it.
Alignment Align the data shown in Data-log view table to the left, right, or to the
center
Key If you check this option, mySCADA will automatically create a search
index for this data item. You can then search based on this key in Data-
log view tables.
335
Data Logging
Data Point Types
A data point can be a value (numeric), string, or date value. For each data point type, you
can specify additional options.
For Value data point type, you can specify if you wish to present the value as a decimal,
hexadecimal, or binary. To do so, click and select the corresponding option in the
Parameter cell.
For String type value, you can specify how the string is represented in PLC. For a detailed
description, please see the section Animations – Get Animation (link Animations). The
usage is exactly the same.
For date type, you can specify if you wish to show only the date, only the time, or both:
Information: mySCADA expects a date to be saved in PLC as an integer value. The date
should be in UNIX UTC format.
336
Data Logging
27.4 Continuous Data Logging
The purpose of the continuous data log is to log data periodically without interruption.
This type of data log is useful mainly for persistent processes.
Log Period
With continuous data logging, you define the log rate in milliseconds. In this period, all
data defined in a data log are read from PLCs and logged into the internal database.
Hysteresis
For any data point, you can define hysteresis. When hysteresis is enabled, mySCADA will
read values each Read cycle, defined by the Read Refresh parameter; however, it will log
data only if the value has changed by more than the specified Delta Abs value.
When hysteresis is enabled for at least one data point, you should specify read refresh and
log refresh.
Read refresh: how often data will be read from the PLC
Log refresh: how often data will be logged when there is no change in value (e.g. no log
triggered by value change > delta abs).
Hysteresis function can be especially useful for logging analog data that does not change
very often. When you set hysteresis of some data points in the data log, you can specify the
log rate – the period in which all data points of the data log will be logged, regardless
whether they have changed or not.
337
Data Logging
By enabling hysteresis, you can dramatically decrease the amount of historical data
logged while maintaining data precision and time continuity.
Triggering Conditions
mySCADA uses CAS Alarms as a triggering condition. You can select multiple CAS Alarms
to use as triggers. Triggering conditions are specified by the Alarm ID field.
338
Data Logging
Click on the “…” button to specify which alarms should be used as triggers.
Pre-trigger buffering
You specify the number of time samples to log before the trigger condition is met. The
system automatically keeps the number of defined time samples in the memory. If the
event occurs, the system will flush all the buffered data from the database and continue
logging.
Post-trigger buffering
The system will continue to log your data even after the trigger condition has stopped. You
should specify the number of the time samples to be logged after the trigger condition
has finished. The time sample duration is equal to the read period.
339
Data Logging
2. Open default data-log and select Triggered logging.
To set up the periodic Export, open your data-log definition file and check the Export to
CSV, PowerBI check box.
340
Data Logging
First of all, you should select a file name for this export. By default, the file will be saved in
the user file folder.
Then you should set the refresh period or times for when to run the export. This is done by
pressing the “…” button right next to the Refresh Time text box.
341
Data Logging
In addition, you can directly write the expression in the Refresh time text box. The
expression is based on CRON syntax. The following figure explains how to create
expressions. More info can be found here: https://en.wikipedia.org/wiki/Cron
Set up the maximum number of records to limit the size of the export file.
342
Data Logging
In the following table, you can see the percentage of how much space your data-log will
have.
343
Data Logging
You can change the size in percent. The overall percentage should be equal to 100
percent. You can check the distribution of your data-logs in the graph below the table:
TIP: You can use decimal numbers to specify maximum size; this can be especially useful if
you have a large number of data-logs and need to split disk space precisely.
344
Data Logging
345
28 Data-Log Views
Each data log can have defined multiple tabular views.
You can define the data-log views in the same window as you define the data-log.
346
Data-Log Views
Tabular views enable displaying all captured data from the data-log in the form of a table.
Parameter Description
Data Points (IDs) List of data points used in this data-log view. For each data
point, you can set up configuration parameters in the editor.
First, fill in the name and description. Then click the Data Points column and click on the
“…” button to include data points in your data-log view. You will be presented with the data
points selection dialog.
347
Data-Log Views
Once you specify all required parameters, you can save your data-log view and show it in
runtime.
A list of all data-log views can be found in Main Application Menu under the “…” -> data-
logs section.
Once you select your data-log view by name, you will see your data in tabular form:
348
Data-Log Views
3. Set up data points. Check Group By for Materials and Batch data points. For
ungrouped data points, select appropriate aggregate function.
349
Data-Log Views
4. Test your view
As you can see, your data are grouped by Material and then by Batches. You can collapse
each group by clicking on the “+” button.
To enable data filtering, you must specify which data points should be used as data filters.
You do this in the data point definition in your data-log definition. Usage is quite simple,
just check the Key check box for all the data points you want to use in data filtering.
350
Data-Log Views
Once you have your data-log prepared, you can see how it will look in runtime:
As you can see, there is a Filter icon. If you click on it, you will be presented with the Filter
dialog:
351
Data-Log Views
Now write down the material name and you will see that your table will show this
material.
352
29 Aggregated Data logs
Aggregated data logs allow you to automatically compute aggregated data from regular
data logs and alarms.
Usually, you have rough data recorded from your PLC in regular data logs. For example,
you can be reading temperature values every 10 seconds and have them logged into the
data log. Now imagine you would like to know the minimum, maximum and average
temperature values per hour, per day and per month. This is where aggregated data logs
come in play.
To create an aggregated data log, first create all sources - eg. Data logs you want to
aggregate data from. Then you can start creating your data log.
You will be presented with the new dialog, please select a name and confirm.
353
Aggregated Data Logs
Once confirmed, a window with the definition of your aggregated data log will be opened.
As you can see, the window is split into several sections. We will explain each section in
detail below.
First item in the table is always Interval End. Aggregated data log has always two dates:
start and end of interval.
Then you can add as many aggregated items as you wish. Table has following columns:
Column Description
Datalog/Alarm Source datalog (or Alarm)
Tag Source tag (or Alarm Severity)
Name Name – eg. name of aggregated item
Description Description of aggregated item
354
Aggregated Data Logs
Unit Unit (useful in trends)
Format Format for numeric values use #.## notation
Function Aggregate function (sum, avg, min, max, ..)
Type Type of item eg. Numeric or String
Parameter Additional format parameter for Type item
Alignment Align item in data log view table to the left, right, or
middle
Key If you want to perform a search by this item, tick it
please.
Then fill in the Name, description and also the aggregate function:
355
Aggregated Data Logs
Once you are done, don’t forget to also set up the data-log view, you can do it by clicking
on the “Data log views” button:
You will be presented with data-log view definition, it is the same as when you define a
data log view in data log definitions (please see chapter Data logs)
Simple Example:
In this example, we are aggregating data from 2 different datalogs “temp” and “humidity”
356
Aggregated Data Logs
Please tick the check box “Aggregate by Time:” and then fill in the time period for your
aggregate. mySCADA is using the ISO8601 norm when you specify the interval.
You should also specify the time zone of your areas (if you aggregate by days, this will
define start time of your day)
Simple Example:
Aggregating data from multiple data logs by 15 minute intervals.
Result:
Raw Data (shown only small part):
357
Aggregated Data Logs
To use Value Change Aggregates, select the “Aggregate by Value Change” check box and
add at least one item by which you want to track value change.
In this simple example, we will show you how to track production change. We have 2 data
logs:
358
Aggregated Data Logs
1. Raw data, where we log each produced item on the production line
2. Product change data log, here we log when we start producing new product
We will create an aggregated data log, which will show how many items we have
produced for each product.
359
Aggregated Data Logs
To define, aggregates base on Alarm activations, please check the “Aggregate by Alarm
(trigger)” check box and fill in the alarm ID or IDs.
Simple example:
We will log production based on the production line activation signal.
1. We will define our activation signal. For this purpose, we will use CAS Alarms. Eg. we
will start by creating CAS Alarm:
2. Now we will use the aggregated data log to aggregate the data based on the alarm
activation:
360
Aggregated Data Logs
Alarm activations:
As you can see, for each alarm activation period, you get one row in the aggregated
data log.
361
Aggregated Data Logs
29.6 Running the Aggregation Periodically
You need to run the aggregated function periodically to get the calculated data log
updated. Ideally, you should run the aggregation just after your data is ready, eg.
shortly after a defined period. To do so, please tick “Autorun every:” check box.
Then define the period by clicking on the “…” button. You will be presented with
dialog, where you can define at what time intervals to run the aggregation function.
If you need to further delay the execution of aggregation function (for example, you
need to run every hour and 5 minutes), you can select “Delay execution by” and add
number of minutes to delay an execution.
IMPORTANT: IF YOU DON’T RUN THE AGGREGATION FUCTION, YOU WILL HAVE NO
DATA IN AGGREGATED DATA LOG
362
30 Advanced Trends
You can easily present your historical data in the form of a historical trend.
To do so, first look at the chapter Data Logging to set your data-log from which to retrieve
data.
1) If you have your Data log ready, create a new historical trend by going to the Advanced
Trends folder and selecting a new trend, as shown in the following picture:
2) A new dialog window will show up where you can fill in the trend name and
description. Then click on OK.
363
Advanced Trends
3) Now the new trend ‘myAdvancedTrend’ is created and you can find it in the
Advanced Trends folder of the Project window.
5) Click on the Add Pen button in the lower part of the Advanced Trend Definition
window.
364
Advanced Trends
6) In the pop-up dialog box, you can define your new pen to show. First, you should
select a data log from which to show data, then select your data point to show (only
the tags from the selected data log are available):
365
Advanced Trends
7) Finally, fill in the Description and Unit. You can also change the pen color and
confirm by pressing the Add button. The pen is now listed in the table below:
Note: You can freely add as many pens as you wish; they can read data from multiple data-
logs.
366
Advanced Trends
30.1 Using Multiple Axes
By default, all pens use the same vertical axis. You can define multiple axes. Each axis can
be used just for one pen, but it can be also shared by multiple pens. To add a new axis:
1. Click on the “+ Add Pen” dialog. Now click on the “…” button next to Second Axis.
3. In the dialog, you can add a new Axis and set its parameters like auto-scale,
location, and name.
4. Once you have created the new axis, you can select it for a given pen:
367
Advanced Trends
5. Now you can look at how the trend will look with multiple axes.
You can easily modify visual appearance of the trend to fit it to your requirements. Eg, you
can change the background color, color of the grid, text labels, etc. To change the visual
appearance of the trend, please click on the trend in the project window and navigate to
the properties window, to the section Visuals.
368
Advanced Trends
Here you can change the parameters to your requirements. Changing these parameters
will allow you to customize the appearance to fit your brand standards or to make it more
visually appealing to you.
Markings/Limits:
Markings allow you to draw regions in your chart. This way, you can easily visually highlight
the limits for variable. You can create multiple markings for one trend. To add/delete
marking please click on the “…” next to the markings. You will be presented with the dialog
to set markings.
The following example shows a chart with 2 markings regions enabled. One gray region in
the range of 15 to 25 and one light red region in the interval 10 to 30.
369
Advanced Trends
- Line thickness
- Fill region under
370
371
31 Connections
To view existing connections, select the Connections folder in the Project Window.
Now double click on the Connections folder, and you will be presented with the
Connections Window:
372
Connections
31.1 Creating New Connection
1) Create a new connection by clicking on the Add Connection button at the bottom of
the main window.
To add a new connection, you must first select the type of connections you want to
create:
373
Connections
Type – select the type of PLC from the drop-down box at the top of the window
Alias – enter the name of the connection
IP – enter the IP address of the PLC
2) Once all the valid information is entered, click on “+ Add” at the bottom of the window.
374
Connections
Database Type
As you can see, the first option is the Type of the database. You have the following options:
PostgreSQL
Microsoft SQL
Oracle
mySQL
sqlite
ODBC
As you can see, all major databases are supported. On the Windows platform, you can also
connect the other database types using the ODBC driver.
Alias
Again, the next option is Alias, and you must fill it to use your connection in your project.
375
Connections
Read
SQL Read Query. This query is used to read values from the database. You can specify any
valid query to the database, including conditional statements.
Write
In the Write Query section, you should specify a TEMPLATE for the SQL Query, which will
be used later for the write commands. In the query, you should use a placeholders #1#,
#2#, and so on in place of values. The placeholders will be replaced with real values
provided from the write/set command during runtime.
1. Specify a Write SQL Query in the connection dialog. In our case, we will write 2
values to the database
376
Connections
2. Use the Write/Set command to write values to the database using the template
query
3. When the write/set command is executed, your query to the database will change
to:
377
Connections
TIP: You can create multiple connections to one database to use different SQL queries and
retrieve multiple data.
Fill in the Alias to be able to use this connection in your project. Then fill in the Login and
Password generated from your account in the SigFox backend server.
If you specify a timeout interval, mySCADA will process the time of every message, and if
the time is over the specified limit, you will be notified by an error communication about
it.
378
Connections
TIP: To edit any of the existing connections, double-click on the connection row.
Your PLC is not able to provide data in such a large block; in that case, you must
decrease the Optimization Window size
379
Connections
Your PLC can provide data in a larger block than selected, if you increase the
Optimization Windows size, you can achieve higher read speeds from your PLC.
To use multiple channel optimization, your PLC must allow for enough simultaneous
connections.
380
32 User Accesses
Security is a major concern for every modern SCADA system. In mySCADA, you can limit
access from the whole project to a single element control. This way you can easily control
user access to your project and keep security at the highest level. In addition, if there is
more than one person using the technology, you can utilize the user access function to set
certain limitations.
Access Levels are security groups with a chosen level of access. You can set different access
levels for different users. For example, maintenance personnel would have lower system
access level than administrators, but higher than operators. This way you can control who
can access your system and who can operate given technology. mySCADA has ten Access
Levels numbered from “0” to “9”. “0” (zero) is the lowest access available while “9” is the
highest access level possible.
For better user orientation, you can give specific names to these user access levels.
Every user in the mySCADA system has a defined unique name and security password.
In mySCADA, every user can be a part of a user group or multiple groups. There can be an
unlimited number of groups in the system. Groups can be assigned to tie users together
for common security, privilege, and access purposes. This is the foundation of mySCADA
security and access. In mySCADA, you can grant access based on group names.
For every user, you can specify a group or groups to which a user belongs. Then, anywhere
in the project, you can limit access to this user (or users) by specifying the group to allow
access.
TIP: If you wish to use authentication based only on Access Groups, you can leave the
Access Level equal to 0.
To specify user accounts, select Users from the project tree and double click it.
381
User Accesses
To add or modify existing users, simply write the values into the provided table:
382
User Accesses
Part of Groups Specify an access group or groups of which a given user is a part.
E-mail Provide user’s email to receive email notifications.
Tel. Provide user’s phone number in the international format to receive
SMS notifications.
Set system myBOX specific settings: enable to change system setting on
myBOX
Set network myBOX specific settings: enable to change networking setting on
myBOX
SMS Control myBOX specific settings: enable to control myBOX with SMS
commands remotely.
As you can see, you can limit access to your project either based on Access Levels or based
on Access Groups.
383
User Accesses
View Access Level: Sets the minimal level of access for viewing your project.
Write Access Level: Sets the minimal level of access for writing values to the
PLCs
Project Read Access: Specifies which groups of users can view your project
Project Write Access: Specifies which groups of users can write values to the
PLCs
384
User Accesses
You can set the user access rights to even more precise detail. The access rights can be set
for each object in a view, allowing creation of complex and customizable visualizations.
Select the target object and set the View and Write Access values:
385
User Accesses
As you can see, there is an Access Settings section right at the bottom of the properties
window:
As you can see, you can limit access to the access levels by simply selecting the desired
level from the combo box:
386
User Accesses
Alternatively, you can limit access based on the user groups simply by clicking on the
Access Groups Button. Then you will be presented with the Access Groups Settings dialog:
As you can see, there are two sections in the dialog, allowing you to set up read (visibility)
access and write access independently.
http://nsa.myscada.org/projects/example/Limited_Access.mep
387
33 Multi-language support
In mySCADA, you have the ability to create projects with multiple languages. This way,
based on user preference, users can view your project in multiple languages. To get
started, click on your project; in properties, go to the section Languages and click on “…”
button.
388
Sever-side Scripts
Here, you can select all languages that you want to have in your project.
First of all, look at the section “Default Language.” This is the default language for your
project. All defined texts in views, names of views, trends, data-logs, etc. are in your default
language. The default language is automatically set upon project creation to the default
language of your computer.
Important: If you wish to create a project in a different language than the language of your
computer, please change it upon project creation!
The next section in the Languages Dialog is available languages. Please select all the
languages that you want to support in your project. For the parts of the project where you
don’t provide translation to a given language, those parts will be shown in the project’s
default language.
389
Multi-language Support
Every textual part of the project, such as text elements in views, view names, trend names,
data-log names, etc. can have its own translation. The following screens show how to
prepare translations for every part of your project.
To provide a Translation for textual elements, fill in the section “Translations” in properties.
Each language defined in the project has its own item. Here you can fill translation for
every language.
390
Multi-language Support
Write/Set Commands:
Write/Set command can contain text as well. You can comfortably set multiple languages
for write/set command text items by clicking on the translation button located next to the
text item:
391
Multi-language Support
392
Multi-language Support
3. Your data-log will be now presented in a selected language. When you make
changes now, they will be saved in the selected language.
393
Multi-language Support
2) Now switch the language by selecting it in the properties
3) Your CAS Alarms will be now presented in the selected language. When you make
changes now, they will be saved in the selected language.
394
Multi-language Support
Provide a translation for the trend name and description. Then open your trend by double
clicking on its name and edit a pen.
When you are editing a pen (or creating a new one) you can provide a translation by clicking on
the translation button.
395
34 Server-side Scripts
34.1 Introduction
Server-side scripting is an easy-to-use, extremely powerful option to extend the
functionality of your mySCADA system. Server-side scripting uses JavaScript as a primary
language for writing scripts, which is one of the simplest, straightforward, versatile, and
effective scripting languages. It is relatively easy to learn since it uses syntaxes close to
English. In addition, you can find a lot of resources and JavaScript libraries on the web -
one of the main reasons why JavaScript has been chosen for server-side scripting on the
mySCADA platform.
The execution of JavaScript is based on the excellent V8 library from Google, which is now
the fastest JavaScript engine available. Rather than interpreting JavaScript, as the old
engines used to do, V8 uses the Just-In-Time compiler to produce and execute native
instructions tailored to a processor on which the application is running. The generated
instructions are cached, avoiding the overhead of repeated code generation and deleted if
no longer needed.
For networking and advanced functionalities, mySCADA server-side scripts use the
NODE.JS toolbox for building fast and scalable network applications. NODE.JS uses an
event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for
data-intensive real-time applications.
396
Sever-side Scripts
PLC Variables Tables – In this section, you can define multiple tables containing the Global
variables linked to the PLC tag. You can use later use this table to read/write tag values
defined in the table.
Script Data-logs – data-logs and data-log views defined for the server side scripts
User Files – used for the user-defined files. This is where you can set user access to
generated files, reports, etc.
Accesses – limit user access to the generated files from server side scripts.
Script Variables Tables – work with internal memory variables (e.g. virtual PLC)
PLC Variables Tables – use these tables to read/write values from PLCs, databases, …
1. Select a Script or PLC Variables Table from the Project / Server side scripts tree and
click on New in the main toolbar.
397
Server-side Scripts
2. Enter a new table name. As you can see, each table is associated just with one
connection.
As you can see, we are filling tags to read/write from the PLC. On the left side, we associate
the variable with each tag.
398
Server-side Scripts
2. Fill in the Items and save it. You can also create data-log views for this data-log.
Now that your data-log is created, mySCADA will automatically create a historical
table, and you can fill in the data from the script.
3. Open a main.js from the Sources folder and fill in the function to log data into your
script data-log.
399
Server-side Scripts
4. You are done; now every second you will get a new row of data in the history.
variable@script
As you can see, the syntax is same as for entering tags.
400
Server-side Scripts
Now fill in your variable name. The Tag syntax is filled in automatically. As you can see on
the right side, you can give your variable an initialization value:
401
Server-side Scripts
34.7 Sources Folder
Your server side scripts project is organized into modules. You can find all modules and
your main.js script in the sources folder:
In this folder, you can create a new source file or a folder containing additional sources.
mySCADA follows the standard file layout for node.js projects. When writing your project,
you should organize your project into independent modules.
Now, let’s turn this code into a real NODE.JS module that can be used by the main script.
As you may have noticed, the modules are used in the code as follows:
...
http.createServer(…);
In NODE.JS there is a module called "http" that can be used in the code by requiring and
assigning the result of this requirement to a local variable. This turns the local variable into
an object carrying all the public methods that the “http” module provides.
It is common practice to use the module name as the local variable name; however, you
may choose whatever you like:
402
Server-side Scripts
var foo = require("http");
...
foo.createServer(...);
To create and use your own modules, you do not have to change very much. Making some
code for a module means that you need to export the parts of its functionality that you
want to provide with scripts requiring this module.
For now, the functionality that the HTTP server needs to export is simple: scripts requiring
the server module simply need to start the server.
To make this possible, put your server code into a function named start() and export it:
function start() {
function onRequest(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World !!!");
response.end();
}
http.createServer(onRequest).listen(8888);
}
exports.start = start;
Now you just save this code into the new folder with name server and name it “server.js”.
You can start the HTTP server from the main or timed scripts:
403
Server-side Scripts
A new NPM window is opened. If you fill in command npm help, you will be presented
with integrated help.
npm install
To install a new module, just type npm install module_name and press the “execute”
button.
404
Server-side Scripts
34.10 Using the Event-driven Asynchronous Callbacks
The NODE.JS approach is not unique, but the underlying execution model is different from
other runtime environments like Python, Ruby, PHP, or Java.
The first line queries the database for lots of rows, and the second line puts "Hello World"
into the console.
Let’s assume that the database query is really slow due to the number of rows, and it takes
too long to execute.
With codes written this way, the JavaScript interpreter of NODE.JS has to read a complete
result set from the database and then execute the console.log() function.
If this piece of code were written in PHP, for example, it would work the same way -> “read
all the results at once, then execute the next line of the code”. If this code were part of a
web page script, the user would have to wait several seconds for this page to load.
However, in the PHP execution model, this would not become a "global" problem (i.e. the
web server starts its own PHP process for every HTTP request it receives). If one of these
requests results in a slow execution of the code, it slows down the page loading only for
that particular user and does not affect other users.
The execution model of NODE.JS is different - there is only one single process. If there is a
slow database query somewhere in the process, it affects the whole process - everything
comes to a halt until the slow query has finished.
We can understand this concept by analyzing the re-written version of the problematic
code:
Instead of expecting database.query() to return the result directly, we pass it the second
parameter - an anonymous function.
In the previous form the code was synchronous: “first do the database query, and only
when this is done write to the console”.
Now, NODE.JS can handle the database request asynchronously, provided that
database.query() is part of the asynchronous library. It takes the query and sends it to the
database, but instead of waiting for it to be finished, it makes a ‘mental note’ saying "when
at some point in the future the database server is done and sends the result of the query,
then I have to execute the anonymous function passed to database.query()."
405
Server-side Scripts
Then, NODE.JS immediately executes console.log() and enters the event loop. It
continuously cycles through this loop repeatedly, even though there is nothing else to do -
events such as “slow database query” finally deliver their results.
Note: This asynchronous, single-threaded, event-driven execution model is not always the
only and the best option - it is just one of several models, and it too has its limitations (one
being that NODE.JS is just a single process capable of running on one single CPU core).
However, this model is quite approachable, because it allows for writing of applications
that deal with completion in an efficient and relatively straightforward manner.
You might want to take time to read Felix Geisendörfer's post on “Understanding NODE.JS”
for additional background explanation.
Report Wizard
This feature helps you create a report step-by-step in the scripts, which saves you plenty of
time spent creating the reports manually.
1) Select the Server-Side Scripts folder in the Project Window and click on the Report
Wizard icon in the toolbar. The following window will appear:
2) In the tab Data-log, select data-logs and tags to be included in the report table. You
can also activate data processing in the script - check the box Process Data in Script. If
406
Server-side Scripts
you wish to create a report without data-logs check the box Without Data-log, then
click on the Next button.
3) The following Chart tab allows you to include a time chart of data-logs in the report.
You can select the data-logs and tags to be displayed. If you do not wish to include the
charts in the report, check the box Without Chart. Click on the Next button.
4) In the Alarms tab, you can select alarms to be included in the report; then click on the
Next button.
407
Server-side Scripts
5) In the Send tab, you can select the way the report from your project will be sent.
Fill in the necessary information as shown in the picture below and click on Next.
6) In the last tab, you will see the list of generated report template files. Now, you have to
set the triggering actions for your report to be sent. Click on the button Copy Code to
Clipboard to use a generated report script for later use and click on Close.
408
Server-side Scripts
409
Server-side Scripts
Example:
1) Prepare a report in MS Word (or any compatible text editor)
410
Server-side Scripts
Note: You can use the timed scripts for report generation in predefined intervals or for
certain dates.
411
Server-side Scripts
NOTE: By default, when you open main.js, mySCADA is already included.
Now you can use any mySCADA specific function. List of all available functions can be
found in online help located under the source code-editing window:
34.13 Debugging
With this feature, you can manually debug your written scripts. Debugging uses an
integrated debugger.
The debugger integrated into myDESIGNER is a powerful debugging interface.
Main functions:
Navigate to your source files
Set breakpoints (and specify trigger conditions)
Step over, step in, step out, resume (continue)
Inspect scopes, variables, object properties
Hover your mouse over an expression in your source to display its value in a tooltip
Edit variables and object properties
Continue to location
Break on exceptions
Disable/enable all breakpoints
412
Server-side Scripts
IMPORTANT: Before you start debugging, make sure you have the same project
downloaded to your device as you have in myDESIGNER.
1) To start debugging, click on the main.js script and then on the Debug icon in the main
toolbar.
413
Server-side Scripts
Note: If your script generates some files, you will find them in the path specified in
UserData dir.
Console Log
For debugging of server-side scripts on mySCADA Compact devices, you can use the
Console log, accessible via a web interface of mySCADA Box in the menu SYSTEM and the
bookmark STATUS.
The console is accessible through any mySCADA runtime with a telnet connection on the
port 11015. The windows users can use a freeware utility Putty (see picture below), and the
UNIX users (including MAC) can use a telnet command with a specific port.
Another useful tool for debugging of server-side scripts is to define a function for logging
of uncaught exceptions:
This function will log a description of uncaught errors into the console; you can, of course,
define any action inside this function.
414
Server-side Scripts
In the Status column, you can see the web log and restart all server-side scripts. You can
use this log from your scripts with the function myscada.logFile ("your text"), which will add
a time stamp to your text. This function is embedded in NODE.JS, so you can call it
without requiring it.
In the next part, there are reports on the Main script and on Timed scripts. There are three
parameters in this report:
415
Server-side Scripts
After configuring the desired serial ports, you can switch to the SER2NET bookmark and
configure the Ser2Net service. The Ser2Net configuration window is shown in the picture
below:
By default, the Ser2Net service is stopped and the service auto-start is disabled. To enable
auto-start of Ser2Net, you have to check the Start after reboot box and click on the
Change button to save the settings. The Start and the Stop buttons can control the
Ser2Net service manually. To enable access to the serial port via Ser2Net, you have to set
up a new device by clicking on New device. The Add device dialog is shown in the
following picture.
416
35 View and Server Side Scripts –
Common tasks
This chapter will show you how to achieve a common tasks using the View or Server Side
Scripts. You will learn how to simply create a timer, read historical data from data-logs and
alarms, use open command, generate reports and more.
Creating Timer
To create a timer, click on a Timer Icon in the toolbar.
417
View and Server Side Scripts – Common tasks
New dialog will appear:
Select an time period and tick repeat if you want to trigger the timer periodically. Once
you press OK, myDESIGNER will automatically create a code for you and insert it into the
edited script.
418
View and Server Side Scripts – Common tasks
New Dialog will appear:
Now select the dates and times, when you want your code to be run and press OK button.
myDESIGNER will automatically create a code for you and insert it into the edited script.
For detail description, please see section Simple Periodic Export to CSV and Microsoft
Power BI
in this manual.
419
View and Server Side Scripts – Common tasks
In the provided dialog, please start by selecting a data-log from which you want to read
data. Then select an items you want to process, or leave all selected. Other options follow:
Limit by time: first you can limit the data by provided time. Time is specified in UTC
format in seconds since 1.1.1970. You can enter a value or provide a variable where
the value is stored.
Filter: if the data-log contains a keyed value, you can limit results shown in your
project by specifying a filter value. Again this can be a hard value or variable.
Limit records to: please provide limits for the number of records loaded. You can
also specify if the limit is taken from the beginning eg. “from start” or from end.
Loop over results: if this option is checked, you will have an option to loop over the
retrieved records and process them in your script.
420
View and Server Side Scripts – Common tasks
Export to CSV (Server side scripts only): if you choose this option, the retrieved
historical data will be exported into a CSV format and saved into a file. File is saved
under a provided name into user data folder accessible over FTP or HTTP and
HTTPS.
press OK button. myDESIGNER will automatically create a code for you and insert it into
the edited script.
421
View and Server Side Scripts – Common tasks
New dialog will open:
In this dialog, you can choose if to process Online or Historical alarms. We will start with
Historical alarms:
Historical alarms dialog has several sections. We will explain in details each section.
Columns:
Columns allows you to select all the data retrievable from the history. Please select what
columns you want to process.
Filters:
Currently, you can filter retrieved data based on time interval. Future versions will allow to
extend the filter for Message, Area and Device as well.
Aggregates:
If you need historical alarms in the form they have been stored, leave aggregates to none.
If you want to retrieve an aggregated data based on alarm occurrence count and overall
activation time, please tick the occurrence option.
Limit records to: please provide limits for the number of records loaded. You can
also specify if the limit is taken from the beginning eg. “from start” or from end.
Loop over results: if this option is checked, you will have an option to loop over the
retrieved records and process them in your script.
422
View and Server Side Scripts – Common tasks
Export to CSV (Server side scripts only): if you choose this option, the retrieved
historical data will be exported into a CSV format and saved into a file. File is saved
under a provided name into user data folder accessible over FTP or HTTP and
HTTPS.
press OK button. myDESIGNER will automatically create a code for you and insert it into
the edited script.
Online Alarms can be processed as well. To do so, click on the tab Online and dialog will
change accordingly:
423
View and Server Side Scripts – Common tasks
This function will retrieve active or non-acknowledge alarms at the time script is run. You
can select which columns you want to process or maximum severity level. Other options
are:
Loop over results: if this option is checked, you will have an option to loop over the
retrieved records and process them in your script.
Export to CSV (Server side scripts only): if you choose this option, the retrieved
historical data will be exported into a CSV format and saved into a file. File is saved
under a provided name into user data folder accessible over FTP or HTTP and
HTTPS.
press OK button. myDESIGNER will automatically create a code for you and insert it into
the edited script.
To read or write tags from PLC, you must create a PLC request table first. To do so, please
navigate to the PLC Variables Tables section and create a new table. You can call it
whatever you like.
424
View and Server Side Scripts – Common tasks
In PLC Variables Table, you define what tags will be read or written from the PLC.
In this example, we will be reading two numerical values and one string from the PLC with
alias M.
Once you create your request, you can proceed to the script. Click on the R/W Tags button
and you will be presented with the following dialog:
In the dialog, you can see, we have specified our created PLC variable table called temps.
You can see all the defined tags in the Tags section. If you wish to read/write only some
tags, please, uncheck the others. Once you are done, press OK button. myDESIGNER will
automatically create a code for you and insert it into the edited script.
425
View and Server Side Scripts – Common tasks
For tags reading:
As you can see, myDESIGNER has prepared a code for you, which will read your tags. For
each tag, you will get its value and also a status info if it was read or ended in error (for
example if you missed typed the tag address)
As you can see, first we create object options and we put all the values we want to write
into the options -> values array. Then we call the function myscada.writeTags. On
successful write you will get the callback to your function.
For detailed explanation on how to generate report from server side scripts, please look at
the section Creating Report on Demand in Reports chapter in this manual.
426
View and Server Side Scripts – Common tasks
In Other guides dialog you are able to:
To read history of user actions, please select the tab User Actions History.
Limit by time: first you can limit the data by provided time. Time is specified in UTC
format in seconds since 1.1.1970. You can enter a value or provide a variable where
the value is stored.
Limit records to: please provide limits for the number of records loaded. You can
also specify if the limit is taken from the beginning eg. “from start” or from end.
Once you are done, press OK button. myDESIGNER will automatically create a code
for you and insert it into the edited script.
427
View and Server Side Scripts – Common tasks
Insert rows into the data-log
With this function, you can easily fill in data-log with data computed in server side scripts.
This can be very convenient in cases when you want to log computed data instead of raw
data from the PLC. We will show how to create a custom data-log and fill it with data in
server side scripts.
3. Firstly, we need to create a custom data-log definition. This is an data-log which will
hold our data. To do so, please navigate to Script Data Logs in server side scripts.
As you can see, we have created data-log with 3 values, two numeric and one string.
As you can see, Script data-log has the same definition as regular data-log. Only
difference is, you don’t link script data log to any data source, but you fill in its values
from the server side scripts. Also, you can create a data-log views for this data-log as
you would do with regular data-log. Once you are done with definition, we will
proceed to data filling.
4. Filling the data-log with data. To fill our created script data-log with data, please
click on the Other button and select an Insert Datalog Row tab.
428
View and Server Side Scripts – Common tasks
https://code.tutsplus.com/tutorials/nodejs-for-beginners--net-26314
http://nodeguide.com/beginner.html
When reading the tutorials, you can skip the node.js installation and environment set up, it
is already done by myDESIGNER for you. Also to install new packages, you can use
embedded npm in myDESINGER. It is located on the main toolbar.
Did we forget to mentions myDESIGNER has embedded debugger for your scripts? Just
press “debug” to debug your code instantly.
1. Firstly, navigate to the Server Side Scripts section and open the PLC Variables Tables
section.
429
View and Server Side Scripts – Common tasks
3. In the dialog, provide a name for the table, select connection and hit the “Create”
button
4. You will be presented with the table where you should fill all the tags you wish to
read from the PLC.
As you can see, we have added 2 tags, one is a Numeric type and other is a String.
5. When you are done, open the main.js script from JS Sources.
6. While in the script, click on the R/W tags button which is located in the scripts
window toolbar
430
View and Server Side Scripts – Common tasks
7. In the dialog, select the name of the table we have created in step 3
8. When you press the OK button, myDESIGNER will generate the code for you.
9. Once this code runs, you will receive values from the PLC and they will be stored in
the local variables
As you can see from the code, you will receive the values from the PLC as well as the
info if the mySCADA was able to read from the tag.
431
View and Server Side Scripts – Common tasks
35.7 Writing data into PLC
To write values into the PLC, you will follow the exact same procedure as for reading tags,
but, in the end, you will use a different function to write values. In this example we will
write a numeric value and string into the PLC.
1. We will prepare PLC Variables Table named “modbus”, to do so, please follow steps
1. to 6. In the previous section.
2. Once you have the R/W Dialog loaded, please tick the Write on the bottom part of
the dialog. When you are done, press the “OK” button, and myDESIGNER will
generate the code for you.
3. When this code runs, values 10 and “String” will be written to the PLC.
432
View and Server Side Scripts – Common tasks
When you click on “OK”, you will have a periodic timer created.
To execute a function in scheduled time intervals, please use a Cron function. It is located
in the script toolbar:
433
View and Server Side Scripts – Common tasks
For example, to execute a script every hour, select hourly:
There is a list of times showing you when the script will run. Now press the “OK” button. A
predefined function will be added to your script.
Step 1: Create your report. To do so, navigate to the Reports section of your project and
select “new.” You will be presented with the Reports GUI designer:
434
View and Server Side Scripts – Common tasks
Step 3: Use server side script to run the report in defined time intervals:
b Now into this function, enter the report generation. You can use the Report dialog
to generate a function for you:
435
View and Server Side Scripts – Common tasks
After pressing “OK” button, you will get the final code:
Now your report will be generated every hour. You will find the generated file in the user
directory accessible over www pages or over FTP.
436
View and Server Side Scripts – Common tasks
35.11 Limiting Access to Generated Files
The files you generate either by using the Report Generation feature or by writing into files
are located in UserFiles section. You can limit access to this section in Accesses.
Please, don’t forget to enable FTP or HTTP access to access your files!
2. Use the data-log function, it is located in the toolbar of the script window
437
View and Server Side Scripts – Common tasks
Select just the first value as we need to calculate the average from one value only.
After pressing OK, myDESIGNER will generate the code for you including the loop.
438
View and Server Side Scripts – Common tasks
Now you have the computed average from last hour, you can do with it whatever you
need.
Very often, you need to export data from data-logs into the CSV files. Doing it in mySCADA
is very easy and straightforward. All you have to do is:
439
View and Server Side Scripts – Common tasks
7. Tick the “Export to CSV” option and Press “OK” to generate the code:
440
View and Server Side Scripts – Common tasks
When this code is run, mySCADA will read values for the previous one hour (specified by
timeFrom) and save them into the file called datalog_export.csv
If the file exists, it is overwritten. If you want to append data to this file instead, please use
option “append.” This way when you run the script, new data will always append to the
end of the file.
2. And now we will create some tag inside. You can also create multiple tags.
441
View and Server Side Scripts – Common tasks
3. Now you can use the tag anywhere in your project. So let’s put it into the view:
We have created the text element, and we have used the Get Value animation
where we used our tag value@script
4. Next step will be to periodically update the value from scripts. To do so, please use
the function R/W Tags located in the toolbar of the script window.
a) Create a timer (you can use the Timer button in the toolbar)
442
View and Server Side Scripts – Common tasks
After hitting “OK,” the generated code will look like this
TIP: analogically, you can read values from virtual PLC using your scripts. To do
so, navigate again to the R/W Tags function and select read instead of write.
1. Create a Script Data log. To do so, navigate to Server Side Scripts -> Script
Data logs
443
View and Server Side Scripts – Common tasks
4. Now we will add one tag to the datalog and name it value
444
View and Server Side Scripts – Common tasks
8. In the following dialog, we will select “Insert data data-log row” and select
“periodic” data-log we have created in previous steps.
445
View and Server Side Scripts – Common tasks
As you can see, we have added the global.val variable which we increase with
each timer tick. This variable is written to the data-log using the function
insertRowIntoDatalog.
11. When your project runs, it will automatically write the value to the data-log
every 10 seconds
446
View and Server Side Scripts – Common tasks
We will show you a simple example on how to send a javascript object into the server side
scripts and get a javascript object as the reply back.
447
View and Server Side Scripts – Common tasks
1. We will create a view with a button. Click on the button, in properties select
Commands and On Click command. In On Click command select Script and create
a new function sendData.
2. Now open a view script and fill in sendData function. You can use drag and drop
from Help as shown on the picture:
448
View and Server Side Scripts – Common tasks
3. Now we will create a javascript object and send it to the server side script. You can
of course send a string or number as well.
4. Once we have our part in view script ready, let’s go to our server side script. Open
main.js
5. You can see there is already prefilled function called myscada.dataFromViewScripts
this function received all data you send from view scripts. Fill in the function:
6. You can see that our function receives data, multiplies the value in received object
by 2 and sends the object back.
7. Now when you load your project into myPRO or myBOX, when you press a button,
your object is sent to the server, received by the function
myscada.dataFromViewScripts and then sent back to view script.
449
View and Server Side Scripts – Common tasks
In the provided dialog, please select our created data-log by its name. Then fill in
the time stamp of the record. Under this time, the record will be saved. Time has
two parts, first is UTC time in seconds (since 1.1.1970) and second part is the number
of milliseconds. If you leave the default values, new record will be logged at the
time when your script is called.
Finally, fill in the values for each defined tag in data-log. Those can be hard coded
values or variables.
Once you are done, press OK button. myDESIGNER will automatically create a code
for you and insert it into the edited script.
450
36 Devices
This module allows a quick overview of all available mySCADA device connections
manually added and connected to the local network.
The main window of the Devices window is split into two parts:
Lower part displays the list of all compatible devices in the local network (iOS or
Android devices with the mySCADA app running in the foreground, mySCADA boxes,
and myPRO computers)
You can easily store online devices by selecting them from the Online Devices list and
clicking on the Add from OnLine icon.
451
Devices
1) Click on the Add Device button to add a device manually and fill in the dialog window:
396
37 EtherNet/IP Driver
The user is not forced to enter the data type during the screen drawing. The proper data
type is fetched during the data reading from the PLC. There might be some limitations, as
only certain data types are supported. The following paragraph specifies all supported
data types for a given PLC type.
The access to user-defined data types, like structures or arrays, is supported. To read or
write the elements inside the structured tags, you should use the “dot” notation, e.g.
Program: name.tag
name - program name
tag - tag name
So if you want to communicate with tag named valve from a program named control, you
will have the following syntax: Program:control.valve
397
EtherNet/IP-Driver
Limitation of the BOOL arrays in ControLogix
The different syntax to access the elements in the BOOL arrays is used in the
myDESIGNER, compared to the programs stored in the controller. In myDESIGNER, you
have to address the word and bit position separately. The word consists of the 32 bits –
BOOL elements and the range of the BOOL array is split into multiple words.
Example:
If you have a BOOL array TestBool with 54 elements, you can access its elements using
the following address:
For example, to read the status of levels in all 10 tanks, you should design your data types
so that all levels are stored in an array with 10 elements. Below you will see an example of
how to implement the faster method:
Level[1]
Level[2] FAST
Level[3]
If you prefer structures, you can use the following way; however, addressing of this type will
slow down the communication. Therefore, we do not recommend the use of this type of
data addressing.
BigTank[1].Level
BigTank[2].Level SLOW
BigTank[3].Level
398
38 MicroLogix and SLC Driver
For MicroLogix PLC, the data types are defined by means of the used file types. In PLC
programs, you can use many different file types, but only the types specified in the
following table can be read or written by the mySCADA application.
The other file types like Strings, Timer, Counter, and Control are not supported.
There is a limitation that certain outputs can be read-only. To set outputs, you should use
the other file type and then adjust the program design.
To access the file elements, you should specify the element position after the colon, i.e. to
read or write to the third element of the integer file no. 100, use the following syntax:
N100:3
You can access each bit directly by defining its position after the slash, i.e. to access the
seventh bit of the third element in the integer file no. 100 use the following syntax:
N100:3/7
399
39 Modbus Driver
The Modbus communication protocol describes the interactions of each device on a
Modbus network. In the protocol description, you can find all the details about
establishing addresses, device recognitions, and all other important parts of Modbus
communication. Here we will concentrate on protocol usage by mySCADA application.
Tag Meaning
30001-39999
Hfsb:e
Hfsw:e
Hdsb:e
Hdsw:e
400
Modbus Driver
Rds:e at address e
Rdsb:e
Rdsw:e
Read function: 2
10000-19999
Read function: 1
Write function: 15
1-9999
Modbus itself does not define floating-point data types, but it is widely accepted that it
implements 32-bit floating-point data using the IEEE-754 standard. However, the IEEE
standard has no clear definition of the byte order. Therefore, the most important
consideration when dealing with 32-bit data is that the data be addressed in the correct
order.
401
Modbus Driver
The following table shows two adjacent 16-bit registers conversion to a 32-bit floating point
or 32-bit integer values:
- N/A [a b][c d] [a b c d]
The following section describes the 32-bit data types implementation to the mySCADA
application.
402
Modbus Driver
403
Modbus Driver
H:0 H:1 H:2 H:3 H:4 H:5 H:6 H:7 H:8 H:9
In 32-bit data type numbers, the signed integers are used by default, and the suffix “n” is
not used.
Example:
An example of advanced Modbus functionality can be seen on ModbusDemo screen,
which can be downloaded as a part of the demo project from
http://www.myscada.org/downloads.
404
Modbus Driver
The current values of inputs and outputs are visible in the upper part of the screen.
Further, the current values of holding registers H:0 and H:1 and their data interpretation
if the stored numbers are signed integers, float numbers, or 32-bit integers.
To set the register, click on the Set or Toggle buttons. Figure 46 shows the storage of a
floating point number 376.455 stored using an Hf:0 register, and the floating-point value
2.456 is stored in the input register Rf:0. z
405
40 Siemens S7 family PLCs Driver
IMPORTANT: mySCADA uses mySCADA is using a direct memory access when
communicating with Siemens S7 PLCs. Make sure you uncheck the “optimized block
access” checkbox in your TIA portal project.
Address Syntax
Note: The Variable Memory is available only for S7-200 and LOGO!.
406
Siemens S7 family PLCs Driver
Note: Be cautious while modifying WORD, INT, DWORD, and DINT types, as each address
starts at a byte offset within the device. Therefore, words MW0 and MW1 overlap at byte 1.
Writing to MW0 will also modify the value held in MW1. Similarly, DWORD and long types
can also overlap. It is recommended that these memory types should be used in such way
that overlapping does not occur. As an example, DWORD MD0, MD4, MD8 ... etc. can be
used to prevent bytes from overlapping.
407
Siemens S7 family PLCs Driver
40.4 Protection
Select the CPU project in the left panel and press Alt+Enter (or in the contextual menu
select “Properties…”)
In the item Protection, select “Full access” and Check “Permit access with PUT/GET ….”, as
pictured.
408
Siemens S7 family PLCs Driver
2) Set up the CP243 position and IP configuration; in the next window, select at least one
Peer-to-Peer connection and set it up the same way as with LOGO!
409
41 OPC UA Driver
OPC Unified Architecture is an interoperability standard developed by the OPC
Foundation. It is the successor to OLE for process control (OPC). Although developed by
the same organization, OPC UA differs significantly from its predecessor, i.e. the older
DCOM-based version is not supported. Using this protocol has two main advantages:
Security – configures a secure message interchange based on contemporary
cryptography
Scalability – OPC server can communicate with a different vendor’s infrastructure
You should keep in mind that when using OPC you are not communicating with PLCs
directly. The OPC server stands in the middle, and all communication is dependent on
the OPC server configuration.
OPC
myScada PLC
Server
mySCADA implementation of the OPC UA standard supports only the binary protocol -
opc.tcp://Server. We do not support the web version – http://Server.
410
OPC UA Driver
411
OPC UA Driver
41.2 Tag Name Syntax
The tag name is any string that is supported and accepted by the connected OPC UA
server. You can use the browse function in the designer to get the list of tags at your
disposal. You can use the dialog to select the proper tag; later, after selecting, you can edit
the tag name. Usually, the subsequent edition is not needed, but sometimes it is, e.g. to
target the proper tag address by adding the suffix.
412
42 MELSEC-Q Driver
Currently, mySCADA supports only a part of MELSEC-Q protocol, namely 3E type of
packets, originally intended for E71 type adapters. In the table below, you can find the list
of both basic (original) tag syntaxes and some extensions introduced by our team.
(91h)
(A9h)
(9Ch)
(9Dh)
(90h)
(92h)
(93h)
(94h)
(A0h)
413
MELSEC-Q Driver
(A8h)
(B4h)
(C1h)/(C0h)
(C4h)/(C3h)
(A1h)
(A2h)
(A3h)
414
MELSEC-Q Driver
Our implementation of MELSEC protocol also supports the following extension tags:
Tag Meaning Address range (decimal)
All custom tags consist of multiple regular 16-bit tags in the least to the most significant
word order.
Port – port for the TCP connection to the PLC; please note that all Mitsubishi PLCs support
only one connection / port. For multiple connections to the same PLC, set a different port
for each mySCADA device.
MultiBatch Optimized – enable this function if the PLC supports “Multiple block batch
read/write” functions (codes 0406/1406). Enabling this option for a PLC that does not
support such functions will cause a communication error.
CPUTimer – set this parameter if you expect an extensive communication with the PLC or
communicate with a heavily loaded PLC to increase the response preparation time on the
PLC side.
415
MELSEC-Q Driver
Optimization Window – this setting influences how “aggressive” the optimization of your
request will be. If it is set to 0, each tag will be requested in a separate packet (slow, but
helps to find errors in the syntax). With a default value of 1, all “adjusted” tags (D0000 and
D0001, for example) will be requested in one packet. Setting it to 2 allows optimization to
skip one tag address to the count tags as “adjusted” (for example, D0000 and D0002 will
be requested in one packet with such a setting). Setting it to 3 allows it to skip 2 addresses,
etc.. The maximal value for this setting is 20. Please note that if an error returns in response
to the request, all tags included in this request will not be read. Use this feature carefully.
The following block of settings is only required for hierarchy access within the MELSEC
network of multiple PLCs - for a direct (local) communication, leave the settings at their
default values.
Request dest.Module No. – sets the number of requested modules for multi-CPU PLC
connection
Request dest.Module I/O - sets the number of requested modules for connecting via
multi-drop
416
43 SigFox Driver
SIGFOX is a cellular-like system that connects remote devices using Ultra Narrow Band
(UNB) technology. It is mainly targeted at low data rate applications. A large number of
devices can be interconnected using SIGFOX technology. mySCADA provides a direct
connection to the SIGFOX portal. You can retrieve current data from all of your devices
registered in SIGFOX portal and use them freely in mySCADA to visualize, log, and use for
alarming.
1. First, log into the SIGFOX portal at https://backend.sigfox.com, select your group,
and enable “Api access.” You will be presented with login details as in the picture
below:
2. Create a new connection in the mySCADA project and enter the Login and Password
from the previous step.
3. Now please add all the devices you wish to use the SIGFOX portal.
Reading data from devices: To read data from your devices connected to SIGFOX network,
all you need to know is the ID of your device. You can find the ID in the device list:
417
When you know ID of your device, you can read various pieces of information from the
device: for example, latitude and longitude, time of delivered message, or the message
itself. To read the message, you have several options of how to retrieve values from the
message automatically. To do so, please look at the format on how to do it.
deviceID.code.datatype[index].bit
deviceID is the ID of your device as registered in SigFox portal; it is a five-digit hexadecimal
number.
code specifies which data you want to read from the device. Possible options are:
data - message from the device (up to 12 bytes)
lat - latitude
lng - longitude
time - time of received message in UTC unix timestamp format
tap - TAP ID of the base station that received the message
TIP: if you just want to read values from the message, you can omit writing "data" and
directly write: deviceID.datatype[index].bit
43.1 datatype
The system can automatically convert most of the data types from your message. The
following types are possible:
418
SigFox Driver
Int signed int 4
float floating point number 4
Chars return char array Length of message
String read and convert the Length of message * 2
message into HEX string
format
IMPORTANT: By default, all data are represented in Little Endian format, typical for
embedded devices. If you want to represent data in Big Endian format, add “be” before the
data type.
Index
If you don't specify index, values are read from the beginning (that means from the zero
index). You can specify at which byte of the message your data are located, e.g. where to
start reading from. Therefore, for example, C3896.int[2] will start reading data from the
third byte of the message and will read 4 bytes, converting them to integers. The index
always starts from 0.
Bits
For integer data types (char, sint, int) you can also extract bits. To do so add .BitNo after the
data type. For example, this command C3896.char[1].2 will read the second character from
the message and extract the third bit. Therefore, you will get 0 or 1 as a result, depending
on the bit status.
Advanced Settings
Moreover, you can control some advanced settings concerning your device by adding a
JSON type string after the tag. The syntax is as follows
deviceID.code.datatype[index].bit{“timeout”:3600}
Currently, only the option timeout is supported; in the future, more options will be added
based on customer requirements. Timeout specifies the maximum age of the message to
consider device communication. The value is in seconds.
419
SigFox Driver
Examples
C3896.char read first char of the message
C3896.char[10] read 11th character of the message (indexing is always from zero)
C3896.int read first four bytes of message and convert them to integers
C3896.int[2] read four bytes of the message starting at the third character and
convert them to integers
C3896.char[1].0 read the second character of the message and return 1st bit of it
420
44 Databases Driver
mySCADA has embedded communication drivers for most of the common database
systems, namely Oracle DB, Microsoft SQL, PostgreSQL, MySQL, and SQLite. mySCADA also
enables generic connections to any database supporting a standardized ODBC driver.
Please select Database, and you will be provided with connection details.
Please fill in necessary details such as username, password, and Host address. It can be
either the IP address or host name.
In the Query -> Read section, fill in your query to retrieve data.
421
Databases Driver
44.1 Reading values from SQL database
Once you have added the connection, you can now use values from the database
anywhere in the mySCADA project. To do so, please follow the described syntax.
COLUMN1@alias
COL[1]@alias
COLUMN2[5]@alias
Will retrieve value from column with name COLUMN2 on 5th row.
COLUMN1[ID>1]@alias
Will retrieve values from first column; only rows with column named id is greater
then 1 will be processed.
ROW[1]@alias
ROW[id=5]@alias
Will retrieve values from first column; only rows with column named id is greater
then 1 will be processed.
422
Databases Driver
44.2 Examples
(tag data are marked in green)
Note: Access to Oracle, PostgreSQL, and MySQL databases uses a native driver
provided by the corresponding companies.
Tip: You can have multiple connections to single or even multiple databases. This
way you can use multiple tables and optimize your queries.
You can also use mySCADA to write new values or update existing ones in the SQL
database. To do so, please follow these steps:
1. In the connection parameters, please fill in the SQL –> Write Query. This query is
a template for your write query; you can modify it anytime when specifying a
new set command. However, it is convenient to prepare this template query so
you don’t have to write it all over again.
424
Databases Driver
2. Specify a set command
In set command, you can see your write query. This query will write values to the
database. As you can see in the query, there is the keyword VAL; whenever you use
VAL followed by a number, this VAL will be replaced with the real value provided as
user input at runtime.
If you put multiple set commands into one Batch, they will be all processed as one
query; in this case, you should have as many VAL keywords in your query as you
have your sets in your batch.
For detailed information on how to work with set command and batches, please
look at the corresponding chapter in this manual.
You can use SQL connectivity in your scripts. This way you actually have limitless
options on how to link mySCADA with your database. You can, for example, read
data from PLCs, process them, and send processed data to the SQL database.
To work with SQL in Server Side Scripts, please use the corresponding mySCADA
functions in the section SQL. You can also look at the provided examples.
425
45 Download/Upload from/to Device
1) Select the project you wish to download to the device from the Projects folder in the
Project Window - this will render the Upload/Download icons
in the toolbar.
2) Click on the Download to Devices button to load the selected project to the device.
You can also right-click on the project from the list and select Download from the
menu.
426
Download/Upload from/to Device
3) In the following dialog window, you will see the list of all defined devices and all
available On-line devices you can load your project into (except mySCADA Box and
myLOGGER - these need a serial number for communication).
4) Before downloading, check the box Check Project before Download -> if there are any
errors found the following dialog will show up:
Note: You can download your project to multiple devices at once. To do that, check
multiple devices.
Warning: when loading a new project to your device all existing projects loaded on the
device will be overwritten! Thus, be sure to back-up all important project information from
the device before loading a new project to it.
427
Download/Upload from/to Device
45.2 Upload from Device
You can also upload a mySCADA project from your device to myDESIGNER.
1) Click on the Upload from Device button or right-click on the Projects folder in the
Project Window and select Upload from Device from the context menu. The following
dialog window will show up:
2) Select the device you want to upload the project from and click on the Connect
button. If the connection is successful the following message will be displayed:
429
Now start using your created project and enjoy working with
mySCADA.
THANK YOU!
No part of this document or of the program may be reproduced or transmitted in any form without
the express written permission of mySCADA Technologies s.r.o.
Information in this document is subject to change without notice and is not binding in any way for
the company mySCADA Technologies s.r.o.
430