Permanent fix to "An error was detected while sending 'M6..."

Hey all,

If you’ve noticed UGS pausing or giving you error messages when you run a job, there have been a few reported software CAM packages out there like Carbide Create that seem to like sticking gcode (such as an M6 tool change or M0) into files.

80326567_10157614815122177_8664182443265228800_n

We recommend using UGS since it’s such a beginner friendly yet powerful interface to your LongMill, however it’s lack of support for M6 commands can get annoying. Some easy fixes to this problem can be:

  1. Open the g-code file in a text editor like Notepad, CTRL + F to search, then find the line where the ‘M6’ command is and delete that whole line. Once deleted, you can save the file and open the revised file back up in UGS.
  2. If you click ‘OK’ on the error window, you should be able to hit the PLAY button again and the program should start to run as you’d expect
  3. Other g-code sender can better handle these commands, so it’s possible to switch over: ex. bCNC, CNCjs, or other LongMill-compatible interfaces, listed here: https://sienci.com/dmx-longmill/machine-interface/).

If you want to stick with UGS and use a more permanent fix, this is a solution we’ve found:

In UGS if you go to Tools → Options → UGS → Controller Options then click the ‘Add’ button, a new row will appear in the bottom part of the window. Under the “Regular Expression Pattern Remover” column, you’ll be able to double-click the empty cell to enter in the g-code command that you’d like UGS to ignore, in this case it would be “M6 T101”.

Once done, be sure to hit “Apply” before you close out of the window. Note that the expressions will only take effect on the NEXT file you open, so if you’ve already got a file open you’ll need to reopen it to see the changes take effect.

Ultimately, you can add as many of these expressions as you wish. Since these commands can take many forms depending on the CAM package used, we’ve listed some of the best ‘catch-all’ expressions we’d recommend you use below:

  • ^M0$
  • M6\s?T\d{1,4}

If these expressions are still not addressing your issues, let us know so we find how to cover your problem as well! Special thanks to @Kevin for pointing out the regex support of these expressions :slight_smile:

2 Likes

EDIT: Updated to include regex for newer CC versions (depending on configuration) putting M0 ;T### and M05 which causes a HOLD condition.

Fantastic -
It appears that the field in UGS supports RegEx expressions.
If you instead put these three expressions, one on each line:

M6\s?T\d{1,4}
M0\s?\;T\d{1,4}
M05

instead of
M6 T101
(as shown in the example above)
that would tell UGS to ignore any M6 T command so long as it has a 1 - 4 digit number after it. This way you are covered for any tool number from 1 to 9999.

The \s? in the command means ~ with or without 1 space. So this should also match the M6T101 example.
The \; makes it match the ; in the M0 command.

Hope this helps someone. :slight_smile:
Kevin

3 Likes

Wow Kevin, that’s brilliant to hear! Thanks for the follow up :+1::+1:

1 Like