Data Acquisition and Active State Behavior


The following tables summarize the expected behavior of OPC servers and OPC clients with respect to the Group and Item Active flags, Reads and Subscriptions, and CACHE and DEVICE data.

The first column (Function) is the short hand notation for the external functions that an OPC client application calls and the OPC server implements. The Source Column is the source from which the client wants the data to be obtained (either device or cache). The Enable Column indicates the callback enable state as set by AsyncIO2::SetEnable. The Group Column is the active state of the group.. The Item Column is the active state of the Item. The Behavior Column is the behavior for this configuration state.

Certain Quality values are identified in the table and reflect required behavior with respect to the active state of groups and items. In all other cases, the server may return quality values as appropriate to communicate the current state of the data to the client.

The information in this table is also applicable to the automation interface.

Additional Notes:

Refresh is a special case of subscription, where refresh forces an OnDataChange call for all active items.

It is expected that most clients will use either Reads or Subscriptions for a particular group but not both. If both are used then there is some interaction between Reads and Subscriptions in that anything sent to the client as a result of a ‘read’ is also considered to be the ‘last value sent’.

A transition from Inactive to Active will result in a change in quality, and will cause a subscription callback for the item or items affected. A change (in the group or item) from Active to Inactive will cause a change in quality but will not cause a callback since by definition callbacks do not occur for inactive items. That is, if you later do an explicit read (sync or async) of an inactive group or item you will get a quality indicating that the item is inactive.
 
 

IOPCSyncIO
Interface ::Method
Source
Enable
Callbacks
Group
Active
State
Item 
Active
State
Server Behavior 
           
IOPCSyncIO::Read 
Cache
NA
Active
Active
The Values and Quality for the requested items are returned to the client as return values from the method. The Value and Quality are the values that the server has in cache.
           
IOPCSyncIO::Read 
Cache
NA
Active
InActive
A Quality of OPC_QUALITY_OUT_OF_SERVICE for the requested items is returned to the client as return values from the method.
           
IOPCSyncIO::Read 
Cache
NA
InActive
NA
A Quality of OPC_QUALITY_OUT_OF_SERVICE for the requested items is returned to the client as return values from the method.
           
IOPCSyncIO::Read 
Device
NA
NA
NA
The Values and Quality for the requested items are returned to the client as return values from the method. The Value and Quality are the values that the server obtains from the device when this method is called. The cache of the server should be updated with the acquired value and quality.

 

IOPCASyncIO2
Interface ::Method
Source
Enable
Callbacks
Group
Active
State
Item 
Active
State
Server Behavior 
           
IOPCAsyncIO2::Read
NA
NA
NA
NA
The Values and Quality for the requested items are sent to the client through the IOPCDataCallback::OnReadComplete method. The Value and Quality are the values that the server obtains from the DEVICE when this method is called. The CACHE of the server should be updated with the acquired value and quality.
Interface ::Method
Source
Enable
Callbacks
Group
Active
State
Item 
Active
State
Server Behavior 
           
IOPCAsyncIO2::Refresh
Cache
NA
Active
Active
The Values and Quality for all the Active items in the group are sent to the client through the IAdviseSink::OnDataChange method. The Value and Quality are the values that the server has in cache. 
           
IOPCAsyncIO2::Refresh
Cache
NA
Active
InActive
The Values and Quality for all the InActive items in the group are not provided to the client. If there are no Active Items in the group then the server returns E_FAIL as the return value from the call.
           
IOPCAsyncIO2::Refresh
Cache
NA
InActive
NA
The server returns E_FAIL as the return value from the call.
           
IOPCAsyncIO2::Refresh
Device
NA
Active
Active
The Values and Quality for all items in the group are sent to the client through the IOPCDataCallback::OnDataChange method. The Value and Quality are the values that the server obtains from the device when this method is called. The cache of the server should be updated with the acquired values and qualities.
           
IOPCAsyncIO2::Refresh
Device
NA
Active
InActive
The Values and Quality for all the InActive items in the group are not provided to the client. If there are no Active Items in the group then the server returns E_FAIL as the return value from the call.
           
IOPCAsyncIO2::Refresh
Device
NA
InActive
NA
The server returns E_FAIL as the return value from the call.
           

 
 
 

SUBSCRIPTION via IOPCDataCallback

OnDataChange
Interface ::Method
Source
Enable
Callbacks
Group
Active
State
Item 
Active
State
Server Behavior 
           
Subscription via IOPCDataCallback::
OnDataChange
NA
TRUE
Active
Active
The Value and Quality are the values that the server obtains from the device at a periodic rate sufficient to accommodate the specified UpdateRate. If the Quality has changed from the Quality last sent to the client, then the new value and new quality will be sent to the client through the IOPCDataCallback::OnDataChange method, and the cache of the server should be updated with the acquired value and quality. If the Quality has NOT changed from the Quality last sent to the client, the server should compare the acquired value for a change that exceeds the Deadband criteria. If the change in value exceeds the deadband criteria, , then the new value and new quality will be sent to the client through the IOPCDataCallback::OnDataChange method, and the cache of the server should be updated with the acquired value and quality.
           
