Andrew,
I may be misunderstanding your statement on no API for spindle functions but, here is a list of spindle functions from the McLua users manual. There is quite a bit of data you can get or set, if the below is not
what your talking about, please clarify.
mc.mcCntlGetPoundVar(inst, mc.FEEDRATE);
mc.mcCntlSetPoundVar(inst, mc.FEEDRATE, val );
Mach4 Spindle:
Spindle Set:
rc = mc.mcSpindleCalcCSSToRPM(number mInst, number DiaOfCut, Bool Inch)
--For doing CSS in Lathe, DiaOfCut is a double, Bool Inch is: 1=inch, 0=mm
rc = mc.mcSpindleSetAccelTime(number mInst, number Range, number Sec)
--Range is pulley range 0-19, Sec is time in seconds
rc = mc.mcSpindleSetCommandRPM(number mInst, number RPM)
--Sets the commanded RPM, (like from running Gcode, or MDI)
rc = mc.mcSpindleSetDecelTime(number mInst, number Range, number Sec)
--Range is pulley range 0-19, Sec is time in seconds
rc = mc.mcSpindleSetDirection(number mInst, number dir)
--dir is: -1ccw, 1cw, 0 stop
rc = mc.mcSpindleSetFeedbackRatio(number mInst, number Range, number Ratio)
--Range is pulleys 0-19, Ratio is a percentage as double
rc = mc.mcSpindleSetMaxRPM(number mInst, number Range, number RPM)
--RPM is the Max for that pulley range 0-19
rc = mc.mcSpindleSetMinRPM(number mInst, number Range, number RPM)
--RPM is the Min for that pulley range 0-19
rc = mc.mcSpindleSetMotorAccel(number mInst, number Range, number Accel)
--Spindle motor Accel is in seconds for the pulley range 0-19
rc = mc.mcSpindleSetMotorMaxRPM(number mInst, number RPM)
--The Max RPM for the spindle motor itself
rc = mc.mcSpindleSetMotorRatio(number mInst, number Range, number Ratio)
--Sets the gear/ratio as a percentage as double for that pulley Range 0-19
rc = mc.mcSpindleSetOverride(number mInst, number percent)
--this is SSOVR percent as a double
rc = mc.mcSpindleSetRange(number mInst, number Range)
--Sets the Pulley range you want to use, 0-19
rc = mc.mcSpindleSetReverse(number mInst, number Range, Bool Reversed)
--Due to gearing pulley Range 0-19 has to be reversed for correct rotation, 1=is reversed, 0=not reversed
rc = mc.mcSpindleSetTrueRPM(number mInst, number RPM)
--RPM is a double, that is coming in from an outside source
Spindle Get:
Sec, rc = mc.mcSpindleGetAccelTime(number mInst, number Range)
--Gets Accel time in sec, for pulley range 0-19
mRPM, rc = mc.mcSpindleGetCommandMotorRPM(number mInst)
--gets the commanded spindle motors’ RPM
cRPM, rc = mc.mcSpindleGetCommandRPM(number mInst)
--gets the commanded spindle Gcode/MDI RPM
Range, rc = mc.mcSpindleGetCurrentRange(number mInst)
--What Pulley range is currently active 0-19
Sec, rc = mc.mcSpindleGetDecelTime(number mInst, number Range)
--Gets Decel time in sec, for pulley range 0-19
dir, rc = mc.mcSpindleGetDirection(number mInst)
--what direction is spindle turning, cw=1, ccw=-1
Ratio, rc = mc.mcSpindleGetFeedbackRatio(number mInst, number Range)
--what is the gearing ratio as a percentage for that pulley range 0-19
MaxRPM, rc = mc.mcSpindleGetMaxRPM(number mInst, number Range)
--returns the MAX RPM for that pulley range 0-19
MinRPM, rc = mc.mcSpindleGetMinRPM(number mInst, number Range)
--returns the MIN RPM for that pulley range 0-19
RPM, rc = mc.mcSpindleGetMotorMaxRPM(number mInst)
--returns the max RPM for the spindle motor
Ratio, rc = mc.mcSpindleGetMotorRatio(number mInst, number Range)
--returns the gear/pulley ratio for that range 0-19 as a double
mRPM, rc = mc.mcSpindleGetMotorRPM(number mInst)
--What is the spindle motor’s current RPM
percent, rc = mc.mcSpindleGetOverride(number mInst)
--What is the current SSOVR percent
bool Reversed, rc = mc.mcSpindleGetReverse(number mInst, number Range)
--Is spindle motor rotation reversed for pulley range 0-19, 1 = yes, 0=no
RPM, rc = mc.mcSpindleGetSensorRPM(number mInst)
--gets what the sensor says the spindle is turning at the sensors location
RPM, rc = mc.mcSpindleGetTrueRPM(number mInst)
--Returns what the actual RPM is at the spindle nose
Scott