Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: learman 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
-
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
-
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
-
oops sorry, I need a marco pump
-
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
-
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
-
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
-
Ray Livingstone wrote a manual I think, think its been posted here somewhere, if I find it I will post a link.
Hood
-
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
-
Thanks Hood,
Have a nice weekend!
-
Yep the macro pump works great!!
I'm hooked I want to run some some more but it seems 1 is the limit. Can the same macropump be written as a brain and work the same way? I would like to watch some temperature switches and position sensors. oh no,, what have you started.
josh
-
Just add more code in the macropump and it will work :)
Slows down a bit if you have too much in it but should be fine for what you want.
Or you can use brains alongside a macropump if you wish to use a brain for something else.
Hood
-
I'll do that
thanks Hood
-
Hi
I was hoping you could tell my why my macro is not working correctly on one of Machs older version 2.0.061. This version works great but to turn on output 4 you have to call it P2 not P4.
If GetOemLED(77) Then < " I'm not sure if version 2.0.061 recognizes this line"
Sleep (1000)
If Not IsActive (Input2) Then
DeactivateSignal(Output4)
MsgBox ("Water Flow Is Low Heat has been shut off")
End If
End If
If IsActive(INPUT1) Then
MsgBox ("Water Temperature is High")
End If
I would hate to update this version, its the best running machine in the building.
Thanks
Josh
-
Dont think it being an old version should matter for that but if you attach your xml from that machine I will see if I can find a problem.
Hood
-
Hope this works!
-
Thats your backups, what you want is the single xml file for the profile you use, if you use standard mill profile it will be called Mach3Mill.xml. If you have a custom profile it will have that name.
You will find the xml in the main Mach3 folder, its not in a sub folder.
Hood
-
try agian
-
Nope, seems to be a blank xml :(
Third time lucky? ;D
Hood
-
I don't know but, its showing it needs to be opened with internet explorer?
-
This is justs some of it, is this what you are looking for?
- <Preferences>
<Syskey1>0</Syskey1>
<DefDir>C:\Mach3</DefDir>
<Profile />
<NewPath>0</NewPath>
<BR>0.0</BR>
<BG>0.0</BG>
<BB>0.0</BB>
<FR>0.0</FR>
<FG>0.0</FG>
<FB>1.0</FB>
<RR>1.0</RR>
<RG>0.0</RG>
<RB>0.0</RB>
<AR>0.7</AR>
<AG>0.2</AG>
<AB>0.7</AB>
<ER>1.0</ER>
<EG>1.0</EG>
<EB>0.0</EB>
<MatRed>0.</MatRed>
<MatGreen>0.1</MatGreen>
<MatBlue>0.1</MatBlue>
<PulseSpeed>0</PulseSpeed>
<ID>None</ID>
<FirstRun>1</FirstRun>
<LastUser>josh learman</LastUser>
<Layout>1024.set</Layout>
<m_SafeZ>0.</m_SafeZ>
<CVUseAngle>0</CVUseAngle>
<CVDegrees>0.</CVDegrees>
<JogHeat>0</JogHeat>
<KeyClick>0</KeyClick>
<THC5>0</THC5>
<SpinInc>100</SpinInc>
<M30SpinOff>1</M30SpinOff>
<AutoCalcs>0</AutoCalcs>
<Boxed>1</Boxed>
<SafeZStop>0</SafeZStop>
-
Try right clicking on your xml and zipping it then attaching the zip, you will need to name the zip something like learman.zip so the forum will accept.
Hood
-
Yes but takes too long trying to look at it that was so really need the xml itself.
Hood
-
Why is it showing up as an explorer doc?
-
xml is a browser document so it will open as such if you double click it.
Hood
-
OK,so mine is showing nothing on your end.
Ill try sending it again
-
It is opening but doesnt have any motor or outputs or inputs settings etc, in other words its basically blank.
Hood
-
Humm. Not sure what to do next. ?
-
Do you have winzip or winrar on the machine in question? if you do go to the Mach3 folder and right click on the xml for the profile you are using and choose to zip (or RAR) it then attach the zip (or rar)
Hood
-
I'm doing some diggin at home and found on one of my backup disks there is a file called machmill xml !! AAh ha! I'll pull that one out of my machine tomarrow and post it.
JOSH
-
Try this!
-
Ok that seems more like it. Now to your problem, how are you switching on OutPut4?
Hood
-
with P2 command
-
Thats a new one on me I am afraid, can you elaborate a bit more?
Hood
-
Sorry about the confusion, its my constant state?
M3
M3
X 00.000 Y00.00000 Z00.00000 F550.00
M11 P2 < This is the command to turn output 4 on, or my heat.
G1 X -00.070 Y00.00000 Z00.00000 F010.0
M11 P7
G1 X -04.800 Y00.00000 Z00.00000 F080.0
M10 P2 < this is the command to turn it off,output 4, or my heat.
M10 P2
X -06.00 Y00.00000 Z00.00000 F130.00
G4 P1.7
X -06.300 Y00.00000 Z00.00000 F7800.00
M10 P7
X -06.400 Y00.00000 Z00.00000 F700.00
M11 P3
M11 P5
M10 P7
X -06.420 Y00.00000 Z00.00000 F800.00
G4 P0.1
M10 P5
M10 P9
M10 P7
X -06.450 Y00.00000 Z00.00000 F800.00
M6
-
Ah ok, can you attach your m10 and m11 macros please.
Hood
-
First Try
-
Second Try
-
Seems to be working fine here but I will see if I can find the exact version of Mach you are using and test again.
Hood
-
Thank you :D
-
Afraid the closest I can find to your version is R2.0.077 and it works fine with that.
I will PM my email address if you can zip and send the Mach3.exe from that version I will test it.
Hood