hexagon logo

2 different parts in the same program

Been requested to merge two separate programs into one. Been searching around the forums this morning and haven't been able to find anything about this.
I have 2 programs I wrote a few months ago for separate parts and have been asked if I'd be able to merge those programs together so our operators can start the program and walk away for both parts to be checked in one shot.
The only idea I currently have is to add both cad models and essentially write 2 programs in 1. Not sure if I can run an If/Then for it or not (I haven't had to use any If/Then commands in the past)

I have just over a year of experience of programming CMMs and have taken CMM 101 and 201.
Running PC-DMIS 2022.1
  • Since you've already got the two separate programs working fine, you can make each program a Subroutine, then create a "master" program that calls those two programs as sub. Basically, open each program and insert->flow control-> subroutine at the top of the program and End Routine at the end. In your master program, Callsub both programs. As always, make backups before you start experimenting!

    I don't use subs because the data in the sub are not viewable after execution which makes troubleshooting impossible via the master program.

    The other way is as you thought. Import both cad setup and copy both programs into a single program. It's literally two programs written in one file.
  • I've never had to do that but I think you are on the right path. Make sure your fixturing is solid. Import both models, program 1 part and then the other. What about reporting? Are you doing to need 2 individual reports or 1 report for both parts? Are both parts going to be on the CMM every time? Like the program and check both parts but sometimes they just put 1 part on...
  • Other option:

    Open the first program, save it as your new program name.

    At the end of the first program section, insert the STARTUP alignment back in, go back into MANUAL mode and insert your second program in. Make sure you have proper move points, workplanes, probes, instructions, etc in place. Then save.

    This way the reporting will all be on one report and in one program.

    Added: The only MAJOR issue with doing this is that if the features / alignments / dimensions / labels / etc are named the same you are going to have an issue! So any naming convention will need to change on the second program to not coincide with the first program.
  • Luckily, they machine both parts together, so they run them on the CMM together as well. 1 report will work as long as they can differentiate between the dimensioning (That will come down to my labeling, I'm guessing)
  • The only MAJOR issue with doing this is that if the features / alignments / dimensions / labels / etc are named the same you are going to have an issue! So any naming convention will need to change on the second program to not coincide with the first program.
  • good idea, open main program, call part 1 sub, print report, call part 2 sub, print report, done.
  • You can copy, Paste with Pattern with 1 instance and no offsets to quickly avoid names being overridden. You may have to rename if you give your features specific names. I generally don't rename features except for datums so this method works well for me.
  • I'll keep that in mind. Luckily they're both somewhat simple, So I wouldn't have a ton of renaming/labeling if I needed to. Thanks for the heads up!