Skip to Content
On this page

OPC DA .NET client

OPC DA client connects to a Windows OPC DA server, browses ItemNames, reads and writes test items, imports variables, and maintains subscriptions.

Compatible devices and models

Device series / model examplesConnection requirements
PLC/device servers or industrial software exposing OPC Classic DAConfigure the OPC DA server and COM/DCOM permissions on Windows and collect by server Item ID. PLCs are accessed through their DA server.

Identify the server and Item with OPC Quick Client

OPC DA uses Windows COM/DCOM. Configure the PLC Channel, Device and Tag in KEPServerEX Configuration, then use its OPC Quick Client to check the source connection. This example uses the changing simulator Item 模拟器示例.函数.Ramp1. For a PLC, use the complete Item ID published by its server.

  1. In Quick Client, choose Edit → New Server Connection, expand the local computer and select Kepware.KEPServerEX.V6. Prog ID identifies the registered server in the gateway URL; it is not the project name. Use Remote Machine Name for a remote server.

Selecting the KEPServerEX V6 ProgID in OPC Quick Client

  1. Create a group below the server. Set Name to CollectDocs, Update Rate to 1000 ms and Percent Deadband to 0; keep Active State selected. Time Bias is a time offset in minutes, not the sampling interval; this example uses 0.

Active Quick Client group with a1000ms update rate and zero deadband

  1. Add an Item to the group. Enter 模拟器示例.函数.Ramp1, choose Native and keep Active selected. The green check only validates the address. Use the adjacent Add Item button to add it, then select OK. Validation alone does not create a monitored row.

Entering the complete Item ID and adding it in Quick Client

  1. Check the value, native type and Quality in the main table. Long maps to gateway Int32 and the quality shown is Good (良好). Ramp1 changes with time. Resolve bad server/device quality before configuring the gateway.

Ramp1 value63, Long type and Good quality in Quick Client

Quick Client value63, timestamp and Good quality on the same row

Collect the same Item in the gateway

  1. Under Development Configuration → Collection Configuration → No channel, create a device using OPC DA .NET client. This example names it Collect_OPC_DA. Ordinary collection does not require device method calls.

Selecting and enabling the OPC DA .NET client device

  1. Under Plugin properties, enter opcda://localhost/Kepware.KEPServerEX.V6. Enable server timestamps and subscriptions, use a 1000 ms update rate and zero deadband, then save.

OPC DA client server URL

Server timestamps and subscription mode

Connection check interval in minutes

Subscription update period in milliseconds

  1. Open Protocol Debug → Node browser and expand 模拟器示例 → 函数 → Ramp1. Select Refresh/read and check the complete ID, value, quality and timestamp. Quality 192 means Good. Node properties also show the Canonical Type and accessRights.

Reading the same DA Item with quality192 in the gateway

  1. Under Real-time variables, add Ramp1 using address 模拟器示例.函数.Ramp1, type Int32, Read Only, array length 1, enabled. This source Item is readable; selecting Read/Write in the gateway does not grant server write access.

Variable name Ramp1

Owning device Collect_OPC_DA and enable switch

Complete Item address and Int32 type

Read-only variable access

Array length1 for this scalar

The address editor takes the Item identifier only. A DA address has no ns=2;s= prefix. Do not substitute a PLC register, display name or UA NodeId.

DA address editor with the complete Item identifier

  1. Save and check that the value changes, collection time advances and the error field stays empty. The example row shows 55. Compare the same instant or changing trend with Quick Client; two screenshots of a changing Item need not contain equal values.

DA real-time variable showing device, value55 and Int32

For a remote server, replace localhost and have the administrator configure DCOM launch/access and callback permissions. The gateway process identity needs access even when an interactive Quick Client works.

Scada data sources in OPCServerTool

The OPCServerTool DA configuration utility connects an existing system through a Scada data source. Enter the target Scada server IP, an optional alias and the available Scada type. Check Advanced settings against that system before saving. This form does not create arbitrary PLC tags.

OPCServerTool Scada data-source IP, alias, type and Advanced settings

After publishing the data source, browse the registered server and its actual Items in an OPC client. Use its own ProgID and complete Item ID in the gateway; the KEPServerEX ProgID belongs to KEPServerEX.

Type, group size and deadband

