I currently don't have the means to test this. You need to edit the enable switch input and select a travel speed.
--------------------------------------
-- X only MPG Code --
--------------------------------------
SigLib = {
[mc.ISIG_INPUT10] = function (state)
RunPendant()
end
}
---------------------------------------------------------------
-- Pendant function.
---------------------------------------------------------------
function RunPendant()
local hSig, rc = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT10) -- Is mapped to Port ? Pin ? *X Selection
local XSelection, rc = mc.mcSignalGetState(hSig)
if XSelection == 1 then
mc.mcMpgSetAxis(inst, 0, 0) --X Axis
mc.mcCntlSetLastError(inst, "X Selected")
else
mc.mcMpgSetAxis(inst, 0, -1) --No Axis
mc.mcCntlSetLastError(inst, "No Axis Selected")
end
mc.mcMpgSetInc(inst, 0, .001) -- travel per encoder step
end