Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: rmothers on February 13, 2011, 10:25:41 AM
-
Ok so i use a little piece of hardware made by Phigdets, it controllers a servo. I made an arm to move the on and off button on my dremel tool. I have made an application to turn the dremel on if i hit the F3 key, and off if i hit the F1 key. F2 is half speed. I would really like to add buttons (which i have done) the the Mach3 screen that when clicked emulates the F1/F2/F3 buttons being pushed. Any thoughts. I tried the send key. can i like it to a input or output of some sort or something?
Also is there anyway to refer to a DLL on the VBscripting tool. I have seen a couple of posts regarding but no one answered those questions.
I am a home user with a DYI cnc machine i love it and this would be the finishing touches on my machine. Any help would be great
thanks in advance
Rodney
-
I have tried a few keys and the sendkeys function in the VB script doesn't seem to be sending the keys strokes
-
Hi Rodney - welcome to the forum.
SendKeys works just fine - but remember that sendKeys targets the application that has focus. If you're running sendKeys from the VB editor in Mach or from a button, then Mach has the focus... so it's sending keystrokes to itself.
Enter this into the VB editor in Mach.
sleep 10000
sendKeys("abc")
before you run it, open a copy of notepad. Then run the script - you then have 10 seconds to give notepad focus. Personally I dislike SendKeys, it can have nasty effects if you focus the wrong app.
As far as accessing a DLL from VB script - just do it as you would from any implementation of VB - use createObject.
Ian
-
If you want an easier way, buy a SuperPID speed controller. It'll turn the Dremel on/off, and provide variable speed controllable by Mach3.
You'd just create buttons that send g-code.
Sending combinations of M3, M5, and S*********x will give you full control of the Dremel.
www.superpid.com
-
That is awesome thanks..
Rodney