Hello Guest it is March 28, 2024, 04:18:51 PM

Author Topic: GetSelectedTool() not working for Mach3 lathe  (Read 2573 times)

0 Members and 1 Guest are viewing this topic.

GetSelectedTool() not working for Mach3 lathe
« on: January 21, 2016, 12:40:00 PM »
Help

I am partway through a project getting my 8 station tool turret up and running and now I'm stumped.

So far the turret is working mechanically and when I press a button a short macro controls it so that

it indexes one position. At the same time a Brain program reads 4 sensors compares against truth table

then outputs the current tool. All that appears to be working fine.


The next step of the project was to make it fully automatic with all the indexing controlled from M6start macro.

I thought it would be a relatively straightforward extension of my initial program. Apparently not.

After some investigation I identified where the program was failing. It wasn't reading the selected tool !!!

I have whittled the program down to the minimum just to test this function



 (M6Start.m1s)


Dim tool As Integer

tool = GetSelectedTool()

Message   " Requested   Tool     " & tool '  just a test output to check function read



As a test when I type for example    M6  T4     into the MDI line    I was expecting to get


Requested Tool  4          instead I get         Requested Tool     0    and the current tool DRO also changes to  '0'


I have tried  on mach3 mill and it works as expected  but not on mach3 lathe

For information

I have  CONFIG - TOOL CHANGE-  set to   Auto tool changer

tried on versions  R3.043.066  and R3.043.052   with three different lathe screen sets

I have looked through the forum and cannot see   this flagged up as a recurring fault

and considering the amount of lathe tool turrets there are out there is must be something I am doing wrong

Any help would be greatly appreciated

cheers George

ps I have also tried removing the brain program from the equation but result is just the same

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: GetSelectedTool() not working for Mach3 lathe
« Reply #1 on: January 21, 2016, 05:13:12 PM »
YOu are using teh wrong tool change fornat for turn. Mill is M6 T1 for tool 1  and turn is M6 T0101 for tool 1.
Re: GetSelectedTool() not working for Mach3 lathe
« Reply #2 on: January 22, 2016, 01:27:05 PM »
Brilliant , That's it. It works now.

Can't tell you how long I have spent swearing at program

commanding it to work. Life is good again.

Thanks BR549 for your help

Have a great weekend

George