Jump to content

Custom Scripting with Calypso/Zeiss Inspect?


---
 Share

Recommended Posts

Some recent questions on here have popped up on how to do "X" if "Y" happens. Is anyone using custom scripts (Python, Powershell, etc) to handle these problem sets?

At my job, I have tried to automate repetitious tasks and different alerts for certain conditions using Powershell and Python scripts (big shout out to ChatGPT for scripting, it's amazing).

I'd love to hear some cool examples of how you guys are using scripts with Calypso or Zeiss Inspect in your programming or even for things around the office.
Link to comment
Share on other sites

Please sign in to view this username.

  I learned python when I saw the need with the CTs. Basically, watched videos, ran through a book during my nights, and eventually got decent with it. I'm glad I learned and struggled before chatgpt so I got a good dosage of the fundamentals. And I also forced myself to code in the GOM IDE instead of visual studio or pycharm so I'd learn the syntax better.  Most of the stuff I do myself, but when I need a quick routine to check something I won't do again, I'll just go to chatgpt and then delete the script once I'm done.

When I first started I re-did all out scan and report scripts from scratch and exported all the time, part, etc, data to a daily excel sheet. Then it combines it at the start of each month. All automatically, for instance, I capture every scan start, end, post processing time, materials found, which CT, part number, gray value, each day. Then once a new month is detected on the first scan of the new month it compiles all the data for a monthly report. We use this data for a lot of reasons, but utilization is one of them. I have another script for utilization, where it pulls from this data to provide metrics for management. I have a cool Gage RR script that asks for a mesh folder, opens the program and runs each mesh individually and kicks out a pdf of each report and uses the csv data to create a custom Gage RR for us.   There is a downloadable Stats tool, but I didn't know that when I made this script, and I do like my data customized. I track all our failed dimensions and pass fail rates, separated by machine for finding poor running machines or maybe a bad program on our end. These are daily outputs and monthly. I used openpyxl for all my csv and excel manipulation and creation. I prefer saving xlsx b/c I can format the cell width and stuff over csvs. Ive been using the native csv module in python more now as well. I have recently started playing around with pandas for excel and csv and paid for a python course online if I ever get around to doing it. I'd like to learn more modules for data, stats, perhaps at least under stand what is going on with the AI machine learning stuff inside python. I'm in a non-coding mood recently though. Trying to take a break and not re-invent the wheel every 100 days.  Due to the ability to do anything I was with the CT, I'm then asked to do alot of if this then do this stuff. So my scan and report scripts are both over 3000 lines long each.  I also have all our programs backed up daily and the CT talks to our operators in case a network fails and explains where reports or meshes are going temporarily until the network is back up.  Nothing too high level, but was a lot of time spent dialing in the script to function as I wanted.   I just got pcdmis to run a python script so I'm testing a simple csv file manipulator on that right now. Not sure it is going to work though.

 

Why are you using powershell?  I've never seen the need and do all my stuff directly in python.  Also, what is PCM, I keep seeing that abbrev.

Edited
Link to comment
Share on other sites

Please sign in to view this username.

 My first experiences scripting started with Powershell. Automatic reporting via email from a CMM to be exact. Like many who start scripting, I would cobble together lines of code, and get the fundamentals under my belt. With Powershell, there is something called the ImportExcel module that probably is very similar to your openpyxl module. Powershell has always suited my needs when I needed to manipulate data outside the software. Now with ChatGPT, I can bang out polished custom or one off scripts at lightning speed. GPT is fantastic not just for getting a working script but also for commenting, error handling and cleanup.

PCM stands for "Parameter Coded Measurement". It is an add-on to Calypso inspection software that allows for automation much like the Python add-on in the GOM and Zeiss Inspect software. I would consider myself an advanced PCM programmer, but I do not currently use it as there is no need at my current job. I do use the Python add-on for Zeiss Inspect X-ray 2023 and I would argue it has much more functionality and support than PCM.

Your gage R&R script sounds pretty dope, and is giving me ideas. In my line of work part traceability is very important, so I developed an interactive script for selecting, naming, copying to a new part, and exporting STL files all at once. This is very useful when you have fifty parts in a scan and need to make sure the file names match the actual samples.

I love being able to take a tedious, repetitious task, click a button and all the magic happens. Just today, a coworker needed to sort through 150 PDFs and look for some missing information. Within about 5 minutes, I had a working script that ripped the text out of the PDF files, searched the text files for a specific phrase, then copied all the PDF reports that were missing this phrase to another folder. He still has to go back and fix the PDFs, but at least he knows where to focus his efforts. We have a Zeiss CMM that exports an Excel file at the end of every part run. Sometimes we run 50+ parts, so that's 50+ Excel files that need to be opened, copy the actuals, and then paste into a single report that holds all the dimensions, and close the files. Scripting took care of all that. I can grab 50 Excel files, rip the data I need out of them, hold it in an array, and then create a new Excel and paste it all in there within 15 seconds. No mistakes, no wasted time.

Automate Everything!

Link to comment
Share on other sites

We think very much alike....I scrape pdfs for several things when hunting down a problem. I save all our failed pdfs in an archived folder so I can hunt stuff down if there is a problem a year later.  Traceability is a bad word in my office b/c it has forced me to add way more to our code than I'd like.   I never knew powershell was a thing...I thought it was just like cmd with admin access or something. Seems like they made cmd on steroids or something.  

Link to comment
Share on other sites

Powershell is powerful stuff.. if you are on a windows machine, type "ISE" in the taskbar search. I usually right click and run as administrator to avoid any issues, but you can run it at the user level too. If your IT department has an execution policy for scripting outside of the administrator level, there is a Powershell parameter called -Force that bypasses restrictions or confirms actions without prompting for input. If that would be the case, you could still run Powershell scripts by including set-ExecutionPolicy Bypass -Force at the beginning of the script. It only affects the script session running, not the global execution policy. Anyway, might be worth checking out!

Link to comment
Share on other sites

 Share

×
×
  • Create New...