OPC-UA Historical Data Streaming

Unified Architecture topics related to OPC UA Specification, compliant behavior and any technical issues of OPC UA, like Security, Information Model, Companion Specs DI, PLCopen, ADI, ...

Moderator: Support Team

Post Reply
dtcsight
Jr. Member
Jr. Member
Posts: 4
Joined: 22 Jan 2022, 02:42

OPC-UA Historical Data Streaming

Post by dtcsight »

Hey there,

I'm using OPC-UA to read historical data from multiple tags (nodes) on a server and this could be any OPC-UA server in the following manner:
* Running "Read History" repeatedly as a data streaming service on a server and incrementing the starttime, endtime range and it'll eventually catch up to the current time.
* I'm merging the data from these different nodes into a tabular format where they all exist in the same row if the timestamp is the same.

A couple of questions:
1. For just a single node, does running "Read History" guarantee that I will retrieve all the recorded data in timestamp order?
2. For reading multiple nodes, is it possible that the data for one node would arrive later than another node? Or would the system guarantee that despite being separate nodes, the data retrieved from all nodes in the system would be guaranteed to be available in order. For example, if I had 2 nodes N1 and N2 where N1 has data coming in every 3 seconds and N2 has data coming in every 2 seconds and it looks like:

N1: t0 t3 t6
N2: t0 t2 t4

Would it be possible that N1 data from t0 to t6 is available but N2 data is still empty when reading history?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: OPC-UA Historical Data Streaming

Post by Support Team »

Hi,
the HistoryRead (raw) service in OPC UA will give you the values of a node in the order you have asked for (from start to end time). So you can read "forward" and "backward" whatever you prefer, depending on how you set the start and end time.

The HistoryRead service allows for interpolated values if you need the value for a certain timestamp (but no concrete value was recorded at that date). However if you ask for "raw" you will get for each node the DataValues in order as requested. In OPC UA we have "DataValue", which is always a tripple set of information (value, time, status).

And no, N2 data will not be empty when N1 was available, except the status of DataValue for N1 was bad at that time.
Best regards
Unified Automation Support Team

Post Reply