1 of 1 people found this helpful
In the future, could you attach pictures directly inline with your post instead of as a file attachment? That little change can make it easier on others that are reading your posts without having them open up additional files. See here:
Next, the Formula DR does not allow text or string (other than with DigState), so you probably want an Analysis.
You may get by 1 event frame template. If you want more customized fields on Lo versus Hi, then you would need a Lo template and a Hi template. In that case, I would recommend 3: a base template that defines the fields for a general limit violation, and then a Lo and Hi template with fields specific to each. Again, all that depends upon the level of customization you desire.
Are you using Limit Traits?
Yes, I'm using limit traits.
In addition to what Rick Davin is suggesting, a common workaround to formulas not working with strings is to use enumeration sets. This was pretty much standard before analysis. The formula would produce a 0 or 1 and those would correspond to your enumerations. There are many ways to do what you need!
Beyond the topic of how many event frame templates you would want, and back to using Analytics or Formulas with enumeration sets, there is also the possibility of a custom data reference. For the online course Developing Application using AF SDK, there is Exercise 4 to create a CDR to perform a limit violation check. The CDR ConfigString only contains the path of the measurement attribute, as the applicable limit traits are automatically detected. The CDR output will return:
Int32 Represents -2 LoLo violated -1 Lo violated but not LoLo 0 No limits violated, i.e. Normal 1 Hi violated but not HiHi 2 HiHi violated
The cool thing is you may then map those integer values into an enumeration set, which unlike PI StateSets can accept negative values.
Link to Solution to Exercise 4 Limit Check Data Reference. Simple yet functional CDR. Includes C# and VB.NET versions.
I also have a more advanced C# version (see link here) that extends the above to implement a data pipe, override GetValues and RecordedValues in order to apply customized compression to only output when the limit check has a new value.