I wish to programatically generated trends from an XML file in ProcessBook, is it possible to do so?
Are you wanting to read an XML file that has information about what is to be trended and then dynamically generate PB trends?
If so, you could do this within the VBA code for ProcessBook. For reading the XML, you could use standard file io (no XML reader commands) and PB has vba classes to create trends dynamically.
For help on PB VBA, open the help menu while in ProcessBook (in display, no VBA) and you will see ProcessBook Programmers Reference. The class you are interested in is trend. And there is an example of how to add one programmatically.
Thanks for your response. I was able to make a headway in this direction and able to write small piece of code via Excel to achieve it. My basic strategy is to try some things manually on processbook and then try it using programming. This helps me to identify the object model and functionalities very easily.
During such a venture i have come across an area where i needed to have multi- plot display viz. temperatures, pressure, valve modes etc plotted in groups as per their scales in a single trend. However i am unable to find a property / method in code to achieve this.
Request your kind help
If by multi plot, you mean have multiple lines on within a single plot, using the trend class, there is an AddTrace method. Multiple traces can be added. If they need have their own scale, there is a MultipleScales property. Check out the trends class info in the PI ProcessBook Programmer Ref Guide, it has a good explanation.
If you instead are wanting to plot one variable vs another variable, you need an XYPlot. It is also scriptable. It is a little different in that is has a Definition class. Essentially you will create a new xyplot definition object first, assign properties (such as tags) and then assign it to an xyplot object.
Yes, it should be possible to create trends in PI ProcessBook using code in an Excel spreadsheet.
As Brian mentioned the Programmer's Reference holds information on how to do this.
Inside the directory PIPC \ HELP \ en you will find the file PITRENDAUTO.HLP.
This is the Programmer's Reference PI Trend Control which describes how to use VBA with PITrends. It also provides some examples.
Hope this helps.
Retrieving data ...