Hi,
Perhaps it's better to assign the step-motor to OB1 or something? how would the Gcode drive look like then? "G91 OB1 36" ?
You cannot control out-of-band axes with Gcode as you can the regular coordinated axes. Out-of-band axes can and must be
jogged into position.
You will have to use Lua macros which use API's like:
LUA Syntax:
rc = mc.mcJogIncStart(
number mInst,
number axisId,
number dist)
and:
LUA Syntax:
rc = mc.mcJogIncStop(
number mInst,
number axisId,
number incr)
for incremental jogs........and for velocity jogs the APIs:
LUA Syntax:
rc = mc.mcJogVelocityStart(
number mInst,
number axisId,
number dir);
and:
LUA Syntax:
mcJogVelocityStop(
number mInst,
number axisId)
The code that you posted sort of looks like it should be going in the PLC script. As it turns out Mach4 has introduced a much
more efficient way to handle inputs like this called the signal table. Section 3.2.4 page 12 of
'Mach4 CNC Controller Lua Scripting Guide' in the docs folder will give you some ideas how it works.
Craig