Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
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?
May 28, 2012, 01:17:39 PM
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
Fire macro when input is triggered.
Pages:
1
Go Down
« previous
next »
Author
Topic: Fire macro when input is triggered. (Read 1511 times)
0 Members and 2 Guests are viewing this topic.
xitian
Holding
Offline
Posts: 1
Fire macro when input is triggered.
«
on:
April 11, 2008, 09:29:07 AM »
I'm trying to figure out how to run a macro when a momentary switch is pressed. So far I’ve got that input setup in my ports and pins as an OEMInput. How do I configure a macro to run when this input goes high? Also can anyone give me some tips on writing the macro? (I’m a programmer so the VB is no problem). I want the macro to do the following:
If machine Is Not running
1.) Clear the ESTOP if there is one
2.) Home the X & Y Axis
3.) Load a GCode file even if one is already loaded.
4.) Execute the GCode file.
5.) Cut the grass and paint the house
Else
‘Do nothing because we are already running.
End if
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
Offline
Posts: 1,707
Briceville, TN, USA
Re: Fire macro when input is triggered.
«
Reply #1 on:
April 11, 2008, 11:41:37 AM »
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
M333.m1s
(0.89 KB - downloaded 92 times.)
mygcodefile.TAP
(0.07 KB - downloaded 114 times.)
Logged
Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
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
=> HiCON 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.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...