3 Replies Latest reply on Apr 27, 2017 11:53 AM by Rick Davin

    Dynamic Tag with Analytics

    AdamFalkenberg

      I'm trying to use an Analysis to write back to a PI tag, but the value I'm writing back will come from 1 of 10 different tags which is dependent on another tag.  For example, I have a tag which is an integer of 0 - 9, lets call it Num.  I also have 10 other tags that are Temp0 - Temp9.  When Num = 0, return data from Temp0, when Num changes to 3, start returning data from Temp3.

       

      I tried to set this up by creating an attribute in AF that contains the tag name I'm interested in by using the string builder and the Num tag (lets call the attribute TempTag).  I then created another attribute which has a PI Point data reference and uses the tag listed in TempTag (%@TempTag%), and called this TempTagValue.  I then have an analysis which takes the value from TempTagValue and writes it to my final tag.  Unfortunately, the final tag will contain the value from whatever tag was set in TempTag when the analysis was started.  When Num changes, the TempTagValue changes, and when I evaluate the Analysis it shows the correct value, but the Analysis output that is sent to my final tag doesn't change.  It appears to set a reference to the original PI tag and won't dynamically change.

       

      Any ideas on how I can get around this?

       

      Thanks for your help.