Sunteți pe pagina 1din 241

mySCADA Editor

User Manual

Ver. 2013

www.myscada.org

mySCADA Technologies s.r.o. 2013

Table of Contents
1 2 3
3.1 3.2

About mySCADA Editor..................................................................................... 3 Before you start ................................................................................................ 5 Download/Upload to/from device....................................................................... 9
Download to Devices ...............................................................................................................9 Upload from Device ............................................................................................................... 10

4
4.1 4.2 4.3 4.4 4.5 4.6 4.7

SVG Editor (In Details) ......................................................................................13


Basics of drawing and working with objects ............................................................................ 20 Drawing lines and curves ....................................................................................................... 24 Path operations ....................................................................................................................29 Grouping elements ................................................................................................................ 35 Other features of drawing ......................................................................................................38 Paste elements ..................................................................................................................... 51 Sorting objects...................................................................................................................... 57

5
5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9

Creating new Views ......................................................................................... 65


Start the SVG Editor..............................................................................................................65 Basic Drawing .......................................................................................................................65 Reading Tag Values ...............................................................................................................66 Tag Connection .....................................................................................................................68 Creating the Parametric window ............................................................................................ 70 User access level.................................................................................................................... 71 Adding components or icons .................................................................................................. 72 View properties .....................................................................................................................78 Error Box Properties ..............................................................................................................79

6
6.1 6.2 6.3

Start new project ............................................................................................ 81


Creating Connections ............................................................................................................81 Creating Views ......................................................................................................................83 Editing of Views ....................................................................................................................83

7 8 9 10 11 12 13
13.1 13.2 13.3 13.4 14.1 14.2 14.3 14.4 14.5 14.6 14.7 14.8

Importing Documents into a Project ................................................................. 87 Creating Trends............................................................................................... 89 Creating Alarms .............................................................................................. 93 Creating Connections ...................................................................................... 96 User Access Levels........................................................................................... 98 Creating and Testing Components................................................................... 103 Properties...................................................................................................... 122
Text Properties ................................................................................................................... 122 Properties of geometric objects............................................................................................ 132 Properties of background..................................................................................................... 134 Project Properties ............................................................................................................... 136 Rotate animation ................................................................................................................ 152 Visibility animation ............................................................................................................. 154 Scale animations ................................................................................................................. 155 Color animation .................................................................................................................. 160 Move animation .................................................................................................................. 162 Get Animation .................................................................................................................... 176 Basic Tag Name Syntaxes .................................................................................................... 179 Sound Animation ................................................................................................................ 180

14 Animations .................................................................................................... 151

15 Effects ...........................................................................................................187 16 Scripting........................................................................................................194 1

17 18 19 20
20.1 20.2

Resources ......................................................................................................199 Devices..........................................................................................................208 Entering Advanced Functions(Equations)......................................................... 212 Entering Expressions ......................................................................................216
Tag Address ........................................................................................................................ 216 Expressions......................................................................................................................... 216

21 22 23
23.1 23.2 23.3 23.4 23.5

DOM viewer ................................................................................................... 223 Memory monitor ............................................................................................ 225 Communications ............................................................................................226
EtherNet/IP (ControLogix) ................................................................................................... 226 MicroLogix and SLC............................................................................................................. 227 Modbus .............................................................................................................................. 228 13.4 Siemens S7 family PLCs ................................................................................................ 233 MELSEC-Q .......................................................................................................................... 236

1 About mySCADA Editor


The mySCADA Editor, part of mySCADA bundle, is an integrated development environment used to configure, develop and manage HMI/SCADA applications. You will find everything you need to create a full-featured SCADA (Supervisory Control and Data Acquisition) visualization with this editor. The mySCADA Editor is used to create and manage mySCADA projects, configure connections to devices, enter tags, alarms, and trends. This editor also allows you to design advanced mimic graphics with specific animations corresponding to tag values in the PLC. A simple to use interface allows for easy manipulation of projects configuration and data. Project data is stored in a single directory for easy backup and restoration. The mySCADA Editor has an integrated GUI visualization editor for easy creation of professionally looking mimic graphics. The graphics are based on the Scalable Vector Graphic format, which means you will always have a sharp view of your controlled technology.

Key Features
Free for personal and business use Simple to use GUI design in Scalable Vector Graphics (SVG) Animations and effects based on tag values can be added to any shape or object Support for background images (JPEG, GIF, PNG) Ability to attach PDF-documents to the project Ability to attach MP3-sounds to the project Built-in script editor Integrated development environment Available for Mac OS X and Windows

Drawing capabilities
Shape tools: rectangles, circles, ellipses, paths Path tools: Bezier curves, conversion to a path, union, subtraction, intersection, merge Group editing Basic text support Images import Transformations: resize, rotate, skew, align, distribute Property manager Resource manager: gradients, patterns, markers DOM viewer Memory monitor

Project Management
The key components of any mySCADA project are the visualization screens. This is where the schematic visualization of the devices being controlled is displayed. Within these visualization screens, an object or groups of objects can be created and then defined

specifically for communication with the connected PLC. These specified objects will then be animated on the basis of the tag values located inside of the PLC. The display screens are internally represented as SVG files. Defined project connections are internally represented as configuration text files, along with the alarm states and trends which are also stored in a separated text file. Text files are easily edited in mySCADA Project editor instead of editing the text file directly. Scripts are also stored in separated files, so that you can edit them with your favorite text processor instead of this editor. The mySCADA projects are saved directly onto your computers hard drive and are composed from all the configuration text, SVG files, scripts, documents and sounds. The following sections describe how to create new projects, how to add, configure or delete connections, how to define alarms, trends and other project settings.

2 Before you start


Start page
The first screen that is presented to the user when starting the application is the Start page.

Click on the blue arrow on the right below corner of the screen to briefly acquaint you with the possibilities of mySCADA Editor. This window always opens when you start the application. To prevent this, uncheck the box Show On Startup down in the middle. You can close the Start page by clicking on the cross to close the tab (below the Toolbar).

Starting the Editor


Upon starting the application you will see the same screen as shown below.

Menu
Devices Equipment with installed mySCADA application, accessible from current instance of editor Document load, copy and deletion of attached PDF-documents File manipulation with project files and print Edit edit alarms, connections and users of projects Library work with Library Script manipulation with scripts Sound load and deletion of MP3-files Trend opening up and closing trend View work with views Navigate navigation between open tabs Tools editor core settings and plugins Window direct access to different editor tabs and window control Help opens the help menu

Toolbar
Basic Toolbar consists of the following functions: Save save your work Save all files save all opened files, if Compile on Save feature is set all opened files will be compiled/built also Upload from Device downloading project from selected mySCADA equipment. Be aware that all files in current project will be overwritten Download to Device uploading the project to selected mySCADA equipment. Be aware that all on selected device will be overwritten New Project creates new project Open Project open an existing project Close Project close selected project Project Up Move project up in the list 6

Project Down Move project down in the list Content of this toolbar can change, depending on selected project element (i.e. project, view, sound, script, document or alarm). Described icons set is attributed to the Project element only, other possible sets are described in chapter, devoted to relevant elements.

Projects Window
Display tree views of opened projects, available libraries and link to the list of connected devices. Project Views all HMI screens for given project Documents PDF-documents, attached to the project Trends configured trends Alarms configured alarms Connections PLCs connections for given project Scripts background scripts (will be loaded to mySCADA box only) Sounds associated sounds in MP3-files Users defined project users (mySCADA for iOS only) Components - Library of dynamic HMI/GUI components sorted into categories. Icons - Library of icons sorted into categories for HMI/GUI development Devices list of available devices to load project from/to. Here you find all iPods, iPhones, iPad Touches and mySCADA BOXes you can connect to. You can also specify a device manually to reach devices from remote network. Be aware that it may take few minutes to find all devices, available on the local network.

Overview Window
This window displays a file preview, when one of the views is selected, otherwise is empty.

Properties Window
This window allows the access to specific characteristics of the project or object. Specific properties of objects are described in the relevant chapters. Animation Properties: allows the work with Components using the Properties, Animations, Effects and Set commands. You can set User access rights for each element of the view. Resources: different types of Gradient, Pattern, Marker fills. Library: the library of Components and Icons.

Main Window
This part of the window is your main work area. Contents of all project elements open here, giving you the ability to draw visualization, change connection details or alter alarm or trend details. Script editor also use main window.

Help Window
The help window provides the description of an object or selected function. You can modify your workspace by resizing each of the windows. To reset your workspace to default state please use Reset Windows functions from Window menu.

You can quickly switch between opened components windows through appropriate tabs at the top of main window. You can use button to expand the list of all opened projects and select one of them. The arrow next to the project name indicates the currently displayed project. Button maximizes the main window by docking the rest of the opened windows to the right and left sidebar. Buttons are used to move between different opened tabs in case that all opened tabs will not fit into the main window.

3 Download/Upload to/from device


3.1 Download to Devices
A project can be saved by choosing the Save item from the menu. As the result all the project files will be saved to the disk. The saved project files are available for download to your devices. Select project folder on the projects list, this should render upload/download icons on the toolbar To load selected project to your device please press Download to Devices button -

You can also right-click on the project folder on the project list and select Download from the drop-down menu. Further dialog appears:

In this dialog window you see a list of all defined devices and all available OnLine devices you can load your project onto.

Note: loading through slow connection may take significant time. To reduce amount of data transferred please use compressed transmission option in the project properties. The back side of compression is that you need more free space available in the device (for archive and unpacked project), so for large project you may receive load error, insufficient space. In that case check your project size and disable compressed transfer. You can download your project to multiple devices at once, check multiple devices for that. Warning: when loading a new project to your device you overwrite and unrecoverable loose all existing projects already loaded and saved on your device. Please back-up all important project information from your device before loading it with a new project.

3.2 Upload from Device


You can also upload mySCADA project from your device to your mySCADA Editor.

10

Select one of the existing projects (warning: all data in the folder will be overwritten!) or create a new one. Click on Upload from Device button and select Upload from Device from the drop-down menu. Further dialog appears: or right-click on project folder

Select the device you want to upload the project from and click on Connect button. On successful connection the following message appears:

Click on the Upload from Device button The warning dialog notifying a possible project data loss appears. Please note that all old data saved in the project folder will be deleted when uploading from your device. Decide according to the content of the selected project folder. 11

After successful upload of the project confirming dialog will be shown.

Now you can work with your uploaded project.

12

4 SVG Editor (In Details)


The SVG Editor is a drawing system based on Scalable Vector Graphics based on XML technology developed by W3C.

Main Window
To create a new view for process visualization select the Views folder in the Project window and click on the Add View icon, located above the main screen. Other option is to create a new view in the main menu: View->Add New View.

A new dialog window opens to set the parameters of the desired visualization:

Name: view name Description: additional comment for visualization Parametric Window: ability to create a parametric view. Use the parametric view when you need few similar views that differ only in the source of data. Such source 13

is specified by the index received, when parametric view is called. (see Sets Open command). Connection: list of PLC connections, defined in the current project Refresh: refresh rate of the visualization, time in milliseconds Page orientation: Portrait predefined vertical display Landscape predefined horizontal display User defined option to define width and height of the view Fixed window dimensions can be changed in the menu: Edit->Transforms->Resize the canvas later. Press Add button to create view with selected parameters. Press Cancel to exit without creating or saving the new view. In the Project window you can see each of the views listed under the Views folder. In the Properties window you can see the parameters of the currently selected view. To open an existing view you can select the Open View icon or select from the top menu Views ->Open View. You also have the options of copying, deleting or importing a view.

Menu

File The File menu allows you manipulations with the opened view. New create a new SVG document. Select the dimensions of the new document to create it (shortcut Ctrl+N). Open open an existing SVG document, you can select one or more files by holding the CTRL key (shortcut Ctrl+O).

14

Recent files shows the recent file activity Save save changes to the current file (shortcut Ctrl+S). Save as save as a new file (shortcut Ctrl+Shift+S). Export - export current view to the next formats: JPG, PNG, BMP and PDF. Print print current file (shortcut Ctrl+P). Close close current file (shortcut Ctrl+W). Edit The Edit menu provides basic operations with objects, like: undo, redo, copy, cut, delete, group, lock, select, etc. Undo erase the last change made in the program (shortcut Ctrl+Z). Redo reverts the change of the last undo (shortcut Ctrl+Y). Copy copy the selected object or area to the clipboard (shortcut Ctrl+C). Paste paste the copied or cut object or area from the clipboard (shortcut Ctrl+V). Paste on same location - paste the copied or cut object to the same location as the source. Cut cut a selected object and place it in the clipboard (shortcut Ctrl+X). Delete delete the selected object (shortcut Ctrl +D). Paste dimensions provides transfer of certain parameters of the selected object: Paste size modifies selected objects, setting it to the same size as copied Paste width modifies selected objects, setting it to the same width as copied Paste height modifies selected objects, setting it to the same height as copied Paste size separately resize selected objects Paste width separately - changes the width of selected objects Paste height separately changes the height of selected objects Group - used to group multiple objects (shortcut Ctrl+G). Ungroup - used to divide a grouped object. Enter group allows to access individual objects inside the group (shortcut Ctrl+E). Exit group return to normal selection mode, i.e. the whole group will be selected at once (shortcut Ctrl+Shift+E). Lock lock the selected object or area (shortcut Ctrl+L). You cannot move or make changes to locked objects until it is unlocked. Unlock unlock the selected locked object or area (shortcut Ctrl+Shift+L). Selection switch cursor to selection. Zone selection - select multiple objects for further processing. 15

Select all select all objects on the canvas (shortcut Ctrl+A). Deselect all deselect all objects on the canvas. For details on these functions see the Drawing and work with objects chapter. Drawing In the Drawing menu you can create figures, lines and curves, add pictures and texts, etc. The Drawing menu contains the same features as the Toolbar, for detailed information see the Toolbar section of this chapter. Transforms In the Transforms menu you can align, center, distribute, order, flip, rotate objects and resize the canvas. Display In the Display menu you can enable grid and rulers. Different zoom options are available also. Dialogs The Dialogs menu includes two features: DOM Viewer and Memory monitor. DOM Viewer allows tree-like access to any element of the current view. Memory monitor shows current amount of memory used by the editor. Help The Help menu offers additional information about the mySCADA Editor. The most commonly used functions from these menus are also available through the Toolbar or right click menu.

Toolbar
Chapter 4.1 Basic of drawing Chapter 4.1 Basic of drawing This chapter Chapter 4.1 Basic of drawing Chapter 4.1 Basic of drawing Chapter 4.5 Other features Chapter 4.5 Other 16

Undo Redo Selection Zone selection Zoom on a zone Adjust the picture content to the frame 100%

features Chapter 4.1. Basic of Create lines drawing Create rectangles or squares (selection by clicking on the Chapter 4.1 Basic of arrow) drawing Chapter 4.1 Basic of Create ellipses or circles (selection by clicking on the arrow) drawing Chapter 4.2 Drawing Create Bzier curves and lines lines Chapter 4.2 Drawing Path lines Chapter 4.2 Drawing Insert a segment lines Chapter 4.2 Drawing Delete a segment lines Chapter 4.5 Other Insert image features Chapter 4.5 Other Create text element features Chapter 4.4 Grouping Group elements elements Chapter 4.4 Grouping Ungroup elements elements Repeated actions mode: Chapter 4.5 Other allows to select by zone or to draw a shape several times, features without being reset to the regular mode Chapter 4.5 Other Activate the Keep ratio mode features Chapter 4.5 Other Activate the Align on rulers mode features Chapter 4.2 Drawing Activate the Close paths mode lines Chapter 4.5 Other Activate the Forced lines mode features Chapter 16 Scripting Script Effects Used tags Live View This chapter This chapter This chapter

