Skip navigation
All People > Jerome Lefebvre > Jerome Lefebvre のブログ > 2019 > April
2019

To export a large amount of data out of a our PI System, the Integrators and our APIs are the way to go.

But, sometime you want to export just a few historical values, say the hourly values for the past 12 hours of tag.

This was always been possible by using either several attributes (one per value) or building up a string (using PrevVal and PrevEvent) that contained all the values you wanted.

I want to show that this has been a bit easier to write down using the new Array methods.

 

To create event frames I will be using the "Event Frame Generation" type of analyses.

To retrieve the values, say hourly values for the last 4 hours, I will use the InterpolatedValues method.

I will then have two output variables, one that stores the time stamps and one that stores all the values.

This is done using the usual array access, Values[4], and the TimeStamp function. To build my string, I will use the Text method.

 

Here are the equations themselves:

Where I retrieve values 1 through 5 of my array.

 

And here is the resulting attributes values.

You can do a bit formatting of the values by using the MapData and Format methods.

 

 

Not that array access outside of the length of the array will lead to the calculation failing, thus, this works best with InterpolatedValues or RecordedValuesByCount functions.

牛島