Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 03:31:01 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
| | |-+  Been searching for an answer
Pages: 1   Go Down
Print
Author Topic: Been searching for an answer  (Read 383 times)
0 Members and 1 Guest are viewing this topic.
rmothers
Active Member

Offline Offline

Posts: 3


View Profile
« 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
Logged
rmothers
Active Member

Offline Offline

Posts: 3


View Profile
« 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
Logged
stirling
Global Moderator
*
Offline Offline

Posts: 1,190

UK


View Profile WWW
« 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
Logged
ger21
Global Moderator
*
Online Online

Posts: 2,619



View Profile WWW
« 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
Logged

rmothers
Active Member

Offline Offline

Posts: 3


View Profile
« Reply #4 on: February 14, 2011, 11:41:13 AM »

That is awesome thanks..

Rodney
Logged
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!