OAS Trend .NET Component

The OAS Trend .NET control is .NET component that can be integrated into any .NET component container like Visual Studio.NET. The component is 100% managed code and works with any local and/or remote OAS Service.

No license is needed to use the components. It can connect to any OAS Service that has an OAS Trend .NET license.

Use the OPC Trends and Alarms application to use the OAS Trend .NET component features if you do not wish to develop your own container application.

Refer to OPCTrendControl help for all properties and members of the OAS Trend .NET component.

Refer to the Windows Trending section for an example of setting up properties of the Trend Window.

Getting Started – .Net Trend

If you do not have a copy of Visual Studio you can download a free version of Visual Studio Community (formerly Visual Basic Express or C# Express) from visualstudio.microsoft.com/vs/community.  You can choose whether to use Visual Basic or C#, but if you have no experience with either language, Visual Basic is easier for new developers.  No programming is required to use .NET Trend for WPF and WinForm applications.

Step 1

Start Visual Studio and select File->New->Project to create a new C#, C++, or VB.

.NET WinForm HMI 292

WPF: If you are using WPF choose the OPCWPFDashboard assembly then use the OPCWPFTrend control.

WinForm: If you are using WinForm choose OPCTrendControl assembly.

Step 2

Select Windows Application or WPF Application as the project type.

.Net Trend 359

** Note: When using Visual Studio 2010 set the Target Framework to the full Framework. The Client Profile does not have the components needed for trending in your application.

View the following video on how to set the Target Framework for you Visual Basic or C# application:

Step 3

For WinForm applications from the Toolbox if OPCTrendControl is not available right click in the Toolbox and select Choose Items.

From the .NET Framework Components select OPCTrendControl and then select OK.

For WPF applications from the Toolbox right click to select all OPCWPFDashboard assembly controls including the OPCWPFTrend control.

Note: If you have installed Visual Studio after Open Automation Software you can either Browse and include the OPCWPFDashboard.dll assembly from C:\Program Files\Open Automation Software\OAS\ or uninstall Open Automation Software and reinstall to register the OPCWPFDashboard.dll assembly with Visual Studio.

.Net Trend 360

Use Add Reference and browse C:\Program Files\Open Automation Software\OAS\ to add the 5 following Nevron assemblies.

Step 4

Add the OPCTrendControl or OPCWPFTrend component onto the Form or Window.

.Net Trend 361

Resize both the form and trend window to the desired size.

.Net Trend 362

Step 5

Right click on the trend window and select Properties.

.NET WinForm HMI 297

Step 6

Set the Anchor property to Top, Bottom, Left, Right.

.Net Trend 363

Step 7

Expand the ChartRates property and set the TimeFrame to 60 seconds.

.Net Trend 364

Step 8

Select the Pens property and click on the small grey square with the 3 dots at the right.

.Net Trend 365

Step 9

Select the Local OAS Service to display a list of available Tags to

.Net Trend 366

Important: If you do not see the desired Tag in this list go back to Configure-Tags and enable the Trend Point property for the Tags you wish to trend.  You can also use the Tag CSV Export and Import with the column Value – Is Trend Point to enable multiple tags for trending in one step.

Note: If you wish to run this application on remote PCs make sure to include the Network Node or IP Address of the OAS Engine.  Select your Network Node or IP Address in the Browse Tags window.

Local Tag

myGroup.myTag.Value

Basic Networking

\\192.168.0.1\myGroup.myTag.Value

Live Data Cloud Networking from local OAS Engine

RemoteSCADAHosting.myLiveDataCloudNode.myGroup.myTag.Value

Live Data Cloud Networking though remote OAS Engine

\\192.168.0.1\RemoteSCADAHosting.myLiveDataCloudNode.myGroup.myTag.Value

Step 10

Expand the Ramp Tag and select Value.

.Net Trend 368

Select the Add Pen button or right click on Value and select Add Pen.

.Net Trend 369

Step 11

The pen Ramp.Value will appear in the lower left list of pens. You can select the pen to change of the pen properties that appear to the right. The YAxisRangeHigh and YAxisRangeLow properties are important when the trend windows YAxis.ScaleMode property is set to PercentOfPenRanges.

Step 12

Select OK from the Pens dialog.

Step 13

Expand the Views property and set the trend window Lighting and PerspectiveView to the desired settings.

.Net Trend 370

Step 14

If you desire for the operator’s changes to the trend window during runtime to remain set the ConfigurationFile property to a valid file path. Make sure each system the application will run on that the directory path is valid.

.Net Trend 371

Note: If you set this property to a file make sure you deploy the file with the application in the directory you specify.

Leave this property blank if you wish to have the default properties set during configuration remain on the application restarting.

Step 15

Set the compile mode on the Visual Studio toolbar to Release.

.NET WinForm HMI 305

Step 16

Select Build from the VS menu and select to Build the application.

.NET WinForm HMI 306

Step 17

Use Windows Explorer to browse for the application located in the binRelease directory and run the application.

.Net Trend 372

Step 18

To deploy the application to remote nodes first make sure the Pen selection as described in Step 9 is set to a Network Node or IP Address. Then simply copy the files in the binRelease directory to the target systems or follow the Smart Client deployment section in this help file to deploy your application using Click Once Deployment.

View the following video on Smart Client Deployment:

Overview – .NET Trend

The OAS .NET Trend product provides real-time trending for WinForm and WPF applications and historical trending when combined with the product feature OAS Data Log.

OAS Trend .NET includes the windows services to provide real-time data, a .NET component to be used on local and remote systems to connect to the local windows service, and together with OAS Data Log provides historical replay to the OPCTrendControl component.

Refer to Tag Configuration to enable the Trend Point property of each Tag Parameter.

FAQs – UDP Broadcast

Do I need to use UDP Broadcast to send data across a network of the Internet?
No, you only need to use UDP Broadcast on networks that have a communication diode that only allow one way communications.
Can UDP Broadcast be used to send data to multiple remote services?
Yes.
Do I need to have all of the source tags defined in the remote receiving services?
No, set the Data Source in the receiving node to UDP Client.  View the video in the Videos-UDP Broadcast section.

Frequently Asked Questions – Live Data Cloud

Do I need to use the Live Data Cloud for communications over the Internet?
No, you can use the standard networking in Open Automation Software if the data source has a fixed IP Address or domain name registered with the Internet. The Live Data Cloud is best when the data source IP Address is dynamic or you are just using a standard Internet connection.

Videos – Live Data Cloud

Live Data Cloud

How to host data from any Windows PC with a standard Internet connection. No fixed IP Address or registered domain name required.

Excel with Live Data Cloud

How to use OPCExcel.NET with data service being hosted with free Live Data Cloud feature over the Internet.

Data Log with Live Data Cloud

How to use Data Logging with data service being hosted with free Live Data Cloud feature over the Internet.

OPC Client with Live Data Cloud

How to use OPCClient.NET with data service being hosted with free Live Data Cloud feature over the Internet.

FAQs – Options

How can I backup the configured options on my system?
Backup the file OAS.options from C:\ProgramData\OpenAutomationSoftware\ConfigFiles.
All default configuration files would be specified under Configure-Options.
How can I move the configured options from one system to another?
Copy the file OAS.options from C:\ProgramData\OpenAutomationSoftware\ConfigFiles\ to the new system in the same directory C:Program Files and restart the OAS Services on the new computer. All default file paths will be located under Configure-Options and they should be copied to the same directory structure of the new system.
How can I prevent the options from being modified by unauthorized users?

Setup Security and select which Options you want users to be able to modify in the Default group and for each Security Group.

Frequently Asked Questions – Reports

When I use multiple DataSets in the same report it only returns data from the first DataSet.
Use and RDL Report type.
I am using GMAIL as the sending address.
Create an App Password for the Google Account.  Use this as the password for authentication.
Report queries are running very slow from the database.
Make sure the date and time span or Query String is defined to return a subset of data instead of all of the data. You can also reindex the database in SQL Server to run faster. Reorganizing and Rebuilding Indexes https://msdn.microsoft.com/en-us/library/ms189858.aspx
Create Report for mySQL and other database engines without OLE-DB Provider
In order to use MySQL you will need to have the MySQL Connector/ODBC driver installed on the system where the OAS Engine is running. If it is not currently installed you can download from here: https://downloads.mysql.com/archives/c-odbc/ In order to use the ODBC Administrator you may also need to install the Visual C++ Redistributable for Visual Studio x86. In MySQL create a separate user from root. You will uses this user in the string below. ServerIPAddress=xxx.xxx.xxx.xxx DataBaseName=The database name of interest inside mySQL MYSQLUserName = The MySQL username provided above MYSQLUserNamePassword = The Password to the database for the username provided No spaces between elements. Database = DatatBaseName Table = a table within the database. Dataset should now show table elements.
Set Printer Driver to work with Automated Reports
The OAS Services by default run under the SYSTEM account. The following link is a guide for setting up the printer driver to work with the SYSTEM account. https://support.microsoft.com/en-us/help/184291/com-objects-fail-to-print-when-called-from-asp

Videos – Reports

Automated Reports

Generate reports based on event trigger or continuously to PDF, HTML, Word, Excel, images, or optionally send to a printer.

Setup Automated Reports

How to create reports for automated report generation from database sources to PDF, HTML, Word, Excel, and printer.