OASYS SCADA HMI Developer Guide
OASYS SCADA HMI Developer Guide
Developer Guide
Release 2021
Month 2020
© 2020 AVEVA Group plc and its subsidiaries. All rights reserved.
The Schneider Electric industrial software business and AVEVA have merged to trade as AVEVA Group plc, a UK
listed company. The Schneider Electric and Life is On trademarks are owned by Schneider Electric and are being
licensed to AVEVA by Schneider Electric.
No part of this documentation shall be reproduced, stored in a retrieval system, or transmitted by any means,
electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of AVEVA.
No liability is assumed with respect to the use of the information contained herein.
Although precaution has been taken in the preparation of this documentation, AVEVA assumes no responsibility
for errors or omissions. The information in this documentation is subject to change without notice and does not
represent a commitment on the part of AVEVA. The software described in this documentation is furni shed under
a license agreement. This software may be used or copied only in accordance with the terms of such license
agreement.
ArchestrA, Aquis, Avantis, Citect, DYNSIM, eDNA, EYESIM, InBatch, InduSoft, InStep, IntelaTrac, InTouch, OASyS,
PIPEPHASE, PRiSM, PRO/II, PROVISION, ROMeo, SIM4ME, SimCentral, SimSci, Skelta, SmartGlance, Spiral
Software, Termis, WindowMaker, WindowViewer, and Wonderware are trademarks of AVEVA and/or its
subsidiaries. An extensive listing of AVEVA trademarks can be found at: https://sw.aveva.com/legal. All other
brands may be trademarks of their respective owners.
Publication date: Monday, July 6, 2020
Contact Information
AVEVA Group plc
High Cross
Madingley Road
Cambridge
CB3 0HB. UK
https://sw.aveva.com/
For information on how to contact sales and customer training, see https://sw.aveva.com/contact.
For information on how to contact technical support, see https://sw.aveva.com/support.
Contents
Chapter 1 Introduction .............................................................................................................5
Chapter 2 Product Configuration Settings ................................................................................7
Before You Begin ................................................................................................................................................................. 7
Modifying Configuration Settings ............................................................................................................................. 7
ezXOS.json Configuration Settings ................................................................................................................................... 9
XE.json Configuration Settings ........................................................................................................................................18
RealTime.json Configuration Settings............................................................................................................................18
Note: In the procedure that follows, the JSON file you place and customize in the %DNADataRoot% directory is
an override file: any keys defined will override those in the %DNAInstallRoot% directory. As a result, only
include settings you wish to override.
1. Locate the JSON file containing the settings you want to modify in %DNAInstallRoot%\<Product
Name>\config\Settings (the install root).
2. Check if the JSON file already exists in %DNADataRoot%\<Product Name>\Config\Settings (the data root)
and do one of the following:
o If the JSON file already exists, proceed to step 3.
o If the JSON file doesn't already exist, proceed to step 4.
3. Proceed as follows:
a. Do not overwrite the existing JSON file in the data root.
b. Check if the key-value pair you want to modify already exists in the JSON file located at the data root.
c. If the key-value pair you want to modify already exists in the JSON file located at the data root, do
nothing.
d. If the key-value pair you want to modify does not already exist in the JSON file located at the data root,
copy the item from the install root file and paste it into the file at the data root. Do not proceed to step
4.
4. Proceed as follows:
a. Copy and paste the JSON file whose settings you want to modify from the install root to the data root.
b. In the JSON file located at the data root, remove all key-value pairs whose values you don't want to
modify.
You can remove whole JSON objects within the file if none of the key-value pair values you want to
modify are contained therein.
5. Change the value of the configuration setting you want to modify to the desired value.
Example 1: JSON file doesn't already exist at the data root
Currently on install root:
{
"OnCall": {
"fromEmail": "TestRegistry@TestRegistry.com",
"emailHost": "localhost",
"SMTPport": 25,
"sleepTime": 20,
"maxSMSlength": 160,
"retries": 5,
"connectionTimeout": 5000,
"SMTPtimeout": 10000
}
}
}
}
is DISABLED.
before
executing the
system switch.
DISABLED -
system switch
will run in a
quiet mode and
requires no
action.
TAG_FONT_ADJUST When the tag font point size is below a Any valid 0
certain value, the text may not look floating point
clear enough. value
representing a
This setting allows you to bold text
point size.
when the text size falls below the value
you define.
TREND_CACHE_TIME Allows you to override the default Values great 3
SPAN trend cache time span value. A value of than or equal to
0 means that no trend data (beyond 0.
that which is currently visible) is
cached. If an invalid value is specified, a
default value of 3 is used.
XOS_ACTIVATION_C Allows you to define the border color String Blue
OLOR for an entity which has been control
panel activated.
XOS_EXCLUDE_PATH Allows you to define a list of paths that String
S will be excluded in search operations
for displays and other elements,
separated by a semi-colon.
XOS_ENABLE_FONT_ Defines what the default value of the True, False True
SIZE_SCALING_NON FontSizeScaling property of any .NET
_BUTTONS
Control is, when that object is placed
on a display in XE.
CoordinateConversions
Redundant properties are not included in XEM files including Location (as made redundant from
LocationWCS) and Size (as made redundant from SizeWCS). However, XE requires the functionality of both
coordinate systems to be available for customers. This means that a light-weight coordinate conversion API will
need to be provided for customers to calculate between Location and LocationWCS, and Size and
SizeWCS.
Basic structs are created to mimic PointF, SizeF, and RectangleF, but with the precision of a double
instead of a float. CoordinateConverter will require these.
The manual of the API is located in the SmartClientComponents help file located here: <ezXOS
directory>\DNA\Documentation\HelpFiles.
using OASySDNA.SmartClientComponents.Drawing;
using OASySDNA.SmartClientComponents.CoordinateConversion;
double x = 123;
double y = 587;
double width = 150;
double height = 50;
Example: Determining the Location and Size of a Static Text on a Model Using an XEM
file
using OASySDNA.XOS.Drawing;
using OASySDNA.XOS.CoordinateConversion;
CoordinateConverter converter = new CoordinateConverter("SENSORS.XEM");
When you create a new culture, or modify an existing one, you copy a starting .resx file from the Install Silo
location to the Data Silo location, and do the work in the Data Silo location. Typically, you would copy the
invariant culture .resx file, which contains the default English text strings, and then create a new .resx file with
the text strings translated to your language. You can also modify an existing baseline culture .resx file by copying
it to the Data Silo location, or modify a previously created .resx file in the Data Silo location.
Important: Use the Development computer when creating a new culture for an application.
Before You Begin
Ensure that Visual Studio is installed on the Development computer.
Ensure that all of the typical tools from the AVEVA Enterprise SCADA HMI install media are installed and
present in the shared\tools\development folder on the Development computer (select Development Tools
during installation).
To create a new culture for an application
1. Log on to the Development computer.
2. In the Install Silo location, locate the invariant .resx file of interest.
For example, the easy eXtended Operator Station (ezXOS) pangrfxStrings.resx file is located in the following
directory: %DNAInstallRoot%\ezXOS\9.0\sdk\ResX\libpangrfxResources
Where: %DNAInstallRoot% is similar to C:\Program Files\AVEVA\DNA.
3. Copy the invariant .resx file from the Install Silo location and paste it into the corresponding Data Silo
location.
In the case of the sample file above, you would paste it into the following location:
%DNADataRoot%\ezXOS\9.0\sdk\ResX\libpangrfxResources
Where: %DNADataRoot% is similar to C:\AVEVA\DNA.
4. Change the name of the .resx file to <resx filename>.<culture>.resx.
Where <culture> is the culture abbreviation as per the Language tag column in the table at the Microsoft
Open Specifications
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8
b0cdb9c page.
For example, to create a Portuguese culture pangrfxStrings.resx file, change the file name to
pangrfxStrings.pt.resx.
Note: Within a product component, there may be multiple .resx files for each language. All the .resx files of a
single language within the component folder will get built into a single culture assembly. Therefore, you should
translate all the invariant culture .resx files within the component folder to your new language, thereby ensuring
that the resulting culture assembly is completely translated to the new language.
Translating Strings
The .strings file takes the following format:
NAME: < Resource Name>
<value>
.
Notes: The translator should only translate the lines between the NAME: line and the line with the single period.
The NAME: line should not be translated.
Resources may have multiple lines. The {0}, {1}, etc. characters indicate words that AVEVA Enterprise SCADA
HMI inserts when the system displays the text.
Each Resource is terminated with a single period at the beginning of the last line, with no other text on the line.
This file is Unicode using UTF8, and can therefore contain characters from any language.
For example:
Notes: Since some culture-specific .resx files rely on the culture-invariant version of that .resx file, WinRes might
only be able to load the culture-invariant version. When you saved the .resx file, you chose the culture to save it
as. In such cases, open the culture-invariant .resx file in WinRes, edit it for your culture-specific sizing and
positioning, and save it to the culture you desire. For all other cases, you can directly open the culture -specific
.resx file.
WinRes works on .resx files generated from a Windows Form or Control, and allows you to position and size
objects on that Form. Many of the AVEVA Enterprise SCADA HMI .resx files are not generated from Windows
Forms and Control: if you attempt to open these in WinRes, the system generates an error message. Only use
WinRes on Forms-based .resx files when you want to position or size objects on the Form.
To modify sizes and locations of Forms objects
1. Launch the WinRes tool.
2. Select File > Open.
For example:
Important: Use the Development computer when creating culture-specific satellite assemblies.
Before You Begin
Ensure that Visual Studio is installed on the Development computer.
To create culture-specific satellite assemblies
1. Click Start, and, in the Search box, type Developer Command Prompt for Visual Studio .
2. Press Enter.
The Visual Studio Developer Command Prompt window opens.
3. Execute the following commands to run the MakeResources tool:
cd %DNADataRoot%\<Product Name>\<Product Version>\sdk\resx\
"%DNAInstallRoot%\Tools\bin\MakeResources" /name: <Component>
For example:
This will generate one satellite assembly dynamic link library (DLL) for each culture. The DLL contains all the
compiled .resx files for the culture that exist in the specified Component folder. These DLLs are created in
the %DNADataRoot%\bin\<culture> folders, as shown in the example above..
4. Copy these Satellite Assembly DLLs to the %DNADataRoot%\bin\<culture> folder on all computers that run
AVEVA Enterprise SCADA HMI with the given regional setting (culture).
Implementing a Custom Data Source for Flexible Trend and Flexible Plot
Objects
The following sections describe how to implement a custom data source for Flexible Trend and Flexible Plot
objects.
Name Description
Note: It is not necessary to raise this event. The QueryTrendSamples method will be called periodically based
on the refresh rate of the chart regardless of whether this notification is raised. It is only provided as a
mechanism to present data immediately even when it comes in between refresh periods.
C# Syntax
event NewDataAvailableHandler NewDataAvailable
Example
To implement a custom trend data source, create an assembly with a class that implements the
ITrendSampleSource. In this example, the assembly is compiled to create CustomTestFlexTrendSource.dll
with the namespace CustomTestFlexTrendSource, and the class is named CustomTestTrendSource.
To implement a custom trend data source
1. Implement the QueryTrendSamples interface.
/// <summary>
/// Query data from the trend source for a particular time range.
/// </summary>
/// <param name="startTime">Data start time.</param>
/// <param name="endTime">Data end time.</param>
/// <returns>List of TrendSample structures</returns>
public List<TrendSample> QueryTrendSamples(DateTime startTime, DateTime endTime)
{
etc…
}
On initial display call up containing a Flexible Trend object, each pen configured to use the custom trend
source makes a call to QueryTrendSamples() to retrieve the initial set of trend samples.
2. Implement the NewDataAvailable interface.
a. Create a class member.
private event NewDataAvailableHandler newDataAvailable;
b. Implement the NewDataAvailable event. The trend pen attaches itself to this event when the Flexible
Trend object is displayed.
/// <summary>
/// Indicates that new data is available.
/// </summary>
public event NewDataAvailableHandler NewDataAvailable
{
add => newDataAvailable += value;
remove => newDataAvailable -= value;
}
c. When new data is available for the trend source, call the event:
newDataAvailable?.Invoke(this);
This makes a call back to the trend pen and in turn, the pen will make a call to QueryTrendSamples()
to retrieve the updated data.
To use the custom trend data source in the easy eXtended Operator Station (ezXOS)/eXtended Editor (XE)
1. Copy the CustomTestFlexTrendSource.dll to the %DNADataRoot%\ezXOS\<silo>\bin folder (for example,
C:\AVEVA\DNA\ezXOS\9.0\bin).
2. Create (or add) to the file %DNADataRoot%\ezXOS\<silo>\config\Settings\ AssemblyList_custom.json (for
example, C:\AVEVA\DNA\ezXOS\9.0\config\Settings) the following:
{
"XE": {
"Assemblies": {
"Custom": [
"CustomTestFlexTrendSource"
]
}
}
}
3. Create a display with a Flexible Trend object, and name it (for example, flexTrend).
4. Open the Visual Basic (VB) code tab and add code to configure a pen with the custom trend data source:
a. Import the assembly.
Imports CustomTestFlexTrendSource
Imports OASySDNA.XOS.FlexibleChart
b. Create a pen and set the trend data source.
Dim pen1 As New TrendPen()
Dim customTrendSource As New CustomTestTrendSource()
pen1.Name = "test1"
‘ optional
pen1.LineColor = Color.DarkCyan
etc…
TrendSample Structure
The TrendSample data structure represents a data sample for the Flexible Trend object.
C# Syntax
public struct TrendSample
Public Constructors
Name Description
Continuation Indicates that this sample is the same as the last but
with an updated timestamp.
TrendSample Constructor
C# Syntax
public TrendSample(
System.DateTime time,
System.double value,
char dataAttribute,
bool continuation = false
)
Parameters
time
Indicates that this sample is the same as the last but with an updated timestamp. Default value is false.
TrendSample Fields
M – Manual
O – Offscan
To use the custom plot data source in the easy eXtended Operator Station (ezXOS)/eXtended Editor (XE)
1. Copy the CustomTestFlexPlotSource.dll to the %DNADataRoot%\ezXOS\<silo>\bin folder (for example,
C:\AVEVA\DNA\ezXOS\9.0\bin).
2. Create (or add) to the file %DNADataRoot%\ezXOS\<silo>\config\Settings\ AssemblyList_custom.json (for
example, C:\AVEVA\DNA\ezXOS\9.0\config\Settings) the following:
{
"XE": {
"Assemblies": {
"Custom": [
"CustomTestFlexPlotSource"
]
}
}
}
3. Create a display with a Flexible Plot object, and name it (for example, flexPlot).
4. Open the Visual Basic (VB) code tab and add code to configure a pen with the custom trend data source:
a. Import the assembly.
Imports CustomTestFlexPlotSource
Imports OASySDNA.XOS.FlexibleChart
b. Create a pen and set the trend data source.
Dim pen1 As New PlotPen()
Dim customPlotSource As New CustomTestPlotSource()
pen1.Name = "test1"
‘ optional
pen1.LineColor = Color.DarkCyan
etc…
PlotPoint Structure
The PlotPoint data structure represents an X, Y pair for the Flexible Plot object.
C# Syntax
public struct PlotPoint
Public Constructors
Name Description
Public Fields
Name Description
PlotPoint Constructor
C# Syntax
public PlotPoint(
System.double x,
System.double y,
)
Parameters
x
x value
y
y value
PlotPoint Fields