SettingEffect
Server timeUses the Item source timestamp when enabled, or gateway receive time when disabled.
Maximum group sizeDefaults to 500 Items per group; reduce it for a smaller server limit.
DeadbandOPC DA percentage deadband depends on the server EU range and support. It differs from UA absolute deadband: 1% of a 100-unit span is approximately one engineering unit.
Variable typeMatch the COM Canonical Type; byte-order settings do not convert different COM types.

Check server Access Rights before writing a permitted Item. Read it back and compare with OPC Quick Client and the underlying device.

Prerequisites

Before using this plugin, you must install OPC Core Components (OPC Core)  on the Windows hosts running the gateway and the OPC DA server. Match the component architecture to the corresponding process.

Open the plugin

Enter “Development Configuration → Collection Configuration”, create a device and select “OPC DA .NET client” in “Device Plugin”.

When upgrading an existing device that still references the removed legacy OPC DA collection plugin, select OPC DA .NET client and enter its server URL. The old plugin type and separate IP/server-name settings are not converted automatically. Save and re-enable the device, then verify the connection, Item addresses, data types, and subscription updates.

Supported channels and data types

Channel typePre-configuration check
Plugin built-in connectionConnection parameters are configured in device properties and do not use public TCP, UDP, or serial fields. The plugin is Windows-only.

Optional data type: The OPC DA Item’s actual Canonical Type. Read a node in the debug page first, then choose the matching Boolean, integer, floating-point, or String type.

Plugin properties

The following fields are OPC DA-specific. Configure common retry and write-priority fields through Collection Configuration.

Connection configuration

SettingDescription
OPC server URLDefault: opcda://localhost/Kepware.KEPServerEX.V6. Enter opcda://host/ProgID, or use the server CLSID.

Data format

SettingDescription
Server TimestampEnabled by default. Use the OPC DA source timestamp for collection time; when disabled, use the gateway receive time.

Subscription configuration

SettingDescription
Subscription modeDefault: Yes; fill in: switch. When enabled, OPC DA DataChanged events push values; when disabled, the gateway polls at the subscription update rate.

Running parameters

SettingDescription
Recheck Rate (min)Default 10 minutes between server-status queries. Subscription health checks and failure recovery run independently.
Subscription Update RateDefault 1000 milliseconds. Requested OPC DA subscription update period.

Variable configuration

SettingDescription
Dead BandDefault 0. Percentage deadband passed to the OPC DA group, subject to server EU ranges and support. 0 disables the deadband.

Request packing

SettingDescription
Max Group SizeDefault 500 items in one OPC DA subscription group; larger sets are split into multiple groups.

Address rules

  • ItemName

Device debug

Enter “Development Configuration → Collection Configuration”, select the current device then open “Protocol Debug” at the top of the workspace.

Node browser

Use the complete browsed Item ID as the variable address. Follow the Ramp1 steps above to read it before importing or subscribing.

Browse an ItemName and read its value before creating a subscription or importing variables. Use writes only for an approved server test item.

Debugging notes

Browse the OPC DA node and read the values ​​before establishing a subscription; review the address and data type after importing the variables.

Functions

FunctionPurpose
Browse nodesBrowse the OPC DA address space and inspect ItemName, value, quality, and timestamp.
Read and write nodesRead one selected item; writing changes the server value and requires an approved test item.
Export and importExport selected nodes to a variable file or import them into the current device.
Subscription managementCreate, inspect, or cancel subscription groups for selected items.

Verify the configuration

  1. Browse to a known ItemName and read the current value. Confirm that the quality is good.
  2. Change the approved test item on the server and confirm that a read or subscription update appears.
  3. Import a small set of test nodes and check ItemName, data type, value, and timestamp.
  4. When subscription mode is enabled, keep the group within Max Group Size and confirm the update rate and deadband.
  5. Write only to a server-approved test item, then read it again.

Troubleshooting

  • The server cannot be browsed: Confirm that TGateway runs on Windows and check OPC server IP, ProgID, DCOM permissions, and the server process.
  • Browsing works but quality is bad: Check ItemName, the server-side device connection, and item quality rather than only the numeric value.
  • Subscription does not update: Check Subscription mode, update frequency, deadband, and group size.
  • Imported variables have no value: Confirm the ItemName matches the server and check the variable data type and device log.
  • Remote OPC DA connection fails: Check DCOM identity, permissions, and Windows firewall rules on both hosts.