Jump to content

Programmable stop with parameters?


---
 Share

Recommended Posts

Has anyone made a programmable stop which relies on a measurement to be within a specific tolerance before it continues?

I would like to add something like this to the program to ensure the part is being placed in the fixture correctly. If for some reason it is not, I would like for the run to cancel.

Any advice would be greatly appreciated 😃
Link to comment
Share on other sites

Blake,
Please go to the Extras->Settings->Miscellaneous menu and post a screenshot, we will be able to identify what licenses you have from that. 2915_2d9cacab0178c1e15d57f25a802298c5.png
Edit: That smashed together quite poorly. The left side is how to get to the menu in question, the right is the menu we are interested in...Dont cover that up in your screenshot the way I did
Link to comment
Share on other sites

The problem is even if you have PCM, doing this is a bit advanced if you don't have any coding experience. I could give you code that would do what you want, like below. You should never use code you don't understand, because then you can't diagnose it. PCM is very useful so if you have it available I highly suggest you take the course to learn the basics and then spend the time to get good with it.
//Pt. Start Check - SA
if (abs(getActual("Pt. Start Check - SA").coordPolRadius - getNominal("Pt. Start Check - SA").coordPolRadius) > startCheckRadTol) or (not(getActual("Pt. Start Check - SA").materialDetected)) then
	setInspectionDrivingSpeed(80)	
	positionCMM(xPos,yPos,zPos)
	message("Wrong part loaded, or part is not loaded correctly"+cr()+ "				Reload part and try again")
	cncBreak()
endif
But it would need modified for your use, all the names and variables pertain to my CMMs and my thought process, to use that code you would need to change most of it to suit your use case.
Link to comment
Share on other sites

This makes me smile. As a contract CMM Programmer, I don't get to play with this kind of stuff anymore because most of my customers couldn't diagnose anything PCM related. My favorite issue is when only certain CMMs have the PCM license. How can we get purchasing teams to include experts when buying CMMs?

Please sign in to view this quote.

Link to comment
Share on other sites

Please sign in to view this quote.

That would be such a different thought process than what I have to do lol.

We have many CMMs, with many hundreds of programs that run daily. That is the reason there is so many seemingly unnecessary variables in the code sample. By using the variables I can reuse that code in many programs all controlled by a couple external files.
Link to comment
Share on other sites

Please sign in to view this quote.

Maybe short term whomever post lines of PCM code to help a less experienced programmer out might highlight the text that needs changed, as well as instructions on where to place said code?
Link to comment
Share on other sites

Please sign in to view this quote.

That's a very deep rabbit hole to go down, sharing code is great, but if you have to explain where to put it the person receiving needs to do some learning before using it, otherwise they won't be able to deal with it if something goes wrong.
Link to comment
Share on other sites

Ideally, if we were all writing PCM the way we "should", it wouldn't be necessary to explain when posted, because it would all have clear, descriptive comments included in the code. But as they say, people in glass houses and all that, so I'm going to go back to trying to figure out this PCM code I wrote a year ago.


If only I had included comments...
Link to comment
Share on other sites

Please sign in to view this quote.

I have a working knowledge of PCM, mainly as it pertains to part families (geometry is the same but part grows) I use a generic template that can be modified per each new program, creating para files with the variables (swapping out nominals and models).
I could use your code, but still need to know if it goes in the pre or post settings, or the feature/characteristic itself.
Link to comment
Share on other sites

Please sign in to view this quote.

Indicating where the PCM would go or be used is entirely reasonable. I was merely using this opportunity to highlight that PCM, like any form of coding, is best done with comments in the code for clarity as it was relevant to the post. This is something which I am entirely guilty of not doing, and also encounter in the field all the time, so was also using a bit of self-effacing humor to convey that this was in no way an attack on anyone, just a convenient and relevant time to note the value of comments in code, whether for future programmers who work with our code, or ourselves in the future(something I am genuinely kicking myself for as I try to modify code I wrote a while back).
Link to comment
Share on other sites

Please sign in to view this quote.

Again rabbit hole, the code I posted requires a lot more than just where to place it, that's what I'm saying. That knowledge really needs to come from specific training, not a few messages on a forum. Forums are great help, but not for teaching a whole module of the software. I just posted it as an example of what is possible, on the off chance the OP does have some coding experience they will likely understand the gist of what I posted.

It won't function period without the program in question being setup for it, and some of it is straight up dangerous if used incorrectly. I do not recommend anybody should drop it into a program and try to use it.
Link to comment
Share on other sites

in the POST-SETTINGS of the FEATURE:
if getActual("featureName").x > [nominal+upperTolLimit] //(this is where you have to get specific to the feature and info and can get creative.  Parameters exist to pull this info but are quite a bit more complex.  I advise you learn the basics first)
	messsage("Tolerance Exceeded" +cr()+"Run will end") //this is your message to display if the out of tolerance condition exists
	positionCMM(30,-30,-30,"Z","X","Y")	//this will send the machine to near home location, 30Z first, then -30X, then -30Y.
	cncBreak()//this ends the program and red-lights the CMM
	else //alternate result if condition false
	display("PASS - Inspection Continue") //display text without a message prompt so inspection carries on without intervention
	endif
As always with PCM - USE AT YOUR OWN RISK. Lack of understanding of the functionality of the code you are implementing can result in devastating consequences. Things as simple as a mis-calculation to a full-speed machine crash or controller failure. With PCM, the sky is the limit. That applies to the possibilities of added functionality as well as added risk.

Adding the comments gave me great joy as it allowed me to rub Kevins nose in it a little 🤣
Link to comment
Share on other sites

 Share

×
×
  • Create New...