Overview

The following topics details IOPCDataCallback::OnDataChange() OPC method invoked in the ##TSEventsGroup##.

An item in the ##TSEventsGroup## is notified with a value, time, and quality parameter described in the following topics.

Value

Value is the event value (Value field in the event data format) converted to VT_BOOL.

Time

Time is the event time stamp (DateAndTime field in the event data format) converted to FILETIME.

The following conversion is applied to the time stamp: pftTimeStamps = 10 000 000 * (DateAndTime.SecondSinceEpoch + 11 644 473 600 + (DateAndTime.FractionOfSecond * 2 power –24))

NOTE: If the Quality of an event indicates a ClockFailure value, the Time field is patched by OFS with the local time of the OFS machine.

Quality

Quality is a WORD and it is the combination of the event time quality and standard OPC quality.

Quality format:

  • Byte 0: OPC Quality

  • Byte 1: TimeQuality (TimeQuality field in the event data format).

OPC_Quality value:

  • OPC_QUALITY_BAD or QUAL_CONFIGURATION_ERROR (04 hex): A configuration error is detected on the item (unknown event source for example)

  • OPC_QUALITY_GOOD (C0 hex): Normal working condition.

OnDataChange() Handle Management

Please note that a SOE notification differs from a classical real-time data notification.

The following table illustrates a series of data that could be modified:

Handle

Value

Quality

TimeStamp

H1

0

TimeQuality1

T1

H1

1

TimeQuality2

T2

H2

0

TimeQuality3

T3

H1

0

TimeQuality4

T4

H2

1

TimeQuality5

T5

A series of results dealing with a same handle might be provided.

To respect the TimeStamp values order for a given handle, the OPC client has to process the array (that contains: Handle, Value, Quality and Time) results in its original order (first array element to last array element).