OAS Trend .NET Programmatic Methods

OAS Trend .NET Programmatic Methods 16There are several different methods to programmatically access the trend data and call history for the trend OPCTrendControl. Refer to the OPCTrendControl help file for all properties and methods with their description and syntax.

Use the GetTrendDataTable method to return a DataTable of all data in the current view.

Get Trend History Data Programmatically

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

OAS Trend .NET Toolbars

Modify Properties Button

Modify Properties Button 376Use the Modify Properties button to make on-line changes to all properties of the Trend Window.

Modify Properties Button 377

View Data Grid Button

View Data Grid Button 378Select the View Data Grid button to show a table of all values of the current trend.

Start Runtime Button

Start Runtime Button 379Select the Start Runtime button to put the Trend Window in real-time update mode. This button is useful if the Trend Window was previously stopped using the Stop Runtime button (see below).

Stop Runtime Button

Select the Stop Runtime button to freeze the Trend Window. Stop Runtime Button 380The Data Cursor button is then selectable.

Data Zoom Button

Data Zoom Button 381Select the Data Zoom button to zoom in on a section of the Trend Window. There are many other zoom types also.

Data UnZoom Button

Data UnZoom Button 382Select the Data UnZoom button to return the Trend Window to 100% data zoom if the Data Zoom button was previously used. There are many other zoom types also.

Data Cursor Button

Data Cursor Button 383The Data Cursor button is available with the Trend Window has been stopped with the Stop Runtime button (see above). Select the Data Cursor to bring up the data plane in 3D mode or data line in 2D mode. Use the mouse to move the data plane to see the date/time and values at the position of the data plane.

History Button

History Button 384Use the History button to freeze the Trend Window and select a Date and Time range to retrieve historical data for all Pens that have been logged using OAS Data Log.

Hide Toolbar Button

Hide Toolbar Button 385Select this button to hide the Toolbar. Click on the Trend Window with the Right Mouse button to show the Toolbar again.

Print Trend Window Button

Print Trend Window Button 386Select this button to print up the Print Preview window that can be used to print the current trend.

 

Print Trend Window Button Warning 387Some printer drivers do not support 3D Window rendering so the application will halt if the printer driver cannot handle the large memory for the print.

2D View Button

2D View Button 388Select this button to view the Trend in just 2 dimensions. Note this selection will not be retentive. Use the View Property to make the change retentive.

3D Perspective View Button

3D Perspective View Button 389Select this button to view the Trend in Perspective View. Note this selection will not be retentive. Use the View Property to make the change retentive.

3D Orthogonal View Button

3D Orthogonal View Button 390Select this button to view the Trend in Orthogonal View. Note this selection will not be retentive. Use the View Property to make the change retentive.

3D Free Rotate Button

3D Free Rotate Button 391Select this button to rotate the Trend Window on all 3 planes. This feature can be used to obtain non standard view perspectives of the data. Note this selection will not be retentive. Use the View Property to make the change retentive.

Predefined Projection Button

Predefined Projection Button 392Select this button to select predefined 2D and 3D views. Note this selection will not be retentive. Use the View Property to make the change retentive.

Predefined Projection Button 393

View Zoom Button

View Zoom Button 394Select this button to enable the mouse to Zoom In and Out by moving the mouse up and down. Note this selection will not be retentive.

Move Trend Button

Move Trend Button 395Select this button to move the Trend. Note this selection will not be retentive.

Lighting Button

Predefined Projection Button 392Use this button to select the desired lighting effect. Note this selection will not be retentive. Use the View Property to make the change retentive.

Lighting 396

User Log In

User Log In 397Use this button to Log In to the trend control when security is enabled in the service.

OAS Trend .NET Runtime Distribution

You can distribute the OAS Trend .NET component with your local and remote applications. This component will only connect to licensed OAS Services.

The Microsoft .NET Framework version 2.0 is required on all systems that will use the OPC Trend component. This is automatically included with Windows XP and greater. Only Windows 2000 systems will you need to install the .NET Framework 2.0 to.

The following files are required to be distributed with your applications that are commonly found in the installation directory of Open Automation Software.

  • For .NET Framework 2.0 the installation directory is C:Program FilesOpen Automation SoftwareOPCSystems.NET.
  • OPCTrendControl.dll
  • C1.Win.C1FlexGrid.2.dll
  • OPCSystemsInterface.dll
  • OPCSystemsBrowseComputers.dll
  • Nevron.Chart.dll
  • Nevron.Chart.WinForm.dll
  • Nevron.GraphicsGL.dll
  • Nevron.Presentation.dll
  • Nevron.System.dll

Visual Studio.NET Reference

To add the OAS Trend .NET component to your Visual Studio.NET development systems select View-Toolbox from within Visual Studio.NET.

Visual Studio.NET Reference 373

Right-Click on the Toolbox and select Add/Remove Items.

Visual Studio.NET Reference 374

Select OPCTrendControl for the .NET Framework Components.

Visual Studio.NET Reference 375

You are now ready to add the OAS Trend .NET component to your Visual Studio Forms to develop unlimited numbers of applications for local and remote connections to OAS Services with a valid OAS Trend .NET license.

Use the OAS Trend .NET Properties to setup the Trend Window attributes such as pens, time frames, and colors.

Set the ConfigurationFile property to a proper file path with the extension .alarm if you desire to save on-line changes.  If you leave this property blank the window setup is saved with your application, but on-line changes are not retentive.

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

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.

More: