3 Replies Latest reply on Feb 3, 2010 2:45 AM by hanyong

    Shift Rotation Perfromance Equations

    Scott

      Hi,

       

      I am trying to create a PI tag that represents our current mine schedule.  I have used the Legacy DevNet "Shift Rotation Calculations" to create the appropriate tags for a 21 day rotation, they work great.  However, our mine works 10 hour shifts and we have 6 crews, A-F.  These crews will work either Wednesday - Saturday, or Sunday - Monday.  Here is the part I am struggling with.  Every President's Day, Memorial Day, Labor Day and Thanksgiving they swap from the Wednesday - Saturday schedule to the Sunday - Wednesday schedule or Sunday - Wednesday schedule to Wednesday - Saturday.  An example of one of these swaps is shown below.

       

      A GROUP B GROUP C GROUP D GROUP E GROUP F GROUP
      Week Of M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S M T W T F S S
      2/8/2010 D D D  -  -  - S S S S  -  -  - G G G G  -  -  - D  -  - D D D D  -  -  - S S S S  -  -  - G G G G  -
      2/15/2010  -  - S S S S  -  -  - G G G G  -  -  - D D D D  - S S S  -  -  - G G G G  -  -  - D D D D  -  -  - S

       

      Swapping like this creates 2 different 21 day rotation cycles.  If the mine would swap every 13 weeks, no problem.  But they swap on the holidays above, resulting in an irregular swap schedule.  I have created the tags necessary for the 2 different 21 day rotation cycles.  Now I need some help figuring out the best way to define these 4 periods:

       

      President's Day - Memorial Day

       

      Memorial Day - Labor Day

       

      Labor Day - Thanksgiving

       

      Thanksgiving - President's Day

       

       

       

      I think that if I can define these periods, a simple if..then can be used to choose the appropriate 21 day cycle.

       

      Any ideas?

       

       

       

       

        • Re: Shift Rotation Perfromance Equations
          hanyong

          I would consider to do something similar like what you have suggested, identify the period with the holiday dates and have an additional if..then statement in the PE tag to determine which cycle to use for that day.

           

          The problem would come down to how to determine the dates of the holidays. Where I am, there is none of the holidays you mentioned, but online references mentioned that most of them are floating date holidays (like President Day is 3rd Monday of Feb, etc). we can either get this information by calculation or retrieve from a web service, and edit the PE tag's exdesc according to the year. Perhaps something like a simple PI SDK apps that is scheduled to executed at the start of the year (since this information often doesn't change for that year)

           

          Another alternative that I would consider would be using ACE, then the period can be determined within the ACE program and the calculation can be based on which period the day of calculation fall on.

           

           

           

           

            • Re: Shift Rotation Perfromance Equations

              Whether you end up doing that in a PI ACE calculation or a Performance Equations (PE) PI Point, try not to rely on a manual or external process. For instance, I would not recommend manually setting the year in the PI Point's ExDesc attribute, nor get this done through a custom PI SDK application scheduled to run once a year. It's just not sustainable... 

              • Manually: One will undoubtedly miss (or be late at) writing the value into the PI Point, resulting in missed or incorrect calculations
              • Scheduled app: This is the kind of "isolated" apps that easily get forgotten in the the big picture... 
                • you forget to move it when you are moving your PI Server to another machine
                • you need modify the source code but nobody remembers where it is (was it even backed up?)
                • the account that this is scheduled to run under changed password and nobody updated the scheduled task
                • ultimately, the person who developed it changed position or even left the company and this was just one of these little details that was left over in the knowledge transfer (if knowledge transfer there is)

              ...as a result you will get this "Calc Failed" value in the PE tag, due to the "holiday" tag being in "Shutdown" or a similar status (and it has been for the last 6 months - it stopped working and nobody took care of bringing it back to life ).

               

              With that said, I would definitely recommend doing that in a PI ACE Module.

              1. PI ACE typically is a "well known" beast and is managed by whoever administers the PI System. That means it is likely being backed up, the processes are known, the source code is readily available.
              2. Writing to a PI Server may seem trivial but involves a lot to be totally reliable: how about buffering in case the PI Server is not available at that moment (e.g. network connectivity issue)? what if it's a PI Server Collective - or become one over time? ...PI ACE takes care of all that.
              3. Because PI ACE is leveraging Visual Studio, it allows you to do everything - complex calculations or querying the web service - in the same spot. Hence, no "cascading" of regular and PE tags to accomplish something relatively simple, or multiple isolated processes that rely on each other.

              Just my 2 (Canadian) cents...

               

              Please do not hesitate to post your PI ACE development or generic .NET development questions (e.g. for the web service) in the related discussion forums.

                • Re: Shift Rotation Perfromance Equations
                  hanyong

                  Steve Pilon

                  Whether you end up doing that in a PI ACE calculation or a Performance Equations (PE) PI Point, try not to rely on a manual or external process. For instance, I would not recommend manually setting the year in the PI Point's ExDesc attribute, nor get this done through a custom PI SDK application scheduled to run once a year. It's just not sustainable... 

                  • Manually: One will undoubtedly miss (or be late at) writing the value into the PI Point, resulting in missed or incorrect calculations
                  • Scheduled app: This is the kind of "isolated" apps that easily get forgotten in the the big picture... 
                    • you forget to move it when you are moving your PI Server to another machine
                    • you need modify the source code but nobody remembers where it is (was it even backed up?)
                    • the account that this is scheduled to run under changed password and nobody updated the scheduled task
                    • ultimately, the person who developed it changed position or even left the company and this was just one of these little details that was left over in the knowledge transfer (if knowledge transfer there is)

                  That is true, often we get into situations where the people that had managed the system leaving the company, and people who take over did not have any idea what has been setup and the system becomes a blackbox.