Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: dbt3000files on January 28, 2019, 12:21:17 PM

Title: trouble with mc.mcaxisisstill
Post by: dbt3000files on January 28, 2019, 12:21:17 PM
I want to have Mach4 check an output from a clearpath motor every time the axis associated with that motor is moving.  I thought using mc.mcaxisisstill would be the way to do that, but it seems to be returning a positive result whether the axis is moving or not.  Any ideas what I might be doing wrong??
Here's a test code that I was using:

    local inst = mc.mcGetInstance()
    local still
    local rc
    local gcode = ""
    gcode = gcode .. ("g0 x-2\n")
    gcode = gcode .. ("g0 x0\n")
    mc.mcCntlGcodeExecute(inst, gcode)
    wx.wxMilliSleep(400)
    still, rc = mc.mcAxisIsStill(inst, 0)
    wx.wxMessageBox(tostring(still))
    if rc ~= mc.MERROR_NOERROR then
        wx.wxMessageBox("error")
    end