Toggle Type User Button linked to Macro
Posted: Wed Oct 03, 2018 11:30 am
Anyone got a way of using a toggle type user button to trigger a macro which will check the state of the button and trigger the macro if the button state is True and another part of the macro if the state is false?
I thought about getting the macro to check a var# for a specific value, and if it was not correct to run part A of the macro, and set the var# to say value "9876", and if the var# was = to value "9876" to run part B of the macro and clear the var# for next toggle use.
Is there another way?
Terry got me thinking about an alternative to the default feedhold button, and getting it to run a custom macro which
checks a var# flag, if FALSE {
checks and saves if active to vars# M3,M4, M7, M8, M10+Q{not sure if possible}, M205, M207, M209, M211 (customise as applicable to machine)
run cycle stop (stops the machine with deceleration + runs M5 & M9 & M11)
saves the 6 axis co-ordinates to vars#
saves set feedrate to vars#
saves set spindle speed to vars#
retracts Z to safeZ
sets a var# flag
/return from macro
}
checks a var# flag, if TRUE {
moves machine to safe Z
moves machine to saved vars# X,Y,A,B,C
move machine to saved var#Z
set feedrate to saved var#
set spindle speed to saved var#
enable if saved vars# set M3,M4, M7, M8, M10+Q{not sure if possible}, M205, M207, M209, M211 (customise as applicable to machine)
(presume all set delays are correct to allow sufficient spindle spinup + coolant etc, if plasma, move M3+M10 to suit cyclestart)
clear all vars# (flag, X,Y,Z,A,B,C,feedrate, spindle speed, M3, M4, M7, M8)
run cycle start
/return from macro
}
I thought about getting the macro to check a var# for a specific value, and if it was not correct to run part A of the macro, and set the var# to say value "9876", and if the var# was = to value "9876" to run part B of the macro and clear the var# for next toggle use.
Is there another way?
Terry got me thinking about an alternative to the default feedhold button, and getting it to run a custom macro which
checks a var# flag, if FALSE {
checks and saves if active to vars# M3,M4, M7, M8, M10+Q{not sure if possible}, M205, M207, M209, M211 (customise as applicable to machine)
run cycle stop (stops the machine with deceleration + runs M5 & M9 & M11)
saves the 6 axis co-ordinates to vars#
saves set feedrate to vars#
saves set spindle speed to vars#
retracts Z to safeZ
sets a var# flag
/return from macro
}
checks a var# flag, if TRUE {
moves machine to safe Z
moves machine to saved vars# X,Y,A,B,C
move machine to saved var#Z
set feedrate to saved var#
set spindle speed to saved var#
enable if saved vars# set M3,M4, M7, M8, M10+Q{not sure if possible}, M205, M207, M209, M211 (customise as applicable to machine)
(presume all set delays are correct to allow sufficient spindle spinup + coolant etc, if plasma, move M3+M10 to suit cyclestart)
clear all vars# (flag, X,Y,Z,A,B,C,feedrate, spindle speed, M3, M4, M7, M8)
run cycle start
/return from macro
}