OPC Client Connection Tag

Introduction

The OPC Client Connection Tag provides a connection to an external OPC Data Access (OPC DA) Server. The data in the external OPC Server can be read at a fixed interval, or on demand, or both.

Configuration Properties

The OPC Client Connection Tag supports the configuration properties of the Alarm Tag plus these properties:

Property Type Version Description
ScanInterval TIME 1.3 The interval between each read. An interval value of zero (T#0s) disables periodic query execution. See Interval and Offset for information on how timed activities are scheduled.
ScanOffset TIME 1.3 The offset added to the ScanInterval to get the actual read time. See Interval and Offset for information on how timed activities are scheduled.
ProgID WSTRING 1.3 The programmatic identifier of the external OPC Server.
RemoteNode WSTRING 3.0 The node name of the computer running the OPC Server.
This can be a UNC name ("\\Name" or "Name"), a dns name ("name.internal"), or an IP Address ("192.168.1.1").
Leave blank if the OPC Server is running on the same computer as Fernhill SCADA.
AlarmSeverity UINT 1.5 The severity of the alarm raised when the OPC server fails.

ProgID Property

The ProgID property tells Fernhill SCADA which external OPC Server to connect to.

Security Considerations

Depending on the external OPC Server you want to connect to, Fernhill SCADA may need to authenticate itself with the external OPC Server. In a default installation, Fernhill SCADA runs under the System account reserved for system services. If the OPC Server does not allow access from the System account, you can change Fernhill SCADA to use a different user account. See Fernhill SCADA Server for information about changing the user account used by Fernhill SCADA.

Dynamic Properties

The OPC Client Connection Tag supports the dynamic properties of the Core Tag plus these properties:

Property Type Description
ServerState UINT A code indicating the state of the connection to the external OPC Server. The value 15 shows successful operation. Other values indicate an error. The FailedFunction and ErrorMessage properties may give additional information.
FailedFunction WSTRING The function call that failed if there is an error communicating the external OPC Server.
ErrorMessage WSTRING The error message returned from the external OPC data source.
OPCServerStartTime DATE_AND_TIME The time the OPC server started (from the GetStatus request).
OPCServerState UINT The state reported by the GetStatus request.
OPCMajorVersion UINT The Major version of the OPC Server reported by the GetStatus request.
OPCMinorVersion UINT The Minor version of the OPC Server reported by the GetStatus request.
OPCBuildNumber UINT The Build number of the OPC Server reported by the GetStatus request.
OPCVendorInfo WSTRING[80] The vendor information string reported by the GetStatus request.
ScanTimer TimerStatus The status of the scan timer.

The ServerState property can be used to diagnose problems with the ODBC data source:

ServerStateDescription
0Initial state before the driver has started
1There is an error in the OPC Client Connection Tag configuration
2The driver has disconnected from the OPC Server
3The ProgID is invalid
4The CoCreateInstanceEx call to create an instance of the external OPC server failed.
5The IOPCServer::GetStatus function call failed
6The IOPCServer::AddGroup function call failed
7The IOPCItemMgt::AddItems function call failed
8The external OPC Server does not support the IOPCSyncIO interface
9The IOPCSyncIO::Read function call failed
15The connection to the external OPC server is working normally

Tag Commands

The OPC Client Connection Tag supports the tag commands of the Alarm Tag, plus these tag commands:

Tag Command Version Description
Refresh 1.3 Requests an immediate read of all of the tags associated with this OPC Client Connection Tag.

Note: Event triggered data reads (from the Refresh tag command) and periodic data reads (defined by the ScanInterval property) are independent. You can use the Refresh tag command, or the ScanInterval property, or both to determine when the tags are read.

Relationships to Other Tag Types

The OPC Client Query Tag builds on the features of these tag types:

Further Information

Interval and Offset

To learn how activities are scheduled using Interval and Offset.

IO Analog Data Tag

To learn about the IO Analog Data Tag that can be associated with the OPC Connection Tag.

IO Digital Data Tag

To learn about the IO Digital Data Tag that can be associated with the OPC Connection Tag.

IO String Data Tag

To learn about the IO String Data Tag that can be associated with the OPC Connection Tag.

IO Word Data Tag

To learn about the IO Word Data Tag that can be associated with the OPC Connection Tag.

IO Double Word Data Tag

To learn about the IO Double Word Data Tag that can be associated with the OPC Connection Tag.

OPC Client Driver

For an overview of the OPC Client Driver.

Glossary

For the meaning of terms used in Fernhill SCADA.