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 OPC .NET WinForm HMI .NET.
Start Visual Studio and select File->New->Project to create a new C#, C++, or VB.
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.
Select Windows Application or WPF Application as the project type.
** 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:
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.
Add the OPCTrendControl or OPCWPFTrend component onto the Form or Window.
Resize both the form and trend window to the desired size.
Right click on the trend window and select Properties.
Set the Anchor property to Top, Bottom, Left, Right.
Expand the ChartRates property and set the TimeFrame to 60 seconds.
Select the Pens property and click on the small grey square with the 3 dots at the right.
Select the Local OAS Service to display a list of available Tags to
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.
Expand the Ramp Tag and select Value.
Select the Add Pen button or right click on Value and select Add Pen.
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.
Select OK from the Pens dialog.
Expand the Views property and set the trend window Lighting and PerspectiveView to the desired settings.
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.
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.
Set the compile mode on the Visual Studio toolbar to Release.
Select Build from the VS menu and select to Build the application.
Use Windows Explorer to browse for the application located in the binRelease directory and run the application.
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: