Operating Instructions
Appendix B – Device Versus Cache Reads
Siemens Building Technologies, Inc. 41
Appendix B – Device Versus Cache Reads
When an OPC client creates a group and adds items to it, the OPC server attempts to retrieve values for
active items from its data source. Internally, the OPC client maintains a data "cache," which it attempts to
update at least as fast as indicated by the update rate of the group. The server optimizes regular
communication with its data source for best performance while keeping the cache "fresh."
However, the need may arise to retrieve real-time values directly from the data source, bypassing the
regular optimization routines of the CACHE and the time delays they might impose. OPC provides the
means to do this using DEVICE reads through either synchronous or asynchronous I/O.
DEVICE reads may be performed at any time on specific items in a group. They ignore the update rate
and active state of the group or items involved. Due to the fact that they by-pass normal optimization
routines, reads from DEVICE should be used sparingly as they can incur a severe performance penalty in
the server.
A scenario where a synchronous read from DEVICE might be useful is in the case of a utility for altering
a series of set points in a device. The client application can create an inactive group with the desired items
and perform a DEVICE read. When the call completes, the item values are as current as possible. The
utility can then display the values, allow the user to alter them, and synchronously write them out to the
device. This can be followed by a second DEVICE read to ensure that the values were properly written.
If a DEVICE read is not used, it can take some time before the server receives the first values for the
group after it is activated. Additionally, there is no guarantee that the values would all arrive in the same
update. A DEVICE read ensures that the values all arrive at the same time.
Technically, write operations are always DEVICE writes. However, there is no point in writing to the
CACHE, so this terminology is redundant.