|
|
Rank: Newbie Groups: Member
Joined: 1/10/2012 Posts: 2 Location: Russia
|
Hello! I have 2 trend on my display. How can i get all tag values from first and second trends, and put it into table (p.e. listview). I need a VBA solution for my task.
And sorry for my bad english.
|
|
|
|
|
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.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
You do realize that if you right-click on the trend in run time and you select "Details and Annotation" the data will be displayed in tabled format which you can then export if needed, or do you want to achieve something else.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
Sorry for the double post, but is there only one or multiple plots per trend? Do you require archive or sampled data (evenly spaced data), there is a lot you will need to think about before starting to write the code, must the table update as the user changes time range is but one of them I can think of.
|
|
|
Rank: Newbie Groups: Member
Joined: 1/10/2012 Posts: 2 Location: Russia
|
Thanks for reply, Squatty!
The method you describe is not good for me, becaurse i need then for button click work with array of data from plots. I need a VBA solution to extrackt data from plot, but i dont know how do that. There only one plots per trend. I requared data from some time period, p.e. 18-01-2011 - 01.01.2012.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
nexys
I would strongly advise you to read the PI-SDK help file as well as the ProcessBook VBA help, I was in the same position where you are now 6 month ago, not knowing where to start, but both these files have a comprehensive help as well as examples for VBA as well as SDK.
Do you require a listview for each trend, or do you want to "combine" data from all plots into one listview? Will you be viewing process or manual data? Showing data in a listview is one thing, but what is your intention with the data once it is in the list?
I can't be of much help unless I have more detail and also keep in mind that I'm doing this during working hours. Also note that it is Sunday, I have sunburn, 2nd cup of coffee and half asleep....zzzzzzz.
|
|
|
Rank: Advanced Member Groups: Member
Joined: 5/28/2009 Posts: 75 Location: Cheshire, UK
|
nexys, do you have Excel & the PI DataLink AddIn? Those two combined will provide what you need I'm sure. MilesUK ProcessBook v3.0.15.3
|
|
|
Rank: Member Groups: Member
Joined: 1/24/2012 Posts: 10 Location: mjcordeiro
|
Hello, I thing this will help you. I done it using VBA in EXCEL. Quote: Dim svr As PISDK.Server Dim pt As PISDK.PIPoint Dim vals1 As PISDK.PIValues Dim v As PISDK.PIvalue Dim st1, en1 As Date Dim itvl, variavel, i As Integer itvl = 5 'Interval (in seconds) Set svr = PISDK.Servers(YOURSERVER) svr.Open Variavel = "YOUR_PI_VARIABLE" Set pt = svr.PIPoints(Variavel) st1 = "yyyy-mm-dd hh:mm:ss" en1 = "yyyy-mm-dd hh:mm:ss" Set vals1 = pt.Data.InterpolatedValues(st1, en1, DateDiff("s", st1, en1) / itvl)
For Each v In vals1
Each_Value_Is_Here = v.Value
Next v
|
|
|
|
Guest
|