JB2020 (Customer) asked a question.

Allowing a task to complete based on a time stamp

I am currently programming a system that is for pumping gravy to a depositor machine.

This system will be running on a P1000 Productivity PLC. We are wanting to have 3 different modes to the operation of said machine/system. Pre-Sanitize, Production, and CIP (Clean-In-Place).

 

Per protocol, if the system sits dormant (power off and/or no production) for longer than 5 hours, a Pre-Sanitization is required before Production begins.

 

If something does not work right or for whatever reason, the operator needs to power cycle the system, I want to prevent them from having to go through the Pre-Sanitize process again especially if there is product in the lines.

 

How do I program this efficiently? I have tried to do it using the CPU time and time stamping when the CIP Process is complete. But I run into snags at this point because the operator will kill power after this process is complete.

 

I tried using a time stamp that is retentive, but how to calculate whether it has been longer than 5 hours or not has got me a bit confused. For instance, if the system completes the CIP at 15:30 on X day and month, power is killed, and several days later, power is restored at 08:30 on X day and month, this looks like it is less than 5 hours and therefore it would bypass the Pre-Sanitize requirement.

 

Any help is appreciated!


  • Todd Dice (Customer)

    Your compares would have to include day date and month (and potentially year) to get this to work like you want. @Garry (Customer)​ might have something on his website showing how to to this.

    • JB2020 (Customer)

      I have done some research into some of @Garry (Customer)​ stuff and it looks like I'm just going to have to find a way to do this with a ton of compare contacts.

      I wish there was a better way, but for now it doesn't look like there is.

      • Garry (Customer)

        Hi @JB2020 (Customer)​ 

        You are correct in using the compare instructions. The productivity suite needs Epoch time or a Date comparison in the math instruction, similar to the Do-More Designer software.

        Regards,

        Garry

  • kewakl (Customer)

    I had some projects in the legacy forum for similar functionality. (determine amount of time elapsed between two arbitrary date/timestamps)

    I cannot find them here now.

    • kewakl (Customer)

      I found an old Proof of Concept (POC) project from a few years back. I used a variation of this in a machine that requires a weekly (calibration verification) test before operating. I calculate the delta between an arbitrary epoch year (2020) and the current datestamp on two events, then calculate the Total Elapsed Delta in days.

       

      I edited some intermediate leap year calc tagnames - the reason for the savefile datestamp being current.

      I did not exhaustively test this POC again. You may wish to verify (by performing some elapsed day tests) before using any of this.

      I tested that it at least functions to find the elapsed days between an arbitrary epoch start year and an arbitrary end date.

      If you find any of it useful, you may use as you wish.

       

      I realize you want finer resolution (hours) but this POC may give you ideas - if you extend the date calcs to include time, you may have a way forward.

      If my workload allowed, I would accept the challenge.

       

      P.S. Ignore the 'Calendar/2-week/4-week' part of the project. We were asked to reinvent a Tork timer in a PLC.😵

       

      Expand Post
  • Durallymax (Customer)

    Epoch time is nice for this but unavailable on Psuite. I would track day and month as well on your timestamp.

    I not sure having the Operator kill power to resolve issues when running product is a good design though.

    • kewakl (Customer)

      If you are replying to my post, my 'epoch' is an arbitrary developer-supplied year.

    • JB2020 (Customer)

      I didn't purposely design the system to require a power cycle to fix issues. In our plant (which operates 24/7) the operators 'go to' method before calling on-call personnel, is to power cycle and see if it resolves the issue.

      • kewakl (Customer)

        But, I've not seen you out on the floor here! 😝

        We are trying to break that habit!