[Pa...] Posted March 23, 2021 Share Posted March 23, 2021 Hi, does anybody have any idea how I could possibly determine the product type being measured based on the height in the Z axis of the temperature probe measurement? This is so that operators cannot load an incorrect part and damage the measuring head... again! I was either thinking of a condition i.e get actual.temp probe.z if less than 315.000 then message “are you sure this is the correct derivative?”. Or would a pcm script be better. Any help is appreciated. Thanks. Paul. Link to comment Share on other sites More sharing options...
[Da...] Posted March 24, 2021 Share Posted March 24, 2021 Even if you put in the condition, what would prevent the operator from clicking "YES" and crashing the machine? It is my opinion that there is nothing more valuable than good training on the proper operation of any machine. If your operators are smart enough to learn how to run their machines, then they are smart enough to learn how to run yours. You should look on the PCM forum, Michael Shultze has quite the conversation (Comparing Paths) about what you are trying to do. Of particular interest is the reply from Eric Moberg and what he has done. Link to comment Share on other sites More sharing options...
[Mi...] Posted March 24, 2021 Share Posted March 24, 2021 We do what you're suggesting with PCM. For most parts we create 1-3 features who's only purpose is to determine correct part and loading. They are the first features that run and they have a PCM condition similar to what you suggest. And then in the post settings for those features we put some PCM code to yell at the operator. Here is an example of an option we use for a CMM that loads two different round-ish parts that look the same, except have a 5mm difference in diameter, in this case we used radius points, but you can do this with just about anything. And those features execute at 30mm/s, so when they crash, nothing bad happens. if (getActual("Part Check Radius Point").radius) < 55.8) positionRS(10.0,-50.0,150.0,baseSystem()) positionCMM(50,-125,-50) message("Verify the part number matches the program and the fixturing is correct!") wait(2) cncBreak() else if (getActual("Part Check Radius Point").radius) > 58.2) positionRS(10.0,-50.0,150.0,baseSystem()) positionCMM(50,-125,-50) message("Verify the part number matches the program and the fixturing is correct!") wait(2) cncBreak() endif endif Eric's way is far superior though. I hope to be able to convince management we need that someday. Link to comment Share on other sites More sharing options...
[Pa...] Posted April 1, 2021 Author Share Posted April 1, 2021 Thanks for the replies. Unfortunately I don’t think my company would spend the money on a camera system although I can see the benefits. So far I have the below pcm but for some reason it does not end the cnc run when I pres “1”, it just continues. It worked until I put the “> greater than” section in. Do you have any ideas as to why? //Prompt the operator to check if the correct part is loaded if the temperature probe measurement is lower than the expected nominal. with_facs=facsIsActive() //Check if facs is active if with_facs==false then //Only run if running in manual mode status_5 = 2 if (getActual("Temp Probe").z) <318.500) message ("Please confirm that the correct part is loaded?") status_5 = inquire("1=CNC-End, 2=Continue. Enter a number") if status_5 == 2 then message ("Are you sure?") status_5 = inquire("1=CNC-End, 2=Continue. Enter a number") if status_5 == 2 then message("The CNC run will continue.") if status_5 == 1 then message("The CNC run will be terminated.") cncBreak() endif endif endif endif if status_5 == 1 then message("The CNC run will be terminated.") cncBreak() endif endif else if (getActual("Temp Probe").z) >319.500) message ("Please confirm that the correct part is loaded?") status_5 = inquire("1=CNC-End, 2=Continue. Enter a number") if status_5 == 2 then message ("Are you sure?") status_5 = inquire("1=CNC-End, 2=Continue. Enter a number") if status_5 == 2 then message("The CNC run will continue.") if status_5 == 1 then message("The CNC run will be terminated.") cncBreak() endif endif endif endif As you can see I have a +/- 0.5mm tolerance but if I select 1 to cancel the cnc run, it continues. Does anybody have an idea why? It works well without “greater than” section. Thanks. Paul. Link to comment Share on other sites More sharing options...
[No...] Posted April 1, 2021 Share Posted April 1, 2021 Unfortunately I havent't got the time to analyze your code any deeper right now, but what strikes me on first sight is that you're nesting all your if statements, which doesn't seem to make any sense. When you put an if statement, it has to be followed by all the actions to be taken when the condition is true, then you end the list of actions with an endif or an else, followed by the actions to take when it's not true, and a final endif. The way you wrote it you make the second, third etc. if statement dependent on the result of the very first one. That CAN be intentional in some situations, but it seems that it's not in this case, since you nest contradictory statements (if status == 1 and if status==2). I dont't see yet where it fails, but I'm not surprised that it does. Link to comment Share on other sites More sharing options...
[Er...] Posted April 1, 2021 Share Posted April 1, 2021 if not(facsIsActive()) if (getActual("Temp Probe").z <318.500) or (getActual("Temp Probe").z >319.500) if not(confirm("Please confirm that the correct part is loaded")) endInspection() endif endif endif Link to comment Share on other sites More sharing options...
[Pa...] Posted April 13, 2021 Author Share Posted April 13, 2021 Thanks Eric for your help and tidying up, Here is what i ended up with:- if not(facsIsActive()) //Only run if running in manual mode status_5 = 2 if (getActual("Temp Probe").z) <315.200) or (getActual("Temp Probe").z >316.200) message("Please confirm that the correct part is loaded?") status_5 = inquire("1=CNC-End, 2=Continue. Enter a number") if status_5 == 2 then message("Are you sure?") status_5 = inquire("1=CNC-End, 2=Continue. Enter a number") endif //endif if status_5 == 2 then message("The CNC run will continue.") endif if status_5 == 1 then message("The CNC run will be terminated.") cncBreak() endif endif endif Thanks again. Paul. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in