Skip to main content

OPC DA client

An OPC DA client connector reads and writes items of OPC DA servers (OPC Classic Data Access 2.0 and 3.0): KEPServerEX, Matrikon, RSLinx, SIMATIC NET, WinCC, iFIX, Citect and the many older gateways and SCADA systems that offer OPC DA. One connector can talk to several servers; each server is one device and counts as one device for the licence.

An OPC DA client connector with a redundant server pair

Windows only. OPC DA works through Windows COM/DCOM, so WiConnector must run on Windows to use it. On Linux or in Docker the connector's form shows OPC DA needs Windows, the connector starts Faulted with that reason on the Modules page and its tags are Bad (NeedsWindows). Install WiConnector on a Windows computer that can reach the server, or read the server through an OPC UA wrapper with the OPC UA client connector.

FieldMeaningDefault
NameHow tags refer to this server, e.g. kepwareserver1
Server typeStandalone: one server. Redundant: a primary and a secondary server (see below)Standalone
ComputerWhere the server runs: empty for the WiConnector computer, else its name or IP address (DCOM). The primary when redundantempty
ProgIDThe server's registered name, e.g. Kepware.KEPServerEX.V6, Matrikon.OPC.Simulation.1, RSLinx OPC Server. Discover fills it in
CLSID (optional)The server's class id, used instead of looking the ProgID up. Needed for a server on another computer without the OPC Core Components
Secondary computer, Secondary ProgIDRedundant only: the backup server; an empty ProgID means the same server as the primary
Return to the primaryRedundant only: When it runs again goes back once the primary runs; No, stay stays on the secondary until it failsWhen it runs again
Check the primary every (s)Redundant only: how often the primary is checked while the secondary is in use (5 to 3600)60
Sign in (DCOM)For a server on another computer: WiConnector's account (the account the WiConnector service runs as), or a Windows user with domain, user and password (stored encrypted, shown as ********)WiConnector's account
Read fromServer's cache: the server keeps each poll group's items up to date at the group's rate and WiConnector reads its cache (light on the devices). Device: every read goes to the deviceServer's cache
Percent deadbandOPC group deadband, 0 to 100 % of an analog item's range; 0 reports every change0
Timeout (ms)Longest wait for one call to the server; a server that does not answer in time counts as lost10000
Reconnect delay (ms)Wait before connecting again (longer after repeated failures, up to a minute)5000
Browse limit (items)Browse stops after this many items20000

Each poll group becomes one OPC group on the server with the poll group's rate as its update rate, and WiConnector reads it at that rate. The Logs page shows the rate the server actually granted.

Finding the server: Discover​

Press Discover beside the ProgID. WiConnector asks the computer (empty: this computer) which OPC DA servers are registered there and lists each one's name, ProgID and the OPC DA versions it supports (DA1, DA2, DA3). Press Use to fill in the ProgID and CLSID. The list comes from OpcEnum, part of the OPC Core Components that every OPC DA server installs; when it is missing or blocked, type the ProgID and CLSID instead (the server's documentation or its registry entry under HKEY_CLASSES_ROOT\<ProgID>\CLSID has them).

Servers on another computer (DCOM)​

OPC DA to another computer uses DCOM, which Windows protects closely. On the server's computer:

  1. Run dcomcnfg → Component Services → Computers → My Computer → DCOM Config → the OPC server (and OpcEnum) → Properties → Security: allow Launch and Activation and Access for the account WiConnector signs in as (remote launch, remote activation, remote access).
  2. Under My Computer → Properties → COM Security, allow remote Access and Launch for that account in Edit Limits as well.
  3. Open the firewall for DCOM: TCP 135 and the server's program (or the DCOM dynamic port range).
  4. The account must exist on both computers: a domain account, or in a workgroup a local account with the same name and password on both. Use Sign in (DCOM) → Windows user to give it here when WiConnector's service account is not that account.

WiConnector only makes calls to the server (synchronous reads and writes); the server never calls back, so no DCOM callback permissions are needed on the WiConnector computer.

Redundant servers (primary and secondary)​

For a redundant pair of OPC DA servers (two SCADA servers or gateways serving the same items), set Server type to Redundant and enter the secondary computer (and its ProgID if it differs). Both servers must offer the same item ids.

  • WiConnector starts with the primary. When it stops answering, or reports a state other than Running (Failed, No configuration, Suspended, Comm fault), WiConnector switches to the secondary at once. The tags keep their last values during the switch; they turn bad only when neither server answers.
  • While on the secondary, it checks the primary every Check the primary every seconds and goes back once it runs.
  • Every switch is written to the Logs (Connector.name). Browse uses the secondary when the primary does not answer.

Adding tags from a server​

Open a tag group and press Add from server (Add from device when there are other browsable devices too). Pick the server and the poll group; the server's address space appears as a tree of branches and items, with each item's type (Float, Word, Boolean, read only …) and the tag type it gets. Tick items or whole branches and press Add. In a single tag's properties, Browse beside the address picks one item.

The device page of an OPC DA server

With Keep structures as templates, each branch with two or more ticked items (for example Motor1) becomes a group bound to a template made from it, one template per kind of branch. The group's Branch is the branch's item id, which {base} becomes in the template's addresses: {base}.Speed with branch Channel1.Motor1 reads Channel1.Motor1.Speed. See Templates.

When a server goes away, its tags turn Bad with CommFailure, and WiConnector reconnects after the reconnect delay. An item the server does not have makes only that tag Bad (UnknownItemId). The server's own quality is kept: Uncertain values show as Uncertain and Bad ones as Bad with the reason (CommFailure, DeviceFailure, NotConnected, ConfigError, OutOfService, …).