Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 10:41:51 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  toolchanger macro not seeing the tool number
Pages: 1   Go Down
Print
Author Topic: toolchanger macro not seeing the tool number  (Read 195 times)
0 Members and 1 Guest are viewing this topic.
angel tech
Active Member

Offline Offline

Posts: 259


View Profile
« 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 » Logged
Hood
Active Member

Offline Offline

Posts: 17,368


Carnoustie, Scotland


View Profile
« 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
Logged
angel tech
Active Member

Offline Offline

Posts: 259


View Profile
« 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.
Logged
Hood
Active Member

Offline Offline

Posts: 17,368


Carnoustie, Scotland


View Profile
« 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
Logged
angel tech
Active Member

Offline Offline

Posts: 259


View Profile
« 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 » Logged
Hood
Active Member

Offline Offline

Posts: 17,368


Carnoustie, Scotland


View Profile
« 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 Grin
Hood
Logged
angel tech
Active Member

Offline Offline

Posts: 259


View Profile
« 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.
Logged
angel tech
Active Member

Offline Offline

Posts: 259


View Profile
« Reply #7 on: January 13, 2012, 03:22:53 PM »

Job done all tested and working

Again, thank you.
Logged
Hood
Active Member

Offline Offline

Posts: 17,368


Carnoustie, Scotland


View Profile
« Reply #8 on: January 13, 2012, 04:20:47 PM »

Great Smiley
Hood
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!