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: 1009
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
Moderator
Members

Moderators
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: 518

Currently Online: Matti Siponen, atdemir
17 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 679

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1