Documentos de Académico
Documentos de Profesional
Documentos de Cultura
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
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.
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:
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:
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.
To disconnect the communication, press the button
("Stop" - Stop application)
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
Tag3/7
*0.1
*Bit(0)
To access formula options click on the button at the side of the formula column.
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:
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.
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.)
It is possible to customize reports and also to create new templates.
Data and Reports - Edit.
See more details on reports at the Data and Report or Database topic.
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
clicking once on the button, a window at the right shows its properties.
. By
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
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.
3 - If you want to turn it into a button activates the property "ChangeOnClick";
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.
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.
Example 2: Step by step manual (10 steps):
1 - Create a new blank application. (Menu New - <blank>)
2 - Click with the right mouse button on the groups list, left side of the tags spreadsheet.
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:
New group: to create new group.
Rename group: to rename the selected group.
Delete group: to delete the selected group.
Duplicate group: to duplicate contents of the selected group into a new group.
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
3 Click on menu - Driver and select the driver.
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.
x is the current value.
Formulas examples:
Tag1*1.7 + 3
Celsius + 273.16
Farenheit > 100
Database
To set a database where data will be stored click on the database column title or drag the cells.
A window will be shown:
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.
Some available drivers:
- MODBUS RTU or MODBUS TCP: protocol MODBUS . Used for communication with a wide variety of
equipments.
- VAR: tag as a generic variable.
- DEMO: simulated sine wave ranging from "Param1" to "Param2".
- OPC: OPC connection.
- TIMER: Counter in milliseconds. Double format Windows use TIMERFORMAT.
- NOW: Current date time in Windows double format.
Examples of communications: menu New.
To list available drivers click on Driver / PLC column title.
File drivers are in the CTRLS sub folder.
34
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
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.
Create new reports as needed.
Once created a report, it can be modified freely.
37
38
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.
n=ldbcount
if n>0 then
for i=1 to n
next
end if
Spreadsheets for reporting and analysis formats are flexible and can be used for many different types of
reports, using or not the data stored in database. This spreadsheet has generic and specific functions to
build reports with calculations, graphics and tables based on the stored data.
The report formats is written in files with LGX extension.
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.
Or can be created manually:
Menu Data and Reports, Edit Database...
Choose or create database:
Menu:
Arquivo
Edit
Edit or list (filter) database stored data
Fields
Edit fields
41
New
Creates new database
Delete
Delete data from database
Change database fields:
Field columns:
- Name: Field name. Can be the tag name if related to tags.
- Type: Field type:
0 - Number: Numeric field.
Size:
empty or 8: Double (8 - bytes) floating point.
1: byte.
2: Integer (2 - bytes) signed.
4: Long integer (4 - bytes) signed.
1 - Text: Text field; Maximum length in Size column.
- Size: Numeric size or text maximum length.
- Format: Number format in simple listing. Example: hh:nn:ss (double to time format).
42
Database configuration
Database folder: Example: c:\temp\. Default: <.>dados\ (files are stored in the current folder\dados\)
Table: file name. D a t e s e p a r a t i o n f o r m p e r f o r m a n c e p u r p o s e s uses
<ddmmyy>. Example: FILE<ddmmyy>.LBX.
User: user name optional.
Senha: password optional.
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.
Network communication can be made via OPC too.
Server
TCP:
Menu File Client & Server.
45
Client
Automatically:
Goto to url address. If needed via TCP download client.
Examples: http://localhost:1234/ or http://servername:1234/
Manually via TCP:
Open the project application file that will be used at the client computer.
Menu File Client & Server.
Turn on Client.
Type server IP address and click OK.
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
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
51
52
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:
53
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:
Tag: Tag name or formula.
Title: Object title (default is the tag title)
Name: Object name.
Color: Text color.
Back Color: Display background color.
Visibility: if 0 invisible, otherwise visible. Can be a formula. (Example: Tag1>30)
TitleSize: Title size character size.
Border: 1 - Yes. 0 - No.
Format: Number format.
Alignment: 0 - Left. 1 - Center. 2 Right.
ShowUnit: 1 - Yes. 0 - No.
TitleColor: Display title background color.
TitleTextColor: Title text color.
LI: Limit Inferior (lower limit). Default: .LI (from tag column LI)
LS: Limit Superior. Default: .LS (from tag column LS)
ShowLimits: 1 Shows arrows indicating limit surpassing.
AlarmColor: Background color when alarm is on.
InternalBorder: 1- Internal border.
Size: 0 - Text size automatically resized with display height. Otherwise text font size.
ForceTitle: Forces a title text.
UnitForce: Forces a unit text.
ForceText: Forces a text.
TransparentTitle: 1 Title background is transparent.
Style: 0 Normal border. 1 Rounded border.
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:
Tag: Tag name or formula.
Title: Object title (default is the tag title)
Name: Object name.
Color: Button color.
Visibility: if 0 invisible, otherwise visible. Can be a formula. (Example: Tag1>30)
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
Includes objects of another page panel. Several purposes:
1 - Replicates objects with different tags or groups.
2 - Creates multiple states objects
3 Vector drawing objects animation.
Main properties:
Tag: Tag name or group name.
Title: Object title (default is the tag title)
Name: Object name.
Color: Button color.
Visibility: if 0 invisible, otherwise visible. Can be a formula. (Example: Tag1>30)
Page: Panel page name or number.
Pages:
- Multiple state: Panel pages and their tag associated values. Example: 0=pagename1;1=pagename2.
(behavior: when tag is 0 then panel page "pagename1" is shown in the pageobject. If tag is 1 then
panel page is "pagename2").
- Animation: Panel pages are animation frames if referenced tag is active. Example:
pagename1;pagename2;pagename3. When tag is 1 then animation will be the switching between
the panel pages.
Examples can be imported by Import button.
59
Graph
Graph
Simple graphic chart to monitor in real time.
Main properties:
Tag: Tag name or group name.
Title: Object title (default is the tag title)
Name: Object name.
Color: First curve color.
Back color: Chart background color.
Visibility: if 0 invisible, otherwise visible. Can be a formula. (Example: Tag1>30)
Maximum: Y axis maximum.
Mnimo: Y axis minimum.
AutoScale: If active then Maximum and minimum are automatically calculated.
GridColor: Chart grid color.
DivisionsX: Divisions count at axis X.
DivisionsY: Divisions count at axis Y.
Points: Maximum points allowed to the chart.
Restart: 1 - Restart chart monitoring.
TimeFormat: Time format at axis X. Example: hh:nn:ss
TimeDelta: Maximum time interval shown at chart.
TextColor: Text color (numbers and text).
Sampling: Smaller time interval, in miliseconds, of chart update.
Thickness: Curves line thickness.
Border: Border around chart.
CharSize: Text font size .
TitleSize: Tile font size at top of chart.
Color2: Curve 2 color
Color3: Curve 3 color.
Color4: Curve 4 color.
Color5: Curve 5 color.
Legend: 1 Shows legend.
Legend1: Curve 1 legend.
Legend2: Curve 2 legend.
Legend3: Curve 3 legend.
Legend4: Curve 4 legend.
Legend5: Curve 5 legend.
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.
Visual objects events:
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.
63
64
Script variables
Variables can be created and used freely in script on assignments of values or as
function parameters. (A tag can also be used as variables, generic or associated with
equipment).
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 .
= : Association. Ex: s = text .
+ : Text concatenation. Ex: s = s + text .
65
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.
If Not ( response == "ERROR" ) Then
Tag1 = 3
End If
Example3:
Else and ElseIf expression:
If Tag1 > 3 Then
Tag7 = 3
ElseIf Tag1 = 1 Then
Tag7 = 1
Else
Tag7 = 2
End If
Expression ElseIf demands an Else at final.
For
For command indicates an iteration where a variable i gets n1 to n2 values.
66
GoTo
Command GoTo leads execution to a label position.
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.
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
ChangeTagsFromPage ( page, tag name or group ):
Associates panel page objects tags to another tag ou group.
Tag:
Grupo:
Refresh:
Focus:
FullScreen:
Tags objects
Tags objects allows script directly access tags spreadsheet.
Main properties:
RowWhoseName (tag name):
Returns tag spreadsheet row.
StartRecord [(group name)]:
Start database recording. Ex: Tags.StartRecord.
StopRecord [(group name)]:
Stop database recording. Ex: Tags.StopRecord.
RecordNow [(group name)]:
Forces recording at the moment.
TagName (row):
Tag name from tag spreadsheet.
TagRow (tag name):
Tag row number from tag spreadsheet.
Update (tag name):
Force tag update from equipment. Ex: Tag.Update (Tag1)
Play (tag name):
Inicia a leitura na line especificada. Planilha.Liga(3)
Pause (tag name):
Pausa a leitura na line especificada. Planilha.Pausa(3)
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)
Example using OnAfterScanning.
If Tag(Tag1) > 20 Then
Tag$(Message) = "Passed 20"
Else
Tag$(Message) = ""
End if
Function MyCalculation( x )
MyCalculation = x * 1.7
End Function
Global object
Global object create variables that can be accessed in all internal script events.
Syntax:
Global.<variable name> [ = value ]
Example:
Global.Variable = 5
Global.Test = 2
' At other event
x = Global.Variable
y = Global.Test
OBS:
Global.Variable = 5 is the same as StoreValue(5, "Variable")
90