Hello Guest it is April 16, 2024, 01:51:28 AM

Author Topic: mcCntrlGcodeExecuteWait fail  (Read 2817 times)

0 Members and 1 Guest are viewing this topic.

mcCntrlGcodeExecuteWait fail
« on: April 09, 2018, 01:19:25 PM »
I have a macro that generates a string of gcode listed below.  If I pass that string to mc.mcCntlGcodeExecuteWait(inst,s) it executes to the x1.320 then skips the rest of the gcode in the string and executes the remaining macro code after the mc.mcCntlGcodeExecuteWait(inst,s). Is there a limitation as to how many characters/commands that can be included and executed in a string with executeWait?  This code executes as a gcode file so I know it is not the code.

Code: [Select]
m3 s1400
g1 x1.5800 f1.000
g1 z0.0000 f12.000
g1 x1.5600 f1.000
g1 z0.2000 f12.000
g1 x1.5400 f1.000
g1 z0.0000 f12.000
g1 x1.5200 f1.000
g1 z0.2000 f12.000
g1 x1.5000 f1.000
g1 z0.0000 f12.000
g1 x1.4800 f1.000
g1 z0.2000 f12.000
g1 x1.4600 f1.000
g1 z0.0000 f12.000
g1 x1.4400 f1.000
g1 z0.2000 f12.000
g1 x1.4200 f1.000
g1 z0.0000 f12.000
g1 x1.4000 f1.000
g1 z0.2000 f12.000
g1 x1.3800 f1.000
g1 z0.0000 f12.000
g1 x1.3600 f1.000
g1 z0.2000 f12.000
g1 x1.3400 f1.000
g1 z0.0000 f12.000
g1 x1.3200 f1.000  (executes up to and including this line)
g1 z0.2000 f12.000
g1 x1.3000 f1.000
g1 z0.0000 f12.000
g1 x1.2800 f1.000
g1 z0.2000 f12.000
g1 x1.2600 f1.000
g1 z0.0000 f12.000
g1 x1.2400 f1.000
g1 z0.2000 f12.000
g1 x1.2200 f1.000
g1 z0.0000 f12.000
g1 x1.2000 f1.000
g1 z0.2000 f12.000
m5

TIA

RT
Re: mcCntrlGcodeExecuteWait fail
« Reply #1 on: April 09, 2018, 10:14:49 PM »
Try adding an actual \n at the end of each line
Re: mcCntrlGcodeExecuteWait fail
« Reply #2 on: April 09, 2018, 10:18:18 PM »
All of them have a \n
Re: mcCntrlGcodeExecuteWait fail
« Reply #3 on: April 11, 2018, 09:27:13 AM »
I am having a problem with a GcodeExecuteWait in my M6 when I do a tool change.  It used to work, and I am going to start a thread,  Mine is with the new update, using a PMDX 411.  In any case, when my is halting due "Requesting a stopped report for Axis 2 motors.  The stop comes in for motors 0 and 1 but not 2.  I also not that my Z location which is not at zero which is where it is commanded to go, it stops short.  In any case you may want to see if your DRO is showing the correct location when it fails..
Re: mcCntrlGcodeExecuteWait fail
« Reply #4 on: April 20, 2018, 03:28:35 AM »
Hi,
could it be that Machs instruction buffer has filled up?

You could try changing the number of 'look ahead lines' in Machs Gen Setup page to 50 say and see whether extra lines from your file are read and executed.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: mcCntrlGcodeExecuteWait fail
« Reply #5 on: April 20, 2018, 05:55:28 PM »
I do not know if there is a limit to string length but imagine there is. Is there a reason you are not just creating a gcode file then loading it and running it?
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: mcCntrlGcodeExecuteWait fail
« Reply #6 on: April 21, 2018, 12:00:53 PM »
Brett, that's a good idea.  RT can make his macro a wizard to generate the code.  I used the BH Wizard guts to make a wizard that generates lines of g code.
Chad Byrd
Re: mcCntrlGcodeExecuteWait fail
« Reply #7 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
Re: mcCntrlGcodeExecuteWait fail
« Reply #8 on: April 23, 2018, 02:38:40 PM »
Hi,
did you try increasing the 'look ahead lines' count to see if it makes a difference?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: mcCntrlGcodeExecuteWait fail
« Reply #9 on: April 23, 2018, 02:42:59 PM »
Hi,
I think there was a change in a release that came out about 6-9 months ago.

Prior to that release GcodeExecuteWait() could not be successive statements and as a consequence multiple lines of Gcode had to be concatenated together.
The current releases allow successive statements.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'