If you are using the stock spindle wait, there is no return code because no m3 script exists. I did increase the wait timeout to 20 seconds because it may take longer than 10 seconds to bring a 20K RPM spindle up to speed.
If you are are using a m3 script, mcSpindleSetDirectionWait() will now return MERROR_TIMED OUT and the API docs reflect this. I juuuuuuust fixed this and it will be in the next build.
Also, the mcSignalWait() function will wait on ALL input signals instead of just the 64 general input signals for quite some time now. As it was always supposed to. So the docs do not mention a limitation, as there wasn't supposed to be one. The issue was that the function was incorrectly ignoring the rest of the inputs.
If you want more control over the spindle waits using signals, and don't want to wait up to 20 seconds for a timeout, then using the mcSignalWait() API function on ISIG_SPINDLE_AT_SPEED and AT_ZERO may be what you need.
I have been using the stock spindle wait with the signals on my personal machine since the beginning of Mach 4 time without issue. The reason those signals are there is because I WANTED them for my machine!
I don't use any custom M3, M4, or M5 scripts. In fact, I don't think I have ANY custom scripts other than M6 to run the tool changer. The machine is a Matsuura MC500. I installed Mach 4, wired my VFD outputs to some inputs and mapped the "at speed" and "at zero" input signals, and enabled them. No drama at all. It was intuitive. I could run that very complex industrial machine (with all of the safety bells and whistles) with Mach 4 "out of the box" with no scripting required if I didn't want to use the tool changer.
So when people complain about Mach 4 being difficult because you HAVE learn LUA to program it, I just don't get it. If you THINK you need something custom, then either you have a Rube Goldberg device or something that just can't be shrink wrapped. Tool changers are pretty much the only thing that falls into this category. Otherwise, you may need to take a step back and think about if you have made a fundamental flaw in the retrofit or machine design. VFDs can get a bit more complicated if you are using modbus. But 99.9% of the hobby AND industrial milling machines really should not need much scripting at all. It is when you want something SPECIAL that scripting is needed.
Steve