17

Selection Tool

The Selection Tool is used to select object(s) for manipulation. Before you can modify an object, you need to select the object first. To edit the selected object you can use different methods available in the mySCADA Editor. To select an object or objects Click on the Selection tools and drag the mouse to enclose the object(s). If the object is successfully selected, the selection border will be displayed and the object properties will appear in the properties window. To add objects to the current selection hold down the Shift key and select the additional objects.

Scripts

Click on the Scripts icon on the toolbar to open the new Main Window tab with scripting editor. For more detail please see the Scripting chapter of this manual.

Please note that Ctrl+S shortcut does not work in the script editor and you have to use the save icon instead.

The Script icon has a drop-down menu. You can open current view script in editor, delete existing script or clear all defined script variables.

18

Effects

This function lists all objects that have enabled effects, and name those effects.

Used tags

This function lists all tags used in the active view.

19

Live View

With Live View function you can load only the active view into your device. This function is intended as a quick test/preview of active view without loading the complete project.

Click on the arrow next to the Live View icon and open a list of all available devices. Select one of them to set the device as LiveView recipient. A click on the icon will send the current view to the previously selected device. The device remains selected as the recipient of the LiveView until another device will be selected. Please remember that the selected device needs to be connected through the local network/VPN to receive the LiveView. This function cannot be used when the device is connected by the data cable (iOS only).

4.1 Basics of drawing and working with objects


Rectangles and squares

To create a rectangle or square, click on the arrow next to the icon and select rectangle or square from the menu (you can also find it in the menu under Drawing). Click on the canvas, hold and drag the mouse for the desired size and shape of the object. Ellipses and circles To create an ellipse or circle, click on the arrow next to the icon and select ellipses or circles from the menu (you can also find it in the menu under Drawing). Click on the canvas, hold and drag the mouse for the desired size and shape of the object. Moving objects To move an object or objects use the Selection tool to select an object or objects. Move the mouse inside the selection border and drag the object to the desired location. Resizing objects You can resize an object by dragging the selection border to the desired size. To resize an object or objects use the Selection tool to select an object or objects. 20

Click once on the selected object, arrows will appear outside of the object pointing both to the inside and outside of the object.

Drag the arrow for the desired size of the object. Rotate Use the Selection tool to select an object or objects. Double click on the selected object. Arrows, pointing around the object, will appear around the selected object.

Drag the arrow on the corner for the desired angle of the rotation.

21

Note: The center of rotation can be offset too (black arrow, Figure 3). Move the point from the object center to desired position and rotate the object as described above. Please remember that the center offset will be reset on each rotation sequence. Skew To skew the selected object use the selection tools to select an object or objects. Double click on the selected object. Arrows (the same as for the rotation) will appear around the selected object. Drag the arrow in the middle of the object (black arrow, Figure 4) for the desired skew.

Corner fillet You can corner fillet on a rectangle or square. Triple-click on the object to show a blue point on its corner (see the black arrow in following picture). 22

Press the point, hold, and drag the mouse into desired design.

Zone selection

Zone selection is used to select multiple objects for further processing. You click on this icon on the Toolbar, then click on the canvas and drag the mouse to enclose the objects. Green arrows will appear around the selected area pointing both to the inside and outside. For the zone selection you can also use a shortcut: Hold down the Shift button as you click on the required objects.

23

For other uses see the chapter 4.4 Group elements. Zoom on a zone

This function zoom the selected area to the whole workspace. First click on this icon on the Toolbar, then left click, hold and drag the mouse on the selected area. Undo and Redo

The Undo button is used to move a step back. It is placed on the Toolbar or in the menu Edit. You can also right-click on an object and select this function.

The Redo button is used to move a step forward after you have already clicked on Undo. It is placed on the Toolbar or in the menu under Edit. You can also right-click on an object and select this function. If the button is grayed out this function is not available at the moment.

4.2 Drawing lines and curves Bezier curves and lines, work with them

24

Click on the arrow on the right side this icon or hold the icon on the Toolbar to expand a menu (each of the functions can also be accessed in the menu under Drawing): Path

This function is used to draw curves and lines. Drawing the line Click on the icon , then click on the canvas and drag the mouse to the desired location. Double-click to end the drawing.

Drawing the curve Click on the icon , then click on the canvas, hold and drag the mouse to the desired location and double-click to end drawing.

25

Drawing complex lines Activate the icon , then click and drag the mouse to the desired location. Click once to set vertex and change the direction of the line, continue to move the mouse to the next planned point of the line. Repeat the procedure of vertex creation as many times as necessary. Double-click to finish drawing. If Close Path Mode is enabled the line will be completed to closed path. You can also use the function Drawing-Path operation-Close path, which will be described in detail later in this chapter.

Drawing complex curves is possible using the same method as drawing complex lines. Work with the line and curve Select the line you want to edit, and then navigate to the Properties tab in the Properties Window to the right of the main window. You can change the color of the line by changing Stroke property. Insert a segment

Use this function to add additional line segment, making visualization more realistic. First click on an existing curve to display its current segments.

26

and select the function , after the click on Then click on the arrow or hold the icon an existing vertex a new point in the middle of the curve is created. Now you can modify the line to your needs.

Delete a segment

This feature is used to delete vertex from a complex line except for those at the either end of the line.

27

The first step is to click on the line which will bring up the vertexes of that line. Next click on the arrow or hold the icon and the menu will drop down where you can choose . The vertexes of the line will now be visible. Select the point you wish to remove icon and click on it, the point will disappear and the line straightens.

Close paths mode

To activate the Close paths mode click the icon then click on as described in the Drawing complex lines paragraph.

and draw the object

28

When you double-click to finish drawing the object will be closed automatically.

Note: you can activate Close Path function after you finished the drawing. Select created path, than select Drawing-Path operations-Close paths.

4.3 Path operations

Turn to path This feature allows the deformation of objects. Open the menu: Drawing-Path Operations Turn to path. You will see a series of points appear around the object.

29

To deform the object you simply drag the points around the object for the desired shape.

Merge These features merge objects into one, including the contours. Cover the objects so that they form the outline of the final desired object.

30

Then select the objects.

Now select the Drawing Path operation and then click Merge. The two objects are now merged into one.

31

Subtract This feature is opposite to the merge function. You can subtract portions of a bigger object to create an object of the desired shape. Select your objects and make sure that the outline is in the desired shape of the final object. Then select the interior object that you wish to remove.

Next open in the menu the Drawing Path operation and click Subtract.

32

Now you have a cut out object that can be deformed. Follow the same steps for deformation as described before to reshape the object.

Intersect This feature creates an object that consists only from the area where the two objects are overlapping. Place the two objects so the overlapping pieces make the desired shape, then select both objects.

33

Next select the Drawing Path operation and click Intersect.

Now we have the cut out ready to be deformed by clicking and dragging the dots surrounding the object into the desired shape.

34

4.4 Grouping elements


Group elements

With this function you can consolidate multiple objects into one for simplification purposes. Select the objects to be grouped and click on the icon on the Toolbar (or in the menu Edit). The group of selected objects appears and behaves as one object. It can be manipulated in the same way as any single object, it is allowed to be moved together, resized, rotated, skewed etc. Selected objects:

35

Group elements:

Ungroup elements

This function is used to divide a grouped object into elements. Select the grouped object and click on the icon the object will separate into elements. on the Toolbar (or in the menu Edit) and

36

Ungroup elements:

Enter group With this function you can work with individual objects that are grouped. There is no need to ungroup the objects in the group; you can work on individual objects related to the group without ungrouping them. Select the grouped objects.

Then click on Edit (shortcut Ctrl+E) and select Enter group.

37

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 it by clicking on Edit then Exit group (in the menu Edit or shortcut Ctrl+Shift+E).

4.5 Other features of drawing


Adjust the picture content to the frame

Click on this icon to see the whole view area to get the overview of your current progress.

38

100%

Click on this icon to adjust window content to its original size. Insert images

With this function you can embed images in PNG, JPG, JPEG format as objects. Click on this icon on the Toolbar, then click on the canvas and drag the mouse to enclose the objects. This will open a new window for the selection of an external object or picture. Navigate to the picture you would like to add and click on the Open button.

39

The picture is now on the canvas and can be moved, resized, rotated, etc. like any other object. Create a text element

This feature allows you to add Text into the canvas. Simply click the Text tool on the Toolbar then on the canvas in the location of desired point. This will open a new window for text input.

Fill in the text to be displayed and click on the OK button. The text is now on the canvas and can be moved, resized, rotated, etc. like any other object. 40

You can change text in the element later. For instructions on editing the text please see the chapter entitled Properties. Repeated actions mode

This mode allows you to continue drawing the same type of objects without having to reselect the object type or shape each time you draw it. Click the icon on the Toolbar and then select the type of object to draw.

Keep ratio mode

Activate the Keep ratio mode by clicking the icon on the Toolbar. With this mode the elements will be drawn to the size of the grid. You can change grid size in Display-Grid settings. You need to have grid displayed for this mode to work, which you can enable in Display-Show grid menu. Align to rulers mode

Activate the Align to rulers mode by clicking the icon on the Toolbar. Objects drawn in this mode will be aligned exactly to the grid. You need to have grid displayed for this mode to work, which you can enable in Display-Show grid menu.

41

Forced lines mode

Activate the Forced lines mode by clicking the allow you to draw lines at a 45 angle. Without activating the Forced lines mode:

icon on the Toolbar. This mode will only

With activated Forced lines mode:

42

Flip

This feature flips the objects horizontally and vertically. Click on Transforms > Flip and then choose which direction to flip the object.

Horizontal flip rotates the object as shown below.

43

Vertical flip rotates the object as shown below, turned upside down.

Rotate

This function rotates the objects by a 90 CCW degrees angle, by a 90 CW degrees angle (called -90), or by a 180 degrees angle. Once the objects are created put them in a group together.

Then click Transforms > Rotate and select the desired type of rotation. In this example you see a 90 degrees rotation angle.

44

Resize the canvas

This function found under Transforms menu changes the size of the canvas either to a custom size or to the content size. To a custom size a window will appear asking for the new dimensions for the height and width of the canvas. To the content size adjusts the canvas size to that of the objects currently on the canvas as shown below.

45

Show opened document list

This function list all opened documents (views, script, alarms etc.)

Zoom

This function found in the menu under Display supports various methods of zooming: Zoom in + Zoom out Zoom on a zone - increase of 10% - decrease of 10% - this function zoom to selected area. For more see chapter Zoom on zone. Adjust the picture to the frame - adjust zoom value, so the whole canvas will be visible.

46

Adjust the picture content to the frame preview image shows the entire canvas. To return to the original size use zoom to 100% option.

47

Adjust the selection to the frame zoom to full screen only what is selected. To return to original size use zoom to 100% option (shortcut is 1 key).

48

Or you can choose zoom from predefined magnifications in range from 5% to 2000%. Basic magnification is set to 100%. Be aware that Undo function does not work for any of zooms functions. Show grid

This function from the menu Display enables the on-screen grid.

49

Grid settings

With grid settings you set the grid parameters. Select in the menu Display > Grid settings. A new window opens, where you can select color, stroke style and step of grid.

Hide show rulers

With this function from the Display menu you show or hide the rulers.

50

4.6 Paste elements


Paste on same location This function is used to paste an already copied object to the same location and is best utilized for specifying more than one parameter when only one object is visible (such as a button). Begin by creating an object, next click Edit then click Copy. Now paste the copied object by clicking on Edit and then Paste on same location (you can also right-click on an object and select this function). This operation can be repeated as many times as you need to layer an object. Verify that the object has been pasted by moving the top layer, then click Undo to move it back. Paste dimensions This feature allows you to paste the specific dimensions of the currently selected objects. Select the object which dimensions you want to copy and call copy function on it. Than select object, you want to resize and use the function EditPast dimensions. Paste size This function will change the dimensions of the currently selected object to match those of the object that has been previously copied. Create two objects of different size, in this example we will copy the smaller square.

51

Click on the object to be resized and open the Edit menu, choose the Paste dimensions Paste size (you can also right-click on an object and select this function). Now both objects are of the same size.

Paste width This function will change the width of the currently selected object to match that of the object that has been previously copied. Create two objects of different size, in this example we will copy the smaller rectangle.

52

Then click on the object to be resized and open the Edit menu, choose the Paste dimensions - Paste width (you can also right-click on an object and select this function). Both objects are now of the same width.

Paste height This function will change the height of the currently selected object to match the height of the previously copied object. Create two objects of different size, in this example we will copy the larger rectangle.

53

Then click on the object to be resized and open the Edit menu, choose the Paste dimensions - Paste height (you can also right-click on an object and select this function). Both objects are now of the same height.

When Past dimensions function is applied to multiple selected objects, the dimensions will be transferred to the bounding box of object selections, while spaces between objects will be scaled accordingly.

54

Paste size separately This feature allows you to resize multiple objects at once to the same size as the previously copied object. Create multiple objects, and then copy the object of the size you wish to make the remaining objects. In this example we will copy the left rectangle and then resize the remaining rectangles.

55

Select the remaining objects.

Open the Edit menu, choose the Paste dimensions - Paste size separately (you can also rightclick on an object and select this function). All objects are now of the same size.

56

Paste width separately This feature allows you to change the width of multiple objects at once to that of the previously copied model object. Open the Edit menu, choose the Paste dimensions - Paste width separately (you can also right-click on an object and select this function). All objects are now of the same width. Paste height separately This feature allows you to change the height of multiple objects at once to that of the previously copied model object. Open the Edit menu, choose the Paste dimensions - Paste height separately (you can also right-click on an object and select this function). All objects are now of the same height.

4.7 Sorting objects


Align

This function sorts the grouped objects on the right, left, up, down or center of the zone; or the center of a horizontal or vertical line, but only within the current zone selection. Once the objects are created group them by using a zone selection or by holding Shift and clicking on both objects.

57

Now click on Transforms Align then select the desired direction to align the objects. For example when you sort to the right, the objects dimensions are not changed but the object to the left is moved so that its right borders of both objects are in line with the farthest right objects border.

58

Or to the Top:

Center on canvas

This function sorts the objects horizontally, vertically or both horizontally and vertically on the canvas. Once the objects are created group them by using a zone selection or by holding Shift and clicking on both objects.

Now select Transforms Center on canvas then select the desired direction to sort to. In this example we chose horizontally and vertically. 59

The objects are ranked both horizontally and vertically in the center of the canvas. Distribute

This function creates an equal gap between multiple objects, horizontal and/or vertical. Begin by creating three objects.

Next resize the objects to the same size by clicking on Edit Paste dimensions Paste size separately (see chapter Paste).

60

Select all the objects in the zone selection and unify the space between them by selecting Transforms Distribute Horizontally.

To get the objects in one row, select Transforms Align Top.

61

The procedure is similar to align objects vertically. After the objects are created resize the objects to the same size by clicking on Edit Paste dimensions Paste size separately (see chapter Paste). Then select all the objects in the zone selection and unify the space between them by selecting Transforms Distribute Vertically. To get the objects in one row, click Transforms Align Left.

62

Order

Order allows a change in the vertical position of stacked objects. They can be moved to the top, raised one level, lowered one level, or lowered to the background. Create one 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.

Now you select Transforms - Order to change the stacking order of the objects. Lower to the background will move the object so that all other objects are on top of it.

63

