Best method of saving tool pocket content

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

Best method of saving tool pocket content

Postby Battwell » Mon Oct 30, 2017 11:21 pm

Just added a tool changer to my machine.
I want to store tool number into a tool pocket
I.e. Tool 46 in pocket 1
Best way to achieve this? So it can be recalled on next startup?
Ideally something where I don't have to add to the stock screens :-)
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 827
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Best method of saving tool pocket content

Postby ger21 » Tue Oct 31, 2017 12:12 am

If it were me, I'd do a custom screen page. You need someplace to enter and store the tools and their positions. Our Morbidelli uses a separate screen page for this.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2671
Joined: Sat Sep 03, 2016 2:17 am

Re: Best method of saving tool pocket content

Postby Derek » Tue Oct 31, 2017 12:20 am

My tool changer uses a T# to load the tool and a G43 Hxx for the offset. The M6 Tx macro handles changing the tool and the G43 Hxx handles the offset. I do that via code.

The M6 macro has to be customized for your particular machine. The M6 macro knows the position of your pocket or carousel position. Terry wrote my macro for me and it's quite complex since I have a rotary tool changer with a bunch of proximity sensors to monitor position.
Derek
 
Posts: 341
Joined: Mon Sep 05, 2016 9:57 am

Re: Best method of saving tool pocket content

Postby Battwell » Tue Oct 31, 2017 12:44 am

I could make a screen
But I'd rather not bother lol

Was wondering whether writekey or a user dro would be best to store the data to be recalled
It's a simple 10 tool linear rack
But I have over 100 tools that could be used- hence wanting to store which tool is in the pockets.
The rest of the coding is ok- just wondering simplest way of storing the numbers
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 827
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Best method of saving tool pocket content

Postby ger21 » Tue Oct 31, 2017 12:56 am

You could just put all the info in the macro, but that might be a lot of aggravation when you swap tools.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2671
Joined: Sat Sep 03, 2016 2:17 am

Re: Best method of saving tool pocket content

Postby Battwell » Tue Oct 31, 2017 1:19 am

I'm sure I read somewhere that certain dros or variables could be saved automatically on shutdown.
If so- that's probably the easiest way
Set var and get var would be simple- as long as they can be saved for next session in the profile.

When I've done this in mach3 I set user dros in the screen- that would save as long as Mach was shut down correctly

What I suppose I'm asking is how to write a number into the profile?
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 827
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Best method of saving tool pocket content

Postby ger21 » Tue Oct 31, 2017 1:31 am

Battwell wrote:I'm sure I read somewhere that certain dros or variables could be saved automatically on shutdown.


User DRO's are saved to the profile when UCCNC exits.
It's up to you to retrieve that data and place it back into the DRO's when UCCNC starts.

Use code like this in the Constructor macro.

Code: Select all
readfield = exec.Readkey("UserTextfields", "20327", "0.000");
AS3.Setfieldtext(readfield, 20327); // Set Park #3 X Value
AS3.Validatefield(20327);
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2671
Joined: Sat Sep 03, 2016 2:17 am

Re: Best method of saving tool pocket content

Postby dezsoe » Tue Oct 31, 2017 9:12 am

The easiest way is as Gerry wrote, but I personally don't like auto-saved data. I have an own section in my profile for my tools. (I only store the names, as I don't have a toolchanger.) The section is:

Code: Select all
[ToolNames]
Tool001=Drill 0.500mm
Tool002=Drill 0.600mm
Tool003=Drill 0.700mm
Tool004=Drill 0.800mm
Tool005=Drill 0.900mm
Tool006=Drill 1.000mm
Tool007=Drill 1.100mm
Tool008=Drill 1.200mm
Tool010=Drill 2.000mm
Tool012=Drill 3.000mm
Tool013=Drill 3.200mm
Tool020=End mill 0.800mm
Tool021=End mill 1.000mm
Tool022=End mill 1.200mm
Tool023=End mill 1.500mm
Tool030=Par 2.0x8 A
Tool031=2F 2.0x22 A W PVC
Tool032=1F 4.0x28 A W
Tool033=2F 2.5x8 D6 ALU
Tool034=2F 4.0x19 D6 ALU
Tool040=V 20° 0.1mm
Tool041=V 10° 0.1mm

And in M6 I read the name (you only need the tool data in M6, so you don't have to store it):

Code: Select all
string NewToolName = "T" + NewTool + " " + ((NewTool > 0) ? exec.Readkey("ToolNames", "Tool" + NewTool.ToString("D3"), "T" + NewTool + "?") : "No tool");
AS3.Setfieldtext(NewToolName, ToolChangeInfoFld);

You can edit the profile with text editor or use macros to store your data. E.g.:

Code: Select all
exec.Writekey("ToolNames", "Tool001", "Drill 0.500mm");
dezsoe
 
Posts: 2055
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Best method of saving tool pocket content

Postby Battwell » Tue Oct 31, 2017 3:10 pm

Ok. I've just spent an hour modifying my run screen
I now have 10 text fields added
So I can change these in my m6
They display nicely by my labels for each pocket
I'm using the tool table etc along with this.
But
How is best to save the fieldnumbernb to the profile
I'm sure I saw a range that would auto save ???
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 827
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Best method of saving tool pocket content

Postby ger21 » Tue Oct 31, 2017 3:24 pm

I use numbers in the 20000 range, but I think any numbers will auto save to the profile.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2671
Joined: Sat Sep 03, 2016 2:17 am

Next

Return to Macros

Who is online

Users browsing this forum: No registered users and 3 guests