Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 02:05:36 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  controlling outputs through g-code
Pages: 1   Go Down
Print
Author Topic: controlling outputs through g-code  (Read 1017 times)
0 Members and 1 Guest are viewing this topic.
ASC
Active Member

Offline Offline

Posts: 64



View Profile WWW
« on: July 22, 2010, 10:38:57 AM »

Hey guys, I'm having trouble wrapping my stupid head around Mach's control of outputs.  I have a mill with a spindle and a dispenser mounted on separate air actuators to move them into the work area and act as a float.  I want Mach to be able to switch these actuators on and off when they're needed through the g-code.  Has anyone had any experience with an application like this, or can anyone recommend a visual basic script to get me started?
Logged

Mr. Creosote
Hood
Active Member

Offline Offline

Posts: 17,352


Carnoustie, Scotland


View Profile
« Reply #1 on: July 22, 2010, 11:35:04 AM »

Open  notepad and type in your VB, for example to switch on OutPut 3 you would have

ActivateSignal(OutPut3)

Save the file as m****.m1s where the **** is a number you wish, for example it could be m1234.m1s.
Yousave it to the macro folder of the profile you are using, exaple if using standard Mach3Mill profile it would be saved to
C:\Mach3\macros\Mach3Mill

Then when you have m1234 in your code or call from MDI that output will be activated. Similarly for shutting it off write another macro as above and call it for example m1235.m1s. In the macro you would have

DeActivateSignal(OutPut3)

So when your code calls m1235 the output will switch off.
Hood
Logged
ASC
Active Member

Offline Offline

Posts: 64



View Profile WWW
« Reply #2 on: July 22, 2010, 12:06:51 PM »

thanks Hood!  Seems so simple once someone knowledgeable explains it!  Grin
Logged

Mr. Creosote
LarryL
Active Member

Offline Offline

Posts: 46


View Profile
« Reply #3 on: October 30, 2010, 12:14:25 PM »

Hey Hood,

A macro question for you!  Is there a way to constantly provide the updated position of an axis so that it can be acted upon by an if then operation?

Larry
Logged
Hood
Active Member

Offline Offline

Posts: 17,352


Carnoustie, Scotland


View Profile
« Reply #4 on: October 30, 2010, 06:19:58 PM »

The macropump or a Brain may be able to but depends I suppose what you actually are wanting to do.
Hood
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!