; G-code highlighting stresstest - useless otherwise ; # = 0 G0 (Rapid to start) X1 Y1 G0 X1 Y1 (Rapid to start; but don't forget the coolant) M2 ; End of program. M66 P1 L3 Q[#] M66 P1 L3 Q[# + [#4711]] M66 P1 L3 Q# M66 P1 L3 Q#3 M66 P1 L3 Q#5999 G5 X23.5 a 19.2 (debug, foo!) (Debug, some text and a substitution: #23 and some more thereafter) (DEBUG, #<_a_param>) (DEBUG, #) G0 G53 Z0 X[#19] G 3 0 G00 G01 G 0 1 G3 0 G30 G53 G5 3 G 5 3 G0 G1 ; ; to activate, incantate as follows in the ini file: ; ; [RS274NGC] ; # remap M6 to a named oword subroutine. ; # the tool number currently loaded (in spindle) is passed as parameter #1 ; M6_COMMAND=ocall ; ; N4711 O sub ; ; N 0815 # = 0 # = 0 # = 0 #4711 = 8.15 ; number of seconds to wait for 'tool-changed' equivalent # = 9999 ; (DEBUG, executing M6 O-word sub, tool=#1) ; O if [#] EQ 0 M5 O endif O if [#] NE 0 G0 G53 Z0 O endif O if [#] NE 0 G30 O endif ; set analog output pin #2 to signal the pocket number ; iocontrol.tool-number becomes motion.analog-out-02 M68 E2 Q[#1] (DEBUG, set current tool number on motion.analog-out-02: #1) ; ; assert the equivalent of the iocontrol.tool-change pin ; which is now motion.digital-out-01 M64 P1 (DEBUG, motion.digital-out-01 set high, waiting for motion.digital-in-01) ; ; wait for the equivalent of the iocontrol.tool-changed pin to go high ; we use motion.digital-in-01 ; M66 P1 L3 Q# ; O if [#5399] EQ -1 (DEBUG, timeout waiting for motion.digital-in-01 to become true: #5399 ) O else (DEBUG, motion.digital-in-01 became true: #5399) O endif ; retract iocontrol.tool-change equivalent (DEBUG, deasserting motion.digital-out-01) ; M65 P1 ; (DEBUG, done with M6 sub) ; O endsub m2