Macros error out

I switch between CNC and Laser often and decided to add a few lines of $nn macros to speed up the switch. About every other time the macro does not complete or completes with missing characters. e.g. 1000 becomes 10. Is there a way to add a delay between lines of macros? Sometimes I get error 26 or error 2. Sometimes is says there is an error on line one …
This is a Dell Precision 5530 Laptop with latest Windows 10 and USB power save off!

Macro commands are processed line-by-line in LightBurn, with each line being sent after the controller responds with ‘ok’ from the previous one. When you refer to $nn macros, do you mean the $N macros supported by GRBL, or the macro buttons in the LightBurn console? If you mean the GRBL macros, those are handled by the controller itself.

Depending on the commands you’re using, the macro buttons in the console in LightBurn might be better behaved, as they would wait for the controller to complete the previous command before continuing.

Hi thanks for the quick reply.
Yes the ShapeOko3 (SO3) is a GRBL controlled machine. What I am striving for is to have all three of these lines in a single macro to save typing:
$30 = 255
$32 = 1
G10 L2 P1 X-812 Y-812

then a second macro to undo

$30 = 1000
$32 = 0
G10 L2 P1 X0 Y0

Most times this errors out. If hit the macro button 2 or 3 times it is successful. And yes if I enter these a single line at a time in the console field it works as expected. I noticed but have not tried again, with just the G10 entry alone, it often does not take the first time I hit the macro button … anyway not a major deal just annoying. I wrote embedded software for 30 years and am somewhat nit picky.
I noticed there isn’t an entry in the online documentation for the macro buttons …

The last paragraph under the ‘Shapeoko’ section discusses macro setup here. https://github.com/LightBurnSoftware/Documentation/blob/master/CommonGrblSetups.md#shapeoko

You can also find macros for your setup addressed in this JTech post, section 11, that might help as well.

https://jtechphotonics.com/?p=10204

Have you tried putting them in reverse order? I can’t see how that would make much difference, but it might. I’ll double check the code here, but macro commands are, if I remember right, ‘dripped’ one line at a time.

Thanks Rick I saw both these, the jtechphotonics tutorial is what I used to setup my SO3 and why I had the great idea to combine two steps in one macro …

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.