turn ATC macro help

MSM turn mode support (and mill-turn as it runs in turn mode).
Post Reply
adam
Posts: 23
Joined: Sun May 05, 2013 8:54 pm

turn ATC macro help

Post by adam »

Hi
I have a lathe with a four tool changer and need help writing some vb script to modbus or in to brains to communicate with a automation direct click plc i have established
communications with plc and brains
step i need to complete
1. send Getslectedtool to a DRO so mach brains can send to plc
2. move to tool change POS in G53 cords
3. plc to tell mach that tool change is complete
4. and move back to G54 cords with new tool work offset
5. and any other steps needed to complete tool change


Thanks adam
User avatar
DaveCVI
Site Admin
Posts: 798
Joined: Mon Feb 04, 2013 3:15 pm
Contact:

Re: turn ATC macro help

Post by DaveCVI »

Hi Adam,
What you are requesting is a quite a tall order :o
I sort of doubt any one will be able to write a custom tool changer script for you that uses a PLC when we know nothing about the PLC or how it is set up in your machine.
What I can do is give you some pointers to the topics and parts of MSM that seem relevant to the overall task.
For MSM in auto tool changer mode, all tool changer code will go into a M6ATC.m1s script. When ever Mach encounters a tool change command in gcode, mach will call MSM and MSM has built in hooks to call this M6ATC script. This lets your tool changer code be separate from mach or MSM tool changer code - so you don't have to worry so much about your code breaking something else.
For info on M6atc see section 15.9.1 of the main MSM mill user manual.
adam wrote:Hi
I have a lathe with a four tool changer and need help writing some vb script to modbus or in to brains to communicate with a automation direct click plc i have established
communications with plc and brains
step i need to complete
1. send Getslectedtool to a DRO so mach brains can send to plc
This is a matter of using the needed calls from the mach programmers script ref manual (avail via the "mach 3 script calls" button on the MSM reference page).
Some relevant calls:
SetSelectedTool()
SetCurrentTool()
SetUserDRO()
Don't pick a 1700 or 1800 series # for your user DROs - those ranges are used internally by MSM.

Also see the modbus section of the programmers manual: there are calls to send and receive via modbus. I'm not personally familiar with them as I don;t have any mod bus devices, but they appear to be what you are looking for.
adam wrote: 2. move to tool change POS in G53 cords
in general, to cause a move in a script, see the Code() call in the programmer manual. You use that to issue gocde commands from a script.
If you want to move to the MSM tool change position you can use the same code that the MSM "Go TC Pos'm" button on the tooling page does:
#expand <Masters\Scripts\Tooling-GoTCPosition>
adam wrote: 3. plc to tell mach that tool change is complete
I can't help with this one as I don't know anything about the PLC being used.
adam wrote: 4. and move back to G54 cords with new tool work offset
The Txxyy gcode in lathe mode will both change the tool and apply the Tool Length offset (as one operation), so the offset will be active after the tool change is done.
Moving to someplace in G54 is a matter of issuing the desired gcode string via the code() call.
adam wrote: 5. and any other steps needed to complete tool change
:D Good try! My crystal ball is not that good... but you'll figure it out as you go. :D

In case it is of help, I will post a tool change script for an Emco CNC lathe. Obviously it will not work as is for your lathe, but you can examine the code to get an idea of the steps involved etc.
Set this post:
http://www.calypsoventures.com/forums/v ... p?f=7&t=72

Dave
Productivity Software for Personal CNC Machinists
http://www.CalypsoVentures.com
Post Reply