Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: alenz on February 10, 2011, 03:54:55 AM
-
A recent post, re. 'soft limits' (thanks kolias), prompted me to write a macro to assist in setting my own soft limits.
I would jog the X, Y and Z against their hard stops (that's acceptable/harmless with a Sherline mill). Then the macro would back off all axes by 0.10, Ref All Home and zero the X, Y and Z work coords. Needless to say it didn't work.
So I have three questions:
1. What is the better/correct way to go about this?
2. What/where is the preferred Macro reference document? I go to the WIKI but didn't someone on the forum write a better document? I can't seem to find it.
3. And last, just for my own info, why doesn't my dumb macro work?
Here is the macro:
'Zero work coords
SetOEMDRO(800, 0.0)
SetOEMDRO(801, 0.0)
SetOEMDRO(802, 0.0)
'Then back off 0.10
Code "G00 X0.1 Y0.1 Z-0.1"
'Ref All Home
DoButton(22)
DoButton(23)
DoButton(24)
DoButton(25)
'Zero work coords
SetOEMDRO(800, 0.0)
SetOEMDRO(801, 0.0)
SetOEMDRO(802, 0.0)
Thanks,
Al
-
Try using the Zero buttons for the axis rather than setting the DRO. If you really want to set the DRO then possibly a sleep between each one would work. You will also likely need a
While IsMoving()
Wend
after the
Code "G00 X0.1 Y0.1 Z-0.1"
Hood
-
Thank you Hood, have it working now.
It did require two while - wends tho.
'Back off hard stops
Code "G91 G00 X0.015 Y0.015 Z-0.015"
Code "G90"
While IsMoving()
Wend
'Ref All Home
DoButton(22)
DoButton(23)
DoButton(24)
While IsMoving()
Wend
'Zero work coords
DoOEMButton(1008)
DoOEMButton(1009)
DoOEMButton(1010)
End
-
http://www.machsupport.com/docs/Mach3_V3.x_Macro_Prog_Ref.pdf
-
Thank you, Thank You Ray.
That's what I was looking for but for some reason couldn't find it.
Al