Quick question on Reading a value from 2022 Screenset

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

Quick question on Reading a value from 2022 Screenset

Postby Erphillips » Thu Apr 10, 2025 11:41 pm

Can someone give me a quick code example on Reading the Calibrate Tool Setter Value that was saved after running the routine

Screen editor shows the box the value is displayed in as " Label 20327" Manual says the value is stored in Field #20327

So is it like something like... exec.Getvar(20327) or AS3.Getfielddouble(20327), to read the stored value and be able to use it in my macro? Or am I on the wrong track completely?

I want to query the value and/or save it and add/subtract it to my measured tool length in My M6 macro so the tool length is correct no matter what tool is in any given holder

probably better ways to do this but its how I see it working in my old brain.

Thanks
Ed
Erphillips
 
Posts: 17
Joined: Sun Aug 20, 2023 3:03 pm

Re: Quick question on Reading a value from 2022 Screenset

Postby ger21 » Fri Apr 11, 2025 1:13 am

Because it's a text field, you have to use AS3.Getfield(20327); and then convert the string into a number.

Code: Select all
string stringval = AS3.Getfield(20327);
double numval = Convert.ToDouble(stringval);


I never considered that anyone would want to extract that value, or I would have made it a regular field, instead of a text field.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2796
Joined: Sat Sep 03, 2016 2:17 am

Re: Quick question on Reading a value from 2022 Screenset

Postby Erphillips » Fri Apr 11, 2025 10:14 pm

Thank you for the info

I'm not sure its the best way to use the offset value but I have it working well for my needs and I understand the logic behind it as I have it implemented.

It grabs a tool from holder fork on command by G-Code or Change tool button, measures tool length at fixed probe then reads and uses the offset value to calculate tool length, so the tool tip is now at Z 0.00 at top of my spoil board every time
When I re surface to spoil board I can simply do a new calibration so it knows the new offset to apply to each tool as they are loaded.

I can use load any tool in the correct number tool holder based on the software I'm using and tool database it uses, My Mozaik Cabinet software generated G-Code plays well with it.

I used ChatGPT to combine the M6 from your 2022 screenset along with one I had customized for the 12 tool Linear rack then ChatGPT added the code needed to read the offset value and do the tool length adjustment
Now ChatGPT is making me a ATC screen that will show the tools and various details we will see how it comes out


Thanks again for your help, I sure I will be back with more questions

Ed
Erphillips
 
Posts: 17
Joined: Sun Aug 20, 2023 3:03 pm

Re: Quick question on Reading a value from 2022 Screenset

Postby ger21 » Sat Apr 12, 2025 12:21 pm

Sometimes I miss questions here, so email me if I don't reply here.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2796
Joined: Sat Sep 03, 2016 2:17 am


Return to Macros

Who is online

Users browsing this forum: No registered users and 1 guest