M66 call hangs and does not return sometimes

More
11 Aug 2023 21:32 #277674 by ZincBoy
I am using M66 to read status bits in gcode macros and am having problems where the system will just stop.  The interpreter is still running but no code get executed past the M66 call.  If the stop button is pressed the interpreter will exit and MDI or Gcode calls can be done again.  One observation is that the spindle will turn off if it is on.

I am calling "M66 P[#<pinnum>] L0" so it should return immediately.  Most of the time it does but sometimes not.  I have a case where it halts 100% of the time but can't figure out what is going on.  The code that fails works fine if called without some of the preceding code. I tried "M66 P[#<pinnum>] L1 Q0.1" but it behaved the same way.

Has anyone else encountered this? 

Suggestions on how to debug it?  I have turned on full logging but nothing looks out of place, no error messages or anything strange.  The version is 2.8.3.

Please Log in or Create an account to join the conversation.

More
12 Aug 2023 22:32 #277761 by ZincBoy
I seem to have figured out the cause of this. The preceding subroutine call had a M73 code at the beginning of the file. Removing all of the M73 calls allowed the M66 in the following subroutine to work normally.

Why the M73 call caused M66 to fail is a mystery to me but things are now working. The M73 was an error and left over from before I started handling the modal codes myself.

This also fixed some odd behaviour where the subroutine would work every other time.

Please Log in or Create an account to join the conversation.

Time to create page: 0.149 seconds
Powered by Kunena Forum