Hey there. I've been tasked with coming up with a sub-routine that can be run at the beginning of programs for new product coming thru. Essentially, when you start the program, it will check to see when was the last time the probes were calibrated. If it has been more than 24 hours, the program will stop. We have other measures in place where we do make sure to calibrate every 24 hours. We are also using the feature in the probe utilities box that gives the warning if it has been more than 24 hours since calibration, but that isn't good enough. We need to have it so the program won't run, basically brick the CMM. I've heard that there is something in newer versions of PC-DMIS that will check the calibration time and stop it if it has been past a certain time, but we are running PC-DMIS 2013 MR1, and it doesn't have that feature.
I've been pouring around thread after thread here on the forum along with the help file and notes from my level 3 class. I've found a way to do it here on the forum. I was able to get it way to work, but I wasn't understanding all that I was typing in. It was more of a monkey see, monkey do thing. It was rather lengthy and involved code as well. I was looking for something a little more simple and straight forward. I thought that I had come up with the perfect solution, but then I got stuck.
Below is what I came up with. I have it check the current date and time. Then I have it check the date and time of when a specific probe angle was last calibrated. I combine the current date and time and the calibration date and time to get it into a format for the CSV file. When I save it, I tell it to save the current date and time on one line and the calibration date and time on the next line. Then I have it insert the formula into the CSV file.
I was so excited that this worked. The only issue is that I have tried several ways to get it to read the value from the CSV file, but every time that I tell it to read the file, it reads the formula, =(A1-A2)*24, instead of the result, 24.3658. I've used the readline function very little, so I'm not overly familiar with it to know what I may be doing wrong or missing. Any help would be greatly appreciated. I hope that there is something that I am missing, but I'm fearful that maybe it just isn't possible for PC-DMIS to read anything other than the =(A1-A2)*24.
calibration_time.JPGcalibration_time_CSV.JPG
I've been pouring around thread after thread here on the forum along with the help file and notes from my level 3 class. I've found a way to do it here on the forum. I was able to get it way to work, but I wasn't understanding all that I was typing in. It was more of a monkey see, monkey do thing. It was rather lengthy and involved code as well. I was looking for something a little more simple and straight forward. I thought that I had come up with the perfect solution, but then I got stuck.
Below is what I came up with. I have it check the current date and time. Then I have it check the date and time of when a specific probe angle was last calibrated. I combine the current date and time and the calibration date and time to get it into a format for the CSV file. When I save it, I tell it to save the current date and time on one line and the calibration date and time on the next line. Then I have it insert the formula into the CSV file.
I was so excited that this worked. The only issue is that I have tried several ways to get it to read the value from the CSV file, but every time that I tell it to read the file, it reads the formula, =(A1-A2)*24, instead of the result, 24.3658. I've used the readline function very little, so I'm not overly familiar with it to know what I may be doing wrong or missing. Any help would be greatly appreciated. I hope that there is something that I am missing, but I'm fearful that maybe it just isn't possible for PC-DMIS to read anything other than the =(A1-A2)*24.
calibration_time.JPGcalibration_time_CSV.JPG
Comment