7 Replies Latest reply on Dec 22, 2010 12:50 AM by skwan

    AF Attribute Data as a Relative Timestamp

    s.grainger

      Hello,

       

      I am attempting to compare a few values in AF and I'm wondering if I'm going about it wrong.

       

      My situation is that I have retrieved values from a CMMS Database and have pulled them into AF Attributes.  These are two attributes for 'Last Maintenance Date' [Date/Time] and 'Mean Time Between Failures' [Hours]. 

       

      I am attempting to use daily runtimes [hours] captured in PI (also imported to AF attributes) to compare the cumulative runtime of a piece of equipment SINCE the last maintenance date to the mean time between failures.  As it stands now, the PI Runtime generates a value every 24 hours, reporting for how many hours it was on over the day (therefore requiring a sum of runtimes over the course of multiple days).

       

      So far I have been unsuccessful.  I have attempted to create a PI Point attribute that references the PI Runtime Attribute, pulling a 'Total' over a time range of '*' to the value of 'Last Maintenance Date' - but I do not know if this functionality exists.

       

      Is there another (better) way to approach this problem, or does this functionality exist, and I am using it incorrectly?

       

      Any guidance would be appreciated, thank you!

        • Re: AF Attribute Data as a Relative Timestamp

          What's your CMMS?

            • Re: AF Attribute Data as a Relative Timestamp
              skwan

              Have you considered building a Totalizer tag in your PI system to account for total run time and then do a simple compare with your CMMS MTBF value?

                • Re: AF Attribute Data as a Relative Timestamp
                  s.grainger

                  Thank you for the replies, right now the CMMS system isn't live, I pulled static values from an instance of SAP PM, loaded the data into a local SQL database, linked the SQL tables to an AF table, and then pulled them into attributes.

                   

                  On the topic of creating tags to perform this equation, I was under the impression that both the PE and totalizer equations required more definate time specifications to perform sum operations.  As the "Start" time for the runtime sum is a value of an AF attribute, I did not think this would be sufficient.  Perhaps I am misinformed or not fully understanding your suggestion.

                   

                  Also, since tag standards are frequently sloppy in many of our clients' systems, we would prefer to utilize element attributes and to only have to map a data point once, as opposed to repeatedly in multiple PI PE Equations.

                   

                  Thank you again for your help!

                    • Re: AF Attribute Data as a Relative Timestamp

                      Hello, Couple of floating thoughts...

                       

                      - In your PI server do you capture a status of when your equipment is offline/online (digital state or similar)?  What is calculating the daily uptime?

                       

                      - Just checking terminology...is your 'Last Maintenance Date' referring to the completion of maintenance?

                       

                      - Have you considered the use of Event Frames for equipment uptime tracking? For example, when maintenance is completed and your equipment is online you create the Event Frame for the asset (either manually or have a trigger system watching all your equipment online digital statuses) with no end time until it is taken offline again.  Based on the generated EF you can then attach other EFs that represent other activities performed. e.g. product runs, process grade changes.

                       

                      - You could look to use the PI OLEDB driver with the AF Table Lookup Data Reference to pass in your maintenance date and your daily runtime tag for a total.  (Not looked at this one in any detail, just a thought that popped in to my head.)

                      • Re: AF Attribute Data as a Relative Timestamp

                        Most of the logic you need is typically already implemented by the CMMS - you just have to post the runtime (totalized)hours on some schedule; typically you can even just use life-time totals, so that once your totalizers are working, all you are doing is to post the value from PI to SAP.  

                         

                        In the manner you have described, it seems that you are attempting redo that logic in PI + AF.

                          • Re: AF Attribute Data as a Relative Timestamp
                            skwan

                            Sara:

                             

                            In case you want to do this in PI System Explorer, here's one way you can accomplish what you need to do.

                             

                            1) Build a run time Totalizer tag in your PI system to track running hours of your machine.  You can use any point in time as your starting point, but once started, it will need to run "forever".  If you're only tracking running hours, this number should not get overly large over time.

                             

                            2) Pull your last maintenance date into AF via a table lookup or linked table.  The attribute value needs to be in a date/time format that PI understands.  For the purpose of this discussion, let's call this attribute: LastMaintenanceDate

                             

                            3) Create an AF attribute that is a PI point data reference to the run time Totalizer tag from above.  Now here's the trick, configure this PI point data reference to use Relative Time and use the substitution text %@LastMaintenanceDate%  This pulls in the PI tag value of the run time Totalizer tag at the date/time corresponding to LastMaintenanceDate

                             

                            4) Create another AF attribute with PI Point data reference that pulls in the run time Totalizer tag at current time.  Subtract one from the other and you have your total run time since the LastMaintenanceDate

                             

                            Hope this helps.

                             

                            A caveat to the steps above.  As I was working with the AF team on finding a solution, we found a bug in PI System Explorer with respect to step #2 above.  Up to AF 2010, the LastMaintenanceDate has to be configured as a String data type and not DateTime data type, otherwise it is evaluated with an improper time offset during the substitution into the PI Point Relative Time.  We have fixed it with AF 2010 R2, due real soon.

                             

                            You never mentioned whether you wanted to accomplish this via PI System Explorer or via programmatic methods such as using the AFSDK.  If your intention is to use the AFSDK, please let us know.  Lastly if your original intention was to use the PI System Explorer, you would've gotten faster (and probably better) response via our tech support department as they are better equiped to answer questions on how to properly use our software.

                             

                            Happy Holidays!