Calculating days between dates

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculating days between dates

    I could really use some help here. we reciently had an instance where an operator ran the machine a few days past its calibration expiration (OOPS). So now i have been tasked to remove all operator input/error and add code to all programs that checks the calibration expiration date agains the current system date and 1, popup a warning @ 30 days left (to remind someone to call for calibtation) and 2 to popup a full screen prompt when the machine is expired and jump to end of program (not run). i cannot figure out an fairly easy way to calculate the days between today and the exp_date. is there a simple way that maybe i cannot find like in excel "days(today, 2/12/2021)" something that can be put into every program or call it as a subroutine. My mind keeps going in 10 different directions. right now I have a cluster of code and i cant think of a clean, easy way to do this.

    appreciate any help.

  • #2
    Originally posted by fordrox View Post
    I could really use some help here. we reciently had an instance where an operator ran the machine a few days past its calibration expiration (OOPS). So now i have been tasked to remove all operator input/error and add code to all programs that checks the calibration expiration date agains the current system date and 1, popup a warning @ 30 days left (to remind someone to call for calibtation) and 2 to popup a full screen prompt when the machine is expired and jump to end of program (not run). i cannot figure out an fairly easy way to calculate the days between today and the exp_date. is there a simple way that maybe i cannot find like in excel "days(today, 2/12/2021)" something that can be put into every program or call it as a subroutine. My mind keeps going in 10 different directions. right now I have a cluster of code and i cant think of a clean, easy way to do this.

    appreciate any help.
    i put all our CMMs in the calibration system. We use Gagetrax and it will tell us when they're due for calibration

    Comment


    • fordrox
      fordrox commented
      Editing a comment
      The problem is, our calibration system not only missed it, but the calibration custodian for the area was out on medical when the notice would have been sent.

  • #3
    fordrox sorry if this is a stupid question (i've been programming for only a year with not any cmm experience before), but isn't the due date just an estimate? Like what would happen if they did use it past its due date?

    i hope someone can help you with a code

    Comment


    • fordrox
      fordrox commented
      Editing a comment
      Disal, not a stupid question. Our calibration procedures require all inspection tools be calibrated. Generally it is 1 year from calibration date. So if the calibration goes past 1 day, we are not allowed to use the equipment. This is machine calibration not stylus (probe tip) calibration.

    • Mike Ruff
      Mike Ruff commented
      Editing a comment
      Using a machine/ tool past the due date will not yield bad/incorrect results just because it's past the due date. But in an Aerospace/Medical/etc. environment, using any gage when it is out of calibration is a major finding which can cause you to lose your AS9100 certification/ other certifications. And if you lose those certifications, you will likely lose a lot of contracts and go out of business. It may not be a big deal as far as accuracy, but as far as paperwork goes, it is a huge deal. At my job, if your tool doesn't have an active cal sticker on it, you better take it home or give it to someone in QC to qualify it

  • #4
    Maybe something like #8 here :
    https://www.pcdmisforum.com/forum/pc...ation-question

    Comment


    • #5
      This sounds very similar to a post from yesterday https://www.pcdmisforum.com/forum/pc...cy-in-the-code

      You'd probably have to add a lot of PC-Dmis code to each program to do a thorough job of things. A better suggestion would be to use a script. You would need to store the expiry date of the CMM somewhere on the local PC - text file or maybe look for the calibration cert / results file that the service guy creates when he calibrates the machine. When your programs launch the script, it could then compare the current date with the expiry date and act accordingly. If you wanted to get really cleaver you could have a script that gets launched automatically during the PC start up and watches for the "OnOpenPartProgram" event to trigger your calibration expiry date check. You can also use automation from within your script to cancel execution, close the program or exit PC-Dmis if you want to.
      Last edited by neil.challinor; 05-28-2020, 04:38 AM.
      Neil Challinor
      PC-DMIS Product Owner

      T: +44 870 446 2667 (Hexagon UK office)
      E: [email protected]

      Comment


      • #6
        Mike Ruff fordrox I just realized it right after i wrote that comment. thank you for explaining though

        Comment

        Related Topics

        Collapse

        Working...
        X