![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
I would like to have a macro that will activate or deactivate an output based on the direction that the tool is traveling while cutting a part. For example, while the tool is cutting in a +X direction, then OUTPUT1 is activated. If it is going in a -X direction, then Output1 will be deactivated, and Output2 will be activated. The same goes for the +Y and -Y, in terms of activating or deactivating Output3 and Output4. And if the machine is going diagonally - say +x and +y, then the two appropriate outputs will be activated (say output 1 & 3). If the tool is stopped, then all Outputs should be off. I don't want the macro to hog unncessary CPU power, so I was thinking that it would only need to check the direction of the tool say every quarter to half second. I plan to add a button to my screen that turns this macro on and off. So, I imagine that this macro would use the IsMoving function, and might do some math by comparing X and Y coordinates every .25 seconds to determine whether things are going in +/- X and Y directions, and that there might be a Sleep() in there. But I am not positive of the best way to approach this. Any help from those folks out there who are skilled with the scripting would be much appreciated. Thanks! |
|
#2
| ||||
| ||||
| Do you want the macro to run continuously? If so, I believe the only way to do that would be to use the macropump, which runs 10 times per second. You can't turn it on and off, except to toggle it in General Config. I guess you can check the position two times, and compare the results. You may need a small delay (sleep(10) maybe?) in between the two checks, as the macro may run too fast to detect the movement.
__________________ Gerry Mach3 2010 Screenset http://home.comcast.net/~cncwoodworker/2010.html (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Direction output inverted in Mach3 R3.041 | kreutz | Machines running Mach Software | 13 | 07-21-2010 07:18 PM |
| Macro for Output in Milliseconds | Joey | Mach Wizards, Macros, & Addons | 0 | 04-28-2008 04:28 AM |
| G43.1 - Tool Axis Direction Tool Length Compensatioin | EngTech | Mazak, Mitsubishi, Mazatrol | 8 | 12-06-2007 04:01 AM |
| Windows based laser engraver software - Hardwired to LPT1 - redirect output to file | sidi_steve | Machine Problems, Solutions , Wireless DNC, serial port | 6 | 05-09-2006 09:52 AM |
| Other controllers that output step/direction? | cn00728 | General Electronics Discussion | 3 | 02-02-2005 01:30 PM |