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.

Re: Best method of saving tool pocket content

Postby Dan911 » Tue Oct 31, 2017 10:08 pm

Ha Ha, forget to attach zip.

ATC Setup.rar.zip
(14.82 KiB) Downloaded 731 times
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Best method of saving tool pocket content

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

ive got everything i needed working now-
well- the read and write side of it anyway.
the rest is pretty simple.

heres what i have for test purposes. - only took about 4 hours lol!

int Currenttool = exec.Getcurrenttool();
int Newtool = exec.Getnewtool();
//AS3.Setfield(22, 20401);//set field1
AS3.Setfield(55, 20410);//set field10 to a number-ok
AS3.Setfield(Currenttool, 20409);//set field 9 to current tool- ok
AS3.Setfield(Newtool, 20406);//set field 6 to new tool -ok

string content1=AS3.Getfield(20406);//get field6-ok
exec.Writekey("tp1","holder1",content1);//-ok
exec.Wait(100);
string read1=exec.Readkey("tp1","holder1",content1);//-ok

exec.AddStatusmessage("Toolholder1 "+ read1);//-ok

double write1 = Convert.ToDouble(read1); //-ok thanks ger!
AS3.Setfield(write1, 20402);//set field2 // this is the line that was killing me- ok now!
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 821
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Best method of saving tool pocket content

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

i wrote it like this so il be able to write the key for every pocket as it happens . also will be writing a key for tool in spindle etc.
that way if there is a crash or power loss all the data should already be saved- without having to shut down properly.
i can now check if the required tool is already in the rack- if not come to me to insert manually.
also i can self populate the rack using any unused tool positions- and have it remove the least used tool when rack is already full
:-)
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 821
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Best method of saving tool pocket content

Postby Battwell » Thu Nov 02, 2017 3:51 pm

ok- probably about 10 hours of head scratching and question asking to get this far! but its looking good and working well
firstly- thanks to the chaps here that helped.

saves tool holder pocket content on shut down - and instantly from my m6 macro. ie what tool is in what tool pocket position
reloads all info on startup
sets last tool used and re loads the correct offset and verifies after startup.
lets me know its all done :-)

lots of converting from string to double, double to int etc had to be done to accomplish this- thats why it took so long.
not bad for someone who isnt a programmer !
have a look- let me know thoughts

https://www.youtube.com/watch?v=PGzKizW ... e=youtu.be
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 821
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Best method of saving tool pocket content

Postby Battwell » Fri Nov 03, 2017 11:20 pm

All finished- works well- I'm happy
https://youtu.be/OwInqk5NQPo

Added optional probing routine too.
https://youtu.be/aGVZdg98cfI
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 821
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Previous

Return to Macros

Who is online

Users browsing this forum: No registered users and 4 guests