Hello Guest it is April 17, 2021, 08:20:18 AM

Author Topic: My LUA Tool changer script Needs to run twice to change tool number, How to fix?  (Read 411 times)

0 Members and 1 Guest are viewing this topic.

I worked on a LUA tool change script this weekend. It is working great except that the script needs to run twice for the Current tool number to be updated.

What happens is on power up. Tool 1 is loaded by default, and I command T4 M6, (or M6 T4), The machine changes to tool 4. Then if I command T2 M6. The message pops up that tool 4 is already loaded. But if command T2 M6 again, the machine changes to tool 2. And this continues for each tool change command.

It is mostly a copy from the LUA programming script tool change function. I've attached my code. I can't see where this is going wrong. Does anybody have any idea? (Had to add TT to the file name to get it to upload)
Hi,
sounds like your Mach setup has the wrong toolchange mode selected.

There are two modes.

The first, and most logical to you and I, is where M6 T4 say would cause the tool to be changed to T4 then resume machining.

The second mode, which is common on production machines, is where M6 T4 and tool 4 is prepared in the toolchanger
for the NEXT toolchange. Having the tool carousel pre positioned is faster.

The setting for the toolchange mode is on Configure/Control/Tools page.

Craig
My wife left with my best friend...
     and I miss him!
HAHA Craig,
I was posting this exact reply, then it wouldn't post because a new post had been made.  Nice!
Great Explanation of the differences as well!!
Chad Byrd
Thanks! This was it exactly!. I never would have found that. :D