Machsupport Forum

Third party software and hardware support forums. => Newfangled Solutions Mach3 Wizards => Topic started by: gtoguy on September 22, 2007, 04:26:07 PM

Title: Tool Number read from Mach's Tool Table?
Post by: gtoguy on September 22, 2007, 04:26:07 PM
Can the program be written to get my tool diameter automatically from the entries in my Tool Table Data when I type in a tool # in the NFW screen?

Thanks,
Pat
Title: Re: Tool Number read from Mach's Tool Table?
Post by: gtoguy on September 24, 2007, 10:07:42 PM
Ron,

Is this included in the next upgrade or is it not doable?

Pat
Title: Re: Tool Number read from Mach's Tool Table?
Post by: Ron Ginger on September 28, 2007, 09:10:47 PM
I do not think the tool table data is accessible to VB. There was some recent discussion on this, but I dont hink it will be possible.
Title: Re: Tool Number read from Mach's Tool Table?
Post by: Graham Waterworth on September 30, 2007, 05:33:55 AM
You can get the data like this :-

GetToolParam(SHORT toolnum, SHORT param) for tool parameters. Param numbers are 1 - n and correspond to the tool window in the mill or turn modes.

In turn for example, 1 is TipDia, 2 is Tip Radius..ect..

Graham.
Title: Re: Tool Number read from Mach's Tool Table?
Post by: gtoguy on September 30, 2007, 11:32:27 AM
Graham,

Thanks.  It is exactly what I was hoping existed to get the tool info.

What is the best source for the complete list of VB functions?

Pat
Title: Re: Tool Number read from Mach's Tool Table?
Post by: Chaoticone on September 30, 2007, 08:46:08 PM
You got to watch Graham, he's pretty bad about pulling a rabbit out of the hat.  :)

Brett
Title: Re: Tool Number read from Mach's Tool Table?
Post by: gtoguy on September 30, 2007, 11:28:49 PM
Graham,

Any way to get the "tool description" from the tool table in addition to the tool diameter and offset length?

Pat
Title: Re: Tool Number read from Mach's Tool Table?
Post by: Graham Waterworth on October 01, 2007, 04:57:33 AM
I have not found one for doing that.

Graham.
Title: Re: Tool Number read from Mach's Tool Table?
Post by: vmax549 on October 01, 2007, 12:33:35 PM
YOu can bring in the current tool # info by setting up a text Label using "TOOLDESC", it will retreive the currently loaded tool # description . I use it in an AUTO tool setting page. You would just need to setup the macro to load up the tool# you need the references on first then extrat the info.

You can also use the Get/Set Tool Param calls to modify the tool data. BUT you cannot change the tool description except in the tool Table Config.

(;-) TP
Title: Re: Tool Number read from Mach's Tool Table?
Post by: gtoguy on October 02, 2007, 12:33:19 AM
Thanks, it works as advertized.  Where do you find this information in the documantation?

Also is there a way to read the label text from the TOOLDESC label in VB code after it displays the tool description?

Pat
Title: Re: Tool Number read from Mach's Tool Table?
Post by: vmax549 on October 02, 2007, 08:04:23 AM
THe details are stashed inside of ART's Brain. We have just picked at him so much for details that some of it leaks out from time to time. I HOPE that when he retires again he will take the time to detail all the hidden tricks of MACH.

(;-) TP
Title: Re: Tool Number read from Mach's Tool Table?
Post by: Ron Ginger on October 02, 2007, 08:59:50 PM
I have been thinking about this, and I dont see a good way to implement it. The problem is that VB cannot react to a change in a DRO. So I would have to add a button to 'lookup tool info'. I still need DROs for both toolnumber and diameter- some guys have empty tool tables, and want to just enter diameter.  I think this might actually make it harder to use than the current screen.

I think the tool screen already has a similar problem with the button to 'calc feed and speed' If you don't press that button the last calculated value will remain in the DROs, and later screens will use old data.

I will try to do some tests with this, but I firmly support the KISS principle.
Title: Re: Tool Number read from Mach's Tool Table?
Post by: gtoguy on October 03, 2007, 12:41:25 AM
Ron,

Were you able to open the modified .set file I sent last night via email? I addressed some of your concerns in the file I sent you.

You can write to the "OEM tool # DRO" by using the SetOemDRO(824,xx) where xx is the tool number selected or entered by the user in a variable, userDRO, etc..

Maybe I missed your point or maybe this will help.

Pat
Title: Re: Tool Number read from Mach's Tool Table?
Post by: Ron Ginger on October 03, 2007, 07:11:46 AM
No, I cannot open that one either.

