OPC DA Client
The OPC DA Client lets 2WinScada connect to OPC DA (OPC Classic) servers and read and write tag values. 2WinScada subscribes to the items on the server; the server sends the values through groups created according to the tags' update intervals.
Platform requirement
The OPC DA client runs only on Windows. On other platforms, OPC DA channels can be defined, but no communication takes place.
Channel Definition
On the General tab of the new channel window, enter the channel name and select OpcServer as the Connection Type. Fields on the Connection Parameters tab:
| Field | Description |
|---|---|
| Computer Name | Read-only; shown as "This computer (local)". OPC DA connects only to a server on the computer where the 2WinScada service runs. |
| Server Name | Required. ProgID of the OPC DA server; on a new channel it defaults to Kepware.KEPServerEX.V5. |
| Idle Time To Reinit Server [s] | 0–86400 seconds. If no tag value changes for this long while the connection is open, the connection is closed and re-established. 0 disables this feature. |
Local OPC DA server only
The connection is established only with the Server Name, to the OPC DA server on the computer where the 2WinScada service runs; an OPC DA server on a remote computer is not supported. If you try to save a new remote computer name, the server rejects it (error 5310). On channels saved with a remote computer name, this name is not used; the channel connects to the local server and a warning is written to the service log. Reconfigure these channels with OPC UA.
To reach a remote OPC DA server, use an OPC UA endpoint on that computer (e.g. an OPC DA/UA gateway or the server's own OPC UA interface) and connect from 2WinScada with the OPC UA Client.
When the connection is lost, 2WinScada checks the connection state about every 10 seconds and tries to reconnect to the server. It waits at least 30 seconds between two connection attempts. When the connection is established, the active devices are restarted.
Choose an Idle Time To Reinit Server [s] value longer than the change interval of the slowest-changing tags in the process. On a server with tags whose values stay constant for a long time, a short value causes the connection to be closed and reopened unnecessarily.
Device Definition
OPC DA devices have no protocol-specific parameters. On the General tab of the device window, the device name and Active are set as for other protocols.
The device name is used to monitor the device's connection state. For each device, 2WinScada reads the item below from the server; when the item's value is true, the device connection is considered bad (Bad):
| OPC DA server | Connection state item read |
|---|---|
| Kepware | <device name>._System._Error |
Servers whose Server Name contains Matrikon | The item formed by appending >$Connected to the device name (e.g. Cihaz1>$Connected) |
| Other servers | <device name>._System._Error |
For the connection state to be monitored correctly, give the device in 2WinScada the same name as the start of the related item path on the server. For example, in Kepware, for Cihaz1 under Kanal1, the device name must be Kanal1.Cihaz1.
Tag Definition
Tags are defined in the device's tag table in the same way as for other protocols (see Tag Management).
| Field | OPC DA rule |
|---|---|
| Address | Full identifier of the item on the OPC DA server (item ID), e.g. Kanal1.Cihaz1.Sicaklik. 1–250 characters. |
| Data Type | If Automatic is selected, the type is read from the server and the type reported by the server is used. If another type is selected, the value is requested from the server in that type. |
| Update Interval[s] | Tags with the same update interval are collected into a single group on the server; the update rate of the group is this interval. |
| Read Only | If selected, 2WinScada does not write to this tag. |
The tag quality is determined by the quality the server reports for the item: if the server reports Good, the tag quality is Good, otherwise Bad. If an item address that does not exist on the server is entered, the tag cannot be added and the error is written to the service log.
Values written to Bool tags are sent to the server as true/false. If the write succeeds, 2WinScada reads the value back from the server.
Troubleshooting
| Symptom | Checks |
|---|---|
| No tag is read | Check that the 2WinScada service runs on Windows, that the Server Name (ProgID) value is spelled correctly and that the OPC DA server runs on the same computer. |
Error 5310 when saving the channel | A remote computer name is not supported. Run the OPC DA server on the same computer as the service, or use OPC UA. |
| A single tag is not read | Compare the item identifier in the Address field with the item on the server; look for an item add error in the service log. |
| The device connection always shows as bad | Check that the device name is the same as the start of the item path on the server and that the connection state item exists on the server. |
| The connection closes and opens periodically | Increase the Idle Time To Reinit Server [s] value, or set it to 0 to disable it. |
| The value arrives with the wrong type | Choose a Data Type that matches the item type on the server, or use Automatic. |