VB Script Question

Post Reply
dbrook
Vectric Apprentice
Posts: 88
Joined: Wed Jul 27, 2011 3:36 am
Model of CNC Machine: 4x4 DIY Router
Location: Starkville, MS

VB Script Question

Post by dbrook »

I am working on developing a simpler Mach3 screen for a friend. He is very new to the world of cnc and has a slight vision problem. The goal is to make the system simpler/easier for him to use as well as see the buttons on the screen. He has purchased a cnc router parts 2'x4' router and we have it up and running well.

I am attempting to add a button to the Mach3 screen to use to warm up the spindle before starting a cut. I have been successful in using the Screen4 editor to add the button to the Mach3 screen with the following VB script appropriately tied to it. When the button is clicked there is a short delay as expected. Next the spindle starts to spin and run at what appears to be 9000 rpm or possibly 13000 but the it never increases in speed as called for in the script. The spindle does continues to run for a little over 6 minutes then stops when the M30 is executed as expected. IT appears that the additional spindle speed calls are being ignored or bypassed.

I have been able to add other buttons to park the router a the rear of the table, move the spindle to a tool change position, turn on and off the dust collector and insert offsets in the x y DRO's for the laser. All the scripts associated with all the other buttons work as expected.

I am obviously missing something when it comes to calling for multiple changes in spindle speed in the VB script. Maybe what I am trying to do is not possible via a VB script. If anyone can shed some light on the problem it would be most appreciated.

CODE "G04 P10"
CODE "M03"
CODE "S9000"
CODE "G04 P120"
CODE "S13000"
CODE "G04 P120"
CODE "S18000"
CODE "G04 P120"
CODE "M30"

ger21
Vectric Wizard
Posts: 1592
Joined: Sun Sep 16, 2007 2:59 pm
Model of CNC Machine: Custom DIY
Location: Lake St Clair, MI, USA
Contact:

Re: VB Script Question

Post by ger21 »

My guess is that the spindle is not setup correctly, most likely with a max of 9000 or so?
What you have there should work.
Try this, though, and see if it works.
CODE "G04 P10"
CODE "M03"
CODE "S9000"
While IsMoving()
Wend
CODE "G04 P120"
CODE "S13000"
While IsMoving()
Wend
CODE "G04 P120"
CODE "S18000"
While IsMoving()
Wend
CODE "G04 P120"
CODE "M30"
Gerry - http://www.thecncwoodworker.com

dbrook
Vectric Apprentice
Posts: 88
Joined: Wed Jul 27, 2011 3:36 am
Model of CNC Machine: 4x4 DIY Router
Location: Starkville, MS

Re: VB Script Question

Post by dbrook »

Ger21,

Thank you for the feedback. You confirmed my thought that the spreed control script should work. Based on previous experience with VB scripting I did not see why is should not work but thought I might have been over looking something. I’ll check into the setup on the spindle as you suggested and verify that the spindle does run at the proper speed when set by gcode while running a part. I appreciate your taking the time to provide the suggested VB script to try.

Dan

Post Reply