OPCDA.NET Reference Manual
Visual Studio OPCDA.NET Controls
Send comments on this topic.
OPCDA.NET Client Component > Application Development > Visual Studio OPCDA.NET Controls

Glossary Item Box

The OPCDA.NET Professional Edition provides two invisible Visual Studio controls that handle the server access and reduce coding to the application specific features.

The server access is handled asynchronously in background threads. The application cannot become unresponsive due to server communication issues.
The sample application shows how simple the application code is, despite the extensive error checking.

 

Create an OPC Client Application

Action Description

 Create Project

In Visual Studio create a Windows Form Application or Windows Service.

DAServer Control From the Visual Studio Toolbox drag the OPCDA.NET DAServer control to the design pane.
The reference to the OpcDaNet.Dll is automatically added.
Define control property values. At least the OPC server ProgID needs to be defined.
DAGroup Control From the Visual Studio Toolbox drag the OPCDA.NET DAServer control to the design pane.
Define control property values. The control must reference a DAServer control instance.
A set of items of the referenced server can be defined. Items can either be assigned to a
- Windows control (e.g. a Textbox)
- User defined control
- User defined method
or they can be handled in the DAGroup generic callback handler.
Connect to OPC server Add code in the application to call
either:    DAServer.Connect(..)
or:         DAGroup.Create(;;)
Data Change Handling The data change callback handling is started in the DAGroup.Create() method and is handled according the configuration settings in the DAGroup control.

Event Notifications Errors are reported in the completion handler of the called DAServer/DAGroup methods. If none is specified the the notification goes to the DAServer.Notifications event handler. The user should always install a DAServer.Notifications event handler.
OPC Server Read/Write OPC items can read or written using the DAGroup.Read() / DAGroup.Write() methods.
ItemDefinitionSets can be configured in the DAGroup control to minimize coding.
The DAGroup handles read/write OPC server access asynchronously and does OPC server access and timeout checks.

Other OPC Server Access The DAServer and DAGroup controls provide access to the underlying BGServer / POPServer respectively BGGroup / OpcGroup classes. Using these classes all OPC server features can be used.
Applications that uses the underlying classes must do their own error checking/handling.

Disconnect from server The DAServer.Disconnect() method disconnects the OPC server. DAGroup controls that reference the DAServer instance are stopped and the associated group removed in the server. The controls keep the current state and can be reactivated by calling the DAServer.ReConnect() method.


Terminate the Application The DAServer.Dispose() method must be called.
The control and the associated DAGroup controls are stopped and disposed.


 

DAServer Control Configuration

The DAServer control properties are defined in the Visual Studio Property editor. The ProgID of the server can be selected in a specific dialog.

 

 

 

 

DAGroup Control Configuration

In the Visual Studio Property editor the basic properties are set and the control is assigned to a DAServer object.
The items handled by this group are selected in a specific dialog from an item tree browsed from the selected server. Manual typing of the item name is also possible for cases when the server is not available for browsing.

 

 

 

 

 

 

 

Copyright © 2002-2018 Advosol Inc. All Rights Reserved.