1811
VB and the development of wizards / Re: About a delay routine with G4
« on: April 12, 2008, 04:32:41 AM »
Hi Gianni
There's a couple of issues here. I'm not entirely sure why there appears to be a limit of around 22000 but for the moment, I'm not sure that is of practical importance - bear with me - it may become irrelevant.
I'm assuming you don't need a delay of 22000 seconds! so you probably have the "G04 dwell in ms" option in Config/general config ticked. If so and you untick it, your delay will be in seconds - so I think your problem will dissappear.
That said, I'm still a little confused as to how you're going about this. If I understand you correctly I think you're intending having all your gcode posted via the "code" sub to Mach from VB. If that is your idea there may be a better way to do it.
If you use the M3 macro to fire your torch (as you would if you were starting a spindle) just add your "wait capture code" prior to DoSpinCW() only use SetVar(1000, wait) instead of your 'code "G4 P" & wait'. Then in your gcode files have G4 P#1000. That way you'll be using a more flexible approach.
So...
In M3.m1s you'll have:
SetVar(1000, GetUserDRO(1037)) 'set gcode var 1000 to delay in SECONDS (no need to go via your wait variable - just wack it straight in there)
DoSpinCW()
In your gcode text files you'll have:
M3
G4 P#1000
G03 X100 Y100 I25 J25
...
...
Cheers
Ian
There's a couple of issues here. I'm not entirely sure why there appears to be a limit of around 22000 but for the moment, I'm not sure that is of practical importance - bear with me - it may become irrelevant.
I'm assuming you don't need a delay of 22000 seconds! so you probably have the "G04 dwell in ms" option in Config/general config ticked. If so and you untick it, your delay will be in seconds - so I think your problem will dissappear.
That said, I'm still a little confused as to how you're going about this. If I understand you correctly I think you're intending having all your gcode posted via the "code" sub to Mach from VB. If that is your idea there may be a better way to do it.
If you use the M3 macro to fire your torch (as you would if you were starting a spindle) just add your "wait capture code" prior to DoSpinCW() only use SetVar(1000, wait) instead of your 'code "G4 P" & wait'. Then in your gcode files have G4 P#1000. That way you'll be using a more flexible approach.
So...
In M3.m1s you'll have:
SetVar(1000, GetUserDRO(1037)) 'set gcode var 1000 to delay in SECONDS (no need to go via your wait variable - just wack it straight in there)
DoSpinCW()
In your gcode text files you'll have:
M3
G4 P#1000
G03 X100 Y100 I25 J25
...
...
Cheers
Ian