Would you like to create a trend or just showing the numeric values? Trends by definition take a time range and show the trend of a number of tags on a graph. A Value Symbol shows the value of a PI tag in numeric format at a specific time. Hope it answers your question.
Have you considered building the data set in Excel using Datalink?
By using the Timed Data function to return the data, you could then use the charting tools in Excel to build your trend\chart.
I am looking for a way to trend the values coming from multiple tags in a single trend in ProcessBook.
Something like trend an array.
Or create a tag that programmatically collects the values from 50 tags at specific time stamp and assign them a new timestamp with 1 min interval.
For example: the real event occurs only 1-2 times a day, if the real event timestamp is 10:00 for all 50 tags then programmatically created tag will write timestamp as follow:
10:01 value coming from tag1
10:02 value coming from tag2
10:50 value coming from tag50
I will have one tag to trend and the time range from 10:01 to 10:50 for the real event that happened at 10:00.
Or some other way that was developed to resolve multi tag trending.
OK so we have multiple tags and also we would like to tweak the time stamps as well as merging them all in one trend/tag. I don't know of an out-of-the-box solution that does all that in one place. I would use PI SDK to get the values from all the tags first. You can retrieve them in the interpolated mode to get the values at the exact timestamp you desire directly from the PI Server (See IPIData2 Interface). Having all the values/timestamps at hand you can push them back into a single PI tag (using UpdateValues method) ready to be trended. There is a nice example of such operations in the PI SDK help file called "UpdateValue / RemoveValue / Annotate Example" under the explanation for PIData object.
Using the trend symbol in PI ProcessBook will be difficult to create a trend that trends values from multiple tags at the same time. I would agree with Barry that we should consider alternatives.
Instead of plotting the chart in Excel, you can also add the Microsoft Office Chart control into PI ProcessBook, Then we can set the layout, chart type and value that the chart is supposed to display in VBA. I think you will need Microsoft Excel installed on the same machine to be able to do this.
Here's a code snippet that shows how you can do that:
Private Sub CommandButton1_Click()
Dim c As ChChart
Set c = ChartSpace1.Charts.Add
Set chConstants = ChartSpace1.Constants
arrSeriesName(0) = "Trend Tag Value at Same Time"
arrTagnames(1) = "CDT158"
arrTagnames(2) = "SINUSOID"
arrTagnames(3) = "BA:Level.1"
arrValue(1) = 100
arrValue(2) = 92
arrValue(3) = 123
c.Type = chChartTypeLine
c.HasLegend = True
c.SetData chDimSeriesNames, chConstants.chDataLiteral, arrSeriesName
c.SetData chDimCategories, chConstants.chDataLiteral, arrTagnames
c.SeriesCollection(0).SetData chConstants.chDimValues, chConstants.chDataLiteral, arrValue
Of cause, the code snippet assumes that we already have the tagnames and values we want to plot, You will have to figure out how you should be setting the timestamp to view the trend and how to get the tags as well as their values at that time (by PI SDK perhaps?).
I've posted a sample PDI file on this as well. Hope this helps
vbaaddchart.pdi 28.5 KB
Thanks for all replies.
I see a problem of using the scrolling or playback function with Excel chart or Microsoft Office Chart in PB.
This type of charting is better handled by our PI Profile client app - here is a visual:
The bars show the tag value, horizontal is the 50 or however many tags you want to plot, vertical is the time scale that you can scroll.
Can you please expand a little bit on your exact use case? What kind of values do your 50 tags hold?
My 50 tags report the profile deviation (-50; 50) from target value or zero. I built an alike visual by putting bar graphs for each tag together.
Could you please send me a link to download PI Profile apps.
PI ProfileView is not part of the vCampus products kit; you can get access to the product's information through OSIsoft Tech Support page for the product. You would need to obtain the product as a separate client tool.