Creating New Project

To create a new project:

Select File>New File or Project > Mikrodev SCA Project

Select project name and location.

After entering the database username and password, you can verify the password by clicking the "Test Connection" button (if you will use PostgreSQL database and the PostgreSQL database is not installed on your system, you need to download and install the relevant version by clicking on "Download PgSQL" link. Likewise if you will use Oracle database, you need to install Oracle database on your system and download oracle runtime from here.)

The visual parameters such as screen color, default page size are set.

If you are going to use the SVN version control tool on the next page, the settings will be adjusted accordingly.

A new project is created by pressing the "Finish" button. The newly created project consists of 2 files. These are the files with the extension "scapro" where the project configuration parameters are stored. You do not need to make any changes to this file. The other file that is automatically created is the file named "intro.sca". You can design the main screen on this page.

On the far left is navigation buttons that allow you to navigate through the editor's basic interfaces. Using these buttons, you can switch between the SCADA Editor view, Projects view and the Tag/channel Editor view. At the bottom of the navigation buttons is the project selector. If more than one project is open at the same time on the editor, this button can be used to switch between projects

SCADA Editor View

Sidebar

The sidebar is available in the SCADA Editor view. Use the sidebar to browse projects, files and insert components.

Project files and components are controlled using panes on the left side of the editor. You can also filter and search the project files via the search box at the bottom of this panel. At the bottom left of the panel is a button that allows you to hide and show panels.

Components

The basic components are located in the "SCADA Components" pane in the left panel of the Editor. The other components can be created using the "components toolbar" on top of the editor window.

Basic Components

Using the "Component Manager", different objects that the user has defined can be added . To insert a component to the current page, press the left mouse button on one of the components in the panel, then press the desired position on the scene with the left mouse button again and the component is added.

To change the size of the added component, you can move the triangle icon in the lower right corner of the component with the mouse. "Object Properties Panel" is used to change the advanced properties of the component.

Text Component

The text component is used to display text in different fonts, colors, and formats. Used for fixed text. You can change the formatting of the text in the "Format" tab in the toolbar.

You can show dynamic content on text component. Please refer to Basic Scripting.

Timer Component

You can control the "Timer Blocks" that you have added to the PLC project with Mikrodiagram software via the "Timer" component. By adding "Timer Tags" you have defined in the Tag/ Channel Editor to the timer component, users can change the timing settings through the client software.

Chart Component

Using the chart component, you can graphically view the data of the desired tags. Chart object displays graphs as lines or bar graphs. In the chart settings window, the chart's appearance, behavior, and parameters for the tags to be displayed can be set.

While only the last values of the tags added are shown on the bar chart; historical values of tags can be displayed on the line chart.

Chart View Type: Sets how the chart will work.

Chart Component : Graphical representation of the added component.

Link to Chart : The added component only acts as a button. A separate window chart display is shown when pressed.

Chart Type: Selective type for chart type

Line Grid : The trend data of the defined labels are drawn with different colors on the same chart . With new data read from the field, the chart is updated once in a second. Bar Chart: Defined tags are displayed in bar chart format. The chart is updated once in seconds.

Database Query Component

This component allows the client to retrieve some specific queries from the database. In the Database query settings window, parameters related to the tag to be queried, query type, range, update frequency, and component visibility can be set.

Database Query Component

Table Component

You can display the data in tabular form on the table component. You can add and remove new columns / rows to table via the table menu .

Styling Table

You can set font and color for cell text using the format toolbar on the top of the editor:

You can also change the appearance of the table itself using stylesheets. Here is a sample stylesheet for changing row colors:

alternate-background-color:#AACA98;
background-color: #D3E3D0;

Formulas on Table

You can use excell like formulation on table cells. Please refer to Basic Scripting for inserting tag values into formulas

Image Component

You can add images into your view by using image component. You can resize, rotate and flip the added image.

Page Properties Panel

The basic settings for the page are set via this panel

Page Name

The name you want to appear for the page in the left panel on the client screen for pages set as tabs.