Subscription via IOPCDataCallback::
OnDataChange
 
TRUE
Active
InActive
Server only acquires values from physical data sources for active items.
           
Subscription via IOPCDataCallback::
OnDataChange
 
TRUE
InActive
NA
Server only acquires values from physical data sources for active items that are contained in active groups.
           
Subscription via IOPCDataCallback::
OnDataChange
NA
FALSE
Active
Active
The Value and Quality are the values that the server obtains from the device at a periodic rate sufficient to accommodate the specified UpdateRate. If the Quality has changed from the Quality in the cache, then the cache of the server should be updated with the acquired value and quality. If the Quality has changed from the Quality in the cache, the server should compare the acquired value for a change that exceeds the Deadband criteria. If the change in value exceeds the deadband criteria, , then the cache of the server should be updated with the acquired value and quality.
           
Subscription via IOPCDataCallback::
OnDataChange
NA
FALSE
Active
InActive
Server only acquires values from physical data sources for active items.
           
Subscription via IOPCDataCallback::
OnDataChange
NA
FALSE
InActive
NA
Server only acquires values from physical data sources for active items that are contained in active groups.

 
 
 

IOPCASyncIO (old)
Interface ::Method
Source
Enable
Callbacks
Group
Active
State
Item 
Active
State
Server Behavior 
           
IOPCAsyncIO::Read 
Cache
NA
Active
Active
The Values and Quality for the requested items are sent to the client through the IAdviseSink::OnDataChange method. The Value and Quality are the values that the server has in cache. 
           
IOPCAsyncIO::Read 
Cache
NA
Active
InActive
A Quality of OPC_QUALITY_OUT_OF_SERVICE for the requested items is sent to the client through the IAdviseSink::OnDataChange method.
           
IOPCAsyncIO::Read 
Cache
NA
InActive
NA
A Quality of OPC_QUALITY_OUT_OF_SERVICE for the requested items is sent to the client through the IAdviseSink::OnDataChange method.
           
IOPCAsyncIO::Read 
Device
NA
NA
NA
The Values and Quality for the requested items are sent to the client through the IAdviseSink::OnDataChange method. The Value and Quality are the values that the server obtains from the device when this method is called. The cache of the server should be updated with the acquired value and quality.
Interface ::Method
Source
Enable
Callbacks
Group
Active
State
Item 
Active
State
Server Behavior 
           
IOPCAsyncIO::Refresh
Cache
NA
Active
Active
The Values and Quality for all the Active items in the group are sent to the client through the IAdviseSink::OnDataChange method. The Value and Quality are the values that the server has in cache. 
           
IOPCAsyncIO::Refresh
Cache
NA
Active
InActive
The Values and Quality for all the InActive items in the group are not provided to the client. If there are no Active Items in the group then the server returns E_FAIL as the return value from the call.
           
IOPCAsyncIO::Refresh
Cache
NA
InActive
NA
The server returns E_FAIL as the return value from the call.
           
IOPCAsyncIO::Refresh
Device
NA
Active
Active
The Values and Quality for all items in the group are sent to the client through the IAdviseSink::OnDataChange method. The Value and Quality are the values that the server obtains from the device when this method is called. The cache of the server should be updated with the acquired values and qualities.. 
           
IOPCAsyncIO::Refresh
Device
NA
Active
InActive
The Values and Quality for all the InActive items in the group are not provided to the client. If there are no Active Items in the group then the server returns E_FAIL as the return value from the call.
           
IOPCAsyncIO::Refresh
Device
NA
InActive
NA
The server returns E_FAIL as the return value from the call.

 
 
 

SUBSCRIPTION via IDataObject (old)
Interface ::Method
Source
Enable
Callbacks
Group
Active
State
Item 
Active
State
Server Behavior 
           
Subscription via (IDataObject::DAdvise) & (IAdviseSink::OnDataChange)
NA
NA
Active
Active
The Value and Quality are the values that the server obtains from the device at a periodic rate sufficient to accommodate the specified UpdateRate. If the Quality has changed from the Quality last sent to the client, then the new value and new quality will be sent to the client through the IAdviseSink::OnDataChange method, and the cache of the server should be updated with the acquired value and quality. If the Quality has NOT changed from the Quality last sent to the client, the server should compare the acquired value for a change that exceeds the Deadband criteria. If the change in value exceeds the deadband criteria, , then the new value and new quality will be sent to the client through the IAdviseSink::OnDataChange method, and the cache of the server should be updated with the acquired value and quality.
           
Subscription via (IDataObject::DAdvise) & (IAdviseSink::OnDataChange)
NA
NA
Active
InActive
Server only acquires values from physical data sources for active items.
           
Subscription via (IDataObject::DAdvise) & (IAdviseSink::OnDataChange)
NA
NA
InActive
NA
Server only acquires values from physical data sources for active items that are contained in active groups.