Raise to the top moves the selected object to the foreground so that all other objects are beneath it. Raise moves the selected object up one place vertically in the stack of objects, while Lower moves the object down one place vertically in the stack of objects.

64

5 Creating new Views


In this chapter you find a detailed description on the drawing of schematic visualizations and descriptions of the object animations based on PLC tag values.

5.1 Start the SVG Editor


Within the Project window select the view labeled Demo3_Anim which is marked with the blue arrow as in the following picture by double-clicking on it. The contents of this folder is now displayed in the main window and the SVG graphic editor is now opened, as indicated by the drawing icons located at the top of the main window.

5.2 Basic Drawing


In the SVG graphic editor window you can zoom in or out, move the drawings, redo or undo your actions, draw rectangles, circles, include text and images, and group or ungroup the objects. To the right of these icons you see the five different align modes (see following picture). The most important tools for the mySCADA applications are the tools for the HMI animation and the SVG library. These tools can be found to the right of the main window in the Properties window.

65

5.3 Reading Tag Values


The key, fundamental function of mySCADA application is accessing values in the PLC. The process of reading from the PLC is described in detail in following example of the tank level values visualization. Start by adding a View into your project titled ReadingCurrentValues . This view will show the tag values from a ControlLogix PLC specified by connection SpelCLgx.

Select the Add button and the default template appears in the SVG editor window. You are now ready to start adding elements for reading tag values to the new view.

66

Let us assume that there are 3 tags in the ControlLogix PLC representing the current tank levels level1, level2 and level3. First add the text elements for the three levels of the tanks using the create text element tool on the top of the screen. The text creation window displayed in the following picture appears.

The visualization shown in the following picture resemble the view you just created.

In this example, the colors of the texts reading in the tag values were changed within the Properties window by selecting the Properties icon indicated by the blue arrow and then selecting the Fill property indicated by the red arrow in the following picture. The Animations-Fill Window appears.

67

5.4 Tag Connection


In the next step you will connect the texts elements to specific PLC tags. First click on a specific text element that will be animated and receive certain data from the PLC. Once selected, the Properties and Animations appear at the top of the Properties window. Select the Animations tab indicated by the red arrow in the following picture. In the Get Animations section enter the specific tag address that the text element will be reading from. The blue arrow in the picture indicates the area where the tag address should be entered. If an invalid tag address is entered, the text will turn into red and you will be prompted to enter a correct address (the same behavior may occur when device-specific tag format is used). When multiple connections are defined in the project all tags will be displayed in the format tagname@connectionname. Please be aware that for iOS project you can use tags from single connection per view. This limitation does not apply to mySCADA Box.

Repeat these steps for the remaining tags level2 and level3. Then save and load your project or use LiveView functions. 68

69

5.5 Creating the Parametric window


Parametric windows are important for situations when there are many similar objects in a view and you want to show more details of the same object on another screen. Create a new view and tick box Parametric Window (following picture green arrow) in the dialog Add new view.

Parametric Window can be changed for existing views through following steps: In the Project Window (left to the Main window in default layout) click on your view once (following picture green arrow). In the Properties Window a table with a brief description and properties of the project will appear. One of the rows is a check box Parameter Window property (following picture red arrow). Check this box to turn the parameterization of the view and uncheck to cancel the parameterization of the view.

70

For the use of parametric windows see the chapter Open command.

5.6 User access level


You can set user access level for each view separately. Click on the desired view in project tree. View properties are now displayed on the right of your screen.

Now you can set access levels for viewing screen and writing to PLC separately:

71

In this example users with access level 3 or higher can view visualization screen, and users with access level 5 or higher can execute Set commands defined in this view. Limit access of arbitrary object in the view

You can set user access rights to even lower detail. Access rights can be set to each object in the view, allowing creation of complex and customizable visualizations. Select target object and select Access tab in Properties:

In this example users with access level 3 or higher can view visualization screen, and users with access level 5 or higher can execute Set commands, defined in this view. For more details about User access level please see the corresponding chapter of this manual.

5.7 Adding components or icons