PageID

System-assigned unique ID for each page.

PageOrder

Sets the order in which the page will appear in the left panel on the client screen for pages set as tabs.

PageType

There are three different page types. "Tab" type pages appear as full screen on the client. At the same time, a button is created in the left-hand navigation panel that provides access to this page. Unlike the "Tab" for the "Linked Page" type, there is no button on the navigation panel. "Dialog" type pages are pages that are configured as popups to be opened in an action repository.

GeoView

Enables Google Maps api and shows the map. You should provide a map API key to be able to use this feature. First login to Google, go to Google API Key Console and select "Google Maps JavaScript API". After you get the key insert this into "Projects > Project File Paths > Map API Key"

GeoCenter

This option determines the initial position and zoom level of map when opened. It should be in that format :" Longitude,Latitude,ZoomLevel"

Scale at startup

Set how to scale scaling when the page is first opened on the client screen.

CustomSize

This option is checked if a different size will be used in the project settings instead of the default page size.

Page Width

Width for custom page size

Page Height

Height for custom page size

BackgroundImage

An image to be displayed on the client screen for the page in the left panel is displayed for the pages set as tabs.

Add Scroll Text

Adds a slip at the bottom of the page that allows you to show informative messages.

AccessRights

Different access rights can be defined to restrict access to the page. For users who do not have these rights, the page is not displayed.

Layers Panel

You can create or delete a new layer on the Layers panel. You can create a hierarchical layout on the page by creating components on the layers you create. You can make complex designs easier by hiding / showing layers. Another benefit provided by the layers is that the visibility of the layers at different zoom levels can be changed.

Hide / Show Layers

You can hide / show the layers you have added using the "Hide / Show Layer" option on the right-click menu of the mouse.

Changing the Order of the Components in the Layer

You can change the order of the layers that you have added using the "Bring Layer Components Front" or "Send Layer Components Back" options on the right mouse button menu.

Hide / Show Layers According to Scale Level

You can hide and show the layers defined on the page according to the scale level of the screen. On this scale, you can display more detailed information components when the scale level increases, but you can reduce the complexity of the design and make it easier to use by showing fewer components when the scale level increases. To do this, first select "Layer Properties" in the "Layers Panel"

In the dialog that appears, there are two fields showing scale level parameters.

The layer will be visible between the two scale values to be entered here. If you define one of the values as "-1", the layer will be continuously visible in this direction regardless of the scale. For example, if values of "300" and "-1" are considered, the result will be like that: "Make the layer visible if the scale is greater than 3"

The scale is smaller than '3':

The scale is higher than '3':

As you can see in the picture, when the scale value goes up to '3', the layer with the buttons becomes visible.

GIS Objects Panel

You can edit your maps using this panel.

Text

The marker's name that will show up on map.

Location

The marker's location on map. It should be in "Lonitude,Latitude" format

Icon

Custom marker icon to be used on map

Link to Page

Select a page link to go when the marker is clicked.

Add Marker Button

Click on the map after selecting this button to insert a new marker

Remove Markers Button

Click on the map after selecting this button to remove markers

Import Markers from GeoJson Button

You can import markers from a geoJson file using this button. Go to http://geojson.io for more information.

Object Properties Panel

It is a panel that allows you to adjust the SCADA objects added to the page.

Object Name

A name that makes it easy to distinguish the object.

ObjectType

Represents the component type of the object.

Geometry

The position of the object on the screen is the parameters related to the scale and rotation. The top leftmost point of the page is positioned by accepting the point (0,0). Position value increases down and to the right.

Constants

Contains some settings related to the appearance of the object.