My issue is how to know if the user has updated either the tool dia or the tool number. Some will fill in both, but not want me to lookup anything, maybe they have an empty tool table- I know some will d o that because thats how I work.

If I add a button that says 'look up tool dia' and the user doesn't push it, I can only read the old tool dia. I could add that lookup code into the 'post code' button, but then I will change it for the guy that doesn't want to use tool table.

If VB had a callback on 'DRO changed' then I could run the code if you changed tool number and update tool dia there, then in post I simply read the values and know they are in sync.

Im still thinking about this, maybe Ill find a way to handle it.

thanks for the suggestions.
Title: Re: Tool Number read from Mach's Tool Table?
Post by: vmax549 on October 03, 2007, 08:38:42 AM
Ron just a thought here but IF you are trying to interface the tool table to the NFW you might be opening a can of worms. I have seen the tool tables used a dozen different ways to do the same end results. How are you going to cover all the possiblities. Even LCAM which SHOULD interface directly to the tool tables DOES not  and even does the tool data BACKWARDS to MACH's.

We eventually went BACK to the OLD way of tool tables to keep from making scrap metal. We run EMPTY tool tables. When we load up a project, I look at the project summary for the tools and use an AUTO Tool Setting routinue to set up the tools in the tool table or just enter the tool data manually for the job loaded. When the job is done a push of a button emptys it back out.

For the tool changer machines we run the tool tables matched to the tool position in the changer. Still you have to be sure of the tools BEFORE you run the project.

NOw if you want something to do, a utilty to Create/PRINT a job summary from MACH and LCAM would be nice. Please enclude a function to reorder the line numbers of patched together programs(;-)

(;-) TP
Title: Re: Tool Number read from Mach's Tool Table?
Post by: gtoguy on October 03, 2007, 11:01:56 PM
Ron,

Its a shame that you cannot open the modified file I sent as it would answer some of the questions you asked.  I don't understand why you can't open it in screen 3.  Maybe it is the version #,  mine is 2.7e.  Maybe Art can comment on why he thinks the file won't open on your computer.

