Hello Guest it is May 20, 2019, 01:22:07 AM

Author Topic: Plasma , new macro code  (Read 16388 times)

0 Members and 1 Guest are viewing this topic.

Offline budman68

*
  • *
  •  2,360 2,360
    • View Profile
Re: Plasma , new macro code
« Reply #10 on: June 20, 2010, 03:34:03 PM »
No sir, no good and it does something odd as well.

It cycles through the GCode and then disappears and then does it again. Did you try some sort of reset to get it to run correctly?

Thanks again,
Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline BR549

*
  •  6,865 6,865
    • View Profile
Re: Plasma , new macro code
« Reply #11 on: June 20, 2010, 03:57:59 PM »
(;-) The problem I see IS that mach has no real controll over the VB threading, it can hop and skip over code randomly at times when the cpu may be busy.

I thought that because the Gcode window was active that Mach had a problem with running a VB/Gcode while the Gcode window was open. That helped but there is still a time/threading problem somewhere.

BUT none of that explains the running from an open VB window unless THAT forces VB to behave??????

Can you load a program then Open the Gcode Var window and use Vars 100,101,110,111 and see when you run the program that the Vars are actually loading. If not we need to add more time for them to update.

What  speed computer are you running?
« Last Edit: June 20, 2010, 03:59:42 PM by BR549 »

Offline budman68

*
  • *
  •  2,360 2,360
    • View Profile
Re: Plasma , new macro code
« Reply #12 on: June 20, 2010, 04:06:58 PM »
This is my main PC which is a dual core 2.8 and I have no optimization on it. What I will do is wait until I get on my machine PC which has all optimizations and report back with the results on that one.

It's fathers day and we're having quite a party here so this will have to wait until tomorrow  ;)

I will say that all my "usual" macros run fine on this PC but maybe this macro needs every every bit of resource to run?

Thanks again,
Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Plasma , new macro code
« Reply #13 on: June 21, 2010, 06:18:30 AM »
Hi Terry - I think the main problem lies with suspending execution until the toolpath regen has finished. This can be tested with isLoading(). So anyway - hope you don't mind but I've done a bit of a re-jig of your code which seems to work for me at least.

Code: [Select]
'Macro To AUTOEXTENTS
Response = MsgBox("Is Your Z HEIGHT Safe To Travel?", 4 )
If Response = 7 Then
  MsgBox("Move Z To A Safe Position And Restart")
  Exit Sub
End If

DoButton(8)      'ZeroX
While isMoving()
Wend

DoButton(9)      'ZeroY
While isMoving()
Wend

DoOemButton(160)   'Regen ToolPath
While isLoading()
  sleep 100
Wend

feed = 30      'Sets feed
dwell = 3       'Sets Dwell Time

xmin = Getoemdro(4)
xmax = Getoemdro(10)
ymin = Getoemdro(5)
ymax = Getoemdro(11)

Code"F" & feed
While Ismoving()
Wend

Code"G1 X" & xmin & " Y" & ymin
While Ismoving()
  sleep 100
Wend

Code"G4 P" & dwell
While isMoving()
  sleep 100
Wend

Code"G1 X" & xmin & " Y" & ymax
While Ismoving()
  sleep 100
Wend

Code"G4 P" & dwell
While isMoving()
  sleep 100
Wend

Code"G1 X" & xmax & " Y" & ymax
While Ismoving()
  sleep 100
Wend

Code"G4 P" & dwell
While Ismoving()
  sleep 100
Wend

Code"G1 X" & xmax & " Y" & ymin
While Ismoving()
  sleep 100
Wend

Code"G4 P" & dwell
While Ismoving()
  sleep 100
Wend

Code"G1 X" & xmin & " Y" & ymin
While Ismoving()
  sleep 100
Wend

Code"G4 P" & dwell
While Ismoving()
  sleep 100
Wend

Code"G1 X0.000 Y0.000"
While Ismoving()
  sleep 100
Wend


Cheers

Ian

Offline budman68

*
  • *
  •  2,360 2,360
    • View Profile
Re: Plasma , new macro code
« Reply #14 on: June 21, 2010, 11:41:53 AM »
Hi Terry,

Unfortunately neither of the codes you made worked on the fully optimized machine PC either. Thanks though.

Ian, I tried yours but is that the whole code? It seems unfinished as when I run it, it cycles through the GCode in the window but the sits there with the machine time DRO just counting away and never does anything after that. What version of Mach are you running?

Thanks,
Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Plasma , new macro code
« Reply #15 on: June 21, 2010, 02:53:58 PM »
Hi Dave - yes that's the whole code (well as long as you copied it all - I make it 87 lines) - as I said it works just fine here.
Strange - the (elapsed) time - if that's what you mean shouldn't run at all as that should only run if you run your gcode program. Try editing the macro and change all the G1 to G0 and see what happens. Or try changing the feedrate - i.e. is a feed of (terry's default) 30 enough on your system or is it just way to slow? - mines metric so I whacked it up to 3000. My version is R3.042.020 but this code is so simple it should run on any version - frankly if this is version dependant I think we might as well pack up and call it a day.

Ian

Offline budman68

*
  • *
  •  2,360 2,360
    • View Profile
Re: Plasma , new macro code
« Reply #16 on: June 21, 2010, 03:18:34 PM »
Well this is just weird then, as it will not run with just the button pressed (could it be my button settings?), BUT it WILL run with the VB Editor open, just like Terrys, so it has to be something in my configuration setup here.

Thanks
Dave
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline BR549

*
  •  6,865 6,865
    • View Profile
Re: Plasma , new macro code
« Reply #17 on: June 21, 2010, 05:36:28 PM »
HIYA GUYS both version work here just fine??????????? I like the first version that still shows the toolpath best , not that it really matters.

Ian , I have tried the While Isloading ()  Funny thing here IS I have 3 computers I have tested it on AND it took a different approach to make it work on each computer????? Mostly it was a time dwell issue try to keep VB in sync with itself.

Another problem was Mach does NOT like to run Gcode inside VB  WHEN it has a Gcode file loaded. It will at times START the Gcode file running WHEN the vb code ends.  THAT WAS EXCITING on the machine testing. That is what the Feedhold/Stop code was all about at the end of the file ,IT kept the machine from autostarting the program file. THAT was also why I tested in G1 instead of G0 as the plasma can haul at better than 300IPM if needed.

I think Mach is WAY TOO spooky to be doing anymore cool things for the masses, you never know when something will go bad.

I have many many cool Mcodes and function routines that we use here BUT I think they will stay in the file cabinet untill mach gets stable.

(;-) AUTOSTART in the worst way LOLOLOLOLOL
« Last Edit: June 21, 2010, 05:41:50 PM by BR549 »

Offline BR549

*
  •  6,865 6,865
    • View Profile
Re: Plasma , new macro code
« Reply #18 on: June 21, 2010, 06:21:17 PM »
IAN I just tried your version(;-) "Here" At the end of the VB file it will autostart the Gcode program that is loaded.

(;-)

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Plasma , new macro code
« Reply #19 on: June 22, 2010, 06:19:34 AM »
Terry - yes - it just did that to me too - funny because I've run it 20 or so times and it behaved perfectly and then suddenly - there's the gcode running all by itself - scaaaaaary. I'm with you - I don't think Mach's anywhere near trustworthy enough for this. Reminds me of my probing routines - that's why I ended up coding a .DLL so I could use as little VB in there as possible.

Ian