Basic macro questions
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
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:
MACRO = i_am_lost
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