Font X Offset : Used to add a horizontal offset to the position of the text to be printed on the object, relative to the upper left corner of the object.
Font Offset : Used to add a vertical offset to the position of the text to be printed on the object, relative to the upper left corner of the object.
Text Content : It is the field in which the display format of the "Text Label" defined in "Feature Tags" is configured. The "formatted" text entered here is printed on the component. The text to be entered must be in "printf text format". The following examples can be used for formatting:
Integer :% d => "1977"
Add leading spaces :% 10d => "1977"
Add a leading zero :% 010d => "0000001977"
Float numbers :% 4.2f => "3.14"
You can also display date/time values read from a 'seconds' source in desired format. To achieve this you can use "%dt(...)" notation. "%dt(...)" notation assumes that the tag value is in seconds:
Date is : %dt(dd.MM.yyyy / hh:mm) will be displayed as:
Date is : 13.05.2017 / 12:24
For different formatting styles please refer to Date/Time Formatting section

Font Style Sheet : By setting the style sheet for the "Font Content" to be displayed, you can make settings such as font, font size and color -generator.html Here some examples can be found.
Text Width : The maximum width of the text to be displayed on the component.

Events: Contains user interaction settings.

Event Type : The parameter that determines when the event will be fired.
MousePressed: Left mouse button press event
MouseReleased: Left mouse button release event Keystroke: Keyboard push event
Event Action : When "Event Type" is triggered, the function to be operated is selected.
SET : Sets the value of "Target Event Tag" to "1". CLEAR: Makes the value of "Target Event Tag" "0".
CHANGE : Makes "0" if "Target Event Tag" is "1" and "1" if it is "0".
LOADVALUE : If this function is selected, users will have a dialogue page in the client software where they can right-click on this component mouse to change the value of "Target Event Tag".
NEXTPAGE
PREVIOUSPAGE
GOPAGE : The page that was selected in "Go to Page" opens on the screen.
GOLINK : The link defined in "WebLink" is executed.
Target Event Tag : Defines the tag that is the target of the "Event Action"
Go to page : Page selection for "Go to page" action

Tags Panel

The values read from the labels selected from this panel are constantly updated according to the values ??read from the field.

The labels defined here can also be used in macros. For each label, there are predefined "i, o, s, w" values. (Such as i1, i2, o1, o2 ..). You can see the default variable names of the tags by hovering over them with the mouse.

Feature Tags

Image Index Tag: Shows the image index of the component to display instantly. Which images is in which index can be changed using the "Component Manager" or can be viewed under "Other Tab".

Text Tag: The value of the selected tag here is displayed on the component according to the form specified in "Text Content".

X Position: The horizontal position coordinate of the component is taken from this parameter. The top left corner of the page is the (0,0) coordinate. As you go to the right, the X value increases.

Y Position: The vertical position coordinate of the component's screen is taken from this parameter. The top left corner of the page is the (0,0) coordinate. The Y value increases as it goes down.

Text color: The color of the text to be displayed on the component is taken from this parameter. *

Mask color: The color of the mask that will be applied on the component is taken from this parameter. *

*Hex value of "112233" of the RGB color value defined as # 112233 is taken as the integer counter value. You can find some sample hex color values here. And you can use this tool to convert the color valueto integer.

Mask transparency: A value from 0-255 is taken from this label for the transparency value of the masquerade to be displayed.

Custom Labels: The 7 labels you select here will be available to the macros.

Other Settings Panel

Limits: The maximum and minimum values by which users can change the "Target Event Tag" value through the client software are set using these parameters.

ToolTip: Adjust the content that will be shown when users bring the mouse over the component in the client software. You can show dynamic content on tool-tips . Please refer to Basic Scripting.

Macro: The script for the component is written in this box . For more information about macros, see the corresponding section.

Web link: If this field is defined as a web link, a menu entry will be created to access the related page from the right-click menu of the component.

Images: The images and index numbers defined for the selected component are displayed in this area. Index number expresses which image to show according to the data value read from the tag value of "Image Index Tag" at "Tags Panel". You can change the index display order of components from this panel

You can move up or down image indexes from the context menu opened by right clicking on the images.

Projects View

SCADA Pages

List of all pages created on the project. This view gives detailed information about the created pages for the project.

Project File Paths

Here are some important folder paths related to the SCADA project

