16:00, EET
December 9, 2024
I created the following sample object tree to verify Historical Access using Prosys OPC UA Simulation Server.
Sample::FolderType
└Terminal001::FolderType
└Terminal001.FICS-AW0001::BaseObjectType
├NodeId ns=3;s=Terminal001.FICS-AW0001.PV::BaseDataVariableType①
└NodeId ns=3;s=Terminal001.FICS-AW0002.PV::BaseDataVariableType②
In the Value tab of ①, I set the simulation Value Type to Counter.
In the Value tab of ②, I set the simulation Value Type to Constant (123.0).
The version of Prosys OPC UA Simulation Server I am using is as follows.
Product Version 5.4.6-18
SDK Version 4.10.4.-14
I defined ReadRawModifiedDetails as follows, and used UaClient.historyRead() to get historical data from the Prosys OPC UA Simulation Server.
The following sdk is used:
prosys-opc-ua-sdk-client-5.2.8-159.jar
When I retrieved historical data under these conditions, I was able to retrieve data for ①Terminal001.FICS-AW0001.PV, which had changes in the data, but I was unable to retrieve data for ②Terminal001.FICS-AW0002.PV, which had no changes in the data.
ReadRawModifiedDetails
ReadRawModifiedDetails details = new ReadRawModifiedDetails(false,
startTime,
endTime,
UnsignedInteger.valueOf(200),
true);
HistoryReadResult[] results = client.historyRead(details,
TimestampsToReturn.Source,
false,
nodesToRead);
https://reference.opcfoundation.org/Core/Part11/v104/docs/6.4.3
According to this URL, ReadRawModifiedDetails
“Specifies the details used to perform a “raw” or “modified” history read.”
There is no mention that unchanged data cannot be read.
Is it because the implementation of Prosys OPC UA Simulation Server is such that unchanged data (Constant(123.0)) cannot be read?
Thanks,
Miya
10:03, EET
Moderators
February 11, 2020
Hello,
Simulation Server version 5.4.6 is already rather old. We would recommend you to update to the newest version, which is 5.5.2.
I’m not certain if Nodes with Constant Simulation support reading history in the version you’re currently using, but I checked that the newest version does support that. Just make sure that the timestamp of the Node with constant value is within the time range specified for reading history and Simulation Server should return that value.
15:21, EET
December 9, 2024
Hello Matty,
I am very grateful for your quick response.
Based on your advice,
I changed to Prosys OPC Simulation Server version 5.5.2.
Unfortunately, the phenomenon did not change.
This time I am repeatedly collecting data for Constant Value Parameters every minute.
After further verification, I found that when I changed the Initial Value of Value Parameters in the Value tab of Simulation Server from 123.0 to 123.1,
or changed the Array Size from 0 to 1,
I was able to obtain data only for that one time.
Judging from that situation, I suspect that only data that is constantly changing, such as Value Type being Counter, can be obtained.
The Prosys OPC Simulation Server I use is the Free Edition,
but are there any restrictions such as not being able to obtain data that does not change with the Free Edition?
Thanks,
Miya
15:44, EET
Moderators
February 11, 2020
Hello,
Can you be more specific on what you mean with “This time I am repeatedly collecting data for Constant Value Parameters every minute”? Are you reading history once every minute? What is the range defined by startTime and endTime for these reads?
The are no limitations in the Free Edition that would change how reading history works for a Node with Constant Simulation.
If the initial Value of the Node with Constant Simulation is not in the range of the history read, it is to be expected that you won’t receive it while reading history for that range. The fact that you get data after you have changed the Value of the Node might suggest that the range of your history read operation just doesn’t typically contain any Values, which is completely normal, if the Value hasn’t changed on the time period covered by the range.
Note, that Constant Simulation is not like other Simulation types that would generate history based on the Simulation parameters. For Nodes with Constant Simulation, history contains only the Values of the Node either set in Simulation Server or written by Clients.
3:21, EET
December 9, 2024
Hello Matty,
> Can you be more specific on what you mean with “This time I am repeatedly collecting data for Constant Value Parameters every minute”?
> Are you reading history once every minute?
> What is the range defined by startTime and endTime for these reads?
As you say, the history is read once every minute.
The startTime and endTime are specified for the most recent minute.
I can read 60 pieces of fluctuating data, such as Counter.
I cannot obtain static data, such as Constant (123.0).
When I check with the VSCode debugger, the DataValues are empty, as shown below.
HistoryReadResult@157 “HistoryReadResult [StatusCode=”GOOD (0x00000000) “The operation succeeded.””, ContinuationPoint=”null”, HistoryData=”ExtensionObject [typeId=null, encodeType=null, object=HistoryData [DataValues=”[]”]]”]”
> The are no limitations in the Free Edition that would change how reading history works for a Node with Constant Simulation.
I’ve got it.
> If the initial Value of the Node with Constant Simulation is not in the range of the history read
I don’t understand this part. In this case, does the range mean the time range of the most recent minute?
I’m using ReadRawModifiedDetails and UaClient.historyRead() to obtain historical data, but
can ReadRawModifiedDetails obtain data that has not changed over the last minute?
Is my understanding correct in the first place?
I’m coming to the conclusion that it may not be possible to obtain historical data that has not changed using ReadRawModifiedDetails and UaClient.historyRead().
Am I wrong?
Thanks,
Miya
11:43, EET
April 3, 2012
Hi,
The ‘Constant’ value simulation behaves differently than the other signals. The name choice could maybe be better (history-wise ‘Point’ would be more descriptive). All other signals define a function of time, which is then (also) used in HistoryRead to simulate (potentially infinite amounts of) history data for given node (based on the simulation interval). Constant value only has a single datapoint i.e. when that value was given in the UI (or after a restart the time of start). If you change the value for the constant node, then the previous value is stored in a memory-only history buffer (upto 10000 last values). One use-case is that you could potentially use another Client to write values in order to produce more advanced simulations.
Also, seems we might have a bug regarding the “Bounding Values” (https://reference.opcfoundation.org/Core/Part11/v105/docs/4.6) that you set to true in the ReadRawModifiedDetails (the last parameter). Thus, if there are no values in the given range, we return 0 values (when per spec instead we should read e.g. the start bound before the given range as the boundary value, since there was no value for that exact timestamp).
13:59, EET
December 9, 2024
Hello Bjarne,
> All other signals define a function of time, which is then (also) used in
> HistoryRead to simulate (potentially infinite amounts of) history data for
> given node (based on the simulation interval).
I’ve got it.
> Constant value only has a single datapoint i.e. when that value was given in
> the UI (or after a restart the time of start).
> If you change the value for the constant node, then the previous value is
> stored in a memory-only history buffer (upto 10000 last values).
I’ve got it.
> One use-case is that you could potentially use another Client to write values
> in order to produce more advanced simulations.
Yes, there is a way to do that.
However, since I only needed to read data that didn’t change,
I set the Value Type on the Value tab to Square, retrieved the trapezoid graph data,
and was able to successfully read the data that didn’t change.
***** ***** ***** ****
* * * * * *
***** ***** *****
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:13.0000000 GMT (1734089340), 2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:14.0000000 GMT (1734089340), 2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:15.0000000 GMT (1734089340), 2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:16.0000000 GMT (1734089340), -2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:17.0000000 GMT (1734089340), -2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:18.0000000 GMT (1734089340), -2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:19.0000000 GMT (1734089340), -2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:20.0000000 GMT (1734089340), -2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:21.0000000 GMT (1734089340), 2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:22.0000000 GMT (1734089340), 2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:23.0000000 GMT (1734089340), 2.0
Terminal001.FICS-AW0002.PV , GOOD , 12/13/24 11:29:24.0000000 GMT (1734089340), 2.0
I was able to dispel my concerns that ReadRawModifiedDetails and UaClient.historyRead()
might not be able to retrieve unchanged historical data.
> Also, seems we might have a bug regarding the “Bounding Values”
> (https://reference.opcfoundation.org/Core/Part11/v105/docs/4.6) that you set
> to true in the ReadRawModifiedDetails (the last parameter).
>
> Thus, if there are no values in the given range, we return 0 values (when per
> spec instead we should read e.g. the start bound before the given range as
> the boundary value, since there was no value for that exact timestamp).
Understood, thank you for the useful information.
Thank you both.
Thanks,
Miya
Most Users Ever Online: 1919
Currently Online:
17 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 726
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_galleryModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1