Hello Guest it is March 29, 2024, 05:00:23 AM

Author Topic: Mach3 Version .066 Missing GetToolParam(), GetToolDesc()  (Read 4351 times)

0 Members and 1 Guest are viewing this topic.

Mach3 Version .066 Missing GetToolParam(), GetToolDesc()
« on: November 15, 2014, 02:09:13 AM »
Hi,

so i'm writing some scripts for my new Mach3. So when i change my tool i will know what tool is next.
I have write some code to the m6-macro and have set an UserLabel on my MachScreen.
I can get an String  like "Hallo" over the M6 macro to my MachScreen UserLabel. So all is okay.
But i want to bring the Tool Parameter on my MAchscreen.

I have used:

GetToolParam(1,1)

only to see Diameter from Tool 1. But the userLabel is blank.

also i try to use

GetToolDesc()

But the UserLAbel shows the Word "Empty"

So how can i became my Tool-Description or the Diameter of the Tool to my UserLabel?

I know the UserLabel need an String and the Diameter an Integer/Double

I have the feeling the functions GetToolParam(), GetToolDesc() don't working on the Mach3 Version 0.66

Can someone explain?

Regards,

nighteagle
Re: Mach3 Version .066 Missing GetToolParam(), GetToolDesc()
« Reply #1 on: November 15, 2014, 02:34:30 AM »
Hi,

so i forgot to explain i don't want to use the tooltable.
So is this the problem to became empty information of the current tool?

So i want only the tool description from the G-Code.
I have set after the M6 the Tool description with my POST-Prozessor for mach3.
I can see the description on the ticker-line so i thing there is also a way to bring it to an user label?

Regards,

nighteagle
Re: Mach3 Version .066 Missing GetToolParam(), GetToolDesc()
« Reply #2 on: November 15, 2014, 06:17:55 AM »
Hello,

so after i have test.. i see the function slike GetToolParam and GetToolDESC is only connected to the tooltable and not to the G-Code.

The ToolDescription is also to see on the ticker line. Also there is an possibility to bring the infos without tootable to an UserLabel?

Regards,

nighteagle

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Mach3 Version .066 Missing GetToolParam(), GetToolDesc()
« Reply #3 on: November 15, 2014, 06:00:53 PM »
NONE that I am aware of. The reason to USE the tool table is to be able store all that info and call it up on demand.

You should be able to modify your Cam Post to input the next tool info in as a line comment. That would show up in the status line as the program ran.

(;-) TP
« Last Edit: November 15, 2014, 06:04:51 PM by BR549 »
Re: Mach3 Version .066 Missing GetToolParam(), GetToolDesc()
« Reply #4 on: November 16, 2014, 03:20:38 AM »
Hi,

so i have write an parser, to parse the GCode and look for the Tool Description and show it on my machscreen.

Here an Video:
https://www.youtube.com/watch?v=002wKNc6EW0&feature=youtu.be

Here the VBScript of the Parser. The MAtch-Pattern have to modify yourself.
I use "TOOL" >> Case Sensitive and "FrS" for two different PP and have all my Infos i want.

Code: [Select]
'Beginn Parser
'__________________________________________


'Variables
'---------
'Only for the Objekt-Function
Const ForReading = 1

'UserLabelNumber Beginn with 100 and added +1 every founded parse-pattern
Dim Count
Count = 100

'Main
'--------
' Create Parser Objekt
Set objRegEx = CreateObject("VBScript.RegExp")

'Search Pattern Case Sensitive, Pattern "TOOL" only for Condacam if you edit the PP for Mach3
objRegEx.Pattern = "...TOOL"

Set objFSO = CreateObject("Scripting.FileSystemObject")

'Get Current GCode-File
Set objFile = objFSO.OpenTextFile(GetloadedGCodeDir() & GetloadedGCodeFileName(), ForReading)

