Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 02:21:32 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
| | |-+  The basics of making a switch run a script?
Pages: 1 2 3 »   Go Down
Print
Author Topic: The basics of making a switch run a script?  (Read 4288 times)
0 Members and 1 Guest are viewing this topic.
Gakiem
Active Member

Offline Offline

Posts: 4


View Profile
« on: June 28, 2006, 02:34:59 PM »

Hi All

A very new user here, with a big router that has some push-button switches on the gantry. First I'll tell you what took me all day to figure out, so you can see my "expertise"....

Have 4 pushbutton switches and 1 probe (Normally Open). Got the red switch to do E-stop - easy. Then a few hours on getting the Green switch to do equivalent of Alt-R with OEM trig on Ports&Pins and External Buttons-OEM Codes on SystemHotkeysSetup (1000). 5 minutes to setup the Yellow feedhold OEM 1001.

Now to the problem at hand. The last pushbutton must plunge the z and zero the z off the probe switch. I have the probe working in Ports&Pins, and can get an OEM Trig to work off that switch. I have been told I must execute the following script when hitting the black switch:

code "g31 z-10 f50"
While IsMoving()
Wend
code "G92 Z0"
code "G0Z3"
While IsMoving()
Wend
code "g92z0"

Where do I save this code? Is it with the M12**.m1s files? Can I call an M.....m1s file with an OEM trig?

Thanks for any hints!

G

Logged
Brian Barker
Administrator
*
Offline Offline

Posts: 3,383



View Profile
« Reply #1 on: June 28, 2006, 06:39:05 PM »

There is a way to call a script from an OEMtrig ... I can't think of it at this point Sad I will get back to you
Brian
Logged

Fixing problems one post at a time Wink

www.newfangledsolutions.com
www.machsupport.com
Brian Barker
Administrator
*
Offline Offline

Posts: 3,383



View Profile
« Reply #2 on: June 28, 2006, 07:24:07 PM »

You need to set the Macro to be called with a VBscript... SetTriggerMacro (450) would set it to M450

And put 177 for the OEM code .. Or 277.. it is one of them ... All this is in the manual if you would like to know more Smiley And if you have any trouble please feel free to ask!

Logged

Fixing problems one post at a time Wink

www.newfangledsolutions.com
www.machsupport.com
Gakiem
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #3 on: June 29, 2006, 08:29:21 AM »

I feel almost too shy to confess that I understand little of what you said. I went backwards and forwards through Using Mach3 Mill and think I am further lost now. Are you perhaps talking of some other manual?
Logged
fer_mayrl
Global Moderator
*
Offline Offline

Posts: 452


View Profile
« Reply #4 on: June 29, 2006, 11:05:40 AM »

I think this should work...

In the Ports and Pins config menu, go to inputs, select an input or an OEM trigger, put your pin and port settings for the switch you are using, and assign a hotkey to that input. Now go and create a button on screendesigner, make that button run the sI thicript you want and assign that buttin the same hotkey you set on the input ports and pins. I think its in the ScanCode box. Now if you dont want that button to show up on your screen use screen designer to drag the button out of the workarea.

I think that might work, havent tried it, please let me know.
Regards
Fernando
Logged
Brian Barker
Administrator
*
Offline Offline

Posts: 3,383



View Profile
« Reply #5 on: June 29, 2006, 11:41:46 AM »

Sorry about that Sad

look in the Mach2 Customization manual

thanks
Brian
Logged

Fixing problems one post at a time Wink

www.newfangledsolutions.com
www.machsupport.com
Brian Barker
Administrator
*
Offline Offline

Posts: 3,383



View Profile
« Reply #6 on: June 29, 2006, 12:10:59 PM »

The OEM code that you need to put into the OEMTrig box is 301.. This will call the Macro that you set with the Call SetTriggerMacro

IF you upload your XML I will make it work Smiley
Logged

Fixing problems one post at a time Wink

www.newfangledsolutions.com
www.machsupport.com
Gakiem
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #7 on: June 30, 2006, 06:59:08 AM »

Hi Brian

Thanks for the offer! Here is the file:


G

* Mach3Mill.xml (52.03 KB - downloaded 127 times.)
Logged
Brian Barker
Administrator
*
Offline Offline

Posts: 3,383



View Profile
« Reply #8 on: June 30, 2006, 07:36:40 AM »

Here you go Smiley

Copy in this new XML and copy the M450 and M451 Macros in to the macros/Mach3Mill directory.... The M450 is the one that you can put you VB code in, and I have it set to work with  OEMTrig#4

* M450.m1s (0.04 KB - downloaded 213 times.)
* M451.m1s (0.02 KB - downloaded 194 times.)
* Mach3Mill.xml (52.16 KB - downloaded 153 times.)
Logged

Fixing problems one post at a time Wink

www.newfangledsolutions.com
www.machsupport.com
Gakiem
Active Member

Offline Offline

Posts: 4


View Profile
« Reply #9 on: June 30, 2006, 08:20:40 AM »

Thanks Brian!

G
Logged
Pages: 1 2 3 »   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!