View Configuration

Default settings for SCADA pages are configured using this menu

Client Options

Various settings related to Client view can be done on this menu

Tag and Channel Editor View

Channels and tags are special definitions that enable the SCADA software to access the data on the field devices. Channels include protocol definitions to provide communication with the device on the field and specific settings for this protocol. Tags consist of address definitions for the registers on the connected device.
Alarm management is also done under this view.

Channels

Channels containing connection definitions can be created with a device in the field, as well as special channels defined by virtual connections such as macros or database queries.

To create a new channel, open the "Tag Channel Editor" tab, press the right mouse button on any channel, and select "New Channel" from the popup menu.

In the dialog that is opened, necessary adjustments can be made about the new channel.

Modbus TCP Channel

You must create a new Modbus Channel to communicate with field devices over TCP using ModBus protocol.

Select "Modbus TCP" as the "Protocol Type" in the dialog for creating a new channel

Channel Parameters

- Server Adress

The IP address of the device you want to connect to

- Server Port

Modbus connection port information of the device

- Response Timeout

It is time value, the Modbus slave waiting for the device to respond after each modbus request, in milliseconds. If no response is received from the slave device during this time, a new request is sent.

- Connection Timeout

It is the time value in milliseconds to wait until a new connection attempt is made after the request to connect to the device is sent. Typically in GPRS or 3G networks this time may be slightly longer than TCP.

- Frame Timeout

It is the time value in miliseconds to be waited until the next request is sent, after receiving a response from a Modbus request.

IEC 104 Channel

You must create a new IEC 104 Channel to communicate with the field devices over TCP using the IEC 104 protocol.

Channel Parameters

- W

ACK(acknowledge message) sending frequency(sends ACK after W packets)

- K

The maximum allowed number of unacknowledged packets

- T1

ACK timeout duration for ASDU packet

- T2

If no new data will be sent after this time, an ACK is sent

- T3

Timeout period for test frame

- General Interrogation

GI message sending frequency

- Clock Synchronisation

CS message sending frequency

- Timezone GMT

Timezone information of server computer

Tag Parameters

- Object Type

...

- InfoObjectAddress

...

SNMP Channel

This channel is used to connect to SNMP devices. The NetSnmp library must be installed on your system in order for this channel type to work. You can download NetSnmp library from here

Channel Parameters

Server Address

The IP address of the device you want to connect to

Read Comunity

The "Read Community" information that will be used to access device information.

Tag Parameters

Macro Channel

This channel is used to create virtual tags and modify them with scripts.

Channel Parameters

- Frame Timeout

The time in milliseconds that expresses the frequency of operation of the macro.

Tag Parameters

Database Channel

This is the type of channel used to make queries from SCADA's own database

Channel Parameters

- Response Timeout

The number of milliseconds that represents the frequency at which the database query is executed.

Global Database Channel

It is the type of channel used to connect to different databases to create custom queries and to pass these query results to project tags.

Channel Parameters

- Response Timeout

The number of milliseconds that represents the frequency at which the database query is executed.

Tag Parameters

- Query

The query expression to be executed in the database. This tag allows retrieving the first line returned from the query. The return values ??for this first row are written into tags respectively into the tags defined in the form of :{${32}, ${33} , ${34}, ${35},....}:

An example "Query" expression:

WITH
t1 AS (
SELECT data_value from logs.tag_log l where tag_id=19 AND data_value IS NOT NULL ORDER BY logtime DESC limit 1 ),
t2 AS (
SELECT data_value from logs.tag_log l where tag_id=20 AND data_value IS NOT NULL ORDER BY logtime DESC limit 1),
t3 AS (
SELECT data_value from logs.tag_log l where tag_id=29 AND data_value IS NOT NULL ORDER BY logtime DESC limit 1),
t4 AS (
SELECT data_value from logs.tag_log l where tag_id=26 AND data_value IS NOT NULL ORDER BY logtime DESC limit 1)
SELECT t1.data_value data1, t2.data_value data2, t3.data_value data3, t4.data_value data4
FROM t1, t2 ,t3,t4;
:{${32}, ${33} , ${34}, ${35}}:

