Hello Guest it is November 13, 2019, 09:21:09 AM

Author Topic: Macro Help  (Read 2220 times)

0 Members and 1 Guest are viewing this topic.

Offline alenz

*
  •  137 137
    • View Profile
Macro Help
« 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

Offline Hood

*
  •  25,856 25,856
  • Carnoustie, Scotland
    • View Profile
Re: Macro Help
« Reply #1 on: February 10, 2011, 04:13:38 AM »
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

Offline alenz

*
  •  137 137
    • View Profile
Re: Macro Help
« Reply #2 on: February 11, 2011, 12:27:57 AM »
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
Re: Macro Help
« Reply #3 on: February 11, 2011, 01:22:58 AM »
Regards,
Ray L.

Offline alenz

*
  •  137 137
    • View Profile
Re: Macro Help
« Reply #4 on: February 11, 2011, 03:32:51 AM »
Thank you, Thank You Ray.
That's what I was looking for but for some reason couldn't find it.
Al