Basic macro questions

More
27 Sep 2013 20:33 #39266 by thet
thet created the topic: Basic macro questions
Hello Community,

I have some basic questions on macro usage in linuxcnc.

Is it possible to execute gcode within self defined macros (e.g. M101)? All examples I found searching the web are executing hal_cmd or other bash code. But no example showing how to let's say move the cnc mill in a rectangle shape.

I found out, that I could do such using python and import linuxcnc module and execute a mdi command. But that does only work as a single G-code line in MDI mode and not when I use that M-code within a ngc file.

Can you give me a hint how to use macros properly?
Or maybe macros aren't the best way to do that?


Ubuntu 10 LTS version
with axis 2.5
More
27 Sep 2013 23:44 - 27 Sep 2013 23:45 #39276 by BigJohnT
BigJohnT replied the topic: Basic macro questions
LinuxCNC doesn't use macros. Look in the User Manual under O Codes. For M1xx also look in the User Manual. Also look at ngcgui in the manual.

JT
Last Edit: 27 Sep 2013 23:45 by BigJohnT.
More
28 Sep 2013 05:27 #39294 by newbynobi
newbynobi replied the topic: Basic macro questions
Or just use gmoccapy, it support macros.

For details see the corresponding WIKI page.

Norbert
More
28 Sep 2013 19:43 - 28 Sep 2013 19:44 #39317 by BigJohnT
BigJohnT replied the topic: Basic macro questions
A macro in gmoccapy is the same as a mdi in Axis it just runs a G code program. Also note that gmoccapy is for a touch screen.

You can add macros to gmoccapy, similar to touchy's way.
A macro is nothing else than a ngc-file. You are able to execute complete CNC programs in MDI mode, by just pushing one button.
To do so, you have to add a section like so:

[MACROS]
MACRO = i_am_lost


JT
Last Edit: 28 Sep 2013 19:44 by BigJohnT.
More
28 Sep 2013 22:32 #39327 by ArcEye
ArcEye replied the topic: Basic macro questions

But no example showing how to let's say move the cnc mill in a rectangle shape.


Make a file called rect.ngc which contains something like
o<rect> sub
	GOO X0 Y0 Z2
	GO0 Z0.1
	G01 Z-0.1
	GO1 X90 Y90
	G01 X180 Y0
	G01 X90 Y-90
	G01 X0 YO
	G00 Z2
o<rect> endsub

Then call it in your code with

o<rect> call

regards
More
29 Sep 2013 03:18 #39335 by thet
thet replied the topic: Basic macro questions
Thank you all for your help.

The subroutine solution (ngc o-code) worked for me.
... for now ;)

Now I will dig a little bit deeper in python based subroutines (found some python code that looked like subs).

regards
More
29 Sep 2013 22:48 #39356 by newbynobi
newbynobi replied the topic: Basic macro questions
Hallo John,

you are right, but you can run a complete subroutine in gmoccapy or touchy by just pressing one button.
I thought, that is what he weant's.

And I have to to also some advertising for my GUI ;-)

Norbert
More
30 Sep 2013 07:00 #39372 by BigJohnT
BigJohnT replied the topic: Basic macro questions
You can do the same thing in Axis as well...

JT
Time to create page: 0.168 seconds
Powered by Kunena Forum