Author Topic: Modified Load G Code Button  (Read 6050 times)

0 Members and 1 Guest are viewing this topic.

Offline engraversoflight

  • Active Member
  • Posts: 98
    • View Profile
Modified Load G Code Button
« on: July 02, 2009, 10:06:09 PM »
I downloaded the Mach screen designer...one thing I want to  do is have a modified "Load G Code" button.  I want to retain the normal button, but just have a new button on the screen set as well.  Here's what I want it to do:

open up file window (i select the file)
sets it at g54 location
opens up file window again (select the file)
sets it at g55 location
opens up file window one last time (I select third file to cut)
sets it at g56 location


then in the toolpath window i should have three different toolpaths. if i hit cycle start, it should run the file at g54, then g55 then g56.

how do i write the VB code for this?  or is there a tutorial i can  watch to do it myself?

Offline zealous

  • Active Member
  • Posts: 492
  • HI!
    • View Profile
    • Artsoft Solutions
Re: Modified Load G Code Button
« Reply #1 on: July 03, 2009, 04:33:29 PM »
Mach3 can only display 1 file in the toolpath at a time.

You would have to write a "Job Queque" program to do what you want (without having the ability to see the toolpath for each file).
I could write the code which the user would load as many files as they would like then set the preset work coordinate system for each, but it would be paid work as there wold be alot to code.

Offline engraversoflight

  • Active Member
  • Posts: 98
    • View Profile
Re: Modified Load G Code Button
« Reply #2 on: July 03, 2009, 05:42:51 PM »
I posted this question about 6-12 months ago and got this response.  I was trying to avoid the LED button thing that this guy's code has:

~~~~~~~~~~~

Below is my code for opening then running 2 g-code files. The Run Button code will run either 2 or 1 depending on led#1110. I hope someone can find it useful.
Bill

Load Button

If GetUserLED (1110) = 1 Then
DoOEMButton (216)
While IsLoading()
Wend
cutfile = (FileName())
SetUserLabel (2,cutfile)
DoOEMButton (216)
While IsLoading()
Wend
camerafile = (FileName())
SetUserLabel (1,camerafile)
Else
DoOEMButton (216)
While IsLoading()
Wend
cutfile = (FileName())
SetUserLabel (2,cutfile)
camerafile = "None"
SetUserLabel (1,camerafile)
End If 



Run Button

If GetUserLED (1110) = 1 Then
If GetUserLED (1112) = 0 Then
SetUserLED (1111,1)
camerafile = GetUserLabel(1)
LoadFile (camerafile)
While IsLoading()
Wend
Sleep (1000)
DoButton (0)
While IsMoving()
Sleep (2000)
Wend
Sleep (5000)
SetUserLED (1111,0)
SetUserLED (1112,1)
Sleep (100)
End If
If GetUserLED (1112) = 1 Then
cutfile = GetUserLabel(2)
LoadFile (cutfile)
While IsLoading()
Wend
Sleep (1000)
DoButton (0)
While IsMoving()
Sleep (2000)
Wend
Sleep (5000)
SetUserLED (1112,0)
Sleep (100)
End If
Else
SetUserLED (1112,1)
Sleep (1000)
DoButton (0)
While IsMoving()
Sleep (2000)
Wend
Sleep (5000)
SetUserLED (1112,0)
End If

~~~~~~~~~~~

Thought this was simple enough I could just modify it a little bit, but I don't quite understand some of the coding.

Offline zealous

  • Active Member
  • Posts: 492
  • HI!
    • View Profile
    • Artsoft Solutions
Re: Modified Load G Code Button
« Reply #3 on: July 03, 2009, 06:21:07 PM »
How well is that code working for you I had wondered that when it was posted?
I ask only because it is looking to see if the machine is moving, what happens if you are in a FeedHold, G04, M06, M00, M01 will it auto load the next file if the machine isn’t moving?

Offline engraversoflight

  • Active Member
  • Posts: 98
    • View Profile
Re: Modified Load G Code Button
« Reply #4 on: July 03, 2009, 10:36:12 PM »
I didn't try it because I don't know how to add an LED....the way it looked to me that it would run in normal mode or dual mode depending on whether this LED was on or off.  I've only spent a few hours on it, then I came here.

Here's the link:

http://www.machsupport.com/forum/index.php/topic,8198.0.html

Look at the last reply...that's where the guy gave me a link to a different place where he posted.

Thanks for the reply.

Bill

Offline Bill_O

  • Active Member
  • Posts: 195
    • View Profile
Re: Modified Load G Code Button
« Reply #5 on: July 06, 2009, 03:38:30 PM »
Zealous,
I have been using it for a while now and it works fine.
Bill