Mach Discussion > Mach4 General Discussion

LUA Problem with Jog Mode

(1/2) > >>

stefangem:
Hello,

sorry for my english.

i have with arduino over USB and the serialDRO.lua a MPG. All function is ok. BUT i can't switch JOG Modus. INC Modus all ok.

   local JogVel = mc.MC_JOG_TYPE_VEL;
   mc.mcJogSetType(inst, 0, JogVel)
      mc.mcCntlSetLastError(inst, "Jog Cont")

Please can you me help for this Problem???

--- Code: ---    elseif Command == "1" then
mc.mcJogSetInc(inst, 0, .001)
mc.mcJogSetInc(inst, 1, .001)
mc.mcJogSetInc(inst, 2, .001)
p:write("I 1\n", 5)
mc.mcCntlSetLastError(inst, "Jog Increment 0.001")
    elseif Command == "2" then
mc.mcJogSetInc(inst, 0, .010)
mc.mcJogSetInc(inst, 1, .010)
mc.mcJogSetInc(inst, 2, .010)
p:write("I 2\n", 5)
mc.mcCntlSetLastError(inst, "Jog Increment 0.010")
    elseif Command == "3" then
mc.mcJogSetInc(inst, 0, .100)
mc.mcJogSetInc(inst, 1, .100)
mc.mcJogSetInc(inst, 2, .100)
p:write("I 3\n", 5)
mc.mcCntlSetLastError(inst, "Jog Increment 0.100")
    elseif Command == "4" then
local JogVel = mc.MC_JOG_TYPE_VEL;
mc.mcJogSetType(inst, 0, JogVel)
mc.mcCntlSetLastError(inst, "Jog Cont")

--- End code ---

Bill_O:
I am not sure there is a mc.MC_JOG_TYPE_VEL.
I think you want to use mc.JogGetVelocity(inst, axisID)

stefangem:
Hello,

i have change to mc.JogGetVelocity(inst, 0), but it comes a failue

the value is "NIL".

stefangem:
I have tested with
mc.mcJogSetType(inst, 0, 1) and in mach4 comes no failure but the inc Modus remains. the steps remains example 0,1mm.
It switched not to Jog Modus.

I need the mc.mcJogIncStart and mc.mcJogIncStop?
I think this is only time steps.

Bill_O:
I dont know.
I do not use it.
Hopefully someone who knows this better can help you out.

Navigation

[0] Message Index

[#] Next page

Go to full version