Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: omiadhi on September 22, 2023, 03:03:47 PM
-
Hello everyone,
I am looking for Macro/ Lua script to TOGGLE between C axis as Spindle (OBB) accepts S command AND to index ROTORY axis when ever require and accept G code commands ,
-
Hai is there anyone have any idea
-
why not simply define another axis as rotary.. I'm guessing you're using pulse and dir for both? otherwise you'd also need to change the mode of whatever drive you're using.. flip the axis thru a relay that simply swaps which pins go to the drive. Thats a cheap and dirty approach.. you'd probably need one of the more advanced users to actually point you in the direction of how to swap the axis internally to Mach4. Bob :P
-
I am just trying to make mill-turn, having basic 5 axis mill and A axis need to run as Spindle when in lathe mode , yes trying to have index axis and spindle are in STEP/ DIR input
-
I have seen codes
mc.AxisSetSpindle
mc.AxisMapMotor
mc.AxisUnmapMotor in Mach4 API core coding,
is these codes can work in user defined M code macros?.
-
I'm not experienced enough to determine how these can and should be implemented.. you'll need someone a lot more involved in the API and with LUA to help. Bob :o
-
Hai cncmagic,
thanks for reply to my topics, i am about to solve this, soon i will upload lua code.