3 Replies Latest reply on Aug 22, 2014 9:07 AM by Gregor

    create a tag that its value is updated every change of state of another tag

    vitorfarias

      Hi,

       

       

       

      I don't know if its possible to do this, but..

       

      I need to create a tag that its value is updated every change of state of another tag.

      example:

      The xxx tag is updated with the value of the event that started the ON minus the value of the beginning of time off yyy.
      .

        • Re: create a tag that its value is updated every change of state of another tag

          Hello Vitor,

           

          You like to create a tag that reports the running hours e.g. of a motor. The running hours are supposed to update each time the motor changes from ON to OFF or vice versa. Is my understanding correct?

            • Re: create a tag that its value is updated every change of state of another tag
              vitorfarias

              +- example

               

              Tag 1  - OFF - 14:09:35

               

              Tag 1  - ON -   14:15:00

               

              Tag 1  - OFF -  14:20:00

               

              Tag 2 - 5 min

               

              understood ?

                • Re: create a tag that its value is updated every change of state of another tag

                  Hello Vitor,

                   

                  I roughly understand what you are looking for but some details are still not clear.

                   

                  With PI you can set up calculated tags. There exist several calculation engines like PI Performance Equation Scheduler, PI Totalizer Subsystem, PI Advanced Calculation Engine (PI ACE) and last but not least PI Asset Based Analytics. Please refer to the PI Server Applications user guide for information about PI Totalizer Subsystem and PI Performance Equation Scheduler. PI ACE User Guide is the manual for PI Advanced Calculation Engine. Asset based Analytics has recently been released. I highly recommend you looking into the related learning videos at OSIsoft youtube learning channel.

                   

                  I suggest going with either Asset Based Analytics or PI Performance Equation Scheduler. For both you are using PI Performance Equation Syntax. PI Performance Equation Reference can usually be found as %PIHOME%\Help\PEReference.chm on each PI Data Archive or PI Client node. The function you need to evaluate how long a particular tag had a specific value is TimeEQ. The function excepts the source tag name, the periods starttime and endtime plus the value as parameter.

                   

                  To be able to provide you with an example, I would need to know some more details.

                   

                  - What calculation engine do you like to go with?
                  - Is Tag 2 supposed to update scan based e.g. every 5 seconds or when Tag 1 receives a new value?
                  - Are you interested in the total time since e.g. the beginning of the year or just for the latest period Tag 1 was reporting "ON"?
                  - What's Tag 2 supposed to report when Tag 1 is in "ON" state, the latest result (no update) or 0?
                  - Will Tag 1 switch between "ON" and "OFF" or are there other states involved?
                  - Will "ON" always be followed by "OFF" and vice versa or is there a chance the snapshot of Tag 1 becomes updated with "OFF" while it is reporting "OFF" already?