In the right panel of the workspace, in the Properties Window, you find the Library tab (red arrow in the following picture. All preloaded graphic components can be accessed through selectors in this tab (see the green arrow).

72

Through the drop-down menu a group (type) of components can be selected. When selected, all group components should appear in a scroll preview list beneath the menu. Each specific icon or component from this list can be dragged to the canvas and used for later visualization.

73

Tip: Editing components If you need to edit a component (for example to change its center, color of certain part), highlight it and click on the right mouse button. Select Enter group from the menu.

Now elements, composing the selected component, are accessible. If desired element is grouped with other use the same procedure as described above to enter the required subgroup.

74

Figure 14

To change the color of the selected element use Animation Properties tab in the Properties Window and click on the Fill box (following picture - green arrow). Click on Color and the color box (red arrow) in the opened window.

75

Pallet window will open, where you select a new color.

When all required editing is done you should return to component level of the selection. Click the right mouse button and select Exit group from the menu.

76

The final appearance of the component is:

77

5.8 View properties


When a view is selected in the project tree its properties appear in the Properties tab.

Following options are available: Change view name Change view description Select another connection for the view Change refresh rate Change Parametric View property 78

Enable/disable zoom for the view Set user access level View Access Group: Sets the minimal level of access for viewing. Write Access Group: Sets the minimal level of access for writing to PLC. Check view size Check if the view contains scripts and Variables.

5.9 Error Box Properties


You can define graphical representation of offline error for objects, tied with some tags for animation. When such tag cannot be read from PLC mySCADA will display error box around such object.

In Error Box Properties you can define the look of those error boxes in your project.

Select Views folder and its properties appear in Properties tab. 79

Set fill color, fill opacity, frame color, frame thickness and opacity for error box. With Rx and Ry parameters you can change softness of corners of the error box. For example, if you fill error box properties with further parameters:

Communication error will be displayed in the visualization like this:

80

6 Start new project


From the home screen, you have the options to create a new project by selecting the New project icon in the toolbar, directly above the main window or through menu File New Project. A previously saved project can be opened by selecting the Open project icon or File Open Project from main menu.

Once you have clicked to create a New project, the screen displayed the following picture appears. You can specify the folder that would be used to store project files. There are two options - creating a new folder or selecting an already existing folder. You can also choose a specific file format to store your project data.

6.1 Creating Connections


To view the existing connections select the Connections folder in the Project window. All connections will be displayed in the main window as shown in the following picture.

81

New connection is created by selecting the Add Connection button at the bottom of the main window. Connections can be deleted by selecting specific connection you wish to delete and then clicking the Delete Connection button directly to the right of the Add Connection button, at the bottom of the main window. To edit any of the existing connections, double-click on the specific value you wish to change (Type, Alias, IP, Slot) and edit the selected value. Once the Add Connection button has been selected, the dialog displayed in the following picture will be prompted. This dialog requires you to set specific connection parameters in order to create a viable communication channel with the PLC. Select the type of PLC from the drop-down menu at the top of the window. Enter the name (alias) of the connection, PLCs IP address and the slot specification. Once all the valid information is entered, select Add at the bottom of the window.

82

6.2 Creating Views


There are several options how to create a new view in your project. Select Views folders inside of the Project Window to enable the Views Icons above the main window. Selecting the Add View icon will prompt the Add New View dialog as displayed in the following figure. Also selecting Views Add View from menu will prompt the Add New View dialog to appear.

The detailed creation of a new view is described in chapter 5. Creating new Views of this manual. Other view manipulating capabilities include: importing, copying, opening and deleting of views within your project folder. Each of these commands can be performed by selecting their given icon.

6.3 Editing of Views


To start the graphic editor, select the view file that will be edited from the list of views in the Project Window. Double-click on the selected file to open it in the main window. The graphic editor will resemble the window shown in the following picture. Once the graphic

83

editor has started you will be able to draw the specific schematics or diagrams needed for the particular view. For more details on working with a graphic editor see the Creating new Views and Drawing and work with objects chapters of this manual.

With the graphic editor open you can edit your view. The available drawing tools are placed along the topside of the editor in a row of icons. When you finish the basic drawing and placement of objects you can specify which objects will be animated. All animations for each object correspond to the specific tag values in the PLC. After selecting any object within the graphic editor, the HMI Animations window will appear within the Properties window right of the main window. Within the animation window an object's height/level, color, opacity, text, move can be animated. You can attach sound animation to the object also. A specific name for each animation tag must be entered (Tag Address). This Tag Address directly correlates to the memory address in the PLC, from which the data will be retrieved. Creating a path for a Move Animation allows a specific object to move along a designated path that is drawn in as tag value changes. For the height, rotation or opacity animation the maximum or minimum values as well as the color codes for the color animation need to be specified. To send the values to the PLC please use one of the Set commands.

84

Following picture gives an accurate depiction of the drawing capabilities provided by the graphic editor.

85

86

7 Importing Documents into a Project


With this powerful function of mySCADA Editor you can link documents with your project. For example, you can have user manuals linked with components in your HMI screen. Or you can even attach a schema or drawing to your project. As the result you get a complete system in one package a project consisting of HMI screens and your linked documentation files. You can attach any documents directly to your project by selecting the function Import Document. Please note that all attached documents must be in a PDF format.

To load the documents use the Import document button or the right-click menu of Document folder. Once your documents are imported into your mySCADA project, you can link the document with any object on a HMI screen. This can be done by activating it in the Open command section of Sets window.

87

Details for the section Open Command:

Open - select Document for opening a document. Screen - name of a document to be open (you will see a list of all available documents in your Document folder) Index - specify a particular page number of the document to be open

88

8 Creating Trends
Visualization of trends is also an important part of the mySCADA application. Same as alarms, values used for trends should be represented as part of an array in the PLC. mySCADA than stores every watched value in built-in database, to create archive of values for each watched tag. Later those archived values can be compared with current values of the same tag. Trend charts for each of the watched tags can be created also. It is possible to monitor multiple trends at once as well as edit, add, and delete trends from the main window. To see the current trends in the project navigate to Trend folder in the Project window.

To add a new trend to your project select the Trends folder in the Project window and either select the Add Trend icon or Trend Add New Trend from the menu. To add a new tag to monitor please select the Add Tag button at the bottom of the main window. The tag . Instead of address along with a description of the trend must be entered click on raw tag value you can use arbitrary mathematical transformation of tag value by choosing Equation form of tag representation in Add Tag dialog (Picture 141). You can find more details about Equations in appropriate chapter of this manual. Specifying a physical/mathematical unit of the data is also possible. The ability to open an existing trend or delete a current trend is provided also.

89

You can edit properties of already created trends by selecting them in Trends folder in your project tree.

90

Next properties can be set: Trend name. Trend description. PLC connection, used to gather data. Refresh rate for the trend(same as for view). No. Of Records number of elements mySCADA will read from PLC field for this trend (for Online trends only). Sample Period timescale between samples. Reverse inverse order of reading of samples. View Access user access level. Online check this settings for iOS application trending. Otherwise mySCADA Box format will be used. mySCADA Box Specific - Datalog No.: define from which datalog values should be read.

91

This picture demonstrates trend visualization in mySCADA Box.

92

9 Creating Alarms
A very important part of mySCADA application is the ability to instantly signal any information about dangerous and/or other important events by means of alarms. In the mySCADA Editor you can create alarms list only for iOS application. The alarms on mySCADA Box need to be defined through web-interface of the box. PLC must support the handling of alarms for this functionality to work properly. The alarms must be stored in an array because the mySCADA application only interprets array values as the alarms so the user needs to set up an acceptable range for each alarm. Select Alarms folder in your project tree. First you have to set Connection and choose which of PLC connections, defined in the project, will be used. Than enter starting tag for alarm list and enable alarm by checking appropriate checkbox.

Than you can alter other properties of alarms, such as: Active Alarms in Icon display number of active alarms on mySCADA icon, when the application runs on the background.

93

Sound on New Alarm plays system sound when one of alarms became active. Shake on New Alarm vibrates device on new alarm, if mySCADA running device is capable of such function. Show Active Only disables to display the inactive alarms in mySCADA application alarms list Sort Based on Severity sorts the alarms in the list according to their severity. Show Severity up to filters out alarms with severity lower than set from the alarms list Text Filter On filters out all alarms, except those containing text, filled in Text property, in their description. The list of alarms is shown in the Alarms folder in the Project window. New alarms can be created using the Add button located at the bottom of the Alarms window. The alarms can be also deleted or shifted down or up in the priority list.

94

After clicking on the Add button the window displayed in the next picture appears. The Bit No. should be filled with index of the bit, representing current alarm, in the array of alarm variables. The severity level of alarm and description must be filled also (0 for the maximum severity). Select OK to create the new alarm.

Example of alarm usage In this example we have 3 PLC, where alarms read by mySCADA from PLC3. With PLC1 you control the temperature with possible range 0C to 120C. To create alarm on this value you need to evaluate temperature readings in PLC1 and send Boolean value to prepared array in PLC3.

95

The desired temperature lies in the 50C to 80C range, so you create two alarms, for high and low temperatures. The first alarm gets position 2 in the bit array of PLC3 and will be activated when temperature fall into 0C-50C range. The second alarm gets 3d position in the array with the range of 80C 120C. Than you create alarm list with appropriate description for those alarms.

When temperature reading gets to 40C, for example, PLC1 will send 1 value to bit array element 2, which, in turn, will pop alarm in mySCADA application.

10 Creating Connections
To view existing connections select the Connections folder in the Project window, so they will be displayed in the main window as shown in this picture.

To create a new connections click on the Add Connection button at the bottom of the main window. Once the Add Connection button has been selected, the following dialog will be 96

prompted. This dialog requires you to enter specific connection parameters in order to properly create a viable communication channel with the PLC.

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 IP address of the PLC Slot select proper slot specification Note: dialog content depends on the selected PLC type. Once all the valid information is entered, select OK at the bottom of the window. Connections can be deleted by selecting the specific connection you wish to delete and then clicking the Delete Connection button directly to the right of the Add Connection button at the bottom of the main window. To edit any of the existing connections, double-click on the specific value you wish to change (Type, Alias, IP, Slot) and proceed to make proper changes.

97

11 User Access Levels


Security is the major concern in all modern SCADA systems. In mySCADA, you can simply limit the access from the whole project viewing up to the single element control. This way you can easily control user access to your project and keep the security at the highest level. Also, if your device is used by more operators, you can also utilize the user access function to limit certain users in what they can do within given sections in your SCADA system. Access Levels: Access Levels are security groups with chosen level of access. You can set different access levels for different users. For example, maintenance personnel would have lower access level to a system 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 possible access level. TIP: you can give names to these user access levels through the web interface of the mySCADA BOX units. Specify User Accounts: In order to use User Access Levels, you have to specify users for your project. You can create as many users as you need. For mobile application the users can be defined only through mySCADA Editor, to define users for mySCADA Box please use the web-interface. Each user must have specified an Access Group ranging from 0 to 9. The higher the number the higher access rights for the user.

98

Limit access for the whole project:

View Access Group: Sets the minimal level of access for viewing. Write Access Group: Sets the minimal level of access for writing to PLC. Enable Remote Control: You can disable the access from mySCADA Editor by unselecting this option. Once unselected, you will not be able to access mySCADA from the Editor. You can always re-enable this option from mySCADA settings page. Enable Settings: Give user access to setting page on Apples iOS devices. Lock in Screens: Allow users access views only. Limit access for any screen in the project: You can set user access level for each view separately. Click on the desired view in the project tree to display the view properties to the right.

99

Here you can set access levels for viewing screen and writing to PLC separately:

In this example users with access level 3 or higher can view visualization screen, and users with access level 5 or higher can execute Set commands, defined in this view. Limit access of arbitrary object in the view:

You can set user access rights to even lower detail. Access rights can be set to each object in the view, allowing creation of complex and customizable visualizations. Select target object and select Access tab in Properties:

100

In this example users with access level 3 or higher can view visualization screen, and users with access level 5 or higher can execute Set commands, defined in this view. Users In this module you can define users for mySCADA iOS application. Users for mySCADA Box/myLOGGER need to be defined through the web-interface of those devices.

After click on Users folder a list of defined users appears in the main window.

101

Down the window you will find buttons for manipulations with the user records.

Click on Add User and following dialog appears:

Here you can define user name, password, E-mail or telephone number. You can also select access level group for the user to define the ability of this user to access certain elements of your project when user access levels are set. The newly added user will be shown in the defined users list.

102

12 Creating and Testing Components


Within the mySCADA Editor you can create feature rich components. The advantage of using components is the motto: create once, use many times. The components are very suitable for creation of heavily animated repeatable objects, like: buttons, gauges, charts etc. The main idea is that you create a group of animated objects, where animations are tied to some variables names instead of direct tag address. After placing such component into the view you simply enter target tag address in one place (in component properties) as variable value and this change reflects to all tied animations, without actual need to go through every object and changing tag address manually. Creating Components New components can be added to existing groups or created as a part of the new components group. For this example we will create new components group to demonstrate such ability. To create new components group click on the Components folder in the Project window (following picture green arrow), then click on the icon Add Component Directory (following picture red arrow).

A new dialog opens where you can enter a name for the new directory and click on the button Add. By clicking the icon from. select the source folder to import the components

103

To create new components select the group, where it will be placed. Then click on the button labeled Add Component on the Toolbar.

A new dialog will be shown:

104

Fill in the name of the component, then specify the width and height of the drawing area, finally hit the Add button to create the component. Now a new Component is created. Double click on its name and you will be taken into the Graphics Editor to work with it.

Lets start with simple rectangle, animated by rotation. Create a rectangle first.

Select the created object and open Properties-Animation, where you need to select Rotation animation. Input Tag into the tag address field you will use this name to create a variable few steps later. Set the minimum and maximum expected tag values and move rotation axis if needed.

105

Now take a look on Component Variables tab.

106

Component Variables In this section you define all local variables (visible only inside of the component) by specifying a meaningful name, short description and type for each variable. Those variables can contain tag values, read from PLC, color and fill values for different elements, calculation results and so on. Each component can have as many local variables as you need for your purposes. You have to save your progress after addition of each new variable by click on Save button in the tab toolbar. The Color button opens color palette when an appropriate type of variable is selected. Each local variable has following properties: Property Variable Description Name of the variable as internal value. It is used for reference in animations and properties of your component. Create variable named Tag to continue in this example Name of the variable seen by the user. This will be shown in component properties later. Name the variable in this example Tag2. Description of the variable. Variable default value. For this example purposes please set to N100:0 Type of variable. Supported types are: Tag, String, Int, Double (Float), Color, Boolean, Object.

Name

Desc Value

Type

You can reference to your local variable anywhere in the animations, effects or in properties across the edited component. Click on Save button to confirm variable changes and save the whole component after that.

107

Return back to view and test the new component.

Now open Components Library in the Properties tab and select the created component. Drag&drop it to the opened view to import. Click on the imported component to see its properties.

108

In properties you can see the parameters of the component, namely the name of the component variable Tag2, which has default value of N100:0. To override default tag address enter any other tag you want to connect your component to, for example to F30:10. To make a quick check that the tag address in the animation was changed right click the component and select Enter group menu entre.

109

Select the rectangle, open its Properties-Animations and check Rotation animation.

Now you see that the tag address used for animation has changed to requested F30:10.

110

Replacements Replacements are intended to ease replacement of predefined text in a component. You can change text, font size, color, stroke or opacity of the text element.

Start with the component variables again. Create next variables: Variable Text with type String Variable Font Size with type Int Fill with type Color Stroke with type Color Opacity Formula with type Int or Double Opacity min/max with type Int or Double Opacity here is similar to Opacity animation, which means that the text will be visible if the value of Opacity formula will be within Opacity min/max range. Now create a text element:

111

Click on

on Text replacement and a new dialog appears.

Put the Component Variable that you want to use for the text, Text in this case. Fill the FontSize and other parameters in similar way. Please note that variable names are case-sensitive. When you fill all properties save your component.

112

Text will change according to the value of appointed component variable. After you saved the component, open the Library and import your component.

Open Components Library in the Properties tab and select the created component. Drag&drop it to the opened view to import. Click on the imported component to see its properties.

113

Now find Component section, where you can change the value for all component variables. For example:

Replacements are important for complex component, where you can replace component text (button text, for example) in just one click.

Example
Creating component: In this example we create simple Slide Bar showing the progress of variable and its minimal and maximal values. Create a new component, as described at the beginning of this chapter Drag a rectangle as seen in the picture below

114

Right click on the rectangle and in the menu select Transforms - Rotate -> by 90 degrees angle

Copy selected rectangle and apply Paste on same location on it.

On the newly created rectangle set Fill property to none, than send the element to the background with Transforms Order lower to the background.

We have created frame of the scale with that. 115

Then create 3 text fields as in the picture below

Now we add the animations: For the animation of the slide bar we use our rectangle. Fill the Component Variables as shown in this picture:

As you can see we have created three local variables. For the tag value we have used variable tag, for specifying the minimum and maximum values we have used the min and max variables. We advise to save your progress often using button Save in the main Toolbar. To make indicator out of our rectangle by resizing it according to the value, read from PLC, lease set Scale as shown on the next picture.

116

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 Animation tab in Properties window and click on the Tag (Address) button in the Get Animation section. Then fill in the Tag field with tag, which corresponds to our local variable name.

As you can see we have used one of our local variables, you can use the same variable (especially of tag type) at multiple animations/effects to achieve better effect.

117

We will also show the min and max limits of our tag. Click on the left text field, than select Replacement tab from Properties window and click on the button in the Text field, as shown in the next picture:

Do not forget to hit the OK button after you entered all required information! Also fill the text replacement for the right text field in the same way, but placing max variable there. We finish our component by drawing a simple rectangle around our slider as a background (Transforms Order Lower to background) and as the boundary for the component. Now we save the component. Component is prepared and looks like this:

Now we close the Editor and test our component. 118

Testing the component Create a new View and open it, then open the Library marker. Choose the component and drag to move it to the main window. Now click on the component and look at the Properties window:

In the Component section you see all local variables you have defined, with variables of tag type shown in bold letters. Set the name of the tag and minimum and maximum values and hit apply:

119

Now save the view and send it to mySCADA device. Resulting screen should look like the figure below:

120

121

13 Properties
Use the Properties window to access all important parameters of every object in mySCADA Editor. In this chapter you find a short description of properties for most common objects.

13.1 Text Properties


Text Text Properties are used for text editing and properties change. Select the desired text you wish to edit. The Text Properties appear in the Properties Window, right of the main window.

122

Now you can edit the selected text properties; all changes are visible immediately, without additional steps to apply on them. #text - this property allows for direct text editing. Font family select one of the available font families. Font size set font size in points, type the desired value into the field. Font weight - choose the font thickness from a drop down box that appears when you click on the arrow at the right side of the box. Font style - choose the font style from a drop down box that appears when you click on the arrow at the right side of the box. Tip: How to align text size To avoid complex adjustments of text size use a simple procedure. Select the text that will serve as a template, mark it with the left mouse button to open the menu and select Copy function. Then mark the text you want to edit, left-click to open the menu, paste the dimensions and then paste the size. Now both text blocks should be of the same size. Please note that the font size will not change with those actions, but the size of the text element will.

123

Deco Font stretch this property controls stretch of the font, options are represented by a drop down menu. Letter spacing this property allows setting spacing between letters (in px), type the desired value into the field. Word spacing - this property allows setting spacing between words (in px), type the desired value into the field. Text-Decoration - this property controls additional font decoration such as underline or strike through, available option can be chosen from a drop down menu. Available options: None no underline Underline line under the text Overline line over the text Line through a line striken through the middle of the text Example: Create a text object. Select the text in the main window and the text properties will appear in the Properties Window under the Properties tab. Change the Font-size property to a new size and in Text-decoration property to Line through. Result should look like Figure 2.

Orient Writing mode - Implements SVG font writing-modes, allows you to change the direction, in which newly typed symbols would appear. Select one of the following values: LtoR TtoB left to right top to bottom: new symbols are appended to the right of the string, for the text running from the top to the bottom. 124

LtoR - left to right: new symbols are appended to the right of the string. RtoL TtoB right to left top to bottom: new symbols are appended to the right of the string, for the text running from the top to the bottom. RtoL - right to left: new symbols are appended to the right of the string. TtoB RtoL top to bottom right to left: new symbols are appended to the right of the string. TtoB top to bottom: the text runs from the top to the bottom.

Glyph orientation horizontal - rotates the symbols of the text by 90, 180 or -90 degrees Text anchor - align text left, right or center within the text element even when the text changes.

125

Example:

This figure shows writing mode Glyph-orientation-horizontal application. After Glyph property application right-click on the text and apply the rotate by -90 degrees function. Fill Fill this option controls the color of the text (or any other filled element). It can be set in two ways: by entering directly color web-safe code or choosing the desired color from the predefined palette. Click on the square button in the Fill field of Properties color to open predefined color palette. New windows as shown in the figure below will open. Click on Resource to choose from predefined artistic fills or on Color to choose a color to fill.

126

This figure shows the color palette for the choice of the color for even fill. If you need a more specific color, click on the HSV tab on top of this window. It will open a new window where you can select the desired hue for the color.

Click on the large color square, hold and drag to the desired shade. At the bottom of the dialog there is the preview area where you can see the previous and new shade of color. You can also modify the saturation of the selected color with slider. In the preview below you 127

can see the color change. The top square shows the original color while the bottom square shows the newly modified color.

The shade can also be tuned by clicking on the RGB tab. You can fine tune the arrows on the slider for the colors of red, green and blue.

Confirm the changes by clicking OK. 128

Other colors can be chosen from a swatch by clicking on the SVG, HSL or CMYK tab. You can also further refine the color by going back to the HSV and RGB tabs.

Opacity this property control object opacity. To change the opacity of selected object, highlight the object by clicking on it. Within the line Opacity you can see current opacity value. Adjust the slider to change the value of opacity from 0 to 1, when 1 corresponds to solid appearance of the object and 0 corresponds to completely translucent state.

129

Stroke Stroke Control color of selected text outline.

Opacity control the transparency of the text outline. Property is changed in the same way, as Opacity from Fill properties. Width change the width of the outline. The up arrow increase and the down arrow reduce the width of the outline. Dasharray - here you can select the type of edging. Available settings are: none 5; 5 10; 5 10 5, where numbers define length of lines and space between them. Dashoffset - this feature allows you to move the dashed lines in outline, so that the gaps are facing each other. Linecap - here we can choose the shape of the dashes edges butt, round, square. Linejoin - choose the shape of curling - miter, round, bevel. These changes are more evident at high magnification. Geom You can specify the exact horizontal and vertical coordinates of the object's location either by properly adjusting the X and Y options under the Properties tab in the Properties window. Coordinates are counted from left-top corner of the object.

130

General Id - each object has its own Id. The system automatically assigns one, but it is recommended to give the element a more specific name. Type - indicates the type of the object, cannot be edited. Display Visibility choose whether the text will be visible or hidden. Opacity - set transparency level of the text.

131

13.2 Properties of geometric objects


The only difference in properties of ellipse and rectangle is in Geom part of the properties; those differences will be described later in this chapter.

Fill this property control fill color of the object. Color can be set manually with webcolour definition or through colour palette, which will open on click. Opacity - control opacity of the object, set with slider in range 0-1. Stroke defines the color of the frame. Width set width of the frame. Dasharray select the type of edging. Available settings are: none 5; 5 10; 5 10 5, where numbers define length of the lines and the space between them. Dashoffset this feature allows you to move the dashed lines in outline, so that the gaps are facing each other. Linecap - choose the shape of the dashes edges butt, round, square. Linejoin - choose the shape of curling - miter, round, bevel. These changes are more evident at high magnification.

132

Geom. Properties of rectangle

X x-axis position of left-top corner of the object Y y-axis position of left-top corner of the object Width width of the object Height height of the object Rx, Ry corner roundness Geom. Properties of ellipse

Cx x-axis position of object center Cy y-axis position of object center Rx x-semi-axis size of object radius Ry y-semi-axis size of object radius General Id - each object has its own Id. The system automatically assigns one, but it is recommended to give the element a more specific name. Type - indicates the type of the object, cannot be edited. Display Visibility choose whether the object will be visible or hidden. Opacity - set transparency level of the object.

133

13.3 Properties of background


This feature allows you to set background for the whole view, as color even or gradient fill or an image. Select any free point of the main window of the view to display selections properties in the Selection-Properties tab.

General Info list of selected items. Items Selected number of selected items. Document Name - name of the View you are working with Width and Height the specific geometric component of the current background Background indicates the color of the current background in RGB. Set Background Image allows selecting an image file from your computer to use it as a background image. You need to set Background Image property first. Background Image filename of the current image used as background. After click on button you can select any accessible file.

134

Example:

135

13.4 Project Properties


Every folder in the Projects window has its own set of properties.

Project Properties
Name name of the project Path path to the project folder LiveView Device device for LiveView currently set Timeout set connection timeout for the whole project. (After this timeout is expired, an error in communication is declared. This value of the timeout can be much higher, than the refresh rate for non-critical applications) Startup Screen view or trend to be shown on mySCADA startup. Size it is a read only value showing the size of the project. Be aware that mySCADA Box has project size limitation. If the project is bigger than the space available on mySCADA Box, you will receive an appropriate warning. Size parameter is common for all elements of the project, so you can always check space usage by any single components.

136

User Access Levels can be set: View Access Group: Sets the minimal level of access for viewing. Write Access Group: Sets the minimal level of access for writing to PLC. Enable Remote Control: You can disable access from the Editor by unselecting this option. Once unselected, you will not be able to access mySCADA from the Editor. You can always re-enable this option from mySCADA settings page. Enable Settings: Give user access to setting page on Apples iOS devices. Lock in Screens: Allow users to access the views only. Specific mySCADA Box settings: LiveView Compress determines if LiveView will be transferred in compressed form.

137

Specific mySCADA for iOS settings: Fullscreen in Landscape application will be showed in full-screen, when device is turned to landscape mode. Status Bar Hide hide application status bar when active. Black Status Bar changes status bar color to black when active. Enable Write Lock when activated prompt confirmation window on every write to PLC. This setting should be used as a protection against unwanted control inputs. Hide Status Button hides Status button in the view when active.

View Common Properties


Click on the Views folder in the project tree to see its properties.

In the read-only part you see the number of views, overall size and number of attached scripts and variables.

138

Error box settings

You can define the graphical representation of offline error for objects, tied with some tags for animation. When such tag cannot be read from PLC mySCADA will display error box around such object.

In Error Box Properties you can define the look of those error boxes in your project.

Here you can set fill color, fill opacity, frame color, frame thickness and opacity for the error box. With Rx and Ry parameters you can change the softness of corners of the error box. For example, if you fill error box properties with following parameters:

139

Communication error during visualization will be displayed like:

View properties
Select a view in your project tree to see its parameters.

140

Through view properties you can: Name change view name Description change(add) description Connection change connection to one of those defined in the project Refresh change refresh rate for the view (in milliseconds) Parameter Window define if the view should behave as a parametric view Zoom enable/disable zoom function for the view Set user access levels View Access Group: Sets the minimal level of access for viewing. Write Access Group: Sets the minimal level of access for writing to PLC. You can also check view size and if some view script is attached.

Documents folder Properties


Click on the Documents folder to see its properties

Here you can find the number of attached documents and their size. Document properties Click on the document to see its properties.

141

Here you can rename document or check its size.

Trends folder properties

Here you can find the number of defined trends. Trend properties Click on the trend to see its properties. 142

Name change the name of the trend Description change(add) description of the trend Connection change connection, used for the trend to any defined in the project Refresh change refresh rate of the trend
Number of Records number of elements in array, from which trend data will be gathered (iOS only) Sample Period (sec) sampling time of the trend data (for correct gird visualization only) Reverse reverse order of reading of trend data View Access Group User Access level properties MySCADA Box Specific Datalog No. - define number of datalog in mySCADA Box where trended tag values should be stored

143

Alarm Properties

Tag(Address) change alarm tag address. Connection change connection, used for alarms to any defined in the project. Enabled define default application setting. Refresh refresh rate for alarm tag. Active Alarms in Icon displays the number of active alarms on the corner of mySCADA icon, when the application runs in the background.

144

Sound on New Alarm play system sound when one of the alarms became active. Shake on New Alarm vibrate your device on new alarm, if mySCADA running device is capable of such function. Show Active Only disable to display inactive alarms in mySCADA application alarms list. Sort Based on Severity sort alarms in the list according to their severity. Show Severity up to sort out alarms from the alarm list with severity lower than set. Text Filter On filter out all alarms, except the ones, which contain text filled in Text property in their description.

Connection Properties

Contain overall number of connection in current version.

145

Scripts folder Properties

Here you can check the number of view scripts and their size. Script properties

Here you can rename a script and check its size. 146

Sounds folder properties

Here you can check the number of loaded sound and their size Sound Properties

You can rename sound or check its size in the sound properties.

147

Users Properties

Here you can see the number of users for iOS devices.

Components Group Properties

You can rename component group or check the number of components in this group

148

Component properties

Here you can rename a component and check its dimensions.

Icon Properties

Here you can check icon name and dimensions.

149

Devices Properties

Here you can check the number of defined devices.

150

14

Animations

By object animations we achieve the proper graphic representation of the current PLC state. mySCADA demo files have been created to give you a better understanding of what type of animations are possible. Demo files are available at the following website http://www.myscada.org/wp/2012/10/22/demo-projects/. The demo project contains examples of animation, linked to different PLC types, such as ControlLogix, MicroLogix or Modbus. Most of the examples in the Animations chapter are based on elements from this demo project. For more detailed description of the demo project please see the demo guide, bundled with the demo files. Next picture shows one of the views of the demo project.

Figure 1: Animation Demo

151

Getting Started With Animations


In the proceeding section you find examples of writing data to your device, reading data from PLC and use them to get color, scale, opacity, rotation and text animation. The process of adding an animation to objects is shown by animating a rectangle in the following example. First draw a rectangle using the Create rectangles and squares icon indicated by the blue arrow at the top of the SVG editor window ). Then select the rectangle and the Animations and Properties tabs will appear at the top of the Properties window. Select the Animations tab indicated by the red arrow.