In the above PostgreSQL database query, the latest recorded database values of the tags 19, 20, 29, and 26 are written into the tags with 32, 33, 34, 35 IDs, respectively.

Tags

"Tag" refers to point data that is read from the scene or created virtually by the system. Tags are defined under the channels and may have different properties depending on the type of channel they are in.

Creating Tags

To create a tag, open "Tag/Channel Editor Panel". Tag/Channel pane is on the top left of the screen. On the pane, right click on the channel in which you want to create a tag. On the context menu select "New Tag" action

On the "New Tag" dialog write a name and description for the tag. The "tag name" must be unique; if you select an existing tag name, the system will prompt you a warning.

All tags created in the system have common properties that can be changed. These features are:

General Tag Parameters

In Use

Tag is ignored by the SCADA server if the tag is not marked as "in use". The tag only becomes a definition in the system.

Tag Name

Each tag must have a unique name. Clear words and format should be used to describe the tag briefly

Description

Give a brief description about the tag

Unit Name

This is an optional property for the tag. It may be useful if you want to group tags by units on the field

Tag Type

This is an option for selecting "Schedule Tag" which is a special register reserved for calendar operations on Mikrodev devices. For more details see Mikrodiagram documentation

Access Rights

Reading: These are the rights that users have to have in order to see the tag values. Users who do not have the rights set here will not be able to read this tag value. Writing: It is the right that users have to have in order to change tag values. Users who do not have the rights set here can not change this tag value.

Variable

Variable Type: The mathematical type of the variable

Logging

Log to Database

If this option is not enabled, the tag value will not be logged on the system and historical values will not be visible. Also, historical values can not be viewed on the graph.

Log on change

Logging is done in case of tag value change. The type of change can be of the type "Percentage" or "Level" change.

Percentage Change

If "Percentage Change" is selected as the type of change; Logging is done if the tag value changes by the specified percentage value of the latest logged value. If value is set to "0", all kinds of changes are logged.

Level Change

If "Level Change" is selected as the type of change; if the tag value has changed by the specified value, logging is done. If value is set to "0", all kinds of changes are logged.

Log Periodically

If this option is enabled, the tag is continuously logged in the specified time period.

Note: Logging type and tags to be logged must be carefully selected to avoid unnecessary increase in the size of the data to be stored. For example;

The tags should never be logged if you do not need historical values.

If a level or percentage change is selected for analog variables, a percentage or level appropriate to the data exchange pattern should be selected.

For digital values, "log on change" should be used instead of periodic logging.

Data Logging Filter

By using the data logging filter, you can prevent the measurement values ??collected from the field from being logged according to the filter you selected. So, you will be able to pick up possible false data

Only log when decreasing by maximum

This filter only allows logging of descending data below the entered maximum value. For example; If the maximum value is entered as 1000:

188,
225 ,(logged)
1500,(not logged)
350 ,(logged)
400 (logged)

In this example, the value '1500' is 1275 more than the previous value, so it exceeds the maximum value of 1000. Thus, is not logged.

Only log when increasing by maximum

This filter only allows logging of incremental data below the maximum value entered.

Only log if value is in range

This filter allows logging only if the value read from the field is in the specified range.

Only log if value is out of range

This filter allows logging only if the value read from the field is out of the specified range.

Alarms

Alarms are an integral part of monitoring systems. ViewPLUS can create alarms for users according to field data and user's access rights.

Creating Alarms

To create an alarm, open "Tag/Channel Editor Panel". Alarms pane is on the bottom left of the screen. Right click on alarm pane. On the context menu select "New Alarm" action

On the "New Alarm" dialog write a name and description for the alarm. If you write an existing "class name" into AlarmClass, the alarm will be added to that class; if you write a new "class name" a new AlarmClass will created and the alrm will be added to that class

General Alarm Parameters

