21
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
if GetXin("Btn_X") == 1 and X_Btn == false then
mc.mcCntlGcodeExecuteWait(inst,'G91 G31 Z-5 F30')
X_Btn = true
end
local Xval = math.abs(GetXin("LTH_X_Val")) -- to get value of the stick
mc.mcJogSetRate(mInst, mc.X_AXIS, Xval) -- set the jog rate
function SetJog()
local Xval = math.abs(GetXin("LTH_X_Val"))
local Yval = math.abs(GetXin("LTH_Y_Val"))
local Zval = math.abs(GetXin("LTH_Y_Val"))
if mc.mcJogGetRate(mInst, mc.X_AXIS) ~= Xval then
mc.mcJogSetRate(mInst, mc.X_AXIS, Xval)
end
if mc.mcJogGetRate(mInst, mc.Y_AXIS) ~= Yval then
mc.mcJogSetRate(mInst, mc.Y_AXIS, Yval)
end
if mc.mcJogGetRate(mInst, mc.Z_AXIS) ~= Zval then
mc.mcJogSetRate(mInst, mc.Z_AXIS, Zval)
end
end
LThumb_Panel:Connect(wx.wxEVT_TIMER, function (event)
SetJog()
-- Y++
if GetXin("LTH_Y_Val") > 20 and GetXin("Btn_LS") == 0 and YPJState == false then
mc.mcJogVelocityStart(mInst, mc.Y_AXIS, mc.MC_JOG_POS)
YPJState = true
end
if GetXin("LTH_Y_Val") == 0 and GetXin("Btn_LS") == 0 and YPJState == true then
mc.mcJogVelocityStop(mInst, mc.Y_AXIS)
YPJState = false
end
-- Y--
if GetXin("LTH_Y_Val") < -20 and GetXin("Btn_LS") == 0 and YNJState == false then
mc.mcJogVelocityStart(mInst, mc.Y_AXIS, mc.MC_JOG_NEG)
YNJState = true
end
if GetXin("LTH_Y_Val") == 0 and GetXin("Btn_LS") == 0 and YNJState == true then
mc.mcJogVelocityStop(mInst, mc.Y_AXIS)
YNJState = false
end
-- X++
if GetXin("LTH_X_Val") > 20 and GetXin("Btn_LS") == 0 and XPJState == false then
mc.mcJogVelocityStart(mInst, mc.X_AXIS, mc.MC_JOG_POS)
XPJState = true
end
if GetXin("LTH_X_Val") == 0 and GetXin("Btn_LS") == 0 and XPJState == true then
mc.mcJogVelocityStop(mInst, mc.X_AXIS)
XPJState = false
end
-- X--
if GetXin("LTH_X_Val") < -20 and GetXin("Btn_LS") == 0 and XNJState == false then
mc.mcJogVelocityStart(mInst, mc.X_AXIS, mc.MC_JOG_NEG)
XNJState = true
end
if GetXin("LTH_X_Val") == 0 and GetXin("Btn_LS") == 0 and XNJState == true then
mc.mcJogVelocityStop(mInst, mc.X_AXIS)
XNJState = false
end
-- Z++
if GetXin("LTH_Y_Val") > 20 and GetXin("Btn_LS") == 1 and ZPJState == false then
mc.mcJogVelocityStart(mInst, mc.Z_AXIS, mc.MC_JOG_POS)
ZPJState = true
end
if GetXin("LTH_Y_Val") == 0 and GetXin("Btn_LS") == 1 and ZPJState == true then
mc.mcJogVelocityStop(mInst, mc.Z_AXIS)
ZPJState = false
end
-- Z--
if GetXin("LTH_Y_Val") < -20 and GetXin("Btn_LS") == 1 and ZNJState == false then
mc.mcJogVelocityStart(mInst, mc.Z_AXIS, mc.MC_JOG_NEG)
ZNJState = true
end
if GetXin("LTH_Y_Val") == 0 and GetXin("Btn_LS") == 1 and ZNJState == true then
mc.mcJogVelocityStop(mInst, mc.Z_AXIS)
ZNJState = false
end
end)
I am yet to find a single M6 script for an ATC