10 Replies Latest reply on Oct 22, 2018 2:41 PM by srburnet

    Testing for "Intf Shut" value

    srburnet

      How can I test in an AF Analysis for the value "Intf Shut". I'm looking to execute something like:

       

      If ('Raw Net Generation Point' = DigState('Intf Shut')) then NoOutput() else 'Raw Net Generation Point'

      All forms of the test have generated a "Calc Failure" in the output.

       

        • Re: Testing for "Intf Shut" value
          Lal_Babu_Shaik

          Hi Stuart

           

          Request you to change analysis expression as below

           

          If ('Raw Net Generation Point' = "Intf Shut")) then NoOutput() else 'Raw Net Generation Point'.

           

          You are receiving Calc failed because DigState converts a string to corresponding PI Data Archive digital state object. As you are comparing object with value it is giving result as calc failed.

           

          Thanks,

          Lal

          2 of 2 people found this helpful
            • Re: Testing for "Intf Shut" value
              srburnet

              Thanks, this code worked. My intent had been to add it in “OR’d” with the existing tests (we look for duplicate data values and “BadVAl”), but the code to test for the duplicate value (If ('Raw Net Generation Point' = PrevVal('Raw Net Generation Point','*'))) does not work when it hits the “Intf Shut” value. I will have to run the code for to test for the “Intf Shut” first, then do a second analysis to test for the duplicate values.

               

              Thanks for your help with this!

                • Re: Testing for "Intf Shut" value
                  sraposo

                  Hi Stuart,

                   

                  Which version of AF and Asset Analytics are you running? The if statement works in 2018. For example,  I have a PI Point with these values:

                   

                   

                  I configured an attribute named PISQ_38157 that has a PI Point data reference and is referring to the PI Point with data above. The if statement works in my case:

                   

                   

                  I'm thinking something may have changed in the more recent versions causing the different behavior. I just want to make sure we are not seeing something unexpected in your system.

                   

                  Thanks,
                  Seb

                    • Re: Testing for "Intf Shut" value
                      srburnet

                      Hi Seb,

                      We are on AF Services 2017 R2 and PI Analysis Service 2018.

                       

                      Note that in our case we get valid data, then a single instance of "Intf Shut", so the failure in the PrevVal() comparison is happening when the analysis compares a valid data value to the "Intf Shut". Maybe there's a problem with the comparison handling the "mixed types" of data and the "Intf Shut" value.

                       

                      Finally, if scanning for other bad values, is it best to use TagBad() function or the BadVal() function? What is the difference between them. The "Expression functions reference" I downloaded doesn't really explain the difference between them.

                        • Re: Testing for "Intf Shut" value
                          Rick Davin

                          Hi Stuart,

                           

                          Superficially the help would say TagBad() is for AF Attributes based on a PIPoint, and BadVal is any value or expression.  Clear as mud, right?  BadVal returns True in 3 circumstances:

                           

                          1. The PI point does not exist
                          2. If point is a digital state but the value is a SYSTEM digital state.
                          3. If the point is not a digital state (helps says integer or floating point, but I suppose Boolean or Timestamp would apply) and the value is also a SYSTEM digital state.

                           

                          How does that differ from BadVal, since BadVal does the same thing?  BadVal additionally returns True if you have a floating point type and the value is a NaN (this is the most subtle distinction from BadVal).  The curious thing there is the AFValue.IsGood property may be True (value is good), but the BadVal function will also return True (value is bad).

                          1 of 1 people found this helpful
                  • Re: Testing for "Intf Shut" value
                    sraposo

                    Hi Stuart,

                     

                    How frequently are you shutting down your interface? It's odd to me that it's frequent enough for you to have to implement some logic in Asset Analytics to handle this.

                     

                    Also, if you want to properly handle other system digital states, you can use the BadVal() function. For example: If BadVal('Raw Net Generation Point') Then NoOutput() else 'Raw Net Generation Point'.

                     

                    Thanks,

                    Seb

                      • Re: Testing for "Intf Shut" value
                        srburnet

                        Seb,

                         

                        We’ve checked with our plant to understand what has changed because we’ve not seen this before. This plant is going through a maintenance outage which has caused them to shut down the control system which has an imbedded PI server that is sending the data to our corporate server. This is causing the imbedded system to generate the “Intf Shut” value to the AF data point. Unfortunately, the “Calc Failed” error from handling that value incorrectly was being propagated to a dash board display that is visible at the highest levels of the company.

                         

                        Thanks,

                         

                        Stuart

                          • Re: Testing for "Intf Shut" value
                            Lal_Babu_Shaik

                            Hi Stuart

                             

                            OSIsoft recommends using the default setting of 0 (Off) for points collected by remote interfaces that are configured for buffering or high availability (HA). The reason: if you run remote interfaces with buffering or PI collectives, shutdown events are not an accurate indicator of data loss when a PI Server is shut down. With properly configured buffering, data will simply be queued up for a PI Server while it is shut down, provided the remote interfaces continue running. Also, if a PI Server is part of a collective, shutting down one member has no effect on the other members' ability to continue receiving and serving data.

                             

                            1 of 1 people found this helpful
                              • Re: Testing for "Intf Shut" value
                                srburnet

                                Lal, This sounds like a good option for us. I believe we have buffering turned on at the sites effected by this issue, as the connection is PI-to-PI from our AF to an imbedded PI server in the site DCS. We are also using other OSIsoft interfaces to other data sources which have active failover capability between redundant interfaces for each data source. This is a better root-cause solution than filtering out the "Intf Shut" value. Thanks for taking the time to respond!

                                Thanks, Stuart