OPC Data Access 2.05 & 3.0 Client

OPC Data Access 2.05 & 3.0 Client

OPC Data Access 2.05 & 3.0 Client Communication Protocol

Supported device types and versions


The protocol supports the client-side of communication with OPC (OLE for Process Control) DA (Data Access) servers according to the OPC DA specification ver. 2.05A and 3.0. It also supports the client-side of communication with OPC HDA (Historical Data Access) servers according to OPC HDA specifications ver. 1.20.

Communication line configuration


  • Communication line category: OPC.

  • OPC parameters:

    • OPC Host: Only Remote entrance requires it. Computer, where the program D2000 OPC Server is installed in - it is defined for OPC server type "Remote" only (maximum string: 50 characters). You can define names according to the UNC convention (e.g. \\server or server), DNS domain names (e.g. domain.com, example.company.com), or IP address (196.54.23.113).

    • Backup Host: Only Remote entrance requires it. It is a backup OPC host. If the parameter is defined, after the communication has failed, the process D2000 KOM is attempting to establish a connection alternately with the OPC host and Backup host.

    • OPC Server: Name (ProgID) of the OPC server (maximum string: 50 characters).

    • Server Type: according to the server type – InProc, Local or Remote.

Communication line parameters

Following communication line parameters can be configured for protocol "OPC Data Access 2.05 & 3.0":

Tab. No. 1

Name

Description

Unit

Default value

OPC HDA: Server if Available

OPC HDA server name (ProgID), if it is available. OPC HDA functions are not to be activated, use empty text.

-

 

OPC HDA: Max. Number of Values

Sets the NumItems parameter for the synchronous reading of historical "raw" values. The implicit value 0 (zero) means all values in the given interval.

-

0

Authentication Level

Authentication level used when establishing a connection to the OPC server. The OPC standard defines the following levels:

  • RPC_C_AUTHN_LEVEL_DEFAULT (0)

  • RPC_C_AUTHN_LEVEL_NONE (1)

  • RPC_C_AUTHN_LEVEL_CONNECT (2)

  • RPC_C_AUTHN_LEVEL_CALL (3)

  • RPC_C_AUTHN_LEVEL_PKT (4)

  • RPC_C_AUTHN_LEVEL_PKT_INTEGRITY (5)

  • RPC_C_AUTHN_LEVEL_PKT_PRIVACY (6)

Note: The default value RPC_C_AUTHN_LEVEL_CONNECT (2) may no longer be sufficient. Microsoft has implemented security hardening to address the security issues described in CVE-2021-26414. See "KB5004442—Manage changes for Windows DCOM Server Security Feature Bypass (CVE-2021-26414)" for more details.
Recommended values when using DCOM (communication with a remote OPC server) are RPC_C_AUTHN_LEVEL_PKT_INTEGRITY (5) and RPC_C_AUTHN_LEVEL_PKT_PRIVACY (6).

-

2

Sequenced Transactions

Starts the sequencing of calling the function Refresh2 of interfaces Async I/O 2.0 and Async I/O 3.0. The calling executes after the first calling has been finished (after it gets the values).

YES/NO

NO

Repeat Failed Group Activation

Failed OPC group activations will be attempted again after a delay specified by the parameter "Group reactivation delay".

YES/NO

YES

Group Reactivation Delay

A delay after which a failed OPC group activations is repeated if repetition is enabled by the parameter "Repeat failed group activation".

sec

30

Reconnect After Failed Group Activation

When an OPC group activation fails, KOM disconnects from the OPC server and reestablishes a connection. The parameter is relevant in a configuration of redundant OPC servers (after a disconnect from an OPC server follows a reconnect to an alternate OPC server where group activation may be successful).

YES/NO

NO

GetGroupState Period

Period of executing the call of GetGroupState of interface IOPCGroupStateMgt. This synchronous call is repeated periodically and detects the problems which could occur in communication with OPC Server.

sec

10

Accept All GetGroupState Errors

All the errors returned by calling of "GetGroupState" of interface IOPCGroupStateMgt are considered to be fatal (they will result in a disconnect from the OPC server and in a reconnect, or in a restart of the KOM process).

An example of an error message returned by "GetGroupState":
WARNING: Siemens.TXP.OPC caused COM/OPC error 80010108H on IOPCGroupStateMgt::GetState(), Error string : The object invoked has disconnected from its clients.

YES/NO

NO

Stop KOM When OPC Server Fails

Allows stopping the KOM process when a fatal error occurs in communication. See the Note.

YES/NO

NO

Disconnect On Passive

Only the active KOM process (i.e., the active instance connected to the HOT server) communicates with the OPC server. The KOM process, which becomes passive (by changing the active instance or switching the redundancy), closes the connection to the OPC server.
Note: This parameter allows the reduction of the OPC server load in redundant D2000 systems as well as solving problems with license limitation of the number of OPC clients.

