YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Getting Compressed Data (Start Time/Number) and (Start Time/End Time) Options · View
dinoken
#1 Posted : Wednesday, November 25, 2009 10:04:38 PM
Rank: Member

Groups: Member

Joined: 11/25/2009
Posts: 11
Location: Aberdeen
Hi All!

This forum is truly so so exciting! Applause I have been search high and low for such a forum for such a long time!

I am new to PI-SDK but have a few years experience in VB.Net. After testing and using some code on this site, i have managed to connect, list tags in a listbox, show snapshot value and extract an archive value.

However, I am looking to get compressed data of one tag and to use that time stamp to load up an archive value of another tag.

How do I do it? How does the PI-SDK handle an array of data?

Any help will be greatly appreciated.

Cheers

Ken
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
dinoken
#2 Posted : Thursday, November 26, 2009 7:19:23 AM
Rank: Member

Groups: Member

Joined: 11/25/2009
Posts: 11
Location: Aberdeen
Is .RecordedValues the same as Compressed data?
RJK Solutions
#3 Posted : Thursday, November 26, 2009 9:02:36 AM
Rank: Administration

Groups: Administration

Joined: 6/20/2008
Posts: 617
Location: Cheshire, United Kingdom.
Hi Ken,

Welcome to the forum!

RecordedValues will give you the values that are stored in the PI data archives - if you have compression switched on for a tag then the value retrieved will be those that passed exception/compression.

In short, yes this is the call you need - as you probably spotted there is also RecordedValuesByCount.

How to use them (where variale P & OtherP = PISDK.PIPoint)...

Code:

Dim PV As PISDK.PIValue
Dim PVS As PISDK.PIValues
Set PVS = P.Data.RecordedValues("*-1d", "*")
For Each PV In PVS
    Dim OtherPV As PISDK.PIValue
    Set OtherPV = OtherP.Data.ArcValue(PV.TimeStamp, rtAtOrBefore)
Next PV


In the above, you get values for one tag and for each value retrieved you get an archive value for another tag. Just note the Retrieval Type Constant that you need to use, I just use At or Before the timestamp passed.

Cheers,

Rhys.
Principal Consultant
Real-Time Data Management @ Wipro Technologies
dinoken
#4 Posted : Thursday, November 26, 2009 12:53:32 PM
Rank: Member

Groups: Member

Joined: 11/25/2009
Posts: 11
Location: Aberdeen
I have noticed that while calling a huge amount of data, the program tends to freeze (white screen) this happens to PI-Datalink and PI-Processbook. Does anyone have experience in using Background worker to run those threads so that the program will not freeze up?

Do you know by any chance what is the size limit in terms of datapoints i can pull our using this method? If i want to get the compressed data for 10years, is that too much for this subroutinue?
dinoken
#5 Posted : Thursday, November 26, 2009 12:54:21 PM
Rank: Member

Groups: Member

Joined: 11/25/2009
Posts: 11
Location: Aberdeen
Oh and by the way Rhys,

This is an AWESOME forum and I look forward to contributing to it.

RJK Solutions wrote:
Hi Ken,

Welcome to the forum!

RecordedValues will give you the values that are stored in the PI data archives - if you have compression switched on for a tag then the value retrieved will be those that passed exception/compression.

In short, yes this is the call you need - as you probably spotted there is also RecordedValuesByCount.

How to use them (where variale P & OtherP = PISDK.PIPoint)...

Code:

Dim PV As PISDK.PIValue
Dim PVS As PISDK.PIValues
Set PVS = P.Data.RecordedValues("*-1d", "*")
For Each PV In PVS
    Dim OtherPV As PISDK.PIValue
    Set OtherPV = OtherP.Data.ArcValue(PV.TimeStamp, rtAtOrBefore)
Next PV


In the above, you get values for one tag and for each value retrieved you get an archive value for another tag. Just note the Retrieval Type Constant that you need to use, I just use At or Before the timestamp passed.

Cheers,

Rhys.

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.