13 Replies Latest reply on Dec 5, 2017 10:24 PM by ian.d.gore

    Building a PI Vision display using indirection


      Hi Everyone,


      I have a complex display I want to build in PI Vision.  To support the display I have created an element that gets it's data from other elements depending on the configuration in the display element. I'm using substitution syntax to get the indirection I need.


      I have this basically working fine in PI System Explorer.  I use a PI Point data reference that uses subsitution to create the attribute path I need to get the data from - like this



      So when the name of the product changes in NAME, the STOCK attribute automatically updates to point at the new path and picks up the data I want.   Works fine - exactly what I wanted.


      Then in a classic "bang my head on the table" moment, I built a value symbol on my display in PI Vision - and it didn't work.  Because PI Vision treats my attribute path as a PI Tag name and fails to find it:




      I've had a similar problem in the past and managed to use StringBuilder to get round it.  But in this case StringBuilder doesn't seem to handle the two level indirection (first to build the path and then to follow the path) needed to get at the value.


      I haven't tried using analytics yet to see if I can get round the problem.


      Has any one else tried to do this?  Is there a trick I'm missing?

        • Re: Building a PI Vision display using indirection

          I could reproduce this issue. It seems that Vision gets the configuration string with the attribute path, but interprets this as the PI Tag name, as you described.


          A workaround I found would be to reference the attribute you configured in another attribute using String Builder with the syntax to get the attribute value (the configuration string would look like this: 'STOCK';).

          • Re: Building a PI Vision display using indirection

            Hi Ian,


            Substitution parameters are resolved only at the time the data reference is loaded, please refer to this section of the PI System Explorer user guide: PI Server


            Having an attribute with a dynamically changing configuration string that auto-updates isn't currently supported in PI AF.


            I've seen customers work around this using a Formula data reference with an IF statement. This does however require that all possible PI Points have a corresponding AF attribute. You can then use the if statement to return the attribute value of a different attribute based on some condition. Of course doing this is more resource intensive and if you have a lot of these on the same element or element template you may run into some performance issues.


            Hope this helps,


            • Re: Building a PI Vision display using indirection

              Looking at this from a slightly different angle, is there a way that I can construct a path in an analysis and then use that to access an attribute value?

              • Re: Building a PI Vision display using indirection

                Hi Everyone,


                Just thought I'd follow up on this and share what I have discovered.


                I have configured a display element that uses the value in an attribute to determine the path to an element with a value in it.  See a cut down configuration below.



                So when the name in the 'ProductName' attribute changes, the PIPoint Path in the 'DisplayValue' attribute resolves to a different element in the 'Products' branch.


                I've built a display in PIVision that points at 'Display Element' and when I update the value in 'ProductName' using the PIwebapi, the display also updates and displays the point value in the new path. 


                The use case I have is an overview display that reflects a "plan".  The data on the display is determined by a display element.    When the plan changes (eg to make a different product) the plan is uploaded, changing attributes in the display element, and the display automatically changes to show values associated with the products in the  new plan.


                This is brilliant and is a very powerful way to dynamically change what is shown on a PIVision display without having to change the underlying AF structure.


                Incidentally, I also tried making the 'ProductName' attribute a PIpoint data reference to see if I could drive the display changes off a point update but unfortunately that didn't work.  Imagine if you could have a single display that updates what it shows  based on the phase a process is in

                1 of 1 people found this helpful