YES/NO

NO

Ignore First Invalid

The parameter causes the first value of each I/O tag received after connecting to the OPC server to be ignored if it is invalid (has a 'BAD' status). This parameter was implemented to suppress undesirable behavior of the OPC.SimaticNET server.

YES/NO

NO

Note:

Fatal abort of communication with OPC Server causes the COM/OPC errors at callings:

  • GetGroupState of interface IOPCGroupStateMgt,

  • "Write" of interface IOPCASyncIO2, IOPCASyncIO3, and IOPCSyncIO2,

  • "Read" of interface IOPCASyncIO2, IOPCASyncIO3, and IOPCSyncIO2.

Communication station configuration


Communication protocol: OPC Data Access 2.05 & 3.0

Station address requires:

  • OPC Group Name - maximum string: 80 characters. This name is only formal in most cases and has no direct relation to the addressing scheme of devices communicating with the OPC server. The name of the group must be unique, two stations cannot the same OPC Group Name within one link.

  • Type -  data access type. You can choose one of the Async I/O 2.0, Async I/O 3.0, and Synchronous I/O options. The Async I/O 2.0 option - the asynchronous OPC interfaces IOPCAsyncIO2 and IOPCDataCallback (OnDataChange and OnReadcompleted call-back procedures) are used for data reading. The Synchronous I/O 2.0 option - OPC interface IOPCSyncIO is used. The Async I/O 3.0 option - OPC interfaces IOPCAsyncIO3 and IOPCDataCallback (OnDataChange and OnReadCompleted call-back procedures) are used for value reading of OPC items

  • Create Active - if the option is checked, the OPC group is active and OPC items in this group get values. If the option is not checked, the OPC group and items are initialized, but the OPC items do not get values. It is possible to block the OPC group - station temporarily. The option controls the pActive parameter of SetState call of the OPC interface IOPCGroupStateMgt.

  • Update Rate - it is given in milliseconds and defines the maximum speed of OPC item value changes for the option Async I/O 2.0 or Async I/O 3.0. It is transferred as pRequestedUpdateRate parameter of SetState call of OPC interface IOPCGroupStateMgt. Warning - the information, set in tab Time parameters in dialog window Communication station - configuration dialog box defines the read rate of OPC items.

  • % Deadband - the parameter range is from 0.0 up to 100.0%. The parameter can be only used for an analog type of items and determines the minimal change of the item for sending the value from the server to clients. For calculation, the OPC server uses the range defined by parameters High EU and Low EU, which can be get by using the interface IOPCItemProperties. The default value of this parameter is 0.0. Value of % Deadband is transferred by means of parameter pPercentDeadband of the SetState call of the  OPC interface IOPCGroupStateMgt.
    Note: The protocol OPC Client described in this topic does not support the OPC interface IOPCItemProperties. For further information read up the document listed in the section Literature.

  • Time Bias - If the OPC server and OPC client do not run in the same time zone, the parameter (given in minutes) will be used for the correct calculation of the time of the value of the "timestamp" OPC item. The default value of the parameter is 0 (zero). For further information read up the documents listed in the section Literature.

Station protocol parameters

The following station protocol parameters can be defined:

Name

Description

Unit

Default value

Do Read after Write

Allows verifying the value after the recording by synchronous reading.

YES/NO

NO

Prefer Synchronous Write

Allows writing data into OPC Server only by synchronous interface IOPCSyncIO2.

YES/NO

NO

Prefer VQT Write

Using the Async I/O 3 option allows writing data by WriteVQT function of IOPCASyncIO3 interface (i.e. the write that transfers the quality and the timestamp together with the value).

YES/NO

NO

Full Debug

Activates the debug list. It increases the number of information about the communication operation. It is recommended to use only for the detection of the problems and debugging.

YES/NO

NO

Merz OPC Server Type

Special mode for communication with OPC Servers made by Merz company. The conversion to/from MS DOS Date Time Format (2 x WORD) is used for values of TiA and ToA type.

YES/NO

NO

AddItems Delay

Delay which is artificially inserted between the AddItems callings to slow down the initialization phase.

ss:mss

0

QERR Value

An integer value of the "ERROR" state for conversion into Qi - quaternary input.

0,1,2,3

3

QOFF Value

An integer value of "OFF" state for conversion into Qi - quaternary input.

0,1,2,3

2

QON Value

An integer value of "ON" state for conversion into Qi - quaternary input.

0,1,2,3

1

QTRANS Value

An integer value of "TRANS" state for conversion into Qi - quaternary input.

0,1,2,3

0

Keep Values Valid as Weak

If the quality of the OPC item changes into "BAD", the value of the I/O tag will be valid with a Weak flag.

YES/NO

NO

