How do I programmatically add pens to a trend window?

The following two (2) examples are for WinForm and WPF applications on how to add pens to a trend window during runtime programmatically.

WinForm:

WPF:

VB

C#

After updating Open Automation Software with the incremental update the project no longer compiles or the application no longer works.

Make sure to Unblock the dlls before copying to C:Program Files (x86)Open Automation SoftwareOPC Systems.NET. To Unblock the files copy to a trusted location for your system, Desktop works well, then right click on the file and select Properties to select Unblock. Then copy from your Desktop to C:Program Files (x86)Open Automation SoftwareOPC Systems.NET.

I want to add annotations to the trend window.

Create a String Tag with the Trend Point property enabled. Add the String Tag to the Trend Window as a new Pen. In one of the other existing pens where you want the annotation to appear on set the property Pen.LabelAnnotationTag to the String Tag. Set the Data Logging Group to the String Tag to a String field you will be updating directly from your application.

Does OPCTrend.NET support OPC HDA?

No, OPCTrend.NET is a client/server architecture that does not require DCOM and the communications uses the built in networking to the .NET Framework. This makes it possible for trend clients to view real-time data and historical data with OPCDatabase.NET from anywhere in the world over the Internet.

The OAS Service can bring in data values from Data Access OPC Servers, Data Access OPC Clients, databases like SQL Server, Oracle, Access, and mySQL, Microsoft Excel, and .NET applications (web, WinForm, WCF, WPF, and Windows Services).

The values can then be cached for unlimited trend clients and logged to databases with OPCDatabase.NET. Trend clients can be running on both Windows Operating systems and non Windows Operating systems like smart phones and the iPads.

Visit the Trend .Net Product page for more information and to run a live example.

How do I programmatically get realtime and historical trend data?

Use the GetTrendDataTable method to return a DataTable object with all trend values.

The following code can be used to programmatically get history data and return the data to a DataTable.