The fault value was 9. (out of range = 1, overspeed = 8... faults are stored bitwise in "value"~so the demo code that comes with the device will only work if there's only one fault!)

Now, the flotor wasn't floating, much less moving, so the flotor definitely wasn't overspeed. Then I realized that on the previous test of one of my programs, the flotor might have gone overspeed. In between the previous test and the current test, the PID controller and the ML device were completely shut down. Yet, somehow, the fault condition was saved from the previous test and was appended to the current fault condition. Is that supposed to happen?

I reset the faults using the monitor program and got the correct result (Sensors out of range).

I added a ResetFault call before the getfault. According to the API, "The ml_ResetFault() call will succeed only if all of the prevailing fault conditions have been removed."

Then the result was:

ml_GetFault: ML_FAULT_TYPE_CLEAR (the value is 0)

(the sensors, mind you, are still out of range)

Is there a way to call get fault without getting the previous faults? and why does reset fault clear even the current faults?

Um...in the meantime, I'm going to do a work-around and check all of the sensors one by one instead of relying on this getFault function. :/