Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: JohnHaine on May 08, 2018, 04:21:48 PM

Title: SetToolX() documentation
Post by: JohnHaine on May 08, 2018, 04:21:48 PM
Please could anyone point me to where the subroutines SetTool<X/Y/Z>() are documented?  I assume that they write the number in the brackets as an offset into the tool table entries for the currently selected tool, but where?  I cannot find any reference in the Wiki or elsewhere to how to use them.

Thanks in anticipation,

John.
Title: Re: SetToolX() documentation
Post by: TPS on May 09, 2018, 01:42:18 AM
Mach3_V3.x_Macro_Prog_Ref is your friend.

http://www.machsupport.com/wp-content/uploads/2013/02/Mach3_V3.x_Macro_Prog_Ref.pdf

Title: Re: SetToolX() documentation
Post by: JohnHaine on May 09, 2018, 02:49:21 AM
Aha!  Many thanks.  Doesn't seem to do quite what I expected, but I'll have a dig around in the document.

Thanks again, John.
Title: Re: SetToolX() documentation
Post by: TPS on May 09, 2018, 02:52:36 AM
what did you expect?
Title: Re: SetToolX() documentation
Post by: JohnHaine on May 13, 2018, 08:01:18 AM
Hmm.  Well, what I would like if it exists is something where a value in a user-defined DRO (resulting from measurement and calculation) could be poked into a specified entry in the tool table for tool "N" (also defined in a DRO).  This must be possible because it is used in the standard turn Tooltable screen but how it works is to me obscure.  Any light on how to do it would be most welcome (if it's possible!).

Thanks, John.
Title: Re: SetToolX() documentation
Post by: Davek0974 on May 13, 2018, 10:26:18 AM
Dim Tool
Dim MyParam

Tool = GetUserDRO(1010)
MyParam = GetUserDRO(1011)

SetToolParam(Tool, 2, MyParam)



This assumes you have added two DRO's - 1010 and 1011
Tool parameter 2 is the the tool length offset

For Mach3Mill:
1 = Diameter
2 = Z Offset
3 = X Wear
4 = Z Wear

For Mach3Turn:
1 = Tip Type
2 = Tool Radius
3 = X Offset
4 = Z Offset
5 = X Wear
6 = Z Wear
7 = Turret Angle

You can't alter tool zero.


Dave
Title: Re: SetToolX() documentation
Post by: JohnHaine on May 13, 2018, 12:56:05 PM
Dave, good input at exactly the right time as I'm rewriting my tool setting macro and you have just saved me hours - many thanks!  To make sure I understand the operative command is:

SetToolParam(<tool number>,<param type from your list>,<parameter value>)

Correct?
Title: Re: SetToolX() documentation
Post by: Davek0974 on May 13, 2018, 03:16:29 PM
Yep

Don't forget to save the tool table after, its DoOEMButton(316)
Title: Re: SetToolX() documentation
Post by: JohnHaine on May 23, 2018, 04:26:00 PM
Dave, just to repeat my thanks, as I've just got my tool setting macro working properly thanks to your input.

I can mount a tool, give it a number in a DRO, position it in the shoulder angle of my test bar of a known diameter, click "Measure Tool", and a minute or so later the offsets are measured and stored in the appropriate line of the Tool Table.  For me, a result!
Title: Re: SetToolX() documentation
Post by: Davek0974 on May 23, 2018, 04:35:48 PM
Nice :)