5 Replies Latest reply on Feb 14, 2018 2:29 PM by matthewskl

    Possible to write analysis output to attribute that is not tied to a Pi tag?

    matthewskl

      I'm attempting to use an attribute as just simple storage for a counter.  I do not want to store this value back to the Pi archive.  Basically, I want to know how many times an analysis has been triggered.  Here's what the code looks like, variables are in bold:

       

      ExcessiveDelta           TagVal('PI Tag') - TagVal('PI Tag', '*-1d') > 1

      ThresholdReached     'PI Tag' > 10000

      AlarmOccurences is tagged as the output

       

      These are the outputs that I've tried with the results directly below:

       

      If ExcessiveDelta or ThresholdReached Then ('Alarm Occurences' + 1) else NoOutput()

      -- Functions such as NoOutput are not supported unless all mapped outputs are configured to save output history

       

      If ExcessiveDelta or ThresholdReached Then ('Alarm Occurences' + 1) else 'Alarm Occurences'

      -- Calc Failed - Output: A circular reference was detected in Attribute 'Alarm Occurences'

       

      If ExcessiveDelta or ThresholdReached Then ('Alarm Occurences' + 1) else 0

      -- This will run as long as the else side is hit

      -- If the Else side is not hit I get this error "Output: Invalid Operation: [Error] + [number]

       

      Any thoughts or alternative approaches?  This is basically just an "x = x+1" scenario.

       

      Thanks!