This chapter describes only basic general parameters to get you started. For detail description off all parameters and options see following chapters.

General
Id each newly created component has an automatically assigned id. It is a unique identifier that can be overridden (renamed). You are recommended to give each component a unique meaningful name. Type indicates the type of component, cannot be edited. You can combine multiple animations on the same object.

14.1 Rotate animation


Similar to the bar and opacity animation, the rotate animation is a feature that allows user to rotate an object around set axis according to the percentage of maximum and minimum values from 0 to 360 degrees.

152

Enter the tag name and then the minimum value (of tag) which will correlate to the 0th degree and the maximum value (of tag) which will correlate to the 360th degree. The rectangle will rotate according to the tag values. Example: The location of the axis of rotation is set to the geometric center of the object or the group of objects by default. To change the rotation axis, double-click the object and select its axis, marked as a blue dot. Move selected point to the desired position, as shown in the following picture:

With rotation axis set we can create animation to get arrow of circular gauge revolve according to input tag value. Go to the Rotate Animation section of Animation tab in Properties window and select Acquire Center option of the Set Center property. This will set rotation axis for animation same as offset object axis. Fill Tag (Address), Minimum and Maximum properties with tag address, minimum expected tag value and maximum expected tag value respectively.

Set Center property can be set to: Acquire Center acquire a new center of rotation from the current state of the object. Clear Center clear center of rotation, set it to default (geometrical) center of the object. Cancel close the menu without any change to current property state. Center Offset X and Center Offset Y fields show coordinates of set rotation axis automatically and cant be edited. Default position is 0.0.

153

Now our object is completely prepared for demonstration, upload LiveView and see the result.

14.2 Visibility animation


Visibility animation is the animation that allows you to control the visibility of an object. There are 3 inputs required for this animation: Tag, Min and Max. When the value is within the min and max values range, the object will be visible, otherwise it will be hidden. To animate visibility based on the discrete (Boolean) value set Min and Max to 1. This way, the object will be visible when tag value will be equal to 1 (true).

Example:
To animate the visibility of the rectangle select the object which will prompt the Properties and Animations tab in the Properties window. From the Animations tab, navigate to the Visibility Animation section indicated by the red arrow in the figure below. Here you need to set Tag (address), Minimum and Maximum variables. The rectangle displayed in the following Figure will be hidden or visible according to the value of the tag set. If the tag value is in range between the Min and Max values the object will be visible, otherwise it will be hidden.

In the example taken from the Demo Project the green rectangle is shown only when the tag value is 10.

154

The next figure shows the settings that would cause the red rectangle to be visible when tag values are between the range of 50-100 or hidden if the tag values are outside of that range.

14.3 Scale animations


Scale Animations are used to change the size of an object (not text) in correspondence with the entered value. You can easily use the scale animation to obtain the bar chart. By rotating the element you can control the direction in which the scaling takes effect. Please note that Scale animation is applicable only on rectangles. Go to the Scale Animation section of Animation tab in Properties window and fill Tag (Address), Minimum and Maximum properties with tag address, minimum expected tag value and maximum expected tag value respectively. The Maximum property will correlate to the original height of the object, if actual tag value overcomes set Maximum value animation will stop at 100% size and the Minimum property will correlate to the height of the object equal to 0, if tag value go below set value object size will stop at 0%. The base point of the object is located in the top right corner of object and the height increases in the direction towards the bottom of the screen.

155

If you want to increase the height downwards or in any other direction you need to rotate the rectangle to the proper angle. To rotate the rectangle, use the selection tool. Double click the rectangle object and then rotate the object by selecting one of the corner arrows.

The next figure shows two rectangles, a blue one and a green one that have been rotated which is indicated by the location of the base points denoted by the blue arrows.

156

The other method for rotation is to right-click and use the context menu to rotate by 90, -90 or 180 degrees. An example of this is shown in the next figure or use Transforms Rotate by a 90 degrees angle.

157

158

Summary of rotation and changing the height:

The typical example of the use of animation as bar graphs:

159

14.4 Color animation


This animation means simply to display a desired color when the associated tag is within the acceptable range of values. You can enter multiple conditions to achieve more color change within one animation. Conditions are evaluated from top to bottom; therefore the bottom condition has higher priority. To animate coloring based on the discrete (Boolean) value set Min and Max to 1. This way, the object will be visible when linked tag value will be equal to 1 (true).

Example:
To change the color of an object dependent on the associated tag value, click on the object and select the Color Animation button, indicated by the blue arrow in the next figure. Click on Add button and enter the values according to the parameter definitions displayed in the appeared dialog. According to the animation definition, if the tag value is 0 the rectangle will be colored red and if the value is 1 it will be black.

160

Examples of color animations: Buttons

Traffic lights

Fans

Valves 161

Motors

14.5 Move animation


Move Animation is a programmed motion of an object along the defined path based on a tag value.

Example:
In the new view we create an object and a path to move our object along. To add move animation click on the object and select the Active button from Move Animation tab in Properties window, as indicated by the blue arrow in the next figure.

Fill tag address in the popped dialog in the tag field and select one of the available paths. Be aware that only unclosed paths will be available for move animation.

162

The other available options are: Visible move path remains visible if this option is enabled. Length represents the length of the selected path, filled automatically and cant be edited. Absolute this option tells mySCADA engine to map the whole length of the path for move animation to tag value as 1:1.

Relative Positioning this option allow using only certain threshold of tag value for move animation. Min value represent starting point of the animation (object will move only when tag value reach Min point) and Max value represent ending point of the animation (object will achieve end of path when tag value reach Max point). Enabling Reverse option allow movement to start from the end of the path. Typical use Move Animation is the object motion as a transport belt etc.

163

Sets
Set commands group combines Open commands, intended for open of new views/documents/other objects in mySCADA, and Set commands, which should be used for writing values to PLC. Select any object in the view, than open Sets tab in the Properties window.

Open Command Open command is used to navigate among HMI screens. You can open other project views from current one. The user can navigate between the various screens created in a project by changing the view using the Menu->Views options on the iPad.

164

The other possibility is to use an Open animation on any drawn object. When activated, this animation will prompt other project view. A parameter can also be passed optionally to the opening view.

Example:
Open command can be used, for example, to connect a detailed visualization of certain process part to the overview visualization of the whole process. For example, in an visualization of technology group it is possible to switch to detailed visualization of certain parts of this group by simply clicking on it.

Objects can be configured to open a new screen when they are selected (clicked on). By selecting the object and proceeding to navigate under the Sets tab within the Properties 165

window. The option of opening the previous window or any other created views inside of the current project is possible.

Open command section properties are: Active check this box to activate Open command. Open select view type that will be opened by command. Available settings are: Window another view will be opened by command. Parametric Window parametric view will be opened by command. Chart chart will be opened by command. Document will open one of the project documents. Index set on which page document will be opened. Screen select exact view that will be opened by command. Choice of options depends on the range of views, already defined in current project, and selected Open property. When Open property is set to Window only views will be available for choice, on Open set to Chart youll be choosing from available charts only and so on. Index this property is relevant for Parametric Window or Document. Here you can set index value(s), which should be transferred to parametric window or number of page, at which document should be opened.

Tips:
Open Window The next figure shows a picture from the Demo2_Technology view. Its a demonstration of the rotation animation. On the right site of the picture the tuning meter is illustrated, while on the left side you will see a button labeled Detail. The Detail button has been configured to take you to the detail screen as shown in the picture below.

166

Open Parameter Window The other Open Command possible configuration is suitable for situations when there are many similar objects within a view and you want to show more details of the same object on another screen. For more details on parametric windows see the chapter .Creating new View. In the demo project you will find a demo view, called AnimModbus which includes the section Open parameter window. The picture from that demo is shown on the following figure below.

It is an example of 3 bars connected to 3 different holding registers (or tags) H:0, H:1 and H:2. The button labeled Detail will open a new view with more details included. Such detailed view is named AnimModbusBar and is shown in the next figure.

167

Open Document Open Document is useful when you need to link certain part of your visualization with some document. For example you can attach maintenance manual to controlled device visualization, so operating personal would be able to access required information in a much convenient and faster way.

In the following example the attached document will be opened on page 45.

168

Set command It is possible to configure some objects to actually write new values to the PLC. The ability to toggle a specified bit, write a static predefined value, write any value given by the user or write any value given from multiple choices from a user created list are all possible. There are three types of triggers available for each object and each of them can have its own dataset to write. Data can be written on on Click, on Up and on Down actions. On Up and on Down triggers are independent, so you can write two different set of data with one button by applying different actions to it. on Click Set command will be activated when object is clicked on Down Set command will be activated when object is pressed(click and hold) on Up Set command will be activated when object is released after click or press All three triggers have the same properties, here we describe onClick only.

169

Press Add button and a new dialog appears:

You should set tag address first. With parameters Scale and Offset you can change user input before sending it to PLC. Expression form can be used also.

170

You can add any message you want to prompt to user on using Set Command animation. If you want no confirmation prompt on write leave this field blank. Values for Set Command can be obtained through several different ways. Type: selector allows setting one of the following methods of value retrieving: Value static value, set in editor, will be send to PLC. Toggle binary switch, set 0 to 1 and 1 to 0, should NOT be applied to non-binary variables. Numeric prompt a dialog in visualization, where user can enter any numeric value. There are options to treat such dialog as password input (hiding input values), and to set allowed range of inputs with Min and Max limits and number of decimal palces.

String prompt a dialog in visualization, where user can enter any string value. There are options to treat such dialog as password input (hiding input values), and to set allowed number of letters with Min and Max limits. Predefined text can be set also with Predef. Text option.

171

Slider prompt a dialog in visualization, where user can select any numeric value with a slider. Additional options allow to set Min and Max limit for slider value, Dec. Places allows to set precision between two slider states.

Multiple Choice prompt a dialog in visualization, where user can select one of predefined values. All predefined values should be entered as tag value/tag text pairs during setting of the animation.

Value from text item

Tips
Writing Predefined Value Objects can be configured to write a predefined value to the PLC when they are clicked on. Start by choosing an object by clicking on it. Select the Sets tab in the Properties window and within the Set Commands section select the On Click tab. The Animations-On Click window will appear. Select the Add button to create a new command. Enter the tag name/address and, if desired, a prompted message. Then select the value option from the Type: context menu and enter the value you wish to send to the PLC.

172

Writing Value from Predefined List This configuration can be selected by choosing the multiple choice option and filling the table with possible values along with the corresponding texts that are displayed in the dialog during the running visualization.

173

In this example table with two buttons will be shown.

Click on the zero will send 0 to PLC register, click on the full will send 100. Writing Numeric Value with slider The next possibility is to write an arbitrary value to the PLC. To activate this configuration setting select one of the Set Commands options and under the Type box menu, select the slider options. Enter the minimum and maximum values for the range which the user can select a value. The next figure shows the configuration setup so that an up click to the object prompts the write dialog where the user can write a value in the range of 0 to 150. Resulting value will be multiplied by 3 and increased by 33 before write to PLC as result of Scale/Offset addition.

174

Writing to Value Memory With Set command you can also write to memory variable of the script. Memory variable needs to be defined before you will add Set command. Click on the Memory tab to add write to memory variable.

Select one of the defined memory variables from list.

The rest of the parameters are same, as for regular tags. Click on OK to create Set command or Cancel to leave without change.

175

14.6 Get Animation


Get Animation allows displaying tag values in the text.

Example:
Lets assume that there are 3 tags in the ControlLogix PLC representing the current tank levels level1, level2 and level3. First add the text elements for the three levels of the tanks using the Create Text Element tool. The text creation window should resemble the window displayed in the following figure:

The visualization shown in this figure should resemble the view you just created:

Proceed to add text elements that will be responsible for reading values form the PLC. This process is the exact same as creation of previous text elements. The text written to the text element will specify the format of the number being read in from the PLC, e.g. REAL, FLOAT. The format specification is described in the following figure:

176

