Professional Documents
Culture Documents
La Qui Senge
La Qui Senge
Simple introduction
application development
http://laquisscada.com
http://www.lcds.com.br
Summary
Introduction.......................................................................................................3
Step by step......................................................................................................4
1– Definition of the tags (I/O points and variables).........................................4
2– Database / History / Report.......................................................................8
3– Visual Objects..........................................................................................10
4– Script.......................................................................................................18
5– Tag groups..............................................................................................19
Tags spreadsheet...........................................................................................24
Communication.............................................................................................31
Formulas......................................................................................................32
Database......................................................................................................33
Drivers.............................................................................................................34
Data and Report..............................................................................................37
Customizing reports......................................................................................37
Database......................................................................................................41
Network...........................................................................................................45
Server...........................................................................................................45
Client............................................................................................................46
Visual Objects.................................................................................................47
Vector drawing objects.................................................................................50
Inserting visual objects.................................................................................53
Panel configuration.......................................................................................53
Visual objects examples...............................................................................54
Script introduction...........................................................................................61
2
Introduction
SCADA LAquis is a supervisory control and data acquisition software. From data acquisition to
application development.
The main screen for development, is divided into two parts: in the bottom where there is a spreadsheet
with the tags and the top panel where the visual objects are placed.
On the spreadsheet tags IN and OUT points are defined. Equipments, variables, files, formulas, scales or
other properties and user defined properties for each case.
On the panel, visual objects can be used both for the development of specific systems via script and also
for simple accompaniment of a data acquisition. Each object can be related to a defined tag in the tag
sheet.
When setting a database in spreadsheet tags, you can generate reports, analysis, and charts with data
stored through the "Reports" menu.
To start a development of a new application click the New button. A window appears with several models
that generate predefined applications that can be changed as needed.
3
Step by step
Test the steps below, clicking the “New” button, select <blank>, click OK, type a name and save.
5 basic steps:
1 – Definition of the tags (I/O points and variables).
2 – File / Report
3 – Visual Objects
4 – Scripts
5 – Groups of tags
When you release the mouse button, the window for selecting the driver will be shown:
4
The driver to be chosen depends on the equipment (hardware / PLC) used.
To simulate a device use, for example, the driver DEMO.
For example, to communicate with a device that uses the protocol "MODBUS RTU" then choose the
driver MODBUS RTU. The Param1 will be the register address and Param2 will be the equipment node
number (Example: Param1 = 400001 Param2 = 1.). See the MODBUS parameters description.
Set up communication (port, speed, timing, etc ....) on the button Config at the driver's window.
Set the communication parameters. Sample conPicturetion for serial port COM1: 1:9600,N,8,1. (serial
port 1, 9600 baud, no parity, 8 data bits, stop bits 1).
To use OPC, the select OPC driver, click on the "Config" button. A window will appear to define the
ProgID and Item ID. Optionally, for remote connections, type the IP of the server in the Server field:
5
Example with four tags: (four first Holding registers will be read of equipment node 1 through Modbus
protocol)
To start reading the values and test communication click on the button
("Play" - Start application). Values will be shown in the Value column. If
there is a communication error, an "ERROR" message will appear in this column, and at the "Status"
column.
The tag may be also a variable for generic purposes. Use, for example, the VAR driver.
Each tag has properties that can be customized: alarms, formulas, limits, etc ...
Formula:
Examples:
Tag1*Tag2 Multiplying two tags.
Tag3/7 Divide by 7
*0.1 Multiply by 0.1 at reading (IN) and divide by 0.1 on write (OUT).
*Bit(0) Returns bit 0
To access formula options click on the button at the side of the formula column.
6
Alarm:
Click on the button at the right side to set alarm functions for a tag.
It can also be used to create descriptions for each tag value. Example:
7
2 – Database / History / Report
Data acquisition in tags can be recorded to a file (database). Click on the database column. The database
can be set by dragging the mouse pointer with the left mouse button on the database column (like it was
done with the driver), or by clicking on the title of database column to select all tags at the group.
In this example, the values of the four tags will be stored in TEST.LB database:
The time interval in which the values are stored is set in the Recording column.
Note: by default, the data are recorded in the sub-folder "dados" inside the main application folder. To
change the database settings using the menu item "Reports" - "Edit Database".
With some data already recorded in the database it is possible to create reports.
8
To generate a report with the recorded data, click at the menu Data and Reports - Open (or insert a button
object on the panel and click "Show this button's report" - as explained in step 3).
At the first time, in this stage of development, a window will be shown for choosing a report template (that
can be customized later):
Set a name for the report. It will be a file with a LGX extension that will contain a layout, formats,
formulas, scripts and other reporting features.
(If you want to create or join a report to the button, just click the right mouse over the button and select
"Show this button's report”- see in step 3.)
See more details on reports at the “Data and Report” or “Database” topic.
9
3 – Visual Objects
On top of the main software screen is located the visual objects panel. On this panel the objects and
visual controls are designed and can be used as the interface for the user. These objects can be displays,
pictures, animations, controls, etc...
Select the desired object and place on the panel. Click on the object icon at the toolbar or choose the
object in the right window (the “object tab” when no objects are being selected). Click on the panel or drag
the mouse pointer with the left button to draw the object.
At the example above, it was added an object "displaytext", and a "Edit" object used to change values.
Each visual object may be associated with a tag. For that, click twice on the visual object at the panel, or
select the "Formula" property of the object.
Select the "tag" to be associated with the visual object. In the example above, the Tag1.
The title property at tag's spreadsheet can be used as the description and passed automatically to the
visual object. (Tag's names also can be freely set, but must have no spaces and cannot be repeated in the
same group).
10
The visual objects has different properties. In the following example was included a button . By
clicking once on the button, a window at the right shows its properties.
In the above example, this properties was changed: Text (with the value "Report") and Report (set to the
report lgx name). The Text property in this case is the title of the button. If you want to create or associate
a report to the button, just click the right mouse over the button and select "Show this button's report".
Another important button's property is Command. When the button is pressed the value of the associated
tag will be the value of Command property. Also check Page properties, PopupPage and ChangeTag.
See the button properties on the topic “Visual Objects Examples”.
Example thermometer visual object. The upper and lower limits can be associated to the worksheet.
11
Creating / Drawing vector objects
If you want to import ready examples through the Import button ...
2 - If you want to make it sensitive to the value of a tag, assign the tag to the “PageObject” and set the
corresponding values in the property "Pages". Tag value = page number. Example: Pagename1 = 1,
Pagename2 = 2 When the tag value is 0 then the drawing on page 1 will be displayed. If the tag value is 1
then the drawing at the second page will be displayed.
12
Animation:
3 - If you want to set up an animation, put the page numbers related to the animation frames in the "Pages"
property (each number must be separated by; - semicolon) and enable the "Animation" property. The first page (at
the "Page" property) will be activated when the "tag" associated with the object is 0. When the "tag" is 1 then there
the animation will be the switching between the remaining pages. Example: 3; 1: 2
4 - If you want to make the object sensitive to mouse, like a button, turn on the "ChangeOnClick" property. By
clicking on the object it switches the value of the "tag" from 1 to 0.
Example:
Pagename1;Pagename2;Pagename3
0=Pagename1;1=Pagename2
etc...
13
Before learning how to create new objects, it is needed to understand two concepts: Drawing vector
objects and PageObject.
Drawing objects:
To draw on the panel using vector objects click on the button. .
PageObject:
It can define groups of objects based on a standard panel. One way to do this is using the PageObject object.
It is possible to create an object with a group of objects based on a standard panel. One way to do this is
using the PageObject .
14
Example of visual object Picture file. This visual object can be used to many purposes. Buttons of two
states, status information, simple illustration, etc .... Pictures files can be bmp, jpeg, gif or emf (vector).
In the example below Picture is set to double status button (Double state property):
When an application is executed, this visual object will become like a button (property ChangeOnClick). By
clicking on this object, the state of the tag associated changes to values alternating between 0 and 1. Its
display changes as the property "Current status". The name of the figure should have the format:
<name><state or value>.emf or .bmp. In this case, valve0.emf and valve1.emf.
It can also be used an animated gif file. Even then set the maximum number of states.
15
In the example below object Picture is configured as a button with animation. (Property Double State
unchecked):
When the application is executed this visual object also will act like a button (property ChangeOnClick). Clicking
on this object, the tag state associated with it will be changed to values switching between 0 and 1. But when
the property Current State became 1 then the object enter in a animation state switching states from 1 to the
maximum number of states. Picture name also must have the format <name><state>.emf or .bmp. In this
case, motor1.emf e motor2.emf. It can be used used too a gif animated file. Nevertheless set the
maximum number of states.
If its desired user intervention to change tag state set property ChangeOnClick.
More details about visual objects see the topic Visual Objects.
16
4 – Script
Scripts are sequences of instructions or programs used to customize the application's actions to meet
the process. They are executed within the available events in the system.
Example:
Select an object, click on the Script tab text. Enter, for example, Tag(“tag5”) = 1.
Note that a simple operation like this, used in these examples do not necessarily requires a script - this
sample is just for understanding purposes. Same operation could be done, just setting in the button object,
Command property to 1.
17
5 – Tag groups
Tags can be divided into groups. These groups may be stations, equipments, modules,
machines, units, plants, etc ... Tags names can be equal to each other, just by changing the
groups and addresses.
PANELS:
Generally do not need to develop a panel for each group if the tags are equal or similar. If the
panel is the same, and changes only addresses / tags groups, just create one panel. Once set
the panel it may be associated in real time for any of the groups. This also applies to database
and reports.
DATABASE:
The database is recorded by group. It is not necessary to create a different database for each group. The
existence of several groups with the same bank, these groups will automatically be stored in parallel as
follows: each record will have a field for each tag name and the group name is recorded in GROUPNAME
field. At the report, they can be displayed individually or in groups. See the examples below.
Example 1: Click the menu New - Example with groups. If you want to use this example to start the
development of your application. Just select the example with groups, save and reset the tags, panels and
reports as required.
18
5 - Set for this group, the equipment, the tags names, databases, parameters, etc ... Example:
Optionally create tags VAR to represent the group, equipment, unit, central, module, product, etc ... (In the
example above ID)
Rename the group if needed. Click the with the mouse right button on the group's tab, and select the
"Rename group ..." option.
6 - To repeat or duplicate the groups, click with the mouse right button on the group's tab, select the
"Advanced " option - "Duplicate groups ...".
Type the number of groups to be added based on the current group and click OK.
Set the correct tags parameters for each group. Addresses, names, etc ... In general keep the same
database name, for all groups. In the database, the internal GROUPNAME field will automatically
differentiate the database's records.
Example:
19
7 - Now set a default panel for one group. Set names for the panel pages. Click with the mouse right button
on the page's tab, and select the Rename option. Example:
In this example it will be used the "Station" as a page name related to a group. Set the
visual objects on this page, and associate tags with the first group.
Example:
20
8 - In the main page, in this example named "Main", place buttons with the properties
Page with the value "Station" and ChangeTag with the property "1 - Yes". Associate each button with the
desired group.
Example:
In excution mode, when the user clicks on one of these buttons, the page "Station" will be shown, and its
objects automatically associated with the group.
Instead of creating buttons, you can create custom objects with information from each group. Use in this
case PageObject.
Example:
This example was made with 3 display texts, a button and a rounded rectangle.
This button has Page and ChangeTag properties set.
21
9 - Database: Use the same database name, for all groups. Automatically the internal GROUPNAME field
will differentiate the records in database.
Plays this application at least once. The system will create the database. Then stop the application.
In this example, to ensure that the field (tag) ID is a text, click on the menu "Data and Reporting" - "Edit
Database". Click on the “Fields” button. ID field type set to 1 - Text.
10 - Report: After stored some data in database, create a Button, click with mouse right button over it,
select "Show this button's report" option.
Select in this case, for example, "General by ID" template, etc ....
Set in the report which fields should appear in the listing (button fields). Or change report's layout as needed.
Example :
22
Tags spreadsheet
A simple data acquisition application can be made in the spreadsheet at the screen below.
Each row of the spreadsheet is a tag related to an I/O point of connected to an equipment (ex:
PLC), formula, variable, etc ... it depends on the driver. The spreadsheet contains this columns
as tags properties by default (it can be added more columns or properties as needed*):
Name: Tag's name. It will be the variable name used by the formula, visual object or script to access
its value. To access other properties (columns) of the same tag use a dot. (Examples: Tag1.setpoint,
Temperature1 = Tag1.LS * Tag7)
Title: Title or description of the tag's meaning . The title can be sent to all visual objects, databases
and reports related to tag.
[...] Unit.
Value: Tag's value.
Param1 and Param2: Values to address equipment variables. Their meanings depends on
driver. (Example: Param1 in MODBUS is the variable address, eg 40x0007. Param2 is the node)
Status: Status or error description of current tag. (Examples: Communcation Error, Alarms, Tag's
code description, etc...)
Database: Database name to store data and create reports. To set all tags group database click
on the column tile “database”.
Driver / PLC: Equipment related driver or tag type (ex: VAR to simple variable). Click on Config
button to set the communication configuration. To set all tags group driver click on the column tile
“Driver / PLC”.
Sampling: Time interval between each communication.
Recording: Time interval between each database data recording.
Formula: Formula, scale or bit related to the tag. The formula result will be constantly updated in
the tag value. To define a simple scale use the symbol * (Example: *0.01). More details see
topic Formula.
Alarm: Set tag alarm behavior Click on the button at alarm column side to settings options.
"Default": 0 = Off; 1 = Greater than LS; -1 – Less than LI. Columns LI and LS are used as limits
defaults. (Superior and Inferior) are used as default for limits. Optionally, an alarm criteria by formula
can be created. Example 1: "=(x<10)+(x>30)". In this example alarm is triggered if tag value is less
than 10 or greater than 30. Example 2: "=(x<.Minimum)+(x>.Maximum)". In this example alarm is
triggered if tag value is less than Minimum or greater than Maximum, that are, for example,
customized columns that can be added.
To set values for each expression, optionally do like this example:
=(x<10)+(x>30)#3 (x>10)*(x<15)#5
(for x<10 or x>30 alarm value is 3, and for values between 10 a n d 15 alarm is 5)
For more advanced cases you want to use the script to change the alarm value.
The alarm can be used also to simply to define a descriptive text to be placed in the Status
column related to tag. Example: 0="State 0",1="State 1",2="State 2",3="State 3"
23
Optional columns:
* If necessary custom columns can be created defining customized properties for the tags.
These columns can also be recorded in database if the fields have been created.
Examples: safety limits, product name, event, non-compliance, etc ...
To create new columns use the option in the menu “Tags” - "Edit" – "Customized tags
properties (columns)".
These names should be short, without space and no reserved, so they are easy to access
through formulas or script.
In script and the formula you can access tags defined in the spreadsheet through their
names. Examples: tag1, pressure, Temperatura1.Alarme.
24
Groups
Tags can separated between groups. Click with the right mouse button on the spreadsheet bottom or on
the list at the left. Select the menu item:
Each group can be used to separate a device, a station, a machine, a database, etc.... The database is
recorded by the group in parallel. If the names of the tags are the same for different groups, then the
system can record at the same database all groups independently. Registers are separated by the internal
field GROUPNAME. The panel with the visual objects, can also be prepared only once, and automatically
linked to any group when the application is running.
30
Communication
To set the communication configuration.
1 - Drag mouse cursor over the tags spreadsheet cells at Driver / PLC column and select the driver.
or
2 – Click on the tile Driver / PLC column at the tags spreadsheet and select the driver.
or
31
Formulas
Formula can be used on the tags worksheet (formula column) or visual objects.
Both in the script as in formula tags can be accessed by their names. Examples: Tag1, pressure,
Temperatura1.setpoint.
Formulas examples:
Tag1*1.7 + 3
Celsius + 273.16
Farenheit > 100
Generic formulas:
Operators: + - * / > < >= <= = <> ^.
Scale:
To define a scale with multiplicative and additive factors use the syntax: *a + b where a is the
multiplicative factor and b the additive factor. EXAMPLE: *1000 + 3. Both reading and changing
values will be based on these factors. The scale can be used as conversion or even calibration.
32
Database
To set a database where data will be stored click on the database column title or drag the cells.
Select or type a database name. If it not exists, the database will be automatically created at the first
recording. Fields will be created from the tags names defined in the worksheet.
Advanced users: to create a new database manually use the menu option 'Data and Reports "-" Edit
Database - "File" - "New".
Select or type a database name. If it not exists, the database will be automatically created at the first
recording.
To generate a report with the recorded data, click at the menu Data and Reports - Open (or insert a button
object on the panel and click "Show this button's report" - as explained in step 3).
At the first time, in this stage of development, a window will be shown for choosing a report template (that
can be customized later):
33
Drivers
The "driver" allows the computer to communicate with the equipment.
In LAquis, these drivers can be developed through a simple scripting language similar to "Basic" or
through an interpreted language LDriver or through dlls.
34
Example driver MODBUS RTU:
where NNNNN is the register address number in decimal or NNNN is the register address number in hexa.
35
Select a Driver
Select a driver by clicking the related cell to the desired tag and the column driver.
Select multiple rows by dragging the left mouse button over the cells.
36
Data and Report
Customizing reports
Options in "Data and Reports" menu option:
Reports can be created, after recorded data in database by inserting a button object on the panel and
clicking with the left mouse button over it, and selecting option "Show this button's report".
At the first time, in this stage of development, a window will be shown for choosing a report template (that
can be customized later):
These reporting formats are recorded as a LGX format. Internally they are similar to spreadsheets.
Select a report template (Example: General with graph.lgx). The report will be generated based on the
template chosen.
A name is automatically created for the format: <filename> .lgx. This report format will be associated with
Button and is saved in the same folder as the LQS file.
37
To edit the report fields, optionally click button "Fields".
38
Formulas and commands
=TAG(tag name)
Returns the specified tag. Example =TAG(“Tag1”)
=TAG(column,tag name
Returns the specified tag column cell.
=TITLE(tag name)
Returns tag title.
=FIELD(field name;id;date;database;idfield;filter)
Returns first field from database addressed by id. Only field name is mandatory. Others are optional.
=LASTFIELD(field name;id;date;database;idfield;filter)
Returns last field from database addressed by id. Only field name is mandatory. Others are optional.
=FIELDTOTAL(field name;id;date;database;idfield;filter)
Returns fields numeric sum from database addressed by id. Only field name is mandatory. Others are optional.
=LISTA(field name,filter,date,database,maximum,dateto,idfield,sampling)
Returns a list based on the filter from below cell.
=TEXT(cell)
Treat cell as a text.
=TEXTO(cell1,cell2,cell3,...)
Concatenate cells as text separated by spaces.
=CONCATENATE(cell1,cell2,cell3,...)
Concatenate cells as text.
=AVERAGE(cells)
Cells average.
=SUM(cells)
Cells sum.
=COUNT(cells)
Cells count.
=DESVPAD(cells)
Cells standard devation.
=MAXIMUM(cells)
Maximum value from cells.
=MINIMO(cells)
Minimum value from cells.
=AMPLITUDE(cells)
Cells amplitude.
=LAST(cell)
Last cell value.
=LASTTEXT(cell)
Last cell as text.
=LASTFILLEDTEXT(cell)
Last filled text.
=TSTUD(cells)
"TStudent" from cells.
=TAGTEXT(tag name)
Return tag as text.
=TAGGROUP(tagname,field optional)
Returns the group name of the tag or another tag field to return form that group.
=COMBO(text1,text2,text3,...)
Create a combo with texts.
=MAXABS(cells)
Maximum absolute cells value.
=SLOPE(cellsx,cellsy)
Slope form curve linear regression.
=INTERCEPT(cellsx,cellsy)
Interception form curve linear regression.
=CORRELATION(cellsx,cellsy)
Cells correlation.
=MVT(cells)
Converts mV to °C thermocouple T
=MVJ(cells)
Converts mV to °C thermocouple J
=MVK(cells)
Converts mV to °C thermocouple K
=MVS(cells)
Converts mV to °C thermocouple S
=MVR(cells)
Converts mV to °C thermocouple R
@BUTTON(text)
Button to create actions at event "OnClick". Example: if colclicked=5 then: if rowclicked=3 then: msgbox("test"): end if: end if
@LISTBUTTON(text)
Opens a database listing of ID field in a window and returns the user selected register to the cell at left.
@LISTBUTTON(text,FIELD,DATABASE,DATE1,DATE2)
Opens a database listing of the field in a window and returns the user selected register to the cell at left.
@COMBOGROUPS
Combo with groups. Returns to the cell at left.
@COMBOGROUPS(field,exclusive)
39
Combo with groups and the field. Returns to the cell at left. If exclusive does not repeat.
@COMBODATABASE(database,field,filter,exclusive)
Combo with database fields with the filter. Returns to the cell at left.If exclusive does not repeat.
@COMBOTAGS
Combo with the tag names. Returns to the cell at left.
@COMBOSUBTAGS
Combo with the tags names under the groups. Returns to the cell at left.
@BUTTONEDITLIST(text)
Fields edition window in main listing.
In the report template edit mode create scripts for programming specific processes for each event.
40
Database
The database is a flexible structure where information is recorded. It can be from data acquisition or
auxiliary tables (users, alarms, products, etc...).
Fields can be customized according to the application.
Data can be stored in database with formats LBX (binary), DBF or TXT. Data can be exported too.
For historic purposes this database format as default is separated internally by date. Performance are not
too much affected after years of storing data.
Example: filename<ddmmyy>.LBX.
Fields can be created automatically by setting a database name at the tags spreadsheet and recording
for the first time.
Menu:
Arquivo
Edit
Edit or list (filter) database stored data
Fields
Edit fields
41
New
Creates new database
Delete
Delete data from database
Field columns:
42
Database configuration
Database folder: Example: c:\temp\. Default: <.>dados\ (files are stored in the current folder\dados\)
43
Editing database
Edits, lists, filters, exports or imports stored data in the selected database:
Menu
File
Research: simple database filter for testing purposes.
Export: Export data to TXT or CSV.
Import: Import data from TXT or CSV files.
Edit
New: Creates new register.
Delete: Deletes selected register.
Copy: Copies selected cells to the clipboard.
Select All: Selects all the data.
Copy all: Copy all data and header to the clipboard.
44
Network
A SCADA LAquis application can be used as a network server via TCP or WEB. Others SCADA (LAquis)
applications can be used as client and vice-versa.
Server
TCP:
WEB:
45
Client
Automatically:
Open the project application file that will be used at the client computer.
Turn on Client.
46
Visual Objects
Visual objects are inserted on the panel for specific applications developments as well as for monitoring
and tag control.
To associate the object with a tag (or his property) click twice on the object, or with mouse right button
choose Tag option (type, if necessary, a formula):
47
To change its properties, click on the object and use the window at right side of the panel.
For each object type, different properties list may be available as font sizes, scales, alarms, colors, etc.
Titles of the objects are defined by the column "Title" in tags spreadsheet.
48
Vector drawing objects
The objects for vector drawings are treated differently from visual objects.
Use:
1 - They can be combined to generate new visual objects
2 - Plants for the generation of 3D interfaces.
3 - Animations.
4 - Simple illustrations.
You can also associate the tag value for some of the object properties.
For example, draw a scale object and draw a polygon object as follows:
Double-click on the polygon object to open its properties. Click on the cell of the column tag associated
with coordinated MY (midpoint on the vertical axis of the object). Select the tag and click OK.
When running the application, the polygon position will vary by tag within the defined range.
50
Types of vector objects:
Generic:
Pipe or wire. (The pipe can be used in the plant for 3D interface also)
Polygon.
Ellipse.
Cube (projected in 2D).
Cylinder (projected in 2D).
Rectangle rounded border.
3D interface plant:
Wall 3D.
Panel 3D.
Object (file) 3D.
Object creation:
Scale
Simple text
51
Attributes of vector drawing objects
Dimensions:
Through these properties, object dimensions and positions can be associated with tags.
52
Inserting visual objects
1 - Choose an object from the top of the panel, just below the menu, clicking on it.
2 - In the clean area between the "menu" and the spreadsheet there is a panel, hold the left mouse button
and drag, creating a rectangle, releasing the mouse button after completion. The chosen object should
appear within the rectangle.
3 - Adjust the height and width of the object for better viewing.
4 - Create other objects, similarly. Every object created, the program will associate it with a sequential way
channel.
5 - To manually associate the visual object to a spreadsheet channels: select the object, click twice on this
and choose the tag.
6 - To change the properties of the object select the object, use the window at the right side.
Panel configuration
Click with the right mouse button at the panel and select option “Panel background and size”:
Window: Width and Height – Window size (without menus and tags spreadsheet).
53
Visual objects examples
Generic visual objects examples:
- DisplayText
Display tag.
- Edit
Edit tag.
- Picture
Picture for background, animation and state response.
- Button
Event activation button.
- Text
Text.
- PageObject
Object to replicate group of objects.
- LCombo
Combo tag.
- Graph
Graphic chart.
- Bar
Bar.
- Check
Check (on/off).
54
DisplayText
DisplayText
Display tag value or text.
Main properties:
55
Edit
Edit
Tag value or text editor.
Main properties:
56
Picture
Picture
Background picture, double state or
animation.
If the picture is associated with a tag then its value will determine its behavior in states or animation mode.
To set an animation or multiple states, it can be used files with numerical values after their names. Example:
Motor001.emf, Motor002.emf and Motor003.emf. The States property defines the maximum number of
states or frames for animation.
Main properties:
Picture: Picture name. Can be bmp, jpg, emf ou gif (animated or not).
Tag: Tag name or formula.
Name: Object name.
Visibility: if 0 invisible, otherwise visible. Can be a formula. (Example: Tag1>30)
Transparent: Transparent background.
Fixed size: Picture original fixed size.
Border: Draw a border around the picture.
States: Nmaximum states number for animation. (0 .. n)
CurrentState: Current state number.
DoubleState: Defines if picture behavior will be two states, otherwise is an animation.
ChangeClick: Switches tag or state value between 0 and 1 or the configured states.
Antialias: Do an antialias effect over stretched picture.
Value=State: Associates tag value to the state number.
57
Button
Button
Event activation button.
Main properties:
Text: Text shown on button. For keyboard shortcuts inserts and & before the desired letter.
TextColor: Text button color.
Report: Report format file name. Can be selected by clicking with right mouse button over it and
selecting "Show this button's report" menu option .
Command: Value to be sent to tag.
Page: Panel page number to change when user clicks on button. It is the same as in the script at
OnClick event doing this for example: Panel.Page = 7.
ChangeTag: When a panel page is changed their tags are changed to the new tag or group
reference.
HotSpot: Invisible but active button.
Margin: Margin width.
CharacterSize: Button's font size.
Bold: Font bold style: 1 - Bolrd. 0 - Normal.
PagePopup: Calls a panel page as a popup window.
Pulse: When pressing the button the tag value changes between High and Low properties waiting
PulseTime property time in miliseconds.
58
PageObject
PageObject
Main properties:
59
Graph
Graph
Simple graphic chart to monitor in real time.
Main properties:
60
Script introduction
Language to create customized applications processes and actions.
Example:
Create a button. Program your action through the script.
Run the application. When this button is clicked its script will run.
Events
There are two types of events where scripts can be run: generic events and events in
objects.
Generic events:
OnAfterScanning
Defines what happens after tags main scanning;
OnStart
Defines what happens when application is started;
<Global>
Defines global functions;
OnGroups
Defines what happens after tags main scanning to each group of tags. Tags.Group is the updated group
name. Use Tag("tagname") to access a tag from the updated group.
OnFinish
Defines what happens when application is finished;
OnBeforeScanning
Defines what happens before tags main scanning;
61
OnInterScanning
Defines what happens during tags scanning;
OnTag
Defines what happens when a tag is updated. Use Tag() to access tag.
OnAlarm
Defines what happens when Alarm is triggered. Use Tag() to access alarmed tag.
Use Tag().alarme to access alarm.
OnBeforeRecording
Defines what happens before tags recording. Tag() is the tag to be recorded.
OnAfterRecording
Defines what happens after tags recording. Tag() is the recorded tag.
OnKeyDown
Defines what happens after keyboard is pressed. Key is key number.
OnClick
Defines what happens when an object is clicked. Tag() is the clicked object associated tag.
Panel.ThisObject access clicked object properties.
OnMouseDown
Defines what happens when an object is clicked (mouse button down). Tag() is the clicked object associated
tag. Panel.ThisObject access clicked object properties.
OnMouseMove
Defines what happens when an object is clicked and mouse pointer is moved over this object.
OnMouseUp
Defines what happens after an object is clicked (mouse button up). Tag() is the clicked object associated tag.
Panel.ThisObject access clicked object properties.
62
Commands browser
To query tags, objects and commands available use the browser option.
In script window click Button "F4 - Commands" or press F4.
Tip: Type the beginning of the command name. A window will present a survey of
available commands.
63
Accessing tags in script
Examples:
x = tagname (returns to variable x the tag value whose name is tagname)
t = Temperatura1*100 ( returns to variable x the tag value Temperatura1 x 100 )
x = Tag1.LS (returns to variable x the tag Tag1 property LS)
x = Tag("Tag1") (returns to variable x the tag value whose name is Tag1)
s = Tag$(7) (returns to a string variable s the tag text whose spreadsheet line number is 7)
x = Tag("teste").LI (returns to variable x the Tag1 property LI)
y = Tag("Group1_Value1") (returns to variable x the Value1 tag from group Group1)
.
y = Tag() (returns to variable y current object tag value)
Access other tags spreadsheet features with object Tags. Example, returns the tags count number: x =
Tags.Count.
To use a tag as a simple variable without an external device, use driver VAR.
64
Script variables
Text constants are set in quotation marks. Texts can be concatenated using
+ operator.
Text concatenation example ". s = "Realized " + CStr( x ) + " test(s). "
(NOTE: The command IF requires == operator to string comparison)
Text variables can be also byte packets memory. They can be used for communication or binary processing
data. (see functions like BytesToStr)
Basic operations
= : Association. Ex: y = 1 .
+ : Sum. Ex: y = y + 1 .
- : Subtraction. Ex: y = y – 1 .
* : Multiply. Ex: y = y*2 .
/ : Division. Ex: y = y / 2 .
65
Commands and basic expressions
IF expression (condition)
If expression indicates a decision based on condition.
Example1:
If <expression> Then
...
End If
If ( Tag1 = 2 ) Then
message1 = "value is 2"
End If
Exemple2:
Text variable.
Example3:
For
66
Expression While (loop)
Expression While indicates a loop while a condition is true
Syntax:
While <condition>
...
WEnd
Example:
reading = 1
x=0
While ( reading = 1 ) And ( x <= 20 )
...
Tag1.atualiza
reading = Tag1
...
x=x+1
WEnd
GoTo
Visual objects
Use panel object to access visual objects. Use script to access visual objects only as a last resort. Prefer
choosing to associate tags to objects and their properties and change only the tags.
Common properties:
Refresh
Refresh object.
Value
Main object value (in most cases came from tag)
Update
Update object. Panel.text1.Update.
67
Panel object
The Panel object has properties that access the visual objects panel.
Main properties:
Page:
Get or set current page number or name. Ex: Panel.Page=0
Main properties:
Count:
Number of tags.
On (tag):
Tag is turned on.
Recording (tag):
Tag is being recorded.
Save (file name):
Save current application project file.
SaveColumn (file name, column_name):
Exports tag spreadsheet column data.
OpenColumn (file name, column_name):
Imports tag spreadsheet column data.
Example (OnAfterScanning)
Function MyCalculation( x )
MyCalculation = x * 1.7
End Function
y = MyCalculation( x )
Global object
Global object create variables that can be accessed in all internal script events.
Syntax:
Example:
Global.Variable = 5
Global.Test = 2
x = Global.Variable
y = Global.Test
OBS:
Global.Variable = 5 is the same as StoreValue(5, "Variable")
90