Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: ballistic42 on April 15, 2016, 04:04:05 PM

Title: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 15, 2016, 04:04:05 PM
I have used all the Inputs 1-4 in the inputs tab on mach3.  I need to find one more input for a pressure sensor.  I do have 11-15 OEM Trig still available.   Could I assign a port and pin to the OEM Trig in the inputs tab to get the input to trip and through VB scripting either shut down the system or flash a message box on the screen for the user to see?

Thanks,

Jeff
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 15, 2016, 05:16:39 PM
You could easily use an OEM Trigger and assign it as an Stop if that is what you are wanting?
Just set up the port and pin number in the trigger then on Config menu then System HotKeys enter the OEM Code for Stop (1003) next to the trigger you are using.
You could also do similar via the macropump if you were wanting a message box to appear.
For example you could have something like this

If IsActive(OemTrig11) Then
DoOemButton(1003)
Sleep 500
MsgBox "Pressure Failure"
End If



Hood
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 15, 2016, 05:27:12 PM
Hood yes I had a brain fart on my end.  I hooked up the Pressure sensor to check the pin to see if I could get the Pin LED to light up on the M21 board and yes it does.  The next part is to use the PSI sensor in my ATC.  I need to write the code so that when the ATC pneumatic system drops below 70PSI,  the ATC function will stop and then put up a message box saying to "CHECK AIR PRESSURE" Click OK to Continue.

Has anyone heard from TP,  have not seen him on in a while just checking to see that everything is all good?

Thanks,

Jeff
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 15, 2016, 05:34:28 PM
Regarding TP, see here
http://www.machsupport.com/forum/index.php/topic,32056.0.html

Hood
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 15, 2016, 05:43:46 PM
Wow I am sad to see that! Terry really helped me out a lot and his knowledge base will be missed along with the tomatoes he through at me to get me thinking!!!!

Jeff
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 03:43:29 AM
Hood, I have the LED working on the M21 board but am trying to get an LED to work on my ATC screen to tell the user the ATC SYSTEM PRESSURE IS LOW.  I made the LED in machscreen with the User LED # of 1061.  The UserLED is attached to OEMTrigger11.  I tried making a brain to get the LED to light up on the ATC screen but have had no luck at all.  When the system pressure drops below 70PSI I have it set on OEMTRIGGER #11 and  Pin 3-7 will light up on the M21 board, when that happens I would like my ATC low psi LED to light up as well.

Any help would be awesome.

Jeff
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 16, 2016, 02:11:10 PM
Works fine here, see vid

https://youtu.be/wy-4bvQgm2U

Hood
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 03:17:15 PM
Hood,  I don't understand how you got that to work!  I made the brain look like this,

OEMTRIGGER11:0--------------------Invert flip signal--------------------OEMLED1061:1

For some reason the UserLED1061 I made in machscreen is not lighting up.  I can see the port and Pin on the M21 board working so I know its getting the signal just not showing on the screen with the LED?

Jeff
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 03:18:34 PM
Are you using the Macro that you wrote at the beginning of the post?
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 16, 2016, 03:25:59 PM
No, just emulating the OEM Trig via my keyboard.

Did you enable the brain?
Did you reload after enabling?


Hood
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 04:10:54 PM
when the brain is active, when air pressure is below 80psi and the pin on the BOB turns on My UserLED on the ATC screen should turn on YES or NO?  When the pressure sensor is satisfied the BOB pin LED is OFF when the Pressure drops below 80PSI the BOB LED should come on which it does.  Why can't I get the UseLED1061 to light up when the BOB LED is ON?  This is the problem.  There is a disconnect somewhere in the logic.  I have to be missing something very simple.

I appreciate your help

Jeff
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 04:15:47 PM
I am sorry what i meant to say is when the Pin on the BOB turns on because the pressure sensor is open the UserLED1061 should be off.  When the pressure drops below the 80PSI the bob LED turns on but the UserLED1061 is not turning on. 
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 16, 2016, 04:32:26 PM
Should work fine, works here.
If you attach your xml and brain I will have a look here and see if I can find the issue.
Hood
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 04:52:18 PM
Hood thanks!
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 16, 2016, 04:54:05 PM
Just to test wherther the LED is working you could open the VB editor and type in

SetUserLED (1061,1)
Sleep 1000
SetUserLED(1061,0)


Then press the Run Script arrow and you should see the LED go on then off.
Hood
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 04:55:09 PM
My brain in fried trying to figure this out....
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 16, 2016, 05:02:03 PM
Not sure if that was the correct xml or not, if it was you didn't have the brain enabled.
Hood
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 16, 2016, 05:07:11 PM
<Brains><OP78LED.brn>1</OP78LED.brn><ModIOMPG.brn>1</ModIOMPG.brn><PSI11.brn>1</PSI11.brn></Braiins<

That is what your xml has, maybe you renamed the brain before posting?
Hood
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 05:43:17 PM
i did what you said and the LED on the ATC screen works.  I need to now try to figure out what I am doing wrong in the brain.  Here the XML is and the brain sorry about that I gave you an old one.
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 05:44:02 PM
I had to rename them to send again on the forum.
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 16, 2016, 05:59:58 PM
Ok which brain is it you are using, there are 3 that are enabled
OP78LED
ModIOMPG
PSI11

I presume it is the last one?
Hood
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 16, 2016, 06:11:26 PM
The brain has an issue, not sure exactly what but I deleted all the steps in it and redid and saved, then reloaded and it works fine.
Hood
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 06:15:37 PM
Hood yes the last one is the brain that I am using.  I will try to delete the brain and then start over if thats what you did and it works.

Thanks for sharing your knowledge!

Jeff
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 06:16:09 PM
Can you show me what the brain looks like that you did?
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 06:16:28 PM
Maybe I did something to the brain when i was making it.
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: Hood on April 16, 2016, 06:20:24 PM
Here is the brain.
I just deleted the steps in it and started again rather than totally deleting the brain, same difference I suppose.
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 07:00:08 PM
Hood Thank You so much for your time I will give it a shot!

Jeff
Title: Re: Mach3 need one more input for Pressure sensor?
Post by: ballistic42 on April 16, 2016, 07:16:38 PM
Hood you are not going to believe this but I had it right all along from when you first showed me.  In the Inputs ports and pins I had the wrong pin!!!!  I had 3-7 and works when I have the right port and pin 3-8!!!  Well I feel stupid!

Thanks for the help