Don't Repeat Failed AddItems

Blocks the effort to call AddItems which still repeats after its failure.

YES/NO

NO

Do AddItems in Single Call

Activates all the items of a group by a single call. It can speed-up the OPC communication start.

YES/NO

NO

Transaction Timeout

All callings of Write and Refresh2 functions as registered as separate transactions. If they do not end up (successful or unsuccessful) within this timeout, the error message will occur in the trace file of communication.

sec

120

Reconnect/Reinitialization Delay

Timeout, which delays repetitions of failed operation:

  • creation of AddGroup,

  • creation of AddItems (see the SA protocol parameter),

  • repeated connection to OPC Server after it has been stopped or failed or disconnected,

  • creation of groups and items after repeated connection to OPC Server.

sec

5

Do Sync Read Before Write If Unk. Type

Enables synchronous reading of the item value before the writing if the KOM process does not know the item data type (i.e. if there is a default value of data type "Empty/Default (VT_EMPTY)" and if the value must be written).

YES/NO

YES

Status Item Name

Address of OPC Item (OPC Item ID), which contains the OPC server or OPC group error status (e.g. depending on the state of communication). An I/O tag with this address must also be configured.
If the status reports an error, it will affect the values of all I/O tags on the station (they will have the Weak flag set). The Status Item Inverted Operation parameter specifies what value corresponds to the error status.

-

-

Status Item Inverted Operation

Interpretation of the OPC Item Status Item Name with an error status of OPC server or OPC group.
The NO value means that the False or 0 reports the correct state and True respectively non-zero value reports an error.
The YES value means that the False or 0 means the error state and True respectively non-zero value reports correct status.

YES/NO

NO

Map NonSpecific as Flag

Mapping the "Non Specific " OPC DA quality flag into the attributes of the I/O tag value.

None, FA, FB, FC, FD, FE, FF, FG, FH, FI, FJ, FK, FL, FM, FN, FO, FP

None

Map LocalOverride as Flag

Mapping the "LocalOverride" OPC DA quality flag into the attributes of the I/O tag value.

Map ConfigError as Flag

Mapping the "Config Error" OPC DA quality flag into the attributes of the I/O tag value.

Map NotConnected as Flag

Mapping the "Not Connected" OPC DA quality flag into the attributes of the I/O tag value.

Map DeviceFailure as Flag

Mapping the "Device Failure" OPC DA quality flag into the attributes of the I/O tag value.

Map SensorFailure as Flag

Mapping the "Sensor Failure" OPC DA quality flag into the attributes of the I/O tag value.

Map LastKnown as Flag

Mapping the "Last Known" OPC DA quality flag into the attributes of the I/O tag value.

Map CommFailure as Flag

Mapping the "Comm Failure" OPC DA quality flag into the attributes of the I/O tag value./td>

Map OutOfService as Flag

Mapping the "Out Of Service" OPC DA quality flag into the attributes of I/O tag value.

Map WaitingForInitData as Flag

Mapping the "Waiting For Initial Data" OPC DA quality flag into the attributes of I/O tag value.

Map LastUsable as Flag

Mapping the "Last Usable" OPC DA quality flag into the attributes of the I/O tag value.

Map SensorCal as Flag

Mapping the "Sensor Cal" OPC DA quality flag into the attributes of the I/O tag value.

Map EGUExceeded as Flag

Mapping the "EGU Exceeded" OPC DA quality flag into the attributes of the I/O tag value.

Map SubNormal as Flag

Mapping the "Sub Normal" OPC DA quality flag into the attributes of the I/O tag value.

Reconnect After Error Count

If a consecutive number of errors during reading equals the value of this parameter, reinitialization of OPC connection will be performed. Value of zero means that reinitialization will not be performed (default behavior). The current implementation handles only errors in synchronous mode (type setting to "Synchronous I/O" in tab Address of Station object).

-

0

I/O tag configuration


Possible I/O tag types: Ai, Ao, Ci, Co, Di, Qi, Dout, TiA, ToA, TiR, ToR, TxtI, TxtO.

I/O tag address requires to define OPC Item ID (maximum string: 200 characters). If the OPC server supports the IOPCBrowseServerAddressSpace interface, the "OPC Item ID" address may be selected directly from the address list supported by the OPC server (by clicking the "Browse Items..." button, see the Browsing of OPC server address space section.
Note: if the I/O tag's address is specified as %IGNORE, such an I/O tag will be ignored.

Further required parameters (OPC Item Parameters) are:

  • Type - required data type (VARIANT). The default value is Empty/Default (VT_EMPTY), - the OPC server makes a decision on the VARIANT type of the item.

  • Item Active - if the option is checked, the item will be active and get values from the server. The option is transferred by the parameter bActive of the pItemArray structure into the AddItems call of the OPC interface IOPCItemMgt.