- Alarm Name

Give an apparent unique name for the alarm

- Class Name

The name of the class which the alarm belongs to. This is useful when grouping the alarms

- Description

Write a human readable explanation about the alarm

- Value Tag

The selected tag is the source of the alarm. Condition check will be made on this tag's value.

Condition

The conditions are evaluated according to the LIMIT and RANGE values on the right side of conditions pane

- VALUE is equal to LIMIT

The alarm is activated if the value of the tag is equal to "LIMIT" value.

-VALUE is smaller than LIMIT

The alarm is activated if the value of the tag is smaller than "LIMIT" value.

- VALUE is greater than LIMIT

The alarm is activated if the value of the tag is greater than "LIMIT" value.

- VALUE is in "RANGE"

The alarm is activated if the value of the tag is in "RANGE".

- VALUE is out of "RANGE"

The alarm is activated if the value of the tag is out of "RANGE".

Subscriptions

Alarms should be assigned to users. A user can monitor an alarm only if the user is subscribed on that alarm.

To add auser subscription on the alarm click on the Subscribed User Selection button.

On the opened dialog, select the users which you want to be subscribed on the alarm

Other

- Require Acknowledge

When this option is checked, if a user does not acknowledge the alarm, it will not disappear from alarms list if also alarm condition has gone away

- Log into Database

When this option is checked, the alarm states will be logged into database

- Enabled

This option activates/deactivates the alarm

Associating PLC and SCADA Projects

As you develop your project, it becomes more important to associate channels in SCADA with PLC projects to prevent mistakes.To do this, you can specify the PLC project path in the upper right corner of the channel menu.

Import and Export Operations

There are different options for importing/exporting data from/to the project.

Importing/Exporting Projects

This wizard allows the user to import/export tags, channels, alarms, users and pages using a special file format(.scaexp).

Exporting Project

After opening the project on ViewPLUS, on the File menu select "Export Project" option:

On the wizard window, select an output folder path for the ".scaexp" file to be generated. After that, when you push on the "Start Export" button, the wizard will create the ".scaexp" file

Importing Project

On the File menu select "Import Project" option:

On the wizard window, select the exported ".scaexp" file and a destination folder for the project files to be extracted:

After that, when you push on the "Import Project" option, the wizard will ask for database connection settings. The project database will be extracted into the configured database

When the operation is complete succesfully, the project is ready to be used.

Importing/Exporting Tags/Channels/Alarms

After opening the project on ViewPLUS, on the Tools menu select "Export Tag/Channel Definitions" option:

When you confirm the export file path selection dialog, a file with ".tcf" extension will be created. You can use this file for importing into other projects.

Importing Tags/Channels/Alarms

After opening a project on ViewPLUS, on the Tools menu select "Import Tag/Channel Definitions" option:

Important Note: This operation will overwrite existing tags. Thus, this operation may damage your project. Be sure that the exported tag id interval and local project's tag id interval do not intersect!

Importing/Exporting Users

Users created for a project could be exported to another project. Export/Import users menu could be used for that

Exporting Users

After opening the project on ViewPLUS, on the Tools menu select "Export Users" option:

When you confirm the export file path selection dialog, a file with ".usr" extension will be created. You can use this file for importing users into other projects.

Importing Users

After opening a project on ViewPLUS, on the Tools menu select "Import Users" option:

Important Note: This operation will overwrite existing users. Thus, this operation may damage your project. Be sure that the exported user id interval and local project's user id interval do not intersect!

Macro Guide

ViewPLUS supports macros in different types. Some of these macros work on the server side, while others work on the client side.

The "macro tags" we define in the Tag/Channel Editor work on the server side. And it acts as a virtual tag. These macros work continuously on the server for the specified period.

On the editor, it is possible to write separate macros for each object. These macros affect the display and behavior of that object and are only executed when the user is watching the object.

Server Side Macro Tags

Macros can take two processing elements at a time and are written line by line.

Example:

[ v0 = $1234 * 2]

