Hello Guest it is December 12, 2024, 12:37:55 PM

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

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
Plasma , new macro code
« on: June 20, 2010, 12:53:23 AM »
I loaded up a new macro program in the MACH TOOL BOX that allows the machine to travel the PART extents to see if the part can be cut from your material on the table.

Load you program, then move to a position that you think will do for the X0Y0 (origin). Then run the code. The macro will ASK you if your Z position is safe for travel. If yes then it will reset the XY axis to zero, retreive the xy minmax extents and then travel the far corners of those values.

IF not then it ends and asks you to correct the problem then restart.

If the part BOX will fit on your material then you are good to go.

Good for routers GREAT for plasma.

Offline Tweakie.CNC

*
  • *
  •  9,274 9,274
  • Super Kitty
Re: Plasma , new macro code
« Reply #1 on: June 20, 2010, 06:48:02 AM »
Absolutely brilliant - great addition for any machine.

Tweakie.


For those who follow -  the Macro is in this thread http://www.machsupport.com/forum/index.php/topic,15154.0.html
PEACE

Offline budman68

*
  • *
  •  2,352 2,352
Re: Plasma , new macro code
« Reply #2 on: June 20, 2010, 08:19:36 AM »
Agreed, this will be great as I like to utilize all my "scrap" pieces, so this will be a nice way to see if the profile will "fit" the material.

Thanks for this-

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

Dave->    ;)

Offline budman68

*
  • *
  •  2,352 2,352
Re: Plasma , new macro code
« Reply #3 on: June 20, 2010, 08:29:22 AM »
Already having a problem and I asked a question in the actual Macro post, maaybe someone can help?

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

Dave->    ;)

Offline BR549

*
  •  6,965 6,965
Re: Plasma , new macro code
« Reply #4 on: June 20, 2010, 11:32:02 AM »
Hi Dave, I just ran it here about a dozen times with different files and NO problems. What version of Mach are you running?

Out of curiousity press the regen button before you try it again. Later vers of mach are not as reliable with VB as the earlier versions. There are as many wait states in that program as I can stuff in there and still have it do anything.

But that is just my opinion

Offline BR549

*
  •  6,965 6,965
Re: Plasma , new macro code
« Reply #5 on: June 20, 2010, 12:03:59 PM »
Dave I just loaded up the stable ver of mach V.040 and I can say that there is something bad wrong in there with VB/Gcode.

SO I will pull the macro code to keep from causeing issues.

Offline budman68

*
  • *
  •  2,352 2,352
Re: Plasma , new macro code
« Reply #6 on: June 20, 2010, 12:32:27 PM »
Thanks for looking into this, I'm running R3.041 so I guess there's the reason why.

EDIT: Tried the regen and the same exact thing.

Thank you sir-
Dave
« Last Edit: June 20, 2010, 12:34:18 PM by budman68 »
----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    ;)

Offline BR549

*
  •  6,965 6,965
Re: Plasma , new macro code
« Reply #7 on: June 20, 2010, 12:47:07 PM »
one last thing, Load up a program and then use the VB editor and single step down through the code to see if it still works. IF it works ok then save and try it again from the button.

I can make it work here by first single stepping down through the code. after that it works every time with the V.040.

Don't ask me why you need to single step it first to make it work ??????

YOU COULD delete out the AUTO section and do that part manually then run the motion code as a button.

It is a darn handy function as we have used it here with plasma for about a year now without problems.
« Last Edit: June 20, 2010, 12:48:47 PM by BR549 »

Offline budman68

*
  • *
  •  2,352 2,352
Re: Plasma , new macro code
« Reply #8 on: June 20, 2010, 12:54:10 PM »
Yep, it works correctly as long as the editor is open! What's up with that?  :D


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

Dave->    ;)

Offline BR549

*
  •  6,965 6,965
Re: Plasma , new macro code
« Reply #9 on: June 20, 2010, 03:27:42 PM »
Dave could you try this version, I have it working reliably here on the V.040 version

'Macro To AUTOEXTENTS
Sub main()
 FR = 30      'Sets FeedRate
 DT = 3         'Sets Dwell Time
 Msg="Is Your Z HEIGHT Safe To Travel?"
SetVar(120,FR)
SetVar(121,DT)
Response = MsgBox(Msg, 4 )
If Response = 7 Then
GoTo N3:
Else
GoTo N2:
End If
N2:
DoButton(8)      'ZeroX
Sleep(1000)      
DoButton(9)      'ZeroY
Sleep(1000)
DoButton(10)
Sleep(1000)
DoOemButton(160)   'Regen ToolPath
Sleep(1000)
Sleep(1000)
SetVar(100,Getoemdro(4))
Sleep(100)
SetVar(101,Getoemdro(10))
Sleep(100)
Setvar(110,Getoemdro(5))
Sleep(100)
Setvar(111,Getoemdro(11))
Sleep(1000)
DoOemButton(169)
Sleep(1000)
Code"G1 X#100 Y#110 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#100 Y#111 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#101 Y#111 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#101 Y#110 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X#100 Y#110 F#120"
While Ismoving()
Sleep(100)
Wend
Code"G4 P#121"
Code"G1 X0.000 Y0.000 F#120"
While Ismoving()
Sleep(100)
Wend
DoOemButton(170)
Sleep(1000)
GoTo N4:
N3:
MsgBox("Move Z To A Safe Position And Restart")
GoTo N4:
N4:
End Sub
End