2 Replies Latest reply on Apr 5, 2018 1:27 AM by alanR

    Config String for a custom data reference.

    alanR

      Hi ,

       

      For a bit of practice in coding in .NET and using the AF SDK  i have been trying to replicate the PI POINT data reference in  System Explorer. My questions are:

      1. Is there any example out there that uses similar to PI Point?

      2.What is the correct naming convention for the config string? so that AF can read it in.

           what i have is;

      targetattribute=Attribute1;timemethod=Auto;relativetime=*-1h;timerangemethod=Average;timerangebasis=Event Weighted;timerangeminpercentgood=80;uom=<None>

       

      What my application does is  only create a config string created using different criteria picked my the user. Is there something else i need to add to it?

       

      Thanks,

      Alan

        • Re: Config String for a custom data reference.
          Rick Davin

          Hi Alan,

           

          Wow you tackled a huge one for practice.  Data references may be categorized into 2 general categories: (1) Calculation data reference and (2) System-of-Record data reference.  We tend to discourage System-of-Record DR's due to their complexity.

           

          The PI Point DR is considered a complex System-of-Record data reference.  Let's ignore the case when a relative attribute is input because that case ultimately means the relative attribute itself uses the PI Point DR.  For a getting data from a tag, the GetInputs() returns a null AFAttributeList.  Without input attributes, there are no input values, nor would there be an easy way to decide what all the events would be.  That means there is a lot of stuff the PI Point DR must do that is not within the typical overrides needed for a Calculation DR.  I would suggest that for a practice application you may consider a Calculation DR instead.

           

          If you would like to practice with a Calculation DR, I would suggest the Limit Check DR being taught in Developing Applications with AF SDK.

           

          There is no naming convention for the ConfigString.  That is all left up to a developer.  I personally favor name=value pairs delimited by semicolons like you have shown.  If you examine the ConfigString of PI Point DR, you will note its first parameter is not name=value, rather its the path of the PI Point or relative attribute, but subsequent parameters do follow name=value.  If you look at the Formula DR, there is additional delimiters for brackets ( '[' and ']' ) in addition to the semicolon and equal sign.  It is not really AF that reads the configuration - rather it is your data reference that reads it.  So everything about the ConfigString is left up to you: the choice of delimiters, the names of parameters, the values of parameters, which parameters are required versus which are optional.  All AF does is either reads a string from the ConfigString getter, or else passes in a string to the ConfigString setter.  What happens within the getter and setter is up to you.  That is to say, composing the string in the getter, or decomposing (parsing) in the setter is up to you.

          3 of 3 people found this helpful