Hello Guest it is April 25, 2024, 06:55:37 AM

Author Topic: Been searching for an answer  (Read 2850 times)

0 Members and 1 Guest are viewing this topic.

Been searching for an answer
« 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
Re: Been searching for an answer
« Reply #1 on: February 13, 2011, 10:49:14 AM »
I have tried a few keys and the sendkeys function in the VB script doesn't seem to be sending the keys strokes

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Been searching for an answer
« Reply #2 on: February 14, 2011, 05:26:54 AM »
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

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Been searching for an answer
« Reply #3 on: February 14, 2011, 11:37:04 AM »
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
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Been searching for an answer
« Reply #4 on: February 14, 2011, 11:41:13 AM »
That is awesome thanks..

Rodney