Home
Downloads
Mach and LazyCam
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Known Bugs
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
February 12, 2012, 09:28:38 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
activate macro when input is triggered
Pages:
1
Go Down
« previous
next »
Author
Topic: activate macro when input is triggered (Read 642 times)
0 Members and 1 Guest are viewing this topic.
tmead
Active Member
Offline
Posts: 61
activate macro when input is triggered
«
on:
March 11, 2010, 12:50:14 PM »
OK, so I found the following in a post, which is fine, except I'm stuck right at the beginning. I'm not sure where the 'trigger code box' is for option 1. I'm scared of writing a brain - out goes number 2, and I can't find anywhere to tell me which command to use to access the input in a macro. I'm assuming it must be something like GetInput (INPUT1) ?
All help welcome - I've been creating screens and simple macros for a while, but it's time to go a little further ! We're using Mach to drive lab rigs, and it's working a treat, but I want to use a couple of hardware buttons to do certain things.
Tim
you can do it three ways..... for example macro "M333.m1s"
1). Put OEM code 301 into your trigger code box next to the OEM input your bringin in. Then put SetTriggerMacro(333) into your init line under general.
2) you can use Brains: put the same init line above, then have your imput map to the terminator under buttons "execute button script"
3). You can have Macro pump watch for your trigger input to go hot, then in an if statement it can run the macro as a Code Call.
here is a Macro that does what you want.
M333.m1s
If GetOEMLED(800) Or Not GetOEMLED(999) Then 'machine in estop or not moving so reset and load run file
If GetOEMLED(800) Then 'if in reset
DoOEMButton(1021) 'push reset
End If
Code("G4 P0.5") 'Pause here is required from first boot up to give time from reset
While IsMoving() 'time to complete code/move
Wend
If Not GetOEMLED(999) Then 'if machine is NOT moving (note 804 "run led" doesnt work well)
DoOEMButton(1022) 'Home the X
DoOEMButton(1023) 'Home the y
While IsMoving() 'time to complete code/move
Wend
Loadrun("C:/Mach3/GCode/mygcodefile.TAP") 'this will load and execute this file replace with your path and file
Message(" Hey Wife, I will let you spend alot of money at walmart if you cut the grass and paint the house")
End If
Else
If GetOEMLED(999) Then 'If machine is moving
Message(" Currently Running a Part!, see if wife finished with Grass and house")
End If
End If
'Note you will need to push the "clear" button to clear the
'messages it is next to the Reset button
'sample G code file is attached in match it to the above directory.
'the macro M333.m1s is also attached to this post
'enjoy, and welcome to the support group
'Scott S
Logged
tmead
Active Member
Offline
Posts: 61
Re: activate macro when input is triggered
«
Reply #1 on:
March 11, 2010, 12:59:55 PM »
OK - Probably a little quick on the draw there.
I'm hoping that what I need will be in here :
http://www.machsupport.com/forum/index.php/topic,12740.0.html
Tim
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP motion controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
Loading...