ngcgui and M2

More
10 Mar 2013 20:11 #31167 by Rick G
ngcgui and M2 was created by Rick G
The finalize button on ngcgui seems to be programmed to issue an M2 at the end of the program even if there is a post_amble sub.

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.

More
10 Mar 2013 20:48 #31170 by BigJohnT
Replied by BigJohnT on topic ngcgui and M2
M2 should not change the active coordinate system...

John

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

More
10 Mar 2013 21:33 #31173 by ArcEye
Replied by ArcEye on topic ngcgui and M2
Afraid Rick is right JT

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.

More
10 Mar 2013 23:44 - 10 Mar 2013 23:45 #31184 by BigJohnT
Replied by BigJohnT on topic ngcgui and M2
Sure enough it does a whole bunch of stuff... I wonder what % does?

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
Last edit: 10 Mar 2013 23:45 by BigJohnT.

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

More
11 Mar 2013 16:10 #31206 by Rick G
Replied by Rick G on topic ngcgui and M2
Morning John,

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.

More
11 Mar 2013 18:27 #31212 by BigJohnT
Replied by BigJohnT on topic ngcgui and M2
What happens if you put a % at the start of the preamble and a % at the end of your subroutine? That should ignore the M2 that ngcgui tacks on...

John

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

More
12 Mar 2013 13:34 #31275 by Rick G
Replied by Rick G on topic ngcgui and M2
Well when I had tried that an error message was generated as the "%" I believe needs to be on the first line and ngcgui adds several comment lines as the first lines of the program.

Rick G

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

More
12 Mar 2013 19:08 #31282 by BigJohnT
Replied by BigJohnT on topic ngcgui and M2
You could try and change lines 2012 and 2028 in ngcgui.tcl to ouput a % instead of the comment and the m2.

John
The following user(s) said Thank You: Rick G

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

More
13 Mar 2013 17:11 - 13 Mar 2013 17:12 #31315 by Rick G
Replied by Rick G on topic ngcgui and M2
Morning John,

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
Last edit: 13 Mar 2013 17:12 by Rick G.

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

More
13 Mar 2013 18:28 #31319 by BigJohnT
Replied by BigJohnT on topic ngcgui and M2
Morning Rick,

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.

Time to create page: 0.092 seconds
Powered by Kunena Forum