Hi All,
I want to interlock the pushbutton for my pneumatic drawbar to not operate when the spindle is rotating.
My first thought was to use the measured RPM of the spindle index pulse and check if it is equal to zero using mc.mcSpindleGetTrueRPM(), however this is not reliable under 200 rpm since the value drops to zero shortly after the index has passed. Also whenever the drawbar extends or releases, a huge garbage number is momentarily thrown into this value (not sure if something to do with relay contact noise or software).
I then wanted to get the commanded motor speed and check if equal to zero. mc.mcSpindleGetCommandRPM() doesn't work because the value is set by the last "S" code and is non-zero when an M05 is issued. I then wanted to use mc.mcMotorGetVel() but I got syntax errors using the code
velocity, rc = mc.mcMotorGetVel(inst, 6)
Note: My Spindle is OB1 (motor 6 I'm pretty sure)
Any thoughts on the best way to detect if the commanded or actual spindle velocity is non-zero? Or why the above syntax was wrong?