Anyway, the way I wrote the code, the user can enter data the way you originally wrote it OR select a tool from the tool table.  They can simply type into the DROs if they want to change the value the wizard will use.  Not sure what TP is referring to as a "risk", the program does not write back to the tool table, it simply reads what the tool table already has in it.

 I have been using this modified wizard and it works great.  It shows me my tool table entries so I don't have to remember them, and automatically enters the diameter data (with no typing errors for me to make), along with my tool description, all with the push of a button.  If the tool table is empty or if the user does not want to use it, they simply type in the DROs as your original pprogram req'd.   Seems like its hard to complain having both options for the user.  (I promise I won't push the subject anymore after this :)))

I attached a screen shot so at least you can see the buttons and dialogue box that will pop up with the tool table data.

Pat
Title: Re: Tool Number read from Mach's Tool Table?
Post by: vmax549 on October 04, 2007, 07:51:12 AM
HI Pat, As long as you do not modify the tool tabel from the wizard no harm. But I also notice that you do not bring in the description. How do you know what tool it is , is it a round nose bull nose straight end, 2 flute ,3 flute,4 flute, tap.reamer,drill, tapping head, boring head????. I used to keep 50 tools in the tool table. It only takes having someone modify 1 tool table setting to turn a $100 piece of Alum into $2 of SCRAP metal.(;-) Even with just me sometimes you have to tweek the settings and if you do not record it in the tool book what you did, the next piece may become scrap metal.

The page does look good, I'll have to keep it on file(;-)

(;-) TP
Title: Re: Tool Number read from Mach's Tool Table?
Post by: gtoguy on October 04, 2007, 03:04:41 PM
TP,

I could not figure out a way tp show the description in the dialogue box.  I did get the secret to displaying it from Graham on this forum as a label so after you select the tool from your table, it actually displays on the wizard screen so you can immediately see if you got the correct tool by its description. on the screen shot you'll see the description for the selected tool is ".25" End Mill - 4 flute carbide".  that was automatically displayed after the user selected tool #3 from the dilogue box.

Pat
Title: Re: Tool Number read from Mach's Tool Table?
Post by: Ron Ginger on October 07, 2007, 03:26:47 PM
Ive been away a few days so couldn't look at this until now.

Your dialog box is a good solution, the original buttons are still there, so anyone not using tool table entries can simply fill in the numbers as before.

I do not understand why I can open your screen set. I have V2.7e, when you open the file I get a dialog box that says 'unexpected file format' When I close the program it gives a dump. Did you .zip the file? It even fails to open with John's Screen Tweak program. How about just opening the code for that button and cutting it into a text file and send me just the code?

Title: Re: Tool Number read from Mach's Tool Table?
Post by: gtoguy on October 08, 2007, 10:05:11 PM
Ron,

I'll send command box the code to your email account.  It will probably be obvious what I did to make it display the "tool description" on the wizard screen.  The little dot you see on the screen shot to the right of the new command box is a minimized OEMDRO for the tool number that I write the user selected tool # to. After that is done, the label text box control named "TOOLDESC" will automatically display the tool description from the tool table.  Let me know if if doesn't make sense after you see the code.

Pat
Title: Re: Tool Number read from Mach's Tool Table?
Post by: keithorr on March 10, 2008, 11:53:32 PM
Just a little add onto this thread:

' append to file = C:\Mach3\macros\toolinfo.txt
 
N = GetToolDesc(1)
D = GetToolParam(1,1)
L = GetToolParam(1,2)

textFilePath = "C:\mach3\macros\toolinfo.txt"

Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.opentextfile(textFilePath,ForAppending)

objTextFile.WriteLine("Tool1: " & N &" Diameter: "& D  &" Length: " & L)

objTextFile.Close

'End

'Now to learn how to scroll through the tool table (until there are no more descriptions) and overwrite the text file.

'Put it all in a button and I can "export" the info.

'I'm just wanting a tool information cheat sheet to take back to my desk while I fiddle with the CAM.

'All suggestions graciously accepted.
Title: Re: Tool Number read from Mach's Tool Table?
Post by: keithorr on March 11, 2008, 02:04:55 AM
This reads information from the tooldata file and overwrites a text file up to 100 tools
Stops writing with the first instance of "Empty" as a tool description

////'PLEASE BE SURE YOU UNDERSTAND WHAT YOU'RE DOING WITH THIS FILE OR ELSE JUST WALK AWAY/////

'Create a New Button on a Screen using the Mach3Screen.exe.
'(Load the screen set you usually use) I placed one on the Offsets Screen for my use. You may have a better location.

'Paste the text below into the VB window of the Button Properties Screen
'The new button will create and update a text file on your desktop showing tool information up to 100 tools.
'Useful to have when your CAD/CAM is on another PC.


' overwrite file = C:\Documents and Settings\All Users\Desktop\ToolInfo.txt

textFilePath = "C:\Documents and Settings\All Users\Desktop\ToolInfo.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(textFilePath)


Do Until num=100

num=num+1

N = GetToolDesc(num)
D = GetToolParam(num,1)
L = GetToolParam(num,2)

objTextFile.WriteLine("Tool"& num &" "& N &" Diameter: "& D &" Length: "& L & Chr(13) & Chr(10))

If N ="Empty" Then num = 100



Loop

objTextFile.Close

'End
Title: Re: Tool Number read from Mach's Tool Table?
Post by: keithorr on March 11, 2008, 03:33:48 PM
newer version will poll up to 225 tools and skip any tool with a description of "empty"

' overwrite file = C:\Documents and Settings\All Users\Desktop\ToolInfo.txt

textFilePath = "C:\Documents and Settings\All Users\Desktop\ToolInfo.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(textFilePath)


Do Until num=225

num=num+1

N = GetToolDesc(num)
D = GetToolParam(num,1)
L = GetToolParam(num,2)

If N <>"Empty" Then

objTextFile.WriteLine("Tool"& num &" "& N &" Diameter: "& D &" Length: "& L & Chr(13) & Chr(10))

Else

End If

Loop

objTextFile.Close

'End
Title: Re: Tool Number read from Mach's Tool Table?
Post by: zealous on March 21, 2008, 08:41:31 AM
thanks Keith very helpful and nice way to do it :)
Title: Re: Tool Number read from Mach's Tool Table?
Post by: vmax549 on March 23, 2008, 12:12:48 AM
Keith thanks for the macro, I have asked Art in the past for such a thing. It is extremely handy to have the tool table handy when you are3 working in cad or just loading up a tool carousel for a job.

You may want to consider posting all parameters of each tool to the file. the tool may measure say .375 but actually cut.3765, so the wear diam are very important also. We use them to setup the exact cutting diam if known.

(;-) TP
Title: Re: Tool Number read from Mach's Tool Table?
Post by: vmax549 on March 25, 2008, 09:07:30 PM
HI  Keithorr, WOuld it be possible to  have the utility write to a LPT port to print the tool table??? It would be nice to make sure the toolbook was current.\

(;-) TP