OPCDA.NET Reference Manual
Getting Started
Send comments on this topic.
OPCDA.NET Client Component > Getting Started

Glossary Item Box

 

OPCDA.NET is a .NET assembly with the functionality of the OPC DA Custom Interface.
OPC client applications can be developed with Visual Basic .Net or C#.

There are different ways to create an OPC client application.
The DAServer/DAGroup Visual Studio controls are configured in the Visual Studio Designer and create a high quality application with a minimal amount of user code. See the demo application for a code sample.

Wizards for VB or C# create the Visual Studio application project.
In the Wizard the user can select the server access features to be included in the created application code. The created code can be used as the base for the application or as samples that show ho to use specific features.

The wrapper assembly supports most OPC DA V2 custom interface functions and offers additional functions for simplified usage. These QuickUse classes handle typical applications and quicken client development considerably. They can be used without much OPC knowledge. The provided VB and C# sample applications use these classes for synchronous read and asynchronous refresh.

Applications that require more flexibility can use the many OPC functions offered by the Wrapper Layer. You may need to study the OpcGroup class. It offers a set of methods that are structured according the functions defined in the OPC DA specification.
The Background Server Access classes handle the server access user requests in background threads to prevent the application from becoming unresponsive due to long server processing times or long timeouts in case of DCOM communication failures.


Steps required to access an OPC DA Server

To access an OPC server the client has to execute the following steps:

  1. Determine the name of the server, either by browsing the installed OPC servers ( OpcServerBrowser Class ) or by other means such as read from a configuration file.
  2. Create a new OpcServer class and connect to the OPC server. The OPC server may be local (on the same machine as the client) or remote (on a networked computer)
  3. Add a group object for each set of items with the same characteristics. You may use the QuickUse classes or the OpcGroup class.
  4. Add Item(s) to the OpcGroup(s). For the QuickUse classes this is not required because the read/write method to add the items internally.
  5. Read and/or write the items. Items added to the QuickUse RefreshGroup class are automatically refreshed and typically need not be read from the server.
  6. Disconnect from the OPC server
  7. Exit the program

Using the invisible DAServer/DAGroup Visual Studio components the application development process is even simpler:

  1. In the Visual Studio Designer drag the components from the toolbox to the application design and make the select the appropriate property settings. The OPC server is selected and OPC items can be assigned to controls of handler methods.
  2. In the application startup code enter a call to the DAGroup.Create() method.
  3. Code necessary features that cannot be selected in the controls.
  4. In the application exit handler, call the DAServer.Dispose() method to stop the processing and disconnect the server.

 

 

 

Additional steps required to access an OPC UA Server

  1. The application must be built with references to UA version OPCDA.NET DLL and the OpcDaNetUaOption.DLL (separate product)
  2. The UA configuration file must be added.
    This can be done with UaClientConfigHelper.exe utility provided with the UA Option.
  3. A certificate must be created for the client application and exported for import on the server machine.
    This can be done with UaClientConfigHelper.exe utility provided with the UA Option.
  4. The UA server certificate needs to be imported.
    This can be done with UaClientConfigHelper.exe utility provided with the UA Option.

 

 

Additional steps required to access an OPC .NET (Xi) Server

  1. The application must be built with references to Xi version OPCDA.NET DLL and the OpcDaNetXiOption.DLL (separate product)
  2. The Xi communication configuration settings (WCF) must be added to the application configuration file.
    This can be done with XiConfig.exe utility provided with the Xi Option.

 

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