Windows Trending

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 Windows HMI.NET.

If you are new to Visual Studio and want to implement HMI Quick Start Templates view the following videos.

WinForm Multi-Document Interface: https://www.opcsystems.com/vs2010templateswinformmdi_video.htm

WinForm Tabbed Interface: https://www.opcsystems.com/vs2010templates_video.htm

 

The following steps can be used to add a trend window to a C#, C++, or Visual Basic.NET application.  Refer to WinForm Example Code in the Form FormMain for programmatic interface of adding and removing pens.  All properties are programmatically accessible.  The following example demonstrates the trend window with no code required.  You can use the OPC Trend.NET control in WinForm and WPF applications using Visual Studio 2005, 2008, and 2010.  The 1.1 Framework version of the trend window can also be used with Visual Studio 2003.

View the following short video on how to add a trend window to a WinForm or WPF application.

https://www.opcsystems.com/opc_trend_netfast_video.htm

View the following detailed video on how to add a trend window to a WinForm application with Visual Studio.

https://www.opcsystems.com/opc_trend_net_video.htm

View the following video on how to display both real-time and historical data in the same trend window.

https://www.opcsystems.com/trendrealtimeandhistory_video.htm

View the following video on how to restrict and set specific real-time time frames.

https://www.opcsystems.com/trendtimeframes_video.htm

View the following video on how to setup a trend window for X-Y Plot trending.

https://www.opcsystems.com/trendxyplotvideo.htm

Use the following steps or view the following videos on how to add a trend window to a WinForm application.

Note: If you are using Visual Studio 2010 make sure to set the Target Framework to the Full Framework and not the Client Profile which is the default.  View the following video on how to set the Target Framework in Visual Studio 2010.

https://www.opcsystems.com/vs2010_video.htm

 

Step

Task

1

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

 

2

Select Windows 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.

https://www.opcsystems.com/vs2010_video.htm

 

3

From the Toolbox if OPCTrendControl is not available right click in the Toolbox and select Choose Items.  If it is available to step 4.

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

 

4

Add the OPCTrendControl component onto the Form.

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

5

Right click on the trend window and select Properties.

6

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

7

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

8

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

 

9

Select the Local OPC Systems 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 OPC Systems Service source.

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

 

10

Expand the Ramp Tag and select Value.

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

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.

12

Select OK from the Pens dialog.

13

If the PC(s) that will run this have a video card that can support OpenGL rendering set the RenderMode3D property to True.

If you are unsure leave this property to False for now.

14

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

 

15

If you desire for the operators 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.

16

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

 

17

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

18

Use Windows Explorer to browse for the application located in the bin\Release directory and run the application.

19

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 bin\Release 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.

https://www.opcsystems.com/smart_client_video.htm

 

Continue: * Web Trending