Custom GCode Bug in RC7

We’re getting closer! There is a really odd bug with the < character. I’m using the GRBL flavor (with FluidNC gcode) with ^ as the escape character.

I have a user start script of:
#<_IsInitialTool> = 1
The Example preview in the Custom GCode window gets rid of the < but it gets added to the gcode correctly.

If you wrap it in the escape character, it gets rid of the < in the preview and duplicates it. The gcode also duplicates it but does include the < character.


I have this for tool change gcode which behaves the same way, just interesting because it’s multiple lines and duplicates the whole thing.

o102 if [#<_IsInitialTool> EQ 1]
  M0 (MSG, Attach Probe)
  G38.2 Z-110 F200 P0.5 (Probe Down, Set Z0)
  G1 Z10 F900
  M0 (MSG, Remove Probe and Turn On Router)
  #<_IsInitialTool> = 0
o102 else
  $HZ (Home Z)
  G0 X0 Y10 F2520 
  M0 (PRINT, Change to Tool #<_NewTool> and Attach Probe)
  G38.2 Z-110 F200 P0.5 (Probe Down, Set Z0)
  G00 Z10.0000 F500 (Clearance)
  M0 (MSG, Remove Probe and Turn On Router)
o102 endif
1 Like

Thank you for reporting. We have generated a report for the Dev Team’s review. :slight_smile:

2 Likes

Just noting this is still an issue in RC9.

This bug report currently remains open and on the list to address.

1 Like

It looks like this is resolved in RC12.

An interesting quirk is that I was trying to include the tool number and name in a comment, but it wouldn’t do that unless I escaped the “(“ so it didn’t think it was a comment.

This doesn’t work. It outputs the literal text.
(Tool {tool}: {tool_name})

This does work with the variable replacement:
^(^Tool {tool}: {tool_name})

I’m fine with the workaround.

Another thing I noticed is that at least for Tool On and Tool Off, I don’t really want it to output anything. I have a router that I manually turn on and off and set the speed. If you leave it blank, it outputs the defaults. It looks like I could set it to a space. This isn’t a big deal since the M3/M5 commands aren’t hurting anything.

I also noticed that when it outputs details of the operation, the comment closing parenthesis is on the next line:

image

I don’t think FluidNC cares, but that’s unexpected.

Either way, it looks like I can do what I want to now.

Thanks!