10 Replies Latest reply on May 18, 2018 1:04 PM by Chris_Hawkins

    Configure alternative PI Points via AF


      This is what I’m attempting to achieve / configure in AF using Process Explorer. I realize that I could do so programmatically but that splits the configuration between (yet more) applications.


      I’ve created a much dumbed-down example - xml attached. In practice there are many elements and many attributes of which a substantial number are PI Points and of these a significant fraction need to be handled in the way I describe.


      The AF attribute [MyTag] contains a PI Point, the name and of configuration of which will be defined by either the client (organization) if it pre-exists or by the application if the PI Point is new. My solution for this up to know has been to create a AF table, Client_PI_Points, in which I define the PI Point name for a given element and attribute. In AF I construct a Default Tag based on %Element%.%Attribute. The AF attribute [Client Tag] uses a Table Lookup on Client_PI_Points to determine whether a client defined PI Point is to be used; if not then the [Default Tag] name is placed in [Client Tag]. The PI Point name itself, is placed into MyTag using substitution (which I am unable to paset here as the 'at' character is illegal!) .


      The above works fine as did when I extended the above to include relevant items of the PI Point configuration in the AF Table. However, this configuration was applied regardless of whether The PI Point referenced in MyTag was [Client Tag] or [Default Tag]. The result being that a reset to template could (and has!) overwritten a PI Point configuration in the client’s PI system.


      So how to make the configuration string specific to only [Default Tag] and to leave whatever is in the Pi system untouched if a client's PI Point is used? Simple…or so I thought; use String Builder to construct the Default Tag name from substation parameters and its configuration from values in child attributes (or another AF Table). Again, this worked but only up to the point of building a sensible [Default Tag] which is copied into [Client Tag]. However the substitution used in MyTag %@.|[Client Tag] resulted in double quotes being placed around the copied string rendering it invalid as a PI Point name For example Element1.MyTag ptclassname=classic; pointtype=float64 in [Client Tag] becomes “Element1.MyTag ptclassname=classic; pointtype=float64;in [MyTag].



      • Is there a way to suppress the double quotes?


      • An alternative formulation within Process Explorer?

      I include a copy of the very simple AF database as this seems easier than pasting lots of screen grabs.

        • Re: Configure alternative PI Points via AF

          Hello Chris,


          Please accept our apologies for the late response!

          I have imported your database but am doing hard to follow. When you talk about Process Explorer, you mean PI System Explorer?


          Looking at Element1, it appears to me as if substitution is working just ok. I do not have a PI Data Archive Server named VIRTUALPC but don't understand this being the concern here. Can you please indicate where you see the problem?


            • Re: Configure alternative PI Points via AF

              Hi Gregor


              No problem – I was unsure than anyone would reply!


              Sorry, yes I meant PI System Explorer.


              Can you not change VIRTUALPC to your own PI Server? I use the substitution %Server% so should not the AF pick up your PI Server name?


              The string builder substitutions themselves work fine. It is when the string created by substitutions is copied/referenced by the attribute that is the PI Point using
              %Server%\%@.|%,  e.g..The PI Point name (and configuration string) is then enclosed in double quotes.


              There are examples of success and failure:



              •   Element1 is ok as the PI Point is client defined (in the AF Table Client_PI_Points), e.g.


              •   Element2 is invalid as the default PI Point name gets the double quotes added, e.g.






              Chris Hawkins | Senior Consultant | Process Systems & Solutions

              Emerson Automation Solutions | 2 Eggleston Court, Startforth Road , Riverside Park | TS2 1RU | Middlesbrough | United Kingdom

              T +4401642773061 | M +4407764929518

              Chris.Hawkins@emerson.com<mailto:Chris.Hawkins@emerson.com> | http://www.emerson.com<http://www.emerson.com/>

                • Re: Configure alternative PI Points via AF

                  Hi Chris,


                  Your question went off my radar once more. You may accept my apologies since I believe that I found the solution for your issue.


                  It took me a little to figure out how your logic with "Client Tag" and "Default Tag" works and that it involves an AF Table named "Client_PI_Points". So in case the Element Name is defined in the table, the name is taken from the corresponding column, otherwise the tag name is generated based the definition in "Default Tag".


                  My issue was that no PI Point was created for Elements, neither for the ones existing in your export nor for new ones. I tried "Create or Update Data Reference" on Element level with the following message returned:


                       Processing Element 'Element4'.
                       Failed to create or update the data reference for Attribute 'MyTag' in Element 'Element4': The attribute's template data reference is not configured for tag creation.

                       Configuration creation or update completed with 1 errors.


                  It again took me quite a while to figure out what was wrong. When creating an Attribute Template with Data Reference "PI Point", the settings dialog shows an option "Tag Creation".



                  What it does, is adding the point type definition to the configuration string.


                  Long story short, this is what you need to add to the config string of your Template1. With this, the PI Points will be created according to your substitution parameters. By the way, please make sure the Value Type corresponds to the pointtype definition. I have changed Value Type from String to Double instead of changing the pointtype to string because string type is not what you want, at least not with the majority of points.


                  1 of 1 people found this helpful
              • Re: Configure alternative PI Points via AF
                Rick Davin

                Hi Chris,


                I don't think you can get rid of the double quotes.  Whether we call it a workaround or a hack, you are attempting to tack the tag creation properties following the tag name by including them in the tag name.  The first thing PI Point DR does is apply its name substitution, which it does correctly to internally resolve the string to what you really wish it to be.  The second thing the PI Point DR does is attempts to validate the tag name does not contain any invalid characters.  And that's the crux of the matter.  The PI Point DR doesn't think of everything in the "name" string as other options in one larger ConfigString.  Rather it thinks of everything in that "name" string as only the exact Tag Name, and inside that tag name are invalid characters such as semi-colons and equal signs.  Therefore, PI Point DR attempt to escape the invalid characters by wrapping it all in double quotes.



                While the original poster Chris understood the explanation as he independently reached same conclusion, I am updating my explanation with more text since others have asked this before, and I suspect others may likely ask again.


                After substitution, what you are hoping to see in the ConfigString window is something like:  \\VirtualPC\Element1.MyTag;ptclassname=classic;pointtype=float64


                A human reading reading that may want to mentally parse that into something like:


                Server:     VirtualPC

                Tag:          Element1.MyTag

                Options:   ;ptclassname=classic;pointtype=float64


                But what the PI Point DR sees is this:


                Server:     VirtualPC

                Tag:          Element1.MyTag;ptclassname=classic;pointtype=float64



                Which causes the PI Point DR to think the Tag contains invalid characters.  Hence, it wraps the double quotes around the Tag because of the invalid characters.