Open Automation Software
Moving Data From Anywhere to Anywhere
1-303-679-0898

Getting Started – .Net Trend

If you do not have a copy of Visual Studio you can download a free version of Visual Basic Express 2010 or C# Express 2010 from www.microsoft.com/express. If you have no experience with either Visual Basic or C# choose Visual Basic.  No programming is required to use OPC .NET WinForm HMI .NET.

Step 1

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

.NET WinForm HMI 292

If you are using WPF choose the OPCWPFDashboard assembly with the Target Framework set to the full 4.0 (not Client Profile) to then use the OPCWPFTrend control.

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:

Direct link: https://www.openautomationsoftware.com/videos/#target-framework-vs2010

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.

.Net Trend 360

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

Note: 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.

Note: If you want the application to be deployed across a network to remote PCs select the Network Node or enter an IP Address in the NetworkNode field and use the Select button to include the network node or IP Address of the OAS Service source.

You can also use the DirectOPC interface to connect directly to OPC Server Items.

.Net Trend 367

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 ConfgiurationFile 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:

Direct link: https://www.openautomationsoftware.com/videos/#publish-smart-clients