Welcome, Guest. Please login or register.
Did you miss your activation email?
May 24, 2012, 06:58:57 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  VB Button: Pause and Raise Z
Pages: 1   Go Down
Print
Author Topic: VB Button: Pause and Raise Z  (Read 1459 times)
0 Members and 1 Guest are viewing this topic.
Anthony M
Active Member

Offline Offline

Posts: 3


View Profile
« on: June 18, 2009, 12:06:05 PM »

I am new to Mach3 and attempting to code the Pause button to stop the machine and raise the Z spindle height.  I am not very familiar with VB and am having trouble making the spindle rise after I have told it to pause... Any Ideas??

Thanks
Anthony
Logged
ger21
Global Moderator
*
Offline Offline

Posts: 2,612



View Profile WWW
« Reply #1 on: June 18, 2009, 12:42:31 PM »

Something like this will move the Z up 2":


DoOEMButton(1001)
While IsMoving()
Sleep 100
Wend
Code "G0 Z2"
Logged

Anthony M
Active Member

Offline Offline

Posts: 3


View Profile
« Reply #2 on: June 18, 2009, 02:36:09 PM »

Worked perfect!

Is there any way to change the delay between the time the pause button is pressed and when the machine actually halts movement?  There seems to be about a 1 second delay.

Thanks!
Logged
zealous
Active Member

Offline Offline

Posts: 486



View Profile WWW
« Reply #3 on: June 19, 2009, 10:57:49 AM »

Hi Anthony,
When you feedhold the machine the amount of time it takes to come to a stop will depend on your motor tuning Accel/Velocity.
You can either change this if your motors permit or use the "stop" (1003) rather than a "FeedHold" (1001)
Logged

Regards, Jason Blake

www.Fusioncnc.com
Cruiser
Active Member

Offline Offline

Posts: 107


View Profile
« Reply #4 on: June 19, 2009, 11:26:23 AM »

Not being familiar with this I have to ask ! The code snippet above must function in incremental ? Will it still go up if you are cutting above 2" or will it go down to 2" ?
Logged

CRUISER
  Don
zealous
Active Member

Offline Offline

Posts: 486



View Profile WWW
« Reply #5 on: June 19, 2009, 12:02:15 PM »

Yes in ABS it will go down to 2 inchs...so if your machine is at 2.000 and you run the script the machine will just sit there Wink
If you are at 3.000 it will come down/up (depending on your machine)  to 2.000.

If you want to increament in ABS you can:

Code:
DoOEMButton(1001)

'Wait for machine to stop
While IsMoving()
Sleep 100
Wend

'Get current Z
current_Z = GetOEMDRO(802)

'Add 2' to z
inc_z = current_Z + 2

'Sent command you can use G1 as well if need
Code "G0 Z" & inc_z
« Last Edit: June 20, 2009, 05:38:08 PM by zealous » Logged

Regards, Jason Blake

www.Fusioncnc.com
ger21
Global Moderator
*
Offline Offline

Posts: 2,612



View Profile WWW
« Reply #6 on: June 19, 2009, 12:38:20 PM »

Sorry, my mistake. Ideally, you'd check if the machine is in abs or inc mode, change to incremental, move up, then change back to whatever it was set to before.
Logged

Cruiser
Active Member

Offline Offline

Posts: 107


View Profile
« Reply #7 on: June 19, 2009, 10:10:34 PM »

So then Anthony M above, could have just as easily have crashed his machine ?
Curious indead !
Thanks for the Instruction
Logged

CRUISER
  Don
zealous
Active Member

Offline Offline

Posts: 486



View Profile WWW
« Reply #8 on: June 20, 2009, 05:33:36 PM »

Thank you for pointing that out...that is my bad!

Code:
'FeedHold
DoOEMButton(1001)

'What mode are we in
mode = GetOEMLed(49)

'Wait for machine to stop
While IsMoving()
Sleep 100
Wend

'Sent command you can use G1 as well if need
Code "G90 G0 Z2"

'If we have changed from abs to inc mode then change back
If mode = true Then
   code "G91"
End If
Logged

Regards, Jason Blake

www.Fusioncnc.com
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!