Tool height Setting Macro

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Re: Tool height Setting Macro

Postby ThreeDJ16 » Sun Sep 08, 2019 3:35 pm

ger21 wrote:It's VB.NET, so the functions are the same, but the syntax is different.
If you've programmed in VB, but not VB.NET, you may struggle with the syntax.

Here are two examples that do the same thing.
VB
Code: Select all
#VB
MessageBox.Show("VB")
dim xval as double

xval = AS3.Getfield(226)

MessageBox.Show(xval)

If xval =0 then
MessageBox.Show ( "X axis is already at zero.")
Else
AS3.SetField(0, 226)
AS3.Validatefield(226)
MessageBox.Show ( "X axis reset to zero.")
End If




C#
Code: Select all
MessageBox.Show("C#");
double xval;

xval = AS3.Getfielddouble(226);

MessageBox.Show(Convert.ToString(xval));

if (xval == 0)
{
MessageBox.Show("X axis is already at zero.");
}
else
{
AS3.Setfield(0, 226);
AS3.Validatefield(226);
MessageBox.Show("X axis reset to zero.");
}

Yup, totally missed that...LOL. No VB.net here....thanks for pointing that out. I'm already started down the C# rabbit hole, no point in heading down another.

Thanks
ThreeDJ16
 
Posts: 164
Joined: Tue Oct 31, 2017 5:57 pm

Re: Tool height Setting Macro

Postby xillianto » Mon Aug 10, 2020 9:37 pm

Did you manage to get this script done ? I would love a copy of the macro to measure and store tools as i also just manually change the tools on my ATC spindle for now.
xillianto
 
Posts: 5
Joined: Sat Nov 30, 2019 8:17 pm

Re: Tool height Setting Macro

Postby ThreeDJ16 » Mon Aug 10, 2020 10:07 pm

xillianto wrote:Did you manage to get this script done ? I would love a copy of the macro to measure and store tools as i also just manually change the tools on my ATC spindle for now.


Nope. The new version released somewhere around the time I was doing this and it just got too frustrating trying to integrate. I'm no programmer, so isn't worth all the effort to learn just to make some type of tool measure with a basic tool change integrated. Would be nice for some basic function to be in the probe screens.
ThreeDJ16
 
Posts: 164
Joined: Tue Oct 31, 2017 5:57 pm

Previous

Return to Macros

Who is online

Users browsing this forum: naijin and 5 guests