4 Replies Latest reply on Nov 10, 2009 2:39 PM by cescamilla

    AF in VB Editor




      I am attaching the following screenshot to ask you guys how I can access to the tag associated with the flow meter(left).


      The flowmeter has been assigned to an element in AF 2.X and I do not want to show the tag like the right hand side.


      I want to access to that flow meter tag and write a script in VB Editor for some manipulation.


      I thought to import PI AF in Reference part of VB Editor and I did but I do not know how I can access while it is an element in AF assigned to that flow meter.


      Can I know the exact script? Is that hierachy like AF SDK in .NET environment?



        • Re: AF in VB Editor

          The AF references you imported in the VBA Editor are COM-based and are those of AF 1.x - they are not the 2.x .NET-based AF SDK. I suggest you take a look at this post, where we discussed the usage of AF data in PI ProcessBook.


          What exactly did you mean by "some manipulation"? Maybe there is a way to accomplish what you would like to do in a non-programmatic manner (you'll recognize the advice from my answer to your previous post - it's just simpler, faster and easier to maintain than writing your own code ).

            • Re: AF in VB Editor

              Thanks Steve for the response


              Let clarify more, I meant by manipulation changing the color or size of value or text not complex math.


              What I understood about PE is that I can convert the value to text and it is very good but I do not want to see that unless the conditions are met.


              I do not want to go for .NET add-in for now. Also regarding ProcessBook side I cannot do a lot change just rename the dataset.



                • Re: AF in VB Editor


                  changing the color or size of value or text


                  Well as far as the text size, I'm afraid you'll have to some VBA. But if changing the text color is sufficient, then you could simply use the Multi-State feature of PI ProcessBook. This can be based on a PI Point value (your original numerical point or the resulting string PE point) or even on an AF Value.



                  I do not want to see that unless the conditions are met


                  Using that same Multi-State feature, you can set the color to None such that the value gets displayed only under certain circumstances.


                  But since this is not exactly related to programming, I invite you to contact Tech Support - they'll be in a good position to help you (and maybe even open a PunchList Item for the Multi-State feature to support changing the size of the text )

                  • Re: AF in VB Editor

                    There are a few tricks you can use for the size change, it may be a bad idead to sue in a heavy PI ProcessBook Display (as in with a lot of elements) but you can create multiple multistates with diferent font sizes and configure each of them to show at a specific range.


                    You could even put two or more multistates at the same time with the top one blinking to make it change color (instead of disapearing) and/or change size a bit while catching atention from the user.


                    And the benefits of this is that it will work in an svg exported file to (so you can view it on the RtPortal Site)