Hello Guest it is March 28, 2024, 04:40:57 PM

Author Topic: toolchanger macro not seeing the tool number  (Read 3999 times)

0 Members and 1 Guest are viewing this topic.

toolchanger macro not seeing the tool number
« on: January 12, 2012, 08:16:09 AM »
Hi guys, i've run a toolchanger macro with 6 positions before in turn with no problems.
I came to write a new macro for a tool changer with 8 positions but I cant seem to access the tool number called from the M6 comand. Something that worked fine in all my other macros.

I've simplified the macro to just the two problematic lines and included it below.


 tool = GetSelectedTool()
 SetCurrentTool( tool )



I can force the macro to find a specific tool by putting "tool = 1" after those two lines. It finds all 8 tool positions ok, so my inputs are working.

The auto tool changer is enabled in general config, and the inputs and outputs are seen.

Any ideas, am i missing something obvious here.?
« Last Edit: January 12, 2012, 08:26:29 AM by angel tech »

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: toolchanger macro not seeing the tool number
« Reply #1 on: January 12, 2012, 06:43:27 PM »
Really would need to see your macro but one thing to do is have a line similar to this in it

MsgBox"It is working"

That will let you know if Mach is seeing the macro.
Hood
Re: toolchanger macro not seeing the tool number
« Reply #2 on: January 13, 2012, 02:47:43 PM »
Thanks for the reply Hood, i have a few messages in the macro that come up and show it's working.

I can add (tool = (number)) into the macro and it works, but without this it doesn't seem to see the entered m6t** number.

It seems the tool = GetSelectedTool() line isn't getting the tool number from the M6T** command.

This macro has worked before on a 6 station Mirac, but for some reason it just isn't working on this one.

Very odd.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: toolchanger macro not seeing the tool number
« Reply #3 on: January 13, 2012, 03:01:35 PM »
You are saying M6T** if thats what you are calling then it wont work, Turn Needs T**** where the first two are the tool number and last two are offsets.
Hood
Re: toolchanger macro not seeing the tool number
« Reply #4 on: January 13, 2012, 03:08:28 PM »
dam....!!!!!!!!!!!!!!!!!.........i knew it would be something as daft as that


AAAAAAAAAAAAAHHHH.



Thanks Hood, as ever you're worth your weight in gold.

I'm going to sit in the corner for an hour and contemplate how dull i am for forgetting that.
« Last Edit: January 13, 2012, 06:13:05 PM by Overloaded »

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: toolchanger macro not seeing the tool number
« Reply #5 on: January 13, 2012, 03:11:03 PM »
Ha ha dont worry about it, when I was first doing my lathe I set up the PLC and used it from my mill profile to check things out. When I eventually made a turn profile the bloody thing wasnt working and it took me a good while to realise what it was, it was exactly as you were doing ;D
Hood
Re: toolchanger macro not seeing the tool number
« Reply #6 on: January 13, 2012, 03:17:10 PM »
i have no excuse as i converted the same lathe about a year or so ago. Not that i do anything on the lathe to keep it in my mind.
Re: toolchanger macro not seeing the tool number
« Reply #7 on: January 13, 2012, 03:22:53 PM »
Job done all tested and working

Again, thank you.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: toolchanger macro not seeing the tool number
« Reply #8 on: January 13, 2012, 04:20:47 PM »
Great :)
Hood