ngcgui and M2
There may be times when you do not want this.
For example if you are working in G55, move around with G0 or G1 moves then run a sub in G55 when the sub finishes running an automatic M2 command will return you to G54.
You now have to remember to issue a G55 command before your next G0 or G1 move.
Is there an option / way to avoid this?
Rick G
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.
It cancels cutter compensation and loads of other stuff too.
As far as I remember the M2 is always appended to the end of the generated file, so probably easier to comment it out, rather than hack the ngcgui files
Please Log in or Create an account to join the conversation.
A G code file must contain one or more lines of G code and be terminated with a Program End. Any G code past the program end is not evaluated.
If a program end code is not used a pair of percent signs % with the first percent sign on the first line of the file followed by one or more lines of G code and a second percent sign. Any code past the second percent sign is not evaluated.
John
Please Log in or Create an account to join the conversation.
Looks like starting and ending with % does not cause all the changes that M2 does. The active coordinate system does not change.
Rick G
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.
Rick G
Please Log in or Create an account to join the conversation.
John
Please Log in or Create an account to join the conversation.
Good ideas, what I have done for now is...
Edit ngcgui so first line it produces is "%" before it's comment lines.
Use a postamble sub that issues a " %" to end the subs.
I also edited the m2 lines as you suggested to send "%" instead of m2.
I did not realize all that a M2 command does...
To end a program, program M2. To exchange pallet shuttles and then end a program, program M30. Both of these commands have the following effects.
1. Change from Auto mode to MDI mode.
2. Origin offsets are set to the default (like G54).
3. Selected plane is set to CANON_PLANE_XY (like G17).
4. Distance mode is set to MODE_ABSOLUTE (like G90).
5. Feed rate mode is set to UNITS_PER_MINUTE (like G94).
6. Feed and speed overrides are set to ON (like M48).
7. Cutter compensation is turned off (like G40).
8. The spindle is stopped (like M5).
9. The current motion mode is set to G_1 (like G1).
10. Coolant is turned off (like M9).
No more lines of code in an RS274/NGC file will be executed after the M2 or M30 command is executed. Pressing cycle start will start the program back at the beginning of the file.
Rick G
Please Log in or Create an account to join the conversation.
I'm glad you got that sorted out. I had forgot all that M2 does...
John
Please Log in or Create an account to join the conversation.