I need to add a pause and ask a question to my g code. Based on the user answer jump to a certain point in my program.
I tried M200 but could never get it to work.
Basiclly I just want to ask the machine operator if a hole needs to be drilled. If not skip that part of the code.
M200 G code yes no
Moderator: cnckeith
Re: M200 G code yes no
That would be M224.
You will have to phrase your question so it takes a numeric answer. E.g.
You will have to phrase your question so it takes a numeric answer. E.g.
Code: Select all
M224 #101 "Enter 1 to drill the hole, or enter 0 to skip"
IF [#101 != 1] THEN GOTO 20
; drill the hole...
N20
-
- Posts: 66
- Joined: Wed Nov 16, 2011 5:50 pm
- Allin1DC CNC Controller: No
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC11: Yes
- CPU10 or CPU7: Yes
Re: M200 G code yes no
I will give it a try.
Thanks
Thanks
-
- Posts: 238
- Joined: Mon Nov 20, 2017 10:13 am
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC11: Yes
- CPU10 or CPU7: Yes
- Location: Frenchville, PA
Re: M200 G code yes no
Here is another way to right the G-code with the M224. This one has a GOTO to go back to ask the question again if they do not answer 1 or 2. This way if they fat finger a number besides 1 or 2 it does not go through and do any part of the program.
download/file.php?mode=view&id=1783&sid ... 35d8fb72ad
download/file.php?mode=view&id=1783&sid ... 35d8fb72ad
- Attachments
-
- M224 - Y or N.txt
- M224 Asking question
- (387 Bytes) Downloaded 185 times
Dana
When requesting support, please ALWAYS post a current report.
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
When requesting support, please ALWAYS post a current report.
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
-
- Posts: 66
- Joined: Wed Nov 16, 2011 5:50 pm
- Allin1DC CNC Controller: No
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC11: Yes
- CPU10 or CPU7: Yes
Re: M200 G code yes no
Thanks guys. I will try these today.
Seems odd you cant look for a Y or N instead of a number.
Can the #300 variables be used? It looks like they are for text (string) format.
Seems odd you cant look for a Y or N instead of a number.
Can the #300 variables be used? It looks like they are for text (string) format.
-
- Posts: 238
- Joined: Mon Nov 20, 2017 10:13 am
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: No
- Oak CNC controller: No
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC11: Yes
- CPU10 or CPU7: Yes
- Location: Frenchville, PA
Re: M200 G code yes no
Yes the M300 variable can be used but not for a comparison.
You are right the they are for text (string) format.
They can be used in M223, M234, M225.
Also the can be used with the M120 and M121. M120 & M121 are used to write information to a file or append a file with additional information
Example of M120:
M224 #300 "Please enter the file name that you wish to save your data to:\n"
#350 = "c:\cncm\"
M120 "#350\ncfiles\#300.cnc" ; This writes the information to the file name they gave in the M224 in the directory c:\cncm\ncfiles with the extension .cnc. This would save the operator writing the full path and make sure it is going into the directory that the program is expecting it to go into with the correct extension.
There is a lot that can be done but I what to try and kept it KIS at this time. I have write macros that have more than 2 options for answer then have used the numbers in comparison with other variables. I have missed putting in checks to make sure the answer for the number was not out of range and got burnt by going into a section that could and/or did case a crash and also got programming errors will trying to test the macro.
As the saying goes" You try to write code to cover for the Idiot, but the keep making Smarter Idiots that that can still break it."
You are right the they are for text (string) format.
They can be used in M223, M234, M225.
Also the can be used with the M120 and M121. M120 & M121 are used to write information to a file or append a file with additional information
Example of M120:
M224 #300 "Please enter the file name that you wish to save your data to:\n"
#350 = "c:\cncm\"
M120 "#350\ncfiles\#300.cnc" ; This writes the information to the file name they gave in the M224 in the directory c:\cncm\ncfiles with the extension .cnc. This would save the operator writing the full path and make sure it is going into the directory that the program is expecting it to go into with the correct extension.
There is a lot that can be done but I what to try and kept it KIS at this time. I have write macros that have more than 2 options for answer then have used the numbers in comparison with other variables. I have missed putting in checks to make sure the answer for the number was not out of range and got burnt by going into a section that could and/or did case a crash and also got programming errors will trying to test the macro.
As the saying goes" You try to write code to cover for the Idiot, but the keep making Smarter Idiots that that can still break it."
Dana
When requesting support, please ALWAYS post a current report.
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
When requesting support, please ALWAYS post a current report.
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
-
- Posts: 66
- Joined: Wed Nov 16, 2011 5:50 pm
- Allin1DC CNC Controller: No
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC11: Yes
- CPU10 or CPU7: Yes
Re: M200 G code yes no
Believe me, I understand.
I am mainly an automation engineer and am a master level programmer in several languages.
Its amazing what an "idiot" can do to an "idiot proof" machine.
When I'm asked to design and build an "idiot proof" machine, I always ask the customer if they really want idiots running there machine.
I am mainly an automation engineer and am a master level programmer in several languages.
Its amazing what an "idiot" can do to an "idiot proof" machine.
When I'm asked to design and build an "idiot proof" machine, I always ask the customer if they really want idiots running there machine.