' First write in UserLabel, after Parsing rewrite with founded Lines
' UserLabel is 101-110 on the Machscreen >> Have to set to your own Numbers/Labels
SetUserLabel(101, "1. No Tool Description found!")
SetUserLabel(102, "2. No Tool Description found!")
SetUserLabel(103, "3. No Tool Description found!")
SetUserLabel(104, "4. No Tool Description found!")
SetUserLabel(105, "5. No Tool Description found!")
SetUserLabel(106, "6. No Tool Description found!")
SetUserLabel(107, "7. No Tool Description found!")
SetUserLabel(108, "8. No Tool Description found!")
SetUserLabel(109, "9. No Tool Description found!")
SetUserLabel(110, "10. No Tool Description found!")

'Loop to parse all line of GCode of the file
Do Until objFile.AtEndOfStream
    strSearchString = objFile.ReadLine
    Set colMatches = objRegEx.Execute(strSearchString)
    If colMatches.Count > 0 Then
        For Each strMatch in colMatches 
'Add +1 to the Count-Variable after found one pattern
Count =  Count + colMatches.Count

'UserLabel beginn with 101 for the first matches of the founded pattern
'next UserLabel is 102 for the next founded pattern and so on...
'So i have only set 10 UserLabels to my Machscreen to have a maximum of 10 Tools.
'Other way is to parse only on the ToolChanger procedure for the current Tool.
'But in this case i can see the Tools only after the M6 Command
strSearchString = Right(strSearchString, Len(strSearchString)- 8)
strSearchString = Left(strSearchString, Len(strSearchString)- 1)
        SetUserLabel(Count, Count-100 & ". " & strSearchString)
        Next
    End If
Loop



'Search Pattern Case Sensitive, Pattern "TOOL" only for eSign Standard PP for Mach3
objRegEx.Pattern = "...FrS"



'Get Current GCode-File
Set objFile = objFSO.OpenTextFile(GetloadedGCodeDir() & GetloadedGCodeFileName(), ForReading)

' First write in UserLabel, after Parsing rewrite with founded Lines
' First UserLabel is 101 on the Machscreen >> Have to set to your own Numbers/Labels


'Loop to parse all line of GCode of the file
Do Until objFile.AtEndOfStream
    strSearchString = objFile.ReadLine
    Set colMatches = objRegEx.Execute(strSearchString)
    If colMatches.Count > 0 Then
        For Each strMatch in colMatches 
'Add +1 to the Count-Variable after found one pattern
Count =  Count + colMatches.Count

'UserLabel beginn with 101 for the first matches of the founded pattern
'next UserLabel is 102 for the next founded pattern and so on...
'So i have only set 10 UserLabels to my Machscreen to have a maximum of 10 Tools.
'Other way is to parse only on the ToolChanger procedure for the current Tool.
'But in this case i can see the Tools only after the M6 Command
strSearchString = Right(strSearchString, Len(strSearchString)- 1)
strSearchString = Left(strSearchString, Len(strSearchString)- 1)
        SetUserLabel(Count, Count -100 & ". " & strSearchString)
        Next
    End If
Loop



objFile.Close

Regards,

nighteagle
Re: Mach3 Version .066 Missing GetToolParam(), GetToolDesc()
« Reply #5 on: November 16, 2014, 06:12:08 AM »
Hi,


so now i have the parser connected to the Button "Load" of GCode and so the ToolDescription is always read after load new GCode. No other Button requiered.

Only change the "LOAD" Button to start a macro instead of the OEMCode 216 and in the macro i have do following:

Code: [Select]
DoOEMButton(216)
'M1999.m1s ist the PArser-Script
Code ("M1999")


On the close Button the same... macro with following:

Code: [Select]
DoOEMButton(169)
'M1999.m1s ist the PArser-Script
Code ("M1999")

'Also delete the UserLabels
SetUserLabel(101, "No GCode loaded!")
SetUserLabel(102, "")
SetUserLabel(103, "")
SetUserLabel(104, "")
SetUserLabel(105, "")
SetUserLabel(106, "")
SetUserLabel(107, "")
SetUserLabel(108, "")
SetUserLabel(109, "")
SetUserLabel(110, "")


Regards,

nighteagle