New option to end a program with % or M2

More
12 years 9 months ago #42348 by Rick G
There seems to be more documentation on M2. And if you look that up you can see exactly what it does.
The idea is that % will just stop the program without all those unwanted changes.
Keep in mind you will have to use the NOM2 option or edit the resulting ngcgui sub before running it it use the % or ngcgui will add a M2 to the end and the % need to be at the beginning.

Rick G

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #42369 by somenewguy
ok so you are confirming % does nothing more than end a program?

I am not sure what you mean by NOM2 option, also I can't find the postamble that is being applied to my subs. I see the default preamble std-in.ngc, but there is a single line w/ two comments being appended to the file wit hthe M2 and I don't know where or how to configure that.

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago - 12 years 9 months ago #42370 by Rick G

I can't find the postamble that is being applied to my subs. I see the default preamble std-in.ngc, but there is a single line w/ two comments being appended to the file wit hthe M2

If you did not select a postamble then none is being used, the M2 is doing everything.

M2 does the following

Change from Auto mode to MDI mode.
Origin offsets are set to the default (like G54).
Selected plane is set to XY plane (like G17).
Distance mode is set to absolute mode (like G90).
Feed rate mode is set to units per minute (like G94).
Feed and speed overrides are set to ON (like M48).
Cutter compensation is turned off (like G40).
The spindle is stopped (like M5).
The current motion mode is set to feed (like G1).
Coolant is turned off (like M9).


There is a bit of info here...
linuxcnc.org/docs/html/gcode/overview.html

It is my understanding that if you start with a % and end with a % the last % is just that, end the program. So I am sure to apply a M5 (spindle off) before ending the program an not relying on the end of program or M2 to turn the spindle off.
You can still use a M2 in a program that starts and ends with % however M2 ends the program at the M2 point and noting is read beyond it.

NOM2 is an option for the latest version of ngcgui. Probably only available as a patch or on Master. The default behaviour is for ngcgui to end all subs with a M2, if you select this option then all subs start and end with % and M2 is not automatically added to the end.
To see this create a sub and instead of auto sending it to linuxcnc save it to a file. You can then edit that file before running it to experiment.

Rick G
Last edit: 12 years 9 months ago by Rick G.
The following user(s) said Thank You: somenewguy

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #42374 by somenewguy
ok I think I will continue to sit on 2.5.3, and wait for 2.5.4 to be released as I assume it will give me the updated ngcgui. I can manually remove the M2 for now and start using a postamble. I thought single line being added WAS from a post amble file that only had that one line. Wrong on that count. Traveling for work soon, the day before I leave I am pulling my controller out and shipping it off for a repair, none of my digital outputs work anymore... Of course it will probably be cheaper to just buy a new board and have 2. Then I will actually care about spindle control, currently there is just al light switch involved. Everything is wired for control but not very usefull without digital out...

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #42378 by andypugh

somenewguy wrote: ok I think I will continue to sit on 2.5.3, and wait for 2.5.4 to be released.


Might be a long wait, I think the next release will be 2.6 :-)

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #42382 by Rick G
Glad you are getting it sorted out.


Rick G

Please Log in or Create an account to join the conversation.

Time to create page: 0.331 seconds
Powered by Kunena Forum