15 Replies Latest reply on Dec 5, 2010 10:20 PM by RJKSolutions

    Need help regarding Process Book and PI Tags

    saxyogi

        Normal   0           false   false   false     EN-CA   X-NONE   X-NONE                                        MicrosoftInternetExplorer4                                                                                                                                                                                                                                                                                                                       

       

      Hi Guys,

       

      I have a requirement as following:

       

      In my Organization X department uses three methods to calculate some values using a few PI Tags.

       

      For the sake of simplicity let's assume three methods are:

       

      1.  Main Calculation (This is an ACE Calculation. Result of this is stored in PI tag for each day.)

       

      2.  Alternative Calculation (This is an ACE Calculation. Result of this is stored in PI tag for each day.)

       

      3.  User overridden (This can be any value entered by end user. We are planning to save this value in a PI tag for each day. Normally this value is entered by end user if Main Calculation and Alternative Calculation’s result are not satisfactory. An Interface would be provided to end user to enter this value.)

       

      I am planning to provide an interface similar to following (This interface would be in ProcessBook). End user should select a value for the day and then should be able to save that set of result. I have two choices to save the selected set of records.

       

      1.  I can use some RDBMS such as SQL Server to save this data. This approach is straight forward but requires maintaining database for long term.

       

      2.  I should somehow save this to PI Server. It’s a little tricky as shown values are already PI Tags. One option could be to save an indication/flag which value is used for a given day in a different PI Tag (For Example: This PI Tag can have value such as “Main” or “Alter” or “Overridden” for a given date). Value in this tag will be updated on the Click of Save button.

       

      2133.Untitled.png

       

        Normal   0           false   false   false     EN-CA   X-NONE   X-NONE                                        MicrosoftInternetExplorer4                                                                                                                                                                                                                                                                                                                       

       

      Could you guys give me your advice if second approach is doable?

       

      I am also think if somehow I could make use of Digital State?

       

       Thanks in advance.

        • Re: Need help regarding Process Book and PI Tags

          What's the logic behind which value is picked for each day?  In your example, it seems the lowest value is being picked or a lower value is being manually input. Is that always true?  Also, can you shed some light on the business context for your use case?

            • Re: Need help regarding Process Book and PI Tags
              saxyogi

              Nope that's not always true. We would provide a UI and business user would use their intelligence to pick best value from "Main Calculation" and "Alternative Calculation". If both of them don't have good value then Business User would provide an overridden value. UI should save Business Users' selection. I am gonna create this UI using Process Book and will save User's selected data as described in my post. Thanks for the response.

              • Re: Need help regarding Process Book and PI Tags

                I would suggest using Overridden By User (may be call it Actual Used) - and when he picks Main or Alternate, populate that value to the Actual Used - and also allow him to edit the Actual Used column. And, save all the values in the Actual Used column. That way, you can go to a single tag to see what values were used.  And, if you want to see whether it was Main or Alternate or Manually Entered - all you have to do is to pull all 3 tags into DataLink or if you have to do it in code, compare the values.  

                  • Re: Need help regarding Process Book and PI Tags
                    saxyogi

                    Thanks Gopal for very quick reply. I thought of using suggested approach but it wont allow me later to know which calculation was used to populate Overridden by user tag. I have given a very simple data but consider a situation where Main and Alternate calculation are yielding same result however their calculation formula could be very much different.

                      • Re: Need help regarding Process Book and PI Tags

                        Manual data entry via ProcessBook, I wonder if Laurie is reading this thread ...

                         

                        I like Gopal's approach of naming the chosen data as "Actual Used".  You could supplement the chosen value by annotating it with the source of the value, so you would see:

                         

                        Nov 1, 2010          100          {Main Calculation}

                         

                        Nov 2, 2010          102          {Main Calculation}

                         

                        Nov 3, 2010          103          {Alternative Calculation}

                         

                        Nov 4, 2010          105          {Overridden by User}

                         

                        Where "{}" denotes the annotated string.

                         

                        Of course, rather than annotating you can just create a corresponding digital tag and your manual entry logic decides what the digital state should be for each value archived.

                         

                        Now if you will be doing this for lots of calculations you may want to consider structuring this in AF (Enumeration Sets, Formula DR)...