Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Historical Data Access in simulation server
December 13, 2016
17:29, EET
Avatar
Tony56
Member
Members
Forum Posts: 7
Member Since:
December 13, 2016
sp_UserOfflineSmall Offline

Hello,

Hi all,
I have to get the past(historic) data from the server. my program is running in client java sdk, and my server is prosys. I checked with prosys client to get the historical data from the server its working fine. i used the codes in the client document.

CODE:
1) HistoryReadDetails details = new ReadRawModifiedDetails(false,DateTime.MIN_VALUE, DateTime.currentTime(),UnsignedInteger.MAX_VALUE, true);
HistoryReadValueId nodesToRead = new HistoryReadValueId(new NodeId(5, “square1”), null,QualifiedName.DEFAULT_BINARY_ENCODING, null);
HistoryReadResult[] result = client.historyRead(details,TimestampsToReturn.Both, true, nodesToRead);
System.out.println(result);

2) DataValue[] result = client.historyReadRaw(new NodeId(5, “square1”),DateTime.MIN_VALUE, DateTime.currentTime(),UnsignedInteger.MAX_VALUE, true, null, TimestampsToReturn.Source);
System.out.println(result);

O/P: when i run this i am getting output as following
1) ” [Lorg.opcfoundation.ua.core.HistoryReadResult;@5609159b”
2) [Lorg.opcfoundation.ua.builtintypes.DataValue;@17a7f733

suggest me a right way to do!!Cool
Thanks

December 13, 2016
17:55, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Since the values are arrays, you have to use the standard Java method ‘Arrays.toString(result)’ instead of plain ‘result’ to see the values of the elements.

Or you can loop the array yourself and display each element on a separate line, which will produce a nicer output.

December 14, 2016
12:55, EET
Avatar
Tony56
Member
Members
Forum Posts: 7
Member Since:
December 13, 2016
sp_UserOfflineSmall Offline

Hi Jouni,

Thanks for the reply. I did looping concept as you said, i have a question for you.

1) Can we set the time period (start and end) in my client program for accessing the data from the history.
2) or we should specify those condition in simulation server.

Thanks!!

December 14, 2016
14:26, EET
Avatar
Heikki Tahvanainen
Member
Members
Forum Posts: 402
Member Since:
April 17, 2013
sp_UserOfflineSmall Offline

Hello,

You should specify the time period in the client application when reading history. For example, in your own example you are setting these values to DateTime.MIN_VALUE and DateTime.currentTime().

The Javadoc of UaClient.historyReadXxx convenience methods contains documentation about these parameters.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
52 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_gallery

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1