VB Script Question

VB Script Question

Postby dbrook » Sat Aug 10, 2019 6:12 pm

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"
dbrook
Vectric Apprentice
 
Posts: 64
Joined: Wed Jul 27, 2011 3:36 am
Location: Starkville, MS
Model of CNC Machine: 4x4 DIY Router

Re: VB Script Question

Postby ger21 » Sun Aug 11, 2019 1:26 pm

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
ger21
Vectric Wizard
 
Posts: 1483
Joined: Sun Sep 16, 2007 2:59 pm
Location: Shelby Township, MI, USA
Model of CNC Machine: Custom DIY

Re: VB Script Question

Postby dbrook » Mon Aug 12, 2019 1:51 pm

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
dbrook
Vectric Apprentice
 
Posts: 64
Joined: Wed Jul 27, 2011 3:36 am
Location: Starkville, MS
Model of CNC Machine: 4x4 DIY Router


Return to Control Software related questions

Who is online

Users browsing this forum: No registered users and 4 guests