6 Replies Latest reply on Aug 20, 2012 2:11 PM by pyeska@tibco.com

    Quality of PI Tags

    pyeska@tibco.com

      Hi All,

       

      I would like to provide quality of PI Tags to clients. Similar to OPC tags quality. Please see the section "OPC Quality flags" in the site below.

       

      http://lhcb-online.web.cern.ch/lhcb-online/ecs/opcevaluation/htmlspef/data_type.html 

       

      Does PI Server provide similar information?

       

      Thanks

        • Re: Quality of PI Tags

          Hello Patricia,

           

          With PI there is usually a state from "SYSTEM" digital state set used.

           

          Digital state numbers are 15 bit unsigned integer values. State sets are used to translate state numbers into status texts. Independently from the point type PI stores the state number with a negative sign (i.e. -248 = "No Data").

           

          You may also be interested in the "Questionable", "Annotated" and "Substituted" bit stored with each event.  

           

          Gregor

            • Re: Quality of PI Tags
              pyeska@tibco.com

              Hello,

               

              Regarding to digital state SYSTEM:

               

              I was reading PI SDK documentation for C++. I found method "IsGood" for object PIValue. This property should represent if value contains valid data or some error state. So, when IsGood returns FALSE, then PIValue.Value returns state from the SYSTEM digital state. 

               

              So, I suppose that PIValue contains either valid data or error. It doesn't contain quality of tag with valid data. Is it correct? Or is this information save in annotations of PI tag?

               

              Thank you,

                • Re: Quality of PI Tags

                  Hello Patricia,

                   

                  You are right. If IsGood returns false, the event wears a state from SYSTEM digital state set rather than a value.

                   

                  If the value of an existent event is changed, PI sets the substituted flag.

                   

                  In case of an annotated event, the annotated flag will be set.

                   

                  The questionable bit is set when the event has been marked questionable.

                   

                  Gregor

                    • Re: Quality of PI Tags
                      pyeska@tibco.com

                      Thank you!

                       

                      I have one additional question. If you have a look on OPC statuses in link above... They have 3 kinds of status (Bad, Uncertain, Good).

                       

                      I guess that Bad quality can correspond to value from digital set SYSTEM. Does it make sense?

                       

                      What about Good and Uncertain qualities.  Does PI Value contain similar data?

                       

                       

                       

                      Please see these parts in link above:

                       

                      Substatus for UNCERTAIN Quality:

                       

                      Substatus for GOOD Quality:

                       

                      The Limit BitField

                       

                       

                       

                      Thank you very much!

                        • Re: Quality of PI Tags

                          Hello Patricia,

                          I expect the following being equivalent but this may vary depending on the data source:

                          OPC Status

                          Quality information in PI

                          BAD

                          IsGood=False with more detailed status information from the SYSTEM Digital State Set

                          UNCERTAIN

                          Event with value corresponding the point type but Questionable bit set

                          GOOD

                          IsGood=True

                          Since you are also asking for sub statuses of UNCERTAIN and GOOD, the Substituted bit would correspond to "Local Override" of status GOOD but PI doesn't have per-se additional reason codes for UNCERTAIN. What can be done here is storing quality information on a separate tag by using a custom Digital State set.

                          If this information isn't helpful or doesn't fully answer your question, please give us a better understanding of what you would like to achieve.

                          Gregor