Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 06:57:02 AM

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
| | |-+  Zero X +Y button?
Pages: 1   Go Down
Print
Author Topic: Zero X +Y button?  (Read 533 times)
0 Members and 1 Guest are viewing this topic.
budman68
Master of the Custodial Arts, or better known as:
Global Moderator
*
Offline Offline

Posts: 1,994



View Profile
« on: June 14, 2010, 02:30:37 PM »

Hi all,

Yes, it's another dumb simple VB question from me.

I would like a button on my screen to Zero the X + Y DRO's together with one press.

I know I can use the OEM codes 1008 (X) and 1009 (Y), but how do I make a VB script to do this?

Thank you kindly-
Dave

Logged

----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    Wink
Greolt
Global Moderator
*
Offline Offline

Posts: 872


View Profile
« Reply #1 on: June 14, 2010, 03:37:36 PM »

Dave

You could use this code as your button script

SetOEMDRO (800,0)
SetOEMDRO (801,0)

Greg
Logged
budman68
Master of the Custodial Arts, or better known as:
Global Moderator
*
Offline Offline

Posts: 1,994



View Profile
« Reply #2 on: June 14, 2010, 03:44:32 PM »

Worked perfectly Greg, thank you very much.

Now I realized you're using the OEM codes for the DROs, but how did you know how to put the comma and add the zero's to actually zero the DRO? Is it just from fooling around with VB, or do you actually know VB scripting/code?

Again, thank you- Smiley
Dave
Logged

----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    Wink
Greolt
Global Moderator
*
Offline Offline

Posts: 872


View Profile
« Reply #3 on: June 14, 2010, 03:47:19 PM »

Dave

The little I know of this stuff is just by looking at other examples and fooling around with it.  Smiley

Greg
Logged
budman68
Master of the Custodial Arts, or better known as:
Global Moderator
*
Offline Offline

Posts: 1,994



View Profile
« Reply #4 on: June 14, 2010, 03:48:49 PM »

Ah, I guess that's how I'll be "learning" as well, lol!

Dave
Logged

----------------------------------------------------------------------
Just because I'm a Global Moderator, don't assume that I know anything !

Dave->    Wink
stirling
Global Moderator
*
Offline Offline

Posts: 1,189

UK


View Profile WWW
« Reply #5 on: June 15, 2010, 07:29:18 AM »

There's useful info for things like this in the WIKI including a Cypress VB manual such as it is.. There is I believe a newer version of the (Mach specific) VB reference written by (I think) HimyKabibble but I'm not sure where it is. Maybe a sticky at the top of this topic would be an idea?

Cheers

Ian
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!