This commit is contained in:
Thaddeus-Maximus
2026-04-03 15:58:58 -05:00
commit f3953d66ae
1516 changed files with 586639 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
o<change> sub
;(debug, in change tool_in_spindle=#<tool_in_spindle> current_pocket=#<current_pocket>)
;(debug, selected_tool=#<selected_tool> selected_pocket=#<selected_pocket>)
;otherwise after the M6 this information is gone!
#<tool> = #<selected_tool>
#<pocket> = #<selected_pocket>
; we must execute this only in the milltask interpreter
; or preview will break, so test for '#<_task>' which is 1 for
; the milltask interpreter and 0 in the UI's
O100 if [#<_task> EQ 0]
(debug, Task ist Null)
O100 return [999]
O100 endif
;first go up
G53 G0 Z[#<_ini[CHANGE_POSITION]Z>]
; then move to change position
G53 G0 X[#<_ini[CHANGE_POSITION]X>] Y[#<_ini[CHANGE_POSITION]Y>]
; cancel tool offset
G49
; using the code being remapped here means 'use builtin behaviour'
M6
O200 if [#<_hal[gmoccapy.toolmeasurement]> EQ 0]
O200 return [3] ; indicate no tool measurement
O200 endif
G53 G0 X[#<_ini[TOOLSENSOR]X>] Y[#<_ini[TOOLSENSOR]Y>]
G53 G0 Z[#<_ini[TOOLSENSOR]Z>]
O300 if [#<_hal[gmoccapy.searchvel]> LE 0]
O300 return [-1] ; indicate searchvel <= 0
O300 endif
O400 if [#<_hal[gmoccapy.probevel]> LE 0]
O400 return [-2] ; indicate probevel <= 0
O400 endif
F #<_hal[gmoccapy.searchvel]>
G91
G38.2 Z #<_ini[TOOLSENSOR]MAXPROBE>
G0 Z2
; This is commented out only for sim.
;F #<_hal[gmoccapy.probevel]>
;G38.2 Z-4
O500 if [#5070 EQ 0]
G90
O500 return [-3] ; indicate probe contact failure to epilog
O500 endif
G90
G53 G0 Z[#<_ini[CHANGE_POSITION]Z>]
#<touch_result> = #5063
#<probeheight> = #<_hal[gmoccapy.probeheight]>
#<blockheight> = #<_hal[gmoccapy.blockheight]>
;(DEBUG, #<touch_result> #<probeheight> #<blockheight>)
G10 L1 P#<tool> Z[#<touch_result> - #<_hal[gmoccapy.probeheight]> + #<_hal[gmoccapy.blockheight]>]
G43
;G10 L1 P#<tool> Z#<touch_result>
;G10 L2 P0 Z[#<workpieceheight> + #<probeheight> + #<touch_result>]
; signal success be returning a value > 0:
o<change> endsub [1]

View File

@@ -0,0 +1,27 @@
; Testfile go to position
; will jog the machine to a position to give
; the image path must be relative from your config dir or absolute, "~" is allowed
(IMAGE, ./macros/images/goto_x_y_z.png)
O<go_to_position> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<go_to_position> endsub
M2

View File

@@ -0,0 +1,26 @@
; Testfile I am Lost
; will just give messages
O<halo_world> sub
G17
G21
G54
G61
G40
G49
G80
G90
G0 X10
(MSG, Hallo Welt)
(MSG, halo world)
(MSG, why does this apeera as an error?)
G0X-10
O<halo_world> endsub
M2

View File

@@ -0,0 +1,27 @@
; Testfile I am Lost
; will jog to machine cero and set all axis to cero
; the image path must be relative from your config dir or absolute, "~" is allowed
(IMAGE, ./macros/images/i_am_lost.png)
O<i_am_lost> sub
G17
G21
G54
G61
G40
G49
G80
G90
(MSG, Will now move to machine cero)
G53 G0 X0 Y0 Z0
(MSG, will now set all axis to cero)
G10 L20 P0 X0 Y0 Z0
(MSG, all done)
O<i_am_lost> endsub
M2

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

View File

@@ -0,0 +1,22 @@
; Testfile I am Lost
; will jog to machine cero and set all axis to cero
O<increment> sub
G17
G21
G54
G61
G40
G49
G80
G90
G91 G0 X#1 Y#2
G90
(DEBUG, X was [#1] and Y was [#2])
O<increment> endsub
M2

View File

@@ -0,0 +1,29 @@
; Testfile I am Lost
; will just jog a little bit around
O<jog_around> sub
G17
G21
G54
G61
G40
G49
G80
G90
G91 G0 X 25
Y-25
Z-25
Y25
X-25
Z25
F250
G2 I 25
(MSG, It is done!)
O<jog_around> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_0> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_0> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_1> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_1> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_10> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_10> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_11> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_11> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_12> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_12> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_13> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_13> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_14> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_14> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_15> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_15> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_2> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_2> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_3> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_3> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_4> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_4> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_5> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_5> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_6> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_6> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_7> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_7> endsub
M2

View File

@@ -0,0 +1,27 @@
; Testfile go to position
; will jog the machine to a position to give
; the image path must be relative from your config dir or absolute, "~" is allowed
(IMAGE, ./macros/images/macro_8.png)
O<macro_8> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_8> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_9> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DBG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_9> endsub
M2

View File

@@ -0,0 +1,44 @@
This is a small instruction to include macros in gmoccapy.
In your INI File you need to introduce a section called [MACROS]
and for every macro you'll need to include a one-liner like so:
MACRO = jog_around
or
MACRO = increment xinc yinc
where xinc and yinc are placeholders
During execution of the macro, you will be asked to enter the values.
You are allowed to introduce 9 macros!
If you enter more macros, only the first 9 will appear with button in gmoccapy.
In the [RS274NGC] section you may want to give a path to your macros like so:
[RS274NGC]
SUBROUTINE_PATH = nc_files/subroutines
or you place your macros in the nc_files folder.
Each macro must have it's own file in one of the mentioned folders and they are normal subroutines, so the must begin with:
O<jog_around> sub
and end with
O<jog_around> endsub
M2
The name of the file must be jog_around.ngc.
And an macro must contain at least one movement of one axis.
macro name in INI file have to be the same as the file name and the sub must have also the same name (case sensitive!)!
BE CAREFUL:
At this development step, the macros can only be interrupted by pressing the machine off button or the emergency exit button! I will check how to make this more secure!
Hope this does help.
Norbert

View File

@@ -0,0 +1,9 @@
%
o<on_abort> sub
G90
G40
G49
o<on_abort> endsub
%