M200 G code yes no

All things related to Centroid Oak, Allin1DC, MPU11 and Legacy products

Moderator: cnckeith

Post Reply
bakeng
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

M200 G code yes no

Post by bakeng »

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.
cncsnw
Posts: 3763
Joined: Wed Mar 24, 2010 5:48 pm

Re: M200 G code yes no

Post by cncsnw »

That would be M224.

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
bakeng
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

Post by bakeng »

I will give it a try.
Thanks
cnc_smith
Posts: 237
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

Post by cnc_smith »

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
Attachments
M224 - Y or N.txt
M224 Asking question
(387 Bytes) Downloaded 183 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
bakeng
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

Post by bakeng »

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.
cnc_smith
Posts: 237
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

Post by cnc_smith »

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."
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
bakeng
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

Post by bakeng »

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.
Post Reply