Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: swanner on September 30, 2011, 12:28:05 AM

Title: Adding a physical button to control outputs
Post by: swanner on September 30, 2011, 12:28:05 AM
How do would I go about setting up a button that would turn an output on and off? I would like to add a button to control the air solenoid for my dust hood, the solenoid is using 2 wires on a 3 conductor wire...it would be nice if I was able to utilize that unused wire instead of running a new one. I know how to setup an input but how do I get it to control the output? Also, if I used a button that sticks instead of a momentary one is there a way that it could override the output on/off code and make sure the dust hood stays up when it's depressed?
Title: Re: Adding a physical button to control outputs
Post by: Hood on September 30, 2011, 03:15:47 AM
How do you control it at the moment?
Hood
Title: Re: Adding a physical button to control outputs
Post by: swanner on September 30, 2011, 10:15:18 AM
The dust hood is setup using the 'flood coolant' button and is triggered by M8, I'm trying to operate it right from spindle location, either toggling it up/down or having it to where the button raises the hood and overrides the code.
Title: Re: Adding a physical button to control outputs
Post by: Hood on September 30, 2011, 10:19:38 AM
No problem then, just use a Brain and have the brain look at the input you are using, pass it through and terminate at the flood toggle button.
Just a momentary switch is needed.
Hood
Title: Re: Adding a physical button to control outputs
Post by: Hood on September 30, 2011, 10:23:25 AM
A brain just like this will work fine, I have it as Input 4.
Hood
Title: Re: Adding a physical button to control outputs
Post by: swanner on October 02, 2011, 11:49:00 PM
I've been playing with the brain part of the software and have a situation: I setup a brain that reads the Y position DRO, so that when the machine is away from the work area and near the tools the dust hood (flood) is up (enabled). Doing this overrides the flood toggle so that the dust hood is either up or down depending on the machine location, is there a way around this so it only locks the dust hood up when it's by the tools but the rest of the machine you can toggle it up or down?

I wanted to setup another one kept the dust hood up if the tool is under a certain length, but I suspect I'll have the same problem. (when using a tool longer then the set length the hood would be stuck down...)

Also whenever I go to brain control and load any brain I get a Bad XML read but they still seem to work....any ideas on that?
Title: Re: Adding a physical button to control outputs
Post by: Hood on October 03, 2011, 07:36:36 AM
Getting a brain to do what you want can be a lot of trial and error and you have to get creative if its not just a simple task such as switching something on/off via a button.
For what o are talking about you will likely have to use formulas (greater than/less than etc) use And and Ors looking at states of LEDs etc.
Hood
Title: Re: Adding a physical button to control outputs
Post by: swanner on October 03, 2011, 05:40:45 PM
I've attached the brain I messing with, this is the last thing I tried, but not matter what I do I'm getting the same results - no manual control over the output once the brain is enabled. Could you give me and example of how to get it to only work if the condition is true and leave it alone when it's false? Any idea on the bad xml read message I'm getting?
Title: Re: Adding a physical button to control outputs
Post by: Hood on October 03, 2011, 05:49:00 PM
Try naming the Brain with no spaces ie DustHood.brn rather than Dust Hood.brn
As for giving you an example, cant unless I mess around with it, which I will try if I get a chance.
Hood
Title: Re: Adding a physical button to control outputs
Post by: Hood on October 03, 2011, 05:56:39 PM
Would this work?
Hood
Title: Re: Adding a physical button to control outputs
Post by: swanner on October 03, 2011, 10:52:25 PM
Thanks, that did it regarding how I want it to work but I'm still getting the bad xml message even after renaming the file...
Title: Re: Adding a physical button to control outputs
Post by: Hood on October 04, 2011, 02:36:16 AM
Are you using the parallel port or some other external device? Do your choices of brains stick when you restart Mach or do you have to enable again? Can you attach your xml and I will see if I get that problem when I use it.
Hood
Title: Re: Adding a physical button to control outputs
Post by: swanner on October 05, 2011, 01:18:35 PM
When I restart the brains are disabled, enabling them give that message but they work after. I'm connected to the controller via USB (Industry Controls MCB-1). See brain attached.
Title: Re: Adding a physical button to control outputs
Post by: Hood on October 05, 2011, 02:42:43 PM
I run brains with IC and a Scorpion so IC is not the problem. Have you got version 4.01.030?
Hood
Title: Re: Adding a physical button to control outputs
Post by: swanner on October 05, 2011, 02:48:16 PM
No, I have 4.001.031 - I updated the mach.exe file a few weeks ago when I was having issues with a dubious soft limit warning that I'm still have half the time.
Title: Re: Adding a physical button to control outputs
Post by: Hood on October 05, 2011, 02:50:18 PM
Ah yes I remember.
Should be fine then, going to load your brain and see if it throws an error here.
Hood
Title: Re: Adding a physical button to control outputs
Post by: Hood on October 05, 2011, 02:53:48 PM
Ok its 030 version I have here and its working fine in that, will see if I can get the 031 version from Brian and test.
Hood
Title: Re: Adding a physical button to control outputs
Post by: Hood on October 05, 2011, 03:22:08 PM
Just loaded 031 and its fine for me, dont have a MCB1 so possibly that is the reason.
Hood