Hello Guest it is April 17, 2024, 09:24:19 PM

Author Topic: macro for the non macro'ish  (Read 13935 times)

0 Members and 1 Guest are viewing this topic.

macro for the non macro'ish
« on: February 26, 2010, 03:34:29 PM »
 
Could somebody pls write a macro for me. I would like to shut off output 4 If an input ( lets call it input 2) dose not close. I hooked a flow meter to my machine and would like the heat to shut off if the water is not on. The Macro would need to give at least 3/4 to 1 second for the switch to close. This input would only be on when output 4 is active. I have only used one macro to zero a DRO, so i am extremely dense.

thanks
josh

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: macro for the non macro'ish
« Reply #1 on: February 26, 2010, 07:06:10 PM »
I think you would need to use the macropump for that, well thats if I am understanding what you want as I am thinking you need to be constantly monitoring the flow meter?
However the easiest way would probably be to do a Brain for it, fairly simple to do and no VB needed :)
Other way would be to have the flow meter connected to the coil of a relay and the contacts of the relay in series with the heater, if the flow meter wasnt registering the relay would drop out and switch off the heater.

Hood
Re: macro for the non macro'ish
« Reply #2 on: February 26, 2010, 08:12:44 PM »
Thanks Hood

The flow meter is a normally open normaly closed contact, I have it set to close at 24 gpm, so a pump wont be needed. I cant wire it in series as the heater is on befor the flow meter reaches 24 gpm and the heat is off befor the flow meter is off.  What would a brain like this look like?

Thanks
Re: macro for the non macro'ish
« Reply #3 on: February 26, 2010, 09:30:27 PM »
oops sorry, I need a marco pump

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: macro for the non macro'ish
« Reply #4 on: February 27, 2010, 04:40:41 AM »
Oh ok thats a bit tricky, will have to think about that but will involve some sort of timer whether using the macro pump or a brain.
Is the time you mentioned above the time it takes for the flowmeter to switch on?
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: macro for the non macro'ish
« Reply #5 on: February 27, 2010, 05:52:19 AM »
Ok if you put this in the macropump it should work I think.

If GetOemLED(77) Then               'Look at OutPut 4 LED to make sure its active
Sleep (1000)                               ' Wait for 1 second
If  Not IsActive (Input2) Then       ' If Input 2 is not active
DeActivateSignal(OutPut4)           ' Turn off OutPut 4
MsgBox ("Water Flow is Low, Heater has been turned Off")   'Message to let you know Heater has been turned off gue to lack of flow
End If
End If

You will need to enable the macropump on General Config page and restart Mach.

Hood

« Last Edit: February 27, 2010, 05:59:42 AM by Hood »
Re: macro for the non macro'ish
« Reply #6 on: February 27, 2010, 08:00:27 AM »
Dude You are awesome, I am actually exited for Monday morning ( believe it or don't)!
You even put in an message thanks.  Could you direct me to the location on the macro comands, I would much like to get a better understanding on its language.

josh

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: macro for the non macro'ish
« Reply #7 on: February 27, 2010, 09:09:26 AM »
Ray Livingstone wrote a manual I think, think its been posted here somewhere, if I find it I will post a link.
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: macro for the non macro'ish
« Reply #8 on: February 27, 2010, 09:14:23 AM »
Here it is
http://www.machsupport.com/forum/index.php/topic,12740.0.html
Not sure all whats in it but should give you a good idea of whats what. Also the wiki has some info, think the Mach2 Customising manual as well has some info and you will also need to know the OEM codes for buttons, DROs, LEDs etc and you can find them in the OEM list in the sticky at the top of the forum or on the Wiki.

I find looking at the wizards VB gives you a good idea how to do things as well.

Hood
Re: macro for the non macro'ish
« Reply #9 on: February 27, 2010, 10:31:33 AM »
Thanks Hood,
Have a nice weekend!