The operands that can be inserted into the macro are:

200 seperate variables(vo, v1, …., v199)

Tag values (in "$1234" format)

Constant values (Constant decimal values such as "234,12" can be added)

[ v0 = $1234 * 2]

v0 : The element to the left of “ = ” is the final result of the operation

[ v0 = 1234 ? 1] : Returns the "Read Time" value of the tag with id 1234 (the time at which the latest data was read from the field)

[ v0 = 1234 ? 2] : Checks whether there is communication with the device on which the tag with id 1234 is located

[ v0 = 1234 ? 3] : Checks whether there is a valid value in the tag with id 1234.(In general, when a SCADA server is started for the first time, it may be late to write a valid value in the tag, or a valid value of the tag may never be written)

[ v0 = v0? 20] : Writes server datetime into "v0" variable as the number of seconds that have passed since 1970-01-01T00:00:00

[ v1 = v0? 21] : Writes server year into "v1" as "v0" is the number of seconds that have passed since 1970-01-01T00:00:00

[ v2 = v0? 22] : Writes server month into "v2" as "v0" is the number of seconds that have passed since 1970-01-01T00:00:00

[ v3 = v0? 23] : Writes server day into "v3" as "v0" is the number of seconds that have passed since 1970-01-01T00:00:00

[ v4 = v0? 24] : Writes server hour into "v4" as "v0" is the number of seconds that have passed since 1970-01-01T00:00:00

[ v5 = v0? 25] : Writes server minute into "v5" as "v0" is the number of seconds that have passed since 1970-01-01T00:00:00

[ v6 = v0? 26] : Writes server seconds into "v6" as "v0" is the number of seconds that have passed since 1970-01-01T00:00:00

Attention: Here the tag id (1234 in the example) must be entered into the macro as a fixed value without "$" at the beginning

Condition check:

In the following example, it is checked whether the variable "v0" is equal to 1. If "v0" is equal to 1, the macro executes the command on the bottom line (makes v1 value 555). If it is not equal to 1, the line is moved down by the second parameter ("2") of the "IF" line. In this example, if "v0" is not equal to 1, the macro will go down 2 lines, that is, it will go to the return value ([E]) line and it will be finished.

[ IF , v0 , 2]

[ v1 = 555]

[ E ]

Another condition control operand is “NI” (NOT IF) . This checks the equality to 0 as the opposite of "IF"..

In the following example, it is checked whether the variable "v0" is equal to 0. If "v0" is equal to 0, the macro executes the command on the bottom line (makes v1 value 555). If it is not equal to 0, the line is down by the second parameter ("2") on the "NI" line. In this example, if "v0" is not equal to 0, the macro will go down 2 lines, that is, it will go to the return value ([E]) line and it will finish

[ NI , v0 , 2]

[ v1 = 555]

[ E ]

In order for macros to work correctly , a return ([E] </ nowiki> return) must be added

Client Macros

Client Macros: This macro is written in the same format as the "server macros". However, only tags defined on that object can be used within those macros The tags defined on the tag tab of objects are used as follows:

For each tag "i, o, s, w" values exist.

i (in) : The raw value of the tag read from the field
o (out):The value to display on the screen after the tag has been passed through the macro operations
s (set):The value set by the user for the tag
w(write): The value to be written to the field device after the value that the user wants to set is passed through the macro operations

i ---Macro---->o , s---Macro---->w
If there is no macro operation 'i' is equal to 'o', 's' is equal to 'w'.

Basic Scripting

Display Tag Value

You can add dynamic content on some components. To achieve this, you should use the '$' operator and 'braces' ($ {....}):

${Tag_ID}

As an example, you should write '${1234}' onto your component to display the value of a tag with the tag ID '1234' in your system.

Tank Level is ${1234}

this expression will be shown on the component like:

Tank level is 78

Performing Arithmetic Operations

You can perform arithmetic operations using the '#' operator and 'braces'(#{....}). In the examples below you can see how you can do an arithmetic operation: