2 Replies Latest reply on Jan 9, 2019 2:32 PM by fmocke

    Set AF Event Frame Reason Value in Analysis

    fmocke

      Good day,

       

      I have a very simple Event Frame Template called "Asset Down". The Event Frame Template has one Attribute called Reason which is linked to an Enumeration Set called Downtime. We make use of PI Vision to capture the Reason field which is linked to the enumeration set.

       

      For normal downtimes, everything works as planned. The event gets generated, and the operator captures the reason using PI AF. However, there are some unique cases where the reason is known based on the signal used to generate the event:

       

      • Crusher bridging
      • Waiting for ore

       

      An operator in the crusher control room gives an input to the SCADA showing the crusher is in bridging mode or waiting for ore mode. This data is obviously sent to PI, which is used to generate the downtime event. However, when the event is generated, there is no way for me to give a default reason value to the event based on the input signal. My downtime event code looks as follows:

       

      Capture.PNG

       

      For example. on crusher bridging, the Val signal will be a binary signal from PI which shows bridging or not briding. Based on that the downtime event is generated. However, there is no way for me to specify the downtime reason within the Analyses.

       

      I would like to be able to set the Reason to "Crusher Bridging" or "Waiting for Ore" based on the signal.

       

      Any ideas on how to do this?

       

      Thanks

       

      Franco

        • Re: Set AF Event Frame Reason Value in Analysis
          Rick Davin

          If you are using PI Server 2017 R2 (AF SDK 2.9.5) or later, an Analysis can output an expression to an attribute.  It's not obvious with Event Frame Generation, so click on the down arrow next to Add...

           

          2019-01-09 08_17_27-Window.png

           

          The one obvious limitation of this is that you only write your custom Reason when the event frame closes.

           

          You say this Reason attribute would be binary in nature, but I would suggest it is not.  There is a 3rd possible value, and that would be None.  One could argue that Waiting for Ore is the same as None, but Waiting for Ore indicates a process state where you are expecting to eventually engage in some process, whereas None indicates you are not simply waiting for ore, but rather not even expecting it and therefore not waiting for it.  None could also be the catch-all of any SYSTEM state or badval.

          1 of 1 people found this helpful
            • Re: Set AF Event Frame Reason Value in Analysis
              fmocke

              Hi Rick.  That is exactly what I need, cannot believe I missed that.  Thanks a lot and thanks for your advice.

               

              The Reason is not binary.  The signal received from the crusher is. 

               

              I have more than one signal which triggers a down event.  The official one which is based on the power signal for obvious downs, and then the additional two which are based off the operator status change for 'waiting for ore' and 'crusher bridged'.