Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 01:33:15 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
Feature Requests
List of Tools used in a Part Program
Pages:
1
Go Down
« previous
next »
Author
Topic: List of Tools used in a Part Program (Read 809 times)
0 Members and 2 Guests are viewing this topic.
DennisinTexas
Active Member
Offline
Posts: 2
List of Tools used in a Part Program
«
on:
January 04, 2011, 09:14:16 PM »
When Mach is loading the G Code program, it seems to parse the program to produce the graphic display. I would like to have Mach produce a list of tools used. This list could be created while the G code program is being loaded. This list would be accessed by a menu item and would list the tool number and at least the description from the tool table.
This list could be used by the operator to be sure that all of the tools are available and ready to go.
Logged
zealous
Active Member
Offline
Posts: 486
Re: List of Tools used in a Part Program
«
Reply #1 on:
January 10, 2011, 06:23:48 AM »
Hello,
Simply change your "Load Gcode" button to "VBScript" and past this code, or if you would like to call on it to read the current file with out the navigation remove:
Code:
DoOEMButton(216)
While(isloading)
sleep(250)
Wend
This code will:
1. Open a file navigation to open Gcode in Mach
2. Look for "M6/M06" and the "T" value
3. Write a file called "StoredM6.txt" in the current directory
4. "StoredM6.txt" will contain:
Inc M6 call
,
Line Number
,
Tool Number
,
Name
,
Diam
and
Length
.
5. Open the text file
If there are no M6's it will display a message.
Code:
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim filesys, filetxt, lastline,oldline,Stored_List,StoreFilePath,path,currentfile As String
Dim dTaskID As Double
Dim i,k,j As Integer
DoOEMButton(216)
While(isloading)
sleep(250)
Wend
StoreFilePath = CurDir & "\StoredM6.txt"
path = "C:\WINDOWS\notepad.exe"
Found = False
Stored_List = ""
currentfile = FileName
i = 0
k = 0
j=0
Set filesys = CreateObject("Scripting.FileSystemObject")
Set objTextFile = filesys.CreateTextFile(StoreFilePath)
Set filetxt = filesys.OpenTextFile(currentfile, ForReading, True)
Do While filetxt.AtEndOfStream <> true
linestring = UCase(filetxt.ReadLine()) & " "
If linestring <> " " Then
k = k+1
If ((InStr(linestring,"M6") >0 Or InStr(linestring,"M06")>0)) Then
Found = True
j = j+1
ToolIndex = InStr(linestring,"T")
For d = 3 To 0 Step -1
ToolNum = Mid(linestring,ToolIndex+1,d)
If IsNumeric(ToolNum) Then
N = GetToolDesc(ToolNum)
D = GetToolParam(ToolNum,1)
L = GetToolParam(ToolNum,2)
Exit For
End If
Next d
i = i+1
objTextFile.WriteLine( j & " Line# " & k & " Tool# " & ToolNum & " Name: " & N & " Diam: " & D & " Length: " & L)
End If
End If
Loop
If Found = True Then
dTaskID = Shell(path + " " + StoreFilePath, vbNormalFocus)
Else
MsgBox "No M6/M06 Found"
End If
filetxt.Close
Set filesys = Nothing
Set filetxt = Nothing
objTextFile.Close
«
Last Edit: January 10, 2011, 06:27:39 AM by zealous
»
Logged
Regards, Jason Blake
www.Fusioncnc.com
Hood
Active Member
Offline
Posts: 17,362
Carnoustie, Scotland
Re: List of Tools used in a Part Program
«
Reply #2 on:
January 10, 2011, 04:26:50 PM »
Very handy Jason, hopefully one day Turn will get sorted and be able to make use of this as well.
Hood
Logged
BR549
Active Member
Offline
Posts: 2,556
Re: List of Tools used in a Part Program
«
Reply #3 on:
January 10, 2011, 07:15:37 PM »
That would be a handy item for the Mach tool box (;-)
Good Job Jason, (;-) TP
Logged
DennisinTexas
Active Member
Offline
Posts: 2
Re: List of Tools used in a Part Program
«
Reply #4 on:
January 10, 2011, 08:23:49 PM »
Much Thanks. I tend to run programs with lots of different tools and this really helps.
Logged
zealous
Active Member
Offline
Posts: 486
Re: List of Tools used in a Part Program
«
Reply #5 on:
January 13, 2011, 06:00:10 PM »
I am so glad that you can use the code and it is useful
I commented the code and cleaned it up a bit, I also fix the code to correctly show the "Line Number" the M6/M06 was on.
Would it help to have a "Show Next Tool" while running the machine? So you know what tool is coming up next in the Gcode?
Code:
'Define vars
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim filesys, filetxt, lastline,oldline,Stored_List,StoreFilePath,path,currentfile As String
Dim dTaskID As Double
Dim i,k,j As Integer
'Bring up File navigation
DoOEMButton(216)
While(isloading)
sleep(250)
Wend
'paths
StoreFilePath = CurDir & "\StoredM6.txt"
path = "C:\WINDOWS\notepad.exe"
currentfile = FileName
'Default values
Found = False
i = 0
k = -1
j=0
'File System Create objects
Set filesys = CreateObject("Scripting.FileSystemObject")
Set objTextFile = filesys.CreateTextFile(StoreFilePath)
Set filetxt = filesys.OpenTextFile(currentfile, ForReading, True)
'Read File
Do While filetxt.AtEndOfStream <> true
linestring = UCase(filetxt.ReadLine()) & " "
'Uppercase check if not emptyLine
If linestring <> " " Then
'Count Line Number
k = k+1
'Is there a M6 or M06
If ((InStr(linestring,"M6") >0 Or InStr(linestring,"M06")>0)) Then
'Tells if we should open Notpad
Found = True
'Count Number of M6 M06
j = j+1
'Find index of T
ToolIndex = InStr(linestring,"T")
'Count backwards till we get a number
For d = 3 To 0 Step -1
ToolNum = Mid(linestring,ToolIndex+1,d)
'Is it a number then we know the tool#
If IsNumeric(ToolNum) Then
'Set the values of the tool
N = GetToolDesc(ToolNum)
D = GetToolParam(ToolNum,1)
L = GetToolParam(ToolNum,2)
Exit For
End If
Next d
'Write values to StoredM6.txt
objTextFile.WriteLine( j & " Line# " & k & " Tool# " & ToolNum & " Name: " & N & " Diam: " & D & " Length: " & L)
End If
End If
Loop
'If a M6 was found then open up notpad with the new values
If Found = True Then
dTaskID = Shell(path + " " + StoreFilePath, vbNormalFocus)
Else
MsgBox "No M6/M06 Found"
End If
'Close and release everthing
filetxt.Close
Set filesys = Nothing
Set filetxt = Nothing
objTextFile.Close
Logged
Regards, Jason Blake
www.Fusioncnc.com
rcaffin
Active Member
Offline
Posts: 280
Re: List of Tools used in a Part Program
«
Reply #6 on:
February 06, 2011, 07:54:05 PM »
On an allied note: it would be extremely nice if we could edit, reload or change the tool table in Mach3Lathe.
To explain: I have several multi-tool mounting blocks. I can calibrate each one and save the tool table. I can even add a descriptor for each tool (T101 to T9999 etc) in the text field, like 'tipl 3 position 2'. Yes, I can rename/save each tool table after I have done the calibration.
But what I cannot do at present is to edit a tool table (tools3.dat) off-line to create a new tool table for a job, putting the appropriate parameters into each tool line. That would let me create a new tool table for a job appropriate to the combination of tips I propose to use. Well, I guess I could but that would mean doing a very messy binary edit of tools3.dat.
What might work almost as well would be to simply change the format of tools3.dat from binary to ASCII. There is NO reason any more to ever use a binary data file: UNIX and LINUX do not.
Hum?
Cheers
Roger
Logged
zealous
Active Member
Offline
Posts: 486
Re: List of Tools used in a Part Program
«
Reply #7 on:
February 06, 2011, 09:44:44 PM »
Quote
There is NO reason any more to ever use a binary data file
I second this %110.
No need to protect this data put it in the XML
*One thing you can do for now is store the data in a text file and onload of Mach write to these values or on a button push.
«
Last Edit: February 06, 2011, 09:46:35 PM by zealous
»
Logged
Regards, Jason Blake
www.Fusioncnc.com
rcaffin
Active Member
Offline
Posts: 280
Re: List of Tools used in a Part Program
«
Reply #8 on:
February 06, 2011, 10:03:28 PM »
Not keen on requiring the user to edit the XML. OK for someone with a CS degree, but not so nice for someone who has come from the hobby or workshop direction.
I suggest that it should be in two parts:
* A menu option to load/save tool table X (different one for each job)
* The tool table in ASCII not binary
Neither of these require any significant change to the structure of Mach - which makes implementing it very easy.
Cheers
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...