Any value received from PLC that do not follow the format specification are transformed (to the best abilities of mySCADA engine) to set format. For example if PLC returns value 3.47 and the visualization expects only one decimal place with format (##.#) than displayed number will be rounded to one decimal place, showing 03.5. Tag Connection In the next step you will connect the texts elements to specific PLC tags. First click on a specific text element that will be animated by receiving certain data from the PLC. Once selected, the Properties and Animations should appear at the top of the Properties window. Select the Animations tab indicated by the red arrow in the following figure. In the Get Animations section enter the specific tag address that the text element will be reading from. Place to enter to the tag address is indicated by the blue arrow the following figure. If an invalid tag address is entered, the text will turn red and you will be prompted to enter a correct address.

177

After that, please send created view to your mySCADA device. Resulting screen looks like:

The tags from the ControlLogix PLC were used in the previous example. You can generally use tags for all supported PLCs given that you use the proper syntax. For short description of proper tag syntax please see chapter Basic Tag Syntax.

178

You can combine static text with PLC values read through get animation. Lets create text element with text: The current level of the 1st tank: ###.### and duplicate it to other two elements.

Now, after configuring Get animation in the way, described above, you see the same visualization as in case with separated text and values.

14.7 Basic Tag Name Syntaxes


You can generally use tags for all supported PLCs given that you use the proper syntax. A summarization of proper tag syntax is discussed in the following section. The syntax for advanced Modbus functions is described in the section Communications: Modbus Tags for ControlLogix, CompactLogix T T.b T[n] Examples: volume1 volume1.3 vols[3] Access to the value of the tag volume1 Access to the 3rd bit of the tag volume1 Access to the 3rd element of the field vols[]. Name of the tag Name of the tag with the b-bit recognition Access to the T-field, n item index

Tags for MicroLogix, SLC 500, PLC5 I:e I:e/b e-th input, read only e-th input with the b-bit recognition, read only 179

I:e.s/b O:e O:e/b O:e.s/b Nf:e Nf:e/b Ff:e Ff:e/b Examples: O:5 I:2/3 O:1.3/7 F202:4 N201:2/3

Input from the card in the e-slot, s-words and optional access to the bbit, read only e-th output, read only e-th output with the b-bit recognition, read only Output on the card in the e-slot, s-word and optional access to the bbit, read only Access to the e-th number in the integer file with the order number f, optional access to the b-bit, reading and writing Access to the e-th number in the file of floats with the order number f, optional access to the b-bit, reading and writing

Reading of the value of the 5th output on the integrated output card. Reading of the value of the 3rd bit of the 2nd integrated input. If the 32-input card is used in the slot 1, access to the 7th bit of the 3rd input. Access to the 4th value in the file of floats F202. Access to the 3rd bit of the second item in the integer file N201.

Tags for Modbus devices I:e O:e H:e H:e/b R:e R:e/b Discrete input at address e, read only Output (coil) at address e Holding register at address e Holding register at address e with the b-bit recognition, read only Register at address e, read only Register at address e with the b-bit recognition, read only

14.8 Sound Animation


Sound animation can be used as notification for some non-standard situation or voice announcement. You need to import sound files before you start to create Sound animation, please read Sound chapter to find more details about import process and limitations.

Example:
Create new element of any kind, and select Anim in its properties.

180

Select Sound animation.

181

In the dialog window you can: Select one of loaded sound files Set sound severity (priority). In case of simultaneous occurrence of multiple sound animations sound with numerically highest severity will be played Repeat Count number of repetitions of selected sound during animation Volume define relative volume (from system maximum) of played sound Start by set trigger for sound animation: Tag sound will be played once selected tag value will reach given range on Click sound will be played when object is clicked on Down sound will be played when object is pressed(click and hold) on Up sound will be played when object is released after click or press Minimum and Maximum fields set range for tag value, when animation will be activated. Click OK once you have set all required parameters. With illustrated settings sound will be played when tag value will be in range 150-333, with 3 repetitions of selected sound.

182

Sounds
In mySCADA you can create sound animation also, which will play loaded MP3 files on defined occasions. Maximal size of the MP3 file is 3.5 MB. Such animations are supported in mySCADA for iOS and on mySCADA Box when HMI-interface viewed through Internet Explorer or Safari browsers. Sound import Click on the Sound folder in project tree. Select appeared Import icon in the toolbar or right click on the folder and select Import from the drop-down menu.

The Import sound dialog appears:

183

Select MP3 file from the available folders. Sound will be loaded into the project folder; you will be able to find it in the Sound folder of your project.

Figure 1 - Imported Sound

When you decide to delete a sound please click on it and select Delete Sound icon from the toolbar or select Delete from the right-click menu. Setting sound animation Select existing object in the view or create new one. Select Anim tab in its properties.

184

Now open Sound Animation dialog.

Here you can: Select one of loaded sound files 185

Set sound severity (priority). In case of simultaneous occurrence of multiple sound animations sound with numerically highest severity will be played Repeat Count number of repetitions of selected sound during animation Volume define relative volume (from system maximum) of played sound Start by set trigger for sound animation: Tag sound will be played once selected tag value will reach given range on Click sound will be played when object is clicked on Down sound will be played when object is pressed(click and hold) on Up sound will be played when object is released after click or press Minimum and Maximum fields set range for tag value, when animation will be activated. Click OK once you have set all required parameters. With illustrated settings sound will be played when tag value will be in range 150-333, with 3 repetitions of selected sound.

186

15 Effects
Effects are used to make the visualization less static. Their appearance is similar to the function of Animations, but, unlike Animations, Effects do not reflect real state of the technological process. We advise to use Animation to visualize precise state of your technology and Effects when you need to visualize that some change is happening at the moment. Object states during Animation are based on the actual values obtained from the PLC. For example the motor rotation visualized through Animations rotates according to the values obtained from PLC. But rotation visualized through Effects will be based on the values, provided by you, and will use hard data only as a starting trigger. Effects can be found in the Properties Window under the tab Animation, along with tables Animation and Properties (as shown by the blue arrow).

To add Effect animation click on the button in the Effects line (as shown by the red arrow). This opens a new dialog, which allows selecting multiple Effects for selected object.

187

Effects are grouped into 5 distinct categories, consisting of predefined effects and slots for custom effect of the same type, defined by the user: Rotate different rotation effects Opacity visibility animation, similar to Visibility Animation of Animations functions Blinking special visibility effects, allowing to visualize blinking of object Color change of object color, similar to Color Animation of Animations functions Stroke change of object stroke, improving perception of selected object. All effects have similar parameters window appearance, with large group of parameters common for all effects.

188

Animate button allow you to view effect in preview tab, to the right of settings tab. Further down the settings tab you can find trigger selection drop-down menu, where you can set event, which will activate current effect. You have four options here: Tag effect will be activated when selected tag value will reach given range on Click effect will be activated when object is clicked on Down effect will be activated when object is pressed(click and hold) on Up effect will be activated when object is released after click or press If you have selected Tag in trigger menu you can set tag address into the next Tag field and minimal and maximal values for tag, when effect will be active. In case of user action trigger those field will be hidden for input. Next you have to set effect duration with slider. In case of infinite overall duration of effect this slider set duration of one effect cycle. To preview behavior of set effect press Animate button. Further properties are effect-type dependent, so they are described later, with more detail about each effect type. Rotation This type of effects intended for creation of different rotation animations. There are two preset effect: CW (ClockWise) and CCW (Counter-ClockWise), which make 360 degree turn 189

in a time, set by the user. There are also additional options for user defined effect. In those you can set duration of single rotation cycle, number of repeated cycles (or infinite rotation) or different angular velocities for different parts of rotation cycle.

Repeat No. option allows to set number of repetition of rotation cycle. continuous checkbox set effect to infinite loop. In the next block you can set duration for each of segments of the cycle. You can add, remove and edit fragments with button right below the fragments tab.

Example:
Following illustration shows rotation effect triggered by click on object, which will last for 5 seconds and will repeat three times. Rotation from 0 to 180 degrees will take 60% of the total time, resulting in a jump in rotation speed.

190

Opacity This type of effects intended for creation of different visibility animations. There are two preset effect: Show and Hide, which make smooth visibility transition of object in a time, set by user. There are also additional slots for user defined effect. There, similar to rotation effects, you can set duration of effect cycle, number of repetitions of the cycle and different transition speed between visibility states of the object. This effect has same properties as Rotate effects, which are described in previous paragraph. Transition settings are similar to that of Rotate effect, but instead of rotation speed allows for changes in visibility change speed. For each change point Position column should be filled with value in the range [0 , 1], where 0 means that object is transparent and 1 means that object is fully visible. Time column allows to set duration of transition between two change points. . You can add, remove and edit fragments with button right below the fragments tab.

191

Blinking This type of effects intended for creation of blinking visibility animation. There are three preset effect: Slow, Medium and Fast, which allow to set object blinking with different frequency. There are also additional slots for user defined effect. There, similar to rotation effects, you can set duration of effect cycle. Please be aware that when tag value is set as trigger effect will continue until tag value will move outside of defined trigger range. If effect is set by onClick trigger it wont stop until screen is refreshed. Color This type of effects intended for creation of different color animations. There is one preset effect: Fill, which make smooth change of object fill in a time, set by user. There are also additional slots for user defined effect. There, similar to rotation effects, you can set duration of effect cycle and different transition speed between colors of the object. For predefined Fill effect you can set target color, so object fill will transit from color set on object property Fill to the color you had set in effect property. Please be aware that object Fill will remain at the state of last step of the effect after the end of effect duration. For user defined effects there is tab, similar to that of Rotate effect, where you can set different colors, which would be used in animation and transition times.

192

Note: Please be aware that object color will remain at the state of the last step of effect and wont return to Fill property color until the whole view is refreshed. If you wish to return object Fill property to the state before effect please add one short(0.1 s) transition step to the effect, with original Fill value set. Stroke Those effects are very similar to Fill effect, they also change color but of object stroke instead of fill. Settings are same, as in predefined Fill effect. Please note that object needs to have stoke-width set higher than 0 for effect to take place. Same note about non-cyclic color change, as for Fill effects, applies here also. You can combine multiple effects on the same object, but please be aware of overlapping behavior in such case.

193

16 Scripting
mySCADA offers many tools to perform the most common data acquisition, display, animation, effects and all of this without coding. For maximum flexibility mySCADA also includes a complete scripting language based on Java Script. Java Script in mySCADA allow 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. They can be as simple as setting a few output values to a preset state to complex animation scenarios. The possibilities are endless. Scripting is designed to be easy to use, extending the functions of mySCADA. You do not need to be an experienced programmer to use scripting. Using java script as a scripting language means you dont have to worry about memory allocations, leaks, and complex programming issues. Usage is very simple and straightforward. Decide when scripting would be beneficial mySCADA has many built-in features. Most can be extended with scripting when you are starting out, you can use all the built-in features to acquire your data, create graphics, make dynamic animations, and 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 other functions. As you get more experienced, you can take further advantage of the power of scripting. Using script in your view For each view you can create your own script. Script evaluated every time active screen is refreshed. Refresh logic work as follows:

Firstly, when you would like to add a user defined script, open your view and click on the script button on the toolbar.

194

Then script window will be opened, where you can insert your user defined script:

The script editor is split into 3 main windows: Script Window: this is a window where you put your user defined script. Variables Window: here you define your view variables Useful function list Window: in this window you will find mySCADA specific functions, which will help you to control your components in corresponding window. Declaring Variables: You can declare your variables in the Variables Window:

195

There are four types of variables to use: Input variables: Use these variables to read data from PLC. Each time your script is evaluated, firstly it reads tags from PLC and stores them into input variables. Output variables: After your script is evaluated, values of output variables are written into PLC. You can set if to write value each time your script is evaluated, or if you want to write value to PLC only on change. This is controlled via 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 script and it will prevail until you switch to different view or close the application. String Memory: string memory variables are the same as value memory variables but are of string type. Writing your script: You can write your script in the Script Window. You can use any function or expression from java script. Editor will automatically highlight your syntax and make an error checking. Using variables in controlling animations You can use declared view variables in animations. To tie view variable to animation just use equation editor as with regular PLC tags. Simple Example: Task is to show value of Value Memory Variable in a text element in your view. First of all we should open Script Window. Than in the Value Memory tab of Variables Window we have to create InternalMemory (its just example naming, call variables in any convenient way) variable with default value 10.0

196

Switch back to the view we are editing. Create a text element in your view. Click on the element and create get animation with memory variable by typing =InternalMemory or selecting memory variable through equation editor.

197

When sent to mySCADA box you view should look like:

Also you can control animations of your graphical object directly in script. You should use mySCADA specific functions to do so. You can find complete list in the Usefull Functions Window. To set value of our element directly in script you would use function myscadaSetText(text0001,internalMemory);

198

17 Resources
The Resource tab is located in the Properties window, together with Animation-Properties and Libraries tabs. Function of this tab is offer different options of creating a different uneven fill effects or pattern/marker fills from objects created in the SVG editor.

To use the gradient fill effect click on the specific object and in the properties tab, within the properties window, set the fill options to resources. Select on of created or predefined fills from the drop-down menu.

199

Linear gradient Linear gradient function provides the ability to create horizontal, vertical and diagonal gradient fills.

To open the properties of the Linear gradient either double click on an existing linear gradient or select the Linear gradient to work with and click on the icon right below the Properties Window. A new window will open.

200

Colors Click on the square above the red arrow, then click the Color box below or double click on the box above the arrow to open the Color Picker (it is the same as in the chapter Properties The Fill tab). You can add additional color by clicking on or double click on the box above the arrow.

If you have not moved the box the additional colors will appear directly on top of the box above the arrow. You can move starting point for the colors in gradient or swap them by moving color indicators along the gradient. Removing color click the box above the arrow, the arrow turns red. Then click on the icon .

Item properties Here you can change selected color, opacity of the selected color and its offset from the left edge of the object (set in percent of object length). Vector Gradient units: - you can choose from two options: Object bounding box allow you to shift points in the window to adjust the course of shading. Positions of these points are seen as a percentage in the table coordinates.

User space on use - the table is used to manually enter coordinates for transition shading. Values are in pixels. Spread method you can choose Pad is basic Repeat repeats the shading Reflect reflects the shading Id - here you can name the newly created style shading, which be displayed in the resources window under this new name.

201

New Linear gradient

You can create a new, custom linear gradient, click on the icon right below the Properties Window and it will add a new item. Double click on this item or on the icon to open the new window (see above). Save the newly created style store by clicking the OK button or to delete it click Cancel. Duplicate If you need to copy any of the predefined styles changed a bit, use the Duplicate function. Click on the selected style then click on the icon name marked Copy. Import . A new line will appear with the same

It will be available in the future version of editor. Delete You can delete the existing style by clicking on the icon . 202

Radial gradient This function operates with circular gradient fills.

To view the properties you can either click on the icon gradient. The properties window below will be displayed.

or double click of an existing

203

Both Colors and Item properties are identical to those of Linear gradient function, described in the paragraph above. Circle Gradient units: - you can choose from two options: Object bounding box - shift points and the circle in the window to adjust the course of shading. The position of these points and the radius of the circle are shown in the coordinates table.

User space on use - the table is used to manually enter coordinates for transition shading. Values are in pixels. Spread method you can choose Pad is basic Repeat repeat shading Reflect - shading reflects Id - here you can name the newly created style shading, which be displayed in the resources window under this new name. New Radial gradient You can create a new, custom radial gradient. Click on the icon and it will add a new item. Double click on this item or on the icon to open the new window (see above). Save the newly created style store by clicking the OK button or to delete it click Cancel. Duplicate If you need any of the predefined styles changed a bit, use the Duplicate function. Click on the selected style then click on the icon name marked Copy. Import . A new line will appear with the same

It will be available in some of the next version.

204

Delete You can delete the existing style by clicking on the icon Pattern Different objects or images can be used as padding of other objects. To open the properties of the pattern either double click on an existing pattern or select the pattern you will be working with and click on the icon. A new window will then open. .

Size Pattern Units: this property allows controlling pattern size and has two options: Object bounding box you can manually enter the coordinates of the location and size of the basic tile. Values are shown as percentages of object size. User space on use coordinates are entered manually to fill the object. Values are shown in pixels. X: x-axis coordinate of pattern placement in percent of object size. Y: y-axis coordinate of pattern placement in percent of object size. Width: set width of single pattern in percent of object size. If width is lower than 100% pattern will be repeated. Height: set height of single pattern in percent of object size. If width is lower than 100% pattern will be repeated.

Example:
Lets use ellipse as a pattern.

205

When such pattern is used as fill for the rectangle you receive a picture similar to the next:

Pattern content units: Id - here you name the newly created pattern, which be displayed in the resources window under this new name. New Pattern You can create a new pattern by clicking on the icon window and the new dialog will open. at the bottom of the Properties

206

You can select what image or element should be used as pattern base in this dialog. Id of a shape select one of the existing object, which will be used as tile. Click the OK button to add a new item in the list, to delete click Cancel. Double click on this item or click on the icon for this pattern (see above). Duplicate If you need any of the predefined patterns changed a bit, use the Duplicate function. Click on the selected style then click on the icon name marked Copy. Import . A new line will appear with the same to open the new window with properties

It will be available in some of the next version Delete You can delete the existing pattern by clicking on the icon .

207

18 Devices
Devices tab allows for quick overview of mySCADA devices connections, both manually added and available through current local network.

The main window of Devices tab is split into two parts: in the upper part all permanently defined devices are listed; in the lower part editor will list all compatible devices on local network (iOS or Android devices with mySCADA app running in foreground or mySCADA boxes) You can easily store Online devices to permanently defined by selecting device in Online list and applying Add from OnLine function to it.

To add define new device manually please use Add Device button and fill next dialog:

208

Please select the type of the device first: iPad iPhone iPod touch mySCADA Box myLOGGER Then set device parameters as: Alias name describing the device IP fill the devices IP Port devices port, set by default, but can be changed (all mySCADA devices use port 2121 by default) Ser. No.: serial number of the device (mySCADA box/myLOGGER only). You can find serial number in System-Status menu of the device.

Click on OK to save device details. Further functions of Devices tab are: Delete Device remove stored device connection Edit Device alter device details

209

Add from On-line stores connection to the selected device, available through local network Test Device tests the connection to the selected device, on successful test you will see next message:

Erase Data in Device delete all logged/project data in device. Show www will open web-interface of the device (mySCADA box/myLOGGER only) in your default browser. Right-click on the button will open web-interface through secure connection (HTTPS).

- will move device up or down in the list. Logger Info will open additional window with device logging details (mySCADA box/myLOGER only):

210

Click on the Show Tags in Logger icon

to list all tags defined in the device.

Click on Show Connection in Logger icon device.

to see all PLC connection defined in the

211

19 Entering Advanced Functions(Equations)


To create complex and feature rich components you need to enter complex formulas instead of simple variables. You can use functions anywhere you like: inside animations, instead of constants or as a text replacement for text fields. To show the functionality we will extend our example by implementing the scale along the slide bar we just created. Open the slide bar created in Chapter 12 and alter it according to the illustration

Delete Min and Max test fields, stretch blue rectangle, including frame. To do so please select both elements with Zone selection tool and resize them. After that, insert additional lines with Drawing-Line tool in thirds of rectangle. With Transforms-Order-Lower to background send both lines and frame to background, below fill rectangle.

Now insert additional text fields.

212

For each text field we need to specify the Replacement - Text (Animation Rep. Text). We will use functions with our variables to achieve the job. So we will add following Replacement - Text to the text fields: Left text field: (min).toFixed(1) Second text field (from left): ((min+max)/3+min).toFixed(1) Second text field (from right): (2*(min+max)/3+min).toFixed(1) Right text field: (max).toFixed(1)

The left text field will show the value of our variable min. toFixed(x) is a function which will round the result to x decimal places. In our case, we will have the value formatted to show one decimal place. The text field second from 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. Again we will use the toFixed() function to floor the result. Other text fields are similar to those two. To finish, we will add the units and label to our component:

213

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 variable label. For Units text field add Text Replacement equal to variable units. Finally, hit the save button to see the changes that have just been made.

The resulting visualization on iPad looks like this:

214

215

20 Entering Expressions
20.1 Tag Address
Animations and effects are intended to visualize values from your PLCs read from certain tags. You can provide tag addresses by directly typing them into proper fields or you can set them through Equation dialog. In dialog window, at first, choose Connection Type Modbus, MicroLogix, Ethernet I/P or Siemens and choose Connection (@). Then set tag address through menus or write it into input box directly.

20.2 Expressions
Instead of writing a tag name, you can enter a mathematical expression. This way you can scale and offset a value read from the PLC, or create more complex data processing. Same as tag address expressions can be entered directly or set through dialog.

216

And then click here

Formatting & Limits: Tag name is entered in adr() function You can use only supported functions and operators Supported functions and operators are listed under input box in five groups; you can switch between them clicking on: Oper, Func, Trig, Vers or Const. Operator or Function will be inserted after clicking on named button.

You can use multiple tags in expression, but remember that iOS application has limitation of one PLC connection per view, so all this tags must be from one PLC to achieve mySCADA for iOS compatibility. This limitation does not extend to mySCADA Box. You can also write equation without using any tag.

217

Example:
We will read a value from Modbus H:0 Lets scale the value by 10 and offset it by 0.5. Formula to enter: =10*ADR(H:0)+0.5 Supported functions and operators
Operator + - or * or / or % ! ** & | ^ ~ << >> = != add subtract and negate multiply divide mod or percent factorial pow dtor and or xor not lshift rshift l_eq l_neq Function Standard Operators addition and unary positive subtraction and negation multiplication division modulus or a percentage of a value factorial exponentiation converts the value to radians Bitwise Operators bitwise and bitwise or bitwise xor bitwise not bitwise left shift bitwise right shift Comparison Operators equal not equal Description

218

< > <= or >= or

l_lt l_gt l_ltoe l_gtoe l_and

less than greater than less than or equal greater than or equal Logical Operators logical and

&& or

l_or || or

logical or

! or

l_not

logical not

Tips The Degree Operator The degree operator () is very useful when converting user input. Because all of the trigonometric functions require their parameters to be passed in radians, the degree operator will convert its operand into radians. Thus, 45 is equivalent to dtor(45). The % Sign When the percent sign is interpreted as modulo, then: 10 % 3 ... evaluates to 1 (the remainder after 10 is divided by 3). However, if you flip the switch to make the % sign be a percentage, then you can now do: 250 + 10% By default, % is usually shorthand for "/100". In other words, 42% becomes 42/100, or 0.42. However, if the % term is the right hand sign of either a subtraction or addition operation (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: (10 % 3) + percent(50) = 1.5 Factorial and Logical Not Differentiating between factorial (!) and a logical not (!) is more difficult. A ! is interpreted as a logical not if: 219

it is the first token it is preceded by a binary operator it is preceded by a right associative unary operator Otherwise it is treated as a factorial. A token is always treated as a logical not (for obvious reasons). Supported function Functions that take more than 1 parameter sum() - returns a sum of the passed parameters count() - returns the number of passed parameters min() - returns the minimum of the passed parameters max() - returns the maximum of the passed parameters median() - returns the median of the passed parameters stddev() - returns the standard deviation of the passed parameters average() - returns the average of the passed parameters random() - returns a random integer. Can take 0, 1, or 2 parameters. The first parameter (if given) is the lower bound of the random integer. The second parameter (if given) is the upper bound of the random integer. nthroot() - returns the nth root of a number. For example, nthroot(27,3) returns the cube root of 27, or 3. Functions that take 1 parameter: sqrt() - returns the square root of the passed parameter log() - returns the base 10 log of the passed parameter ln() - returns the base e log of the passed parameter log2() - returns the base 2 log of the passed parameter exp() - returns e raised to the power of the passed parameter ceil() - returns the passed parameter rounded up floor() - returns the passed parameter rounded down The trigonometric functions: sin(), cos(), tan() Their inverses (asin, acos, atan) Their reciprocals (csc, sec, cotan) The reciprocals of the inverses (acsc, asec, acotan) The hyperbolic variations of all the above functions (sinh, cosh, tanh, asinh, acosh, atanh, csch, sech, cotanh, acsch, asech, acotanh) The versine functions (versin, vercosin, coversin, covercosin, haversin, havercosin, hacoversin, hacovercosin, exsec, excsc, crd) dtor() - converts the passed parameter from degrees to radians rtod() - converts the passed parameter from radians to degrees Functions that take no parameters ("constant functions"): 220

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 ln2() - returns the value of the log base e of 2 ln10() - returns the value of the log base e of 10 Parentheses are used to group sub-expressions to set the order of execution, and can be nested to any depth. All computation is carried out using double precision floating point. In case of error the editor will give you a warning and error expressions wont be evaluated. You can always check validity of entered expression with the Test button.

Please click on OK button after completing expression. Now you should see your expression in Tag(Address) field.

221

Examples of valid expressions adr(N100:0)*adr(F30:10) sin(adr(N100:0))+cos(adr(F30:10)) median(adr(N100:0),adr(F30:10),adr(N20:5),adr(F10:10)) multiple arguments should be separated with commas. 2>=1 logical operations always return binary result (0 or 1).

222

21 DOM viewer
This feature from menu Dialogs allows you to view individual objects of the visualization, showing all object parameters. Open view, than select Dialogs DOM.

Here you will find tree of all view elements and groups, showing also applied styles and background.

223

Each element can be opened for detailed view also. You will find all element properties, animation and effects listed in sub-tree.

224

22 Memory monitor
This function from menu Dialogs allows you to check memory utilization by editor.

Application release unused memory automatically, in certain periods. To release unused memory immediately please press Collect button in the dialog.

225

23 Communications
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 are some limitations and only some data types are supported. The following paragraph specifies all supported date types for the PLC. Each supported PLC protocols described in own subchapter below.

23.1 EtherNet/IP (ControLogix)


Using the ControLogix PLC all atomic numeric data types are supported Tag Data Type DINT SINT INT REAL BOOL Description An atomic data type consisting of a DWORD used to store a 32bit signed integer value (-2,147,483,648 to +2,147,483,647). An atomic data type that stores an 8-bit signed integer value (128 to +127). An atomic data type consisting of a word used to store a 16-bit signed integer value (-32,768 to +32,767). An atomic data type that stores a 32-bit IEEE floating point value. The BOOL data type is an atomic data type consisting of a single bit.

The other primitive data types like ALARM, COUNTER, i.e. are not supported. The access to user defined data types like structures or arrays are supported, but only if you use the above mentioned atomic data types in the structures or arrays. To read or write the elements inside the structured tags you should use the dot notation, i.e. tank[1].volume is a proper syntax to read the volume of the 1st tank. Reading Controller Tags: To read a controller tags just specify directly the tag name. Reading Program Tags: To read a program tag, you have to specify the program name before a tag name. You must use the following syntax: Program: name.tag name is a program name tag is a tag name So if you want to communicate with tag named valve from a program named control you will have a following syntax: control.valve Limitation of the BOOL Arrays in the ControLogix The different syntax to access the elements in the bool arrays is used in the mySCADA editor comparing to the programs stored in the controller. In the mySCADA editor you have 226

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: 3rd element (bit) 34th element (bit) 54th element (bit) Out of range, bad address Out of range, bad address TestBool[0].3 TestBool[1].2 TestBool[1].22 TestBool[2].0 TestBool[50]

Recommendation on improvement of communication speed The communication with a ControLogix controller was designed in such a way that reading of arrays together is faster than reading each element separately. That means that if you use the tags that can be arranged into the arrays you will notice significant increase of speed. 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] Level[3] . If you like structures, you should use them in the proper way. E.g. addressing of this type will slow down the communication. You are discouraged to use this type of data addressing. BigTank[1].Level BigTank[2].Level BigTank[3].Level SLOW FAST

23.2 MicroLogix and SLC


For MicroLogix PLC the data types are defined by means of the file types used. 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.

227

File Type N Integer

B Binary F Float

L - Long

O0 - Output I1 - Input

Use with these controllers 16-bit long numbers, signed, this file is used SLC and to store numeric values or bit information, MicroLogix read/write support. 16-bit long numbers, signed, this file stores SLC and internal relay logic, read/write support. MicroLogix This file stores numbers with a range of SLC and 1.1754944e-38 to 3.40282347e+38, MicroLogix read/write support. 32-bit long numbers, signed, Also called MicroLogix 1100, double word, read/write support. 1200, 1400 and 1500 This file stores the state of output terminals SLC and for the controller, read only. MicroLogix This file stores the state of input terminals SLC and for the controller, read only. MicroLogix

Description

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 3rd element of the integer file number 100 use following syntax N100:3 You can access each bit directly by defining its position after the slash. I.e. to access the 7th bit of the 3rd element in the integer file number 100 use following syntax N100:3/7

23.3 Modbus
The Modbus communication protocol describes the interactions of each device on a Modbus network. In protocol description you can find all details about establishing address, device recognitions and all other important part of Modbus communication. Here we will concentrate on protocol usage by mySCADA program. Tag Name Syntax In the following table the available syntax of tags names is summarized. Tag Rn:e R:e Meaning 16-bit signed integer stored in input Read access only. Read function: 4 register at address e 16-bit unsigned integer stored in input Standard address range: 30001-39999 register at address e 228

H:e Hn:e Hf:e Hfs:e Hfsb:e Hfsw:e Rf:e Rfs:e Rfsb:e Rfsw:e Hd:e Hds:e Hdsb:e Hdsw:e Rd:e Rds:e Rdsb:e Rdsw:e I:e

16-bit unsigned integer stored in holding register at address e 16-bit signed integer stored in holding register at address e Float number stored in holding register at address e Read/write access. Float number stored in input register at Read function: 3 Write function: 16 address e Standard address range: 40001 49999(extended to 499999 32-bit integer stored in holding register at by some manufacturers) address e

32-bit integer stored in input register at address e

Discrete input, boolean value

O:e

Discrete Output Coils

Read access only. Read function: 2 Standard address range: 10000-19999 Read/write access: Read function: 1 Write function: 15 Standard address range: 1-9999

A lot of manufacturers uses addresses instead of tags when describe Modbus communication. mySCADA currently does not support direct access by address, so you have to convert such addresses to tags according to provided table. Be aware that specific read/write function is needed to access each range, so correct choice of tag type is important. 32-bit registers in Modbus Modbus protocol was designed to operate with devices of 16-bit register length. Consequently, special considerations are required when implementing 32-bit data elements. Most of implementations use two consecutive 16-bit registers to represent 32 bits of data or essentially 4 bytes of data. Within these 4 bytes of data that single-precision floating point data can be encoded into a Modbus RTU message. Modbus itself does not define a floating point data type 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 byte order of the data payload. Therefore the most

229

important consideration when dealing with 32-bit data is that the data will be addressed in the proper order. The following table shows the two adjacent 16-bit registers conversion to a 32-bit floating point or 32-bit integer value: Register suffix s sb sw Swap mode N/A Byte and word swap Byte swap Word swap 16-bit registers [a b][c d] [a b][c d] [a b][c d] [a b][c d] 32-bit floating point or integer [a b c d] [d c b a] [b a d c] [c d a b]

The following section describes the implementation of the 32-bit data types in the mySCADA application. Floating Point Numbers Floating point data type is possible to use in both input and holding registers and all possible byte swap combinations are supported. Register Hf Hfs Hfsb Hfsw Rf Rfs Rfsb Rfsw Mapping Holding registers Holding registers Holding registers Holding registers Input registers Input registers Input registers Input registers Swap mode N/A Bytes in 2 16- Resulting bit registers floating point [a b][c d] [a b c d] [d c b a] [b a d c] [c d a b] [a b c d] [d c b a] [b a d c] [c d a b] 32-bit

Byte and word [a b][c d] swap Byte swap [a b][c d] Word swap N/A [a b][c d] [a b][c d]

Byte and word [a b][c d] swap Byte swap [a b][c d] Word swap [a b][c d]

32-bit Integers The long integers are implemented in the same manner as the floating point numbers. Register Hd Mapping Holding Swap mode N/A Bytes in 2 16- Resulting bit registers integer [a b][c d] [a b c d] 32-bit

230

Hds Hdsb Hdsw Rd Rds Rdsb Rdsw

registers Holding registers Holding registers Holding registers Input registers Input registers Input registers Input registers

Byte and word [a b][c d] swap Byte swap [a b][c d] Word swap N/A [a b][c d] [a b][c d]

[d c b a] [b a d c] [c d a b] [a b c d] [d c b a] [b a d c] [c d a b]

Byte and word [a b][c d] swap Byte swap [a b][c d] Word swap [a b][c d]

Address Mapping On the Modbus server-side only 16-bit long holding and input registers are used. The 32-bit long data types are just the interpretation of the two adjacent registers. The concept of address mapping is clearly shown on the following figure. Three tables are shown there. All of them are addressing the same place in the memory: holding registers. In the first table the holding registers are shown, in the second the 32-bit integers and in the last table the floating point data type are shown. H:0 Hd:0 H:1 H:2 Hd:2 H:3 H:4 Hd:4 H:5 H:6 Hd:6 H:7 H:8 Hd:8 H:9

Hf:0 Hf:2 Signed and Unsigned Numbers

Hf:4

Hf:6

Hf:8

Signed and unsigned integers can be stored in the registers. The unsigned numbers are read from or written to the Modbus device using simple addressing, like H or R for holding and input registers. To use signed integers add the suffix n to the address. Using tag Hn:5 would mean that you will access the holding register at address 5 and the number will be interpreted as the signed integer. In 32-bit data type numbers, the signed integers are used by default and the suffix n is not used. Demo An example of advanced Modbus functionality can be seen as ModbusDemo screen, which can be downloaded as a part of the demo project at the address: http://www.myscada.org/wp/category/downloads/ 231

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 its data interpretation whether 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 Hf:0 register and the floating point value 2.456 is stored in the input register Rf:0.

232

23.4 Siemens S7 family PLCs


Standard S7-300/400/1200 Item Syntax Address Syntax Input, Output, Peripheral, Flag Memory Types <memory type><S7 data type><address> <memory type><S7 data type><address><.bit> <memory type><S7 data type><address><[row][>col]> DB Memory Type DB<num>,<S7 data type><address> DB<num>,<S7 data type><address><.bit> DB<num>,<S7 data type><address><[row][col]> where <num> ranges from 1 to 65535. Memory Types Memory Type I E Q A PI PE PQ PA M F DB S7 Data Types The S7 Data Type is used to coerce the data type for a tag. It does not apply to Timers and Counters. The default data types are shown in bold.
S7 Data Type X B Byte Description Bit Unsigned Byte Address Range X0. b-X65534.b .b is Bit Number 0-15 B0-B65535 BYTE0-BYTE65535 B0.b-B65535.b BYTE0.b-BYTE65535.b .b is Bit Number 0-7 Data Type Boolean Byte, Char Boolean

Description Inputs Outputs Peripheral Inputs Peripheral Outputs Flag Memory Data Blocks

Address Range

Data Type

Access Read/Write Read/Write

Dependent on S7 Data Type (see table below)

Read Only Read/Write Read/Write Read/Write

233

C Char

Signed Byte

B0.n-B65535.n BYTE0.n-BYTE65535.n .n is string length. 0<n<=212. C0-C65535 CHAR0-CHAR65535 C0.b-C65535.b CHAR0.b-CHAR65535.b .b is Bit Number 0-7 C0.n-C65535.n XHAR0.n-CHAR65535.n .n is string length. 0<n<=212. W0-W65534 WORD0-WORD65534 W0.b-W65534.b WORD0.b-WORD65534.b .b is Bit Number 0-15 I0-I65534 INT0-INT65534 I0.b-I65534.b INT0.b-INT65534.b .b is Bit Number 0-15 D0-D65532 DWORD0-DWORD65532 D0.b-D65532.b DWORD0.b-DWORD65532.b .b is Bit Number 0-31 DI0-DI65532 DINT0-DINT65532 DI0.b-DI65532.b DINT0.b-DINT65532.b .b is Bit Number 0-31 REAL0-REAL65532

String*

Byte, Char Boolean

String*

W Word

Unsigned Word

Word, Short, BCD Boolean

I INT

Signed Word

Word, Short, BCD Boolean

D DWORD

Unsigned Double Word

DWord, Long, LBCD, Float Boolean

DI DINT

Signed Double Word

DWord, Long, LBCD, Float Boolean

REAL

IEEE Float

Float

*These are Raw Strings that differ in structure and usage from the STEP 7 String data type. Note: Be cautious while modifying Word, Short, DWord, and Long type, 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, with DWord MD0, MD4, MD8 ... and so on can be used to prevent overlapping bytes. Note: Please be aware of difference in addressing of X type of variables (like IX0.0) between TIA portal/Step 7 and mySCADA. The problem is that in TIA portal variable of X type defined as of 8 bit size. In mySCADA we treat them as 16 bits with swap byte order. For example if you define db1.dbx1 and .dbx2 in TIA portal you can access each of them in .0-.7 bit range. In mySCADA you can access both variables as db1.dbx1 with .0-.15 bit range. Because of swap bit order db1.dbx1.0-.7 in mySCADA would relate to TIA portal db1.dbx2.0-.7 and 234

db1.dbx1.8-.15 would access db1.dbx1.0-.7 in TIA portal addressing. We made such difference in mySCADA to fully accommodate analog inputs readings, like IX64, for example. At the moment to achieve same addressing to boolean variables as TIA portal please use B type instead of X in mySCADA, as B type don't have swap bytes order. See Also: Examples String Support Raw Strings For an address DBx,By.n @ String, String values read and written are stored at Byte offset y. y y+1 y+2 y+n-1

Raw strings are null terminated. If the maximum string length is 10 and 3 characters are written, the fourth character is set to NULL, while characters 5-10 are left untouched. Array Support The [rows][cols] notation is appended to an address to specify an array (e.g. MW0[2][5]). If no rows are specified, row count of 1 is assumed. Boolean Arrays and String Arrays are not supported. For Word, Short and BCD arrays, the base address + (rows * cols * 2) cannot exceed 65536. Keep in mind that the elements of the array are words, located on a word boundary. For example, IW0[4] would return IW0, IW2, IW4, and IW6. For Float, DWord, Long and Long BCD arrays, the base address + (rows * cols * 4) cannot exceed 65536. Keep in mind that the elements of the array are DWord, located on a DWord boundary. For example, ID0[4] will return ID0, ID4, ID8, ID12. For all arrays, the total number of bytes being requested cannot exceed the internal block size of 212 bytes. Examples:
S7 Data Type X B Byte Data Type Boolean Byte Input IX0.7 IB0 IBYTE0 IB0.7 IBYTE0.7 IB0.64 IBYTE0.64 IB0[2][5] IBYTE0[2][5] IC0 Flags MX0.7 MB0 MBYTE0 MB0.7 MBYTE0.7 MB0.64 MBYTE0.64 MB0[2][5] MBYTE0[2][5] MC0 DB DB1,X0.7 DB1,B0 DB1,BYTE0 DB1,B0.7 DB1,BYTE0.7 DB1,B0.64 DB1,BYTE0.64 DB1,B0[2][5] DB1,BYTE0[2][5] DB1,C0

Boolean

String

Array C Char

235

Char Boolean

ICHAR0 IC0.7 ICHAR0.7 IC0.64 ICHAR0.64 IC0[10] ICHAR0[10] IW0 IWORD0 IW0.15 IWORD0.15 IW0[10] IWORD0[10] II0 IINT0 II0.15 IINT0.15 II0[5][2] IINT0[5][2] ID0 IDWORD0 ID0.31 IDWORD0.31 ID0[10] IDWORD0[10] IDI0 IDINT0 IDI0.31 IDINT0.31 IDI0[4][3] IDINT0[4][3] IREAL0 IREAL0[10]

MCHAR0 MC0.7 MCHAR0.7 MC0.64 MCHAR0.64 MC0[10] MCHAR0[10] MW0 MWORD0 MW0.15 MWORD0.15 MW0[10] MWORD0[10] MI0 MINT0 MI0.15 MINT0.15 MI0[5][2] MINT0[5][2] MD0 MDWORD0 MD0.31 MDWORD0.31 MD0[10] MDWORD0[10] MDI0 MDINT0 MDI0.31 MDINT0.31 MDI0[4][3] MDINT0[4][3] MREAL0 MREAL0[10]

DB1,CHAR0 DB1,C0.7 DB1,CHAR0.7 DB1,C0.64 DB1,CHAR0.64 DB1,C0[10] DB1,CHAR0[10] DB1,W0 DB1,WORD0 DB1,W0.15 DB1,WORD0.15 DB1,W0[10] DB1,WORD0[10] DB1,I0 DB1,INT0 DB1,I0.15 DB1,INT0.15 DB1,I0[5][2] DB1,INT0[5][2] DB1,D0 DB1,DWORD0 DB1,D0.31 DB1,DWORD0.31 DB1,D0[10] DB1,DWORD0[10] DB1,DI0 DB1,DINT0 DB1,DI0.31 DB1,DINT0.31 DB1,DI0[4][3] DB1,DINT0[4][3] DB1,REAL0 DB1,REAL0[10]

String

Array W Word Word

Boolean

Array I INT Short

Boolean

Array D DWORD DWord Boolean

Array DI DINT Long

Boolean

Array REAL Float Array

23.5 MELSEC-Q
At the moment mySCADA support only part of MELSEC-Q protocol, namely 3E type of packets, originally intended for E71 type of adapters. In the table below you will find list of both basic (original) tag syntax and some extensions, introduced by our team. Tag Name Syntax In the following table the available syntax of tags names is summarized. Tag Meaning 236

Rn:e R:e H:e Hn:e Hf:e Hfs:e Hfsb:e Hfsw:e Rf:e Rfs:e Rfsb:e Rfsw:e Hd:e Hds:e Hdsb:e Hdsw:e Rd:e Rds:e Rdsb:e Rdsw:e I:e

16-bit signed integer stored in input register at address e 16-bit unsigned integer stored in input register at address e 16-bit unsigned integer stored in holding register at address e 16-bit signed integer stored in holding register at address e Float number stored in holding register at address e

Read access only. Read function: 4 Standard address range: 30001-39999

Read/write access. Float number stored in input register at Read function: 3 Write function: 16 address e Standard address range: 40001 49999(extended to 499999 32-bit integer stored in holding register at by some manufacturers) address e

32-bit integer stored in input register at address e

Read access only. Read function: 2 Standard address range: 10000-19999 O:e Discrete Output Coils Read/write access: Read function: 1 Write function: 15 Standard address range: 1-9999 A lot of manufacturers use addresses instead of tags when describing Modbus communication. mySCADA currently does not support direct access by address, so you have to convert such addresses to tags according to provided table. Be aware that specific read/write function is needed to access each range, so correct choice of tag type is important. 32-bit registers in Modbus Modbus protocol was designed to operate with devices of 16-bit register length. Consequently, special considerations are required when implementing 32-bit data elements. Most of implementations use two consecutive 16-bit registers to represent 32 bits of data or essentially 4 bytes of data. Within these 4 bytes of data that single-precision floating point data can be encoded into a Modbus RTU message.

Discrete input, boolean value

237

Modbus itself does not define a floating point data type 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 byte order of the data payload. Therefore the most important consideration when dealing with 32-bit data is that the data will be addressed in the proper order. The following table shows the two adjacent 16-bit registers conversion to a 32-bit floating point or 32-bit integer value: Register Swap mode 16-bit registers 32-bit floating suffix point or integer N/A [a b][c d] [a b c d] s Byte and word swap [a b][c d] [d c b a] sb Byte swap [a b][c d] [b a d c] sw Word swap [a b][c d] [c d a b] The following section describes the implementation of the 32-bit data types in the mySCADA application. Floating Point Numbers Floating point data type is possible to use in both input and holding registers and all possible byte swap combinations are supported. Register Hf Hfs Hfsb Hfsw Rf Rfs Rfsb Rfsw Mapping Holding registers Holding registers Holding registers Holding registers Input registers Input registers Input registers Input registers Swap mode N/A Bytes in 2 16- Resulting bit registers floating point [a b][c d] [a b c d] [d c b a] [b a d c] [c d a b] [a b c d] [d c b a] [b a d c] [c d a b] 32-bit

Byte and word [a b][c d] swap Byte swap [a b][c d] Word swap N/A [a b][c d] [a b][c d]

Byte and word [a b][c d] swap Byte swap [a b][c d] Word swap [a b][c d]

32-bit Integers The long integers are implemented in the same manner as the floating point numbers. Register Hd Mapping Holding Swap mode N/A Bytes in 2 16- Resulting bit registers integer [a b][c d] [a b c d] 32-bit

238

Hds Hdsb Hdsw Rd Rds Rdsb Rdsw

registers Holding registers Holding registers Holding registers Input registers Input registers Input registers Input registers

Byte and word [a b][c d] swap Byte swap [a b][c d] Word swap N/A [a b][c d] [a b][c d]

[d c b a] [b a d c] [c d a b] [a b c d] [d c b a] [b a d c] [c d a b]

Byte and word [a b][c d] swap Byte swap [a b][c d] Word swap [a b][c d]

Address Mapping On the Modbus server-side only 16-bit long holding and input registers are used. The 32-bit long data types are just the interpretation of the two adjacent registers. The concept of address mapping is clearly shown on the following figure. Three tables are shown there. All of them are addressing the same place in the memory: holding registers. In the first table the holding registers are shown, in the second the 32-bit integers and in the last table the floating point data type are shown. H:0 Hd:0 H:1 H:2 Hd:2 H:3 H:4 Hd:4 H:5 H:6 Hd:6 H:7 H:8 Hd:8 H:9

Hf:0

Hf:2

Hf:4

Hf:6

Hf:8

Signed and Unsigned Numbers Signed and unsigned integers can be stored in the registers. The unsigned numbers are read from or written to the Modbus device using simple addressing, like H or R for holding and input registers. To use signed integers add the suffix n to the address. Using tag Hn:5 would mean that you will access the holding register at address 5 and the number will be interpreted as the signed integer. In 32-bit data type numbers, the signed integers are used by default and the suffix n is not used. Demo An example of advanced Modbus functionality can be seen as ModbusDemo screen, which can be downloaded as a part of the demo project at the address:

239

http://www.myscada.org/wp/category/downloads/ 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 its data interpretation whether 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 Hf:0 register and the floating point value 2.456 is stored in the input register Rf:0.

240

S-ar putea să vă placă și