274
« on: April 23, 2018, 12:31:51 PM »
When I first started coding with Mach4 I put everything in the button mouse up script. I generated a line of gCode and then ran mcCntlGcodeExecuteWait for each line. I was told that was wrong that I needed to generate a string consisting of lines of gcode separated by newline characters. Which I did. I then started getting a huge amount of code included in the screen button scripts so I created a module to reduce the amount within the screens. I then thought I should just write macros that called the module's functions and create the string. That's when I ran into this 'new' limitation that nobody seems to know the answer to (lua defaults to 4096 characters for a string which this example doesn't exceed). No one knows if this is due to a look ahead problem or a line limit with mcCntlGcodeExecuteWait.
So I thought that I would just run the macro to generate and save it as gcode file, load and run it. No can do. Can't load a gcode file while running a macro (error: not now).
So I am back to button scripts that generate the gcode file, save, load and start it.
RT