Macro

More
17 Aug 2017 14:05 #97625 by smplc
smplc created the topic: Macro
Does LinuxCNC parametric programming have custom macro similar to Fanuc G65, G66, G67 and P, M or G9### and underlays canned cycles? For instance a drill fixed cycle or a roughing cycle with looping and branching. Are any parametric programming algorithms reference sources of a multi-repetitive, non-monotonic and Type 2 cycle (Fanuc G71) without air cuts and not like roughing an existing pattern and casting (G73)? Does LinuxCNC have a parametric programming quick reference key and where?
More
17 Aug 2017 14:45 - 17 Aug 2017 14:56 #97632 by Todd Zuercher
Todd Zuercher replied the topic: Macro
I am not real familiar with Fanuc macro calls (not all of our Fanuc machines have Custom Macro enabled.) so I don't use them much.

Linuxcnc does not have a Modal call similar to M66. (To the best of my knowledge, but it wouldn't be the first time I was wrong.)
But to the best of my knowledge most of the same functionality as G65 can be achieved with Linuxcnc's O-subs. With one glaring difference. Linuxcnc does not have a goto funtion. You can usually work around this if you're clever in your parametric programming. But it can make porting existing Fanuc code over to Linuxcnc a bit of a pain.
Here is a link to the O-Word section of the Linuxcnc Docs.
linuxcnc.org/docs/html/gcode/o-code.html
And the Parameter section of the G-Code Overview.
linuxcnc.org/docs/html/gcode/overview.html#_parameters

It might be possible to add G65, G66, G67 functionality without too much difficulty using Remapping. G65,G66, and G67 are currently undefined and open for remapping. (I believe someone recently added Fanuc style M98/M99 support this way.)
linuxcnc.org/docs/html/remap/remap.html
Last Edit: 17 Aug 2017 14:56 by Todd Zuercher.
More
17 Aug 2017 15:02 #97638 by smplc
smplc replied the topic: Macro
LinuxCNC O-Codes similar Fanuc N### (line number). i.e. GOTO 111; N111; G70 P111; DO 111; END 111;
More
17 Aug 2017 15:20 #97643 by Todd Zuercher
Todd Zuercher replied the topic: Macro
As far as I know Linuxcnc completely ignores N### line numbering, so it can't be used for referencing a GOTO or other branch/loop fuctions. But you can use the o-word while/endwhile, do/while, if/elseif/else/endif, repeat, and call.
More
17 Aug 2017 16:02 #97650 by smplc
smplc replied the topic: Macro
Understood. I haven't reference source a parametric algorithm of a canned cycle similar to Type 2 foregoing. I can set a counter to do a non-monotonic profile but it has some air passes yet. It could require some nested loops, branching and arithmetic expressions. I'll have to improvise, experiment and test it simulated.
More
17 Aug 2017 16:02 #97651 by andypugh
andypugh replied the topic: Macro
G71 / G72, if you mean lathe roughing cycles is a "work in progress".
There is a simple (no pockets) version here:
github.com/LinuxCNC/linuxcnc/tree/BenPotter/G71
And a more complicated (with pockets) one here done as a remap in Python (but it has limitations)
github.com/LinuxCNC/linuxcnc/tree/andypugh/g71type2remap

The remap version could, in theory, be used on a standard install without recompiling.
More
18 Aug 2017 01:15 #97679 by smplc
smplc replied the topic: Macro
The G71 and G72 monotonic (no pockets) link reminds me of scripture and not very identifiable. Seen some it's G-code ISO too and I already knew text.

I was looking for source code or C. Python appears an interpreter. Maybe close enough. configs/sim/axis/g71/python/remap.py

I see SUB can get used like custom macro G65.
More
18 Aug 2017 14:43 #97704 by smplc
smplc replied the topic: Macro
github.com/LinuxCNC/linuxcnc/commit/f4f0...cc7d5de2bfeab66a4b25
G71 and G72 Type II: Change to a better algorithm with clues for the …
Time to create page: 0.082 seconds
Powered by Kunena Forum