Hello Guest it is August 17, 2019, 07:22:52 AM

Author Topic: controlling outputs through g-code  (Read 6532 times)

0 Members and 1 Guest are viewing this topic.

Offline ASC

*
  •  59 59
    • View Profile
    • Automation Systems
controlling outputs through g-code
« on: July 22, 2010, 11: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?
Mr. Creosote

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: controlling outputs through g-code
« Reply #1 on: July 22, 2010, 12:35:04 PM »
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

Offline ASC

*
  •  59 59
    • View Profile
    • Automation Systems
Re: controlling outputs through g-code
« Reply #2 on: July 22, 2010, 01:06:51 PM »
thanks Hood!  Seems so simple once someone knowledgeable explains it!  ;D
Mr. Creosote
Re: controlling outputs through g-code
« Reply #3 on: October 30, 2010, 01: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

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: controlling outputs through g-code
« Reply #4 on: October 30, 2010, 07:19:58 PM »
The macropump or a Brain may be able to but depends I suppose what you actually are wanting to do.
Hood