I was also thinking about that but just didn't try that.
Now I change the code, for code"M4" I put:
'----M4-------- 'Start spindle CCW to brake
DoSpinCCW() 'Enable CCW Relay
ActivateSignal(OUTPUT6) 'Spindle enable
This didn't solve the problem with getting the error message line 134 error (while ismoving)
I keep playing around with vb, and found out vb is jumping so fast from 1 sub to another and I think this is causing the issue.
I put sleep 200 before (End Sub), and until now the problem seems to be solved.