Hello Guest it is June 21, 2025, 12:18:06 PM

Author Topic: TOOL INFORMATION FROM GCODE TO MACH3  (Read 3798 times)

0 Members and 1 Guest are viewing this topic.

Re: TOOL INFORMATION FROM GCODE TO MACH3
« Reply #10 on: February 15, 2025, 06:36:11 AM »
thanks a lot for the help, it could be a viable way that surely helps. It was not what I wanted but I guess that there is nothing else that can be done. At this point I guess that there is no way to read a text string contained in the Gcode from a macro
Re: TOOL INFORMATION FROM GCODE TO MACH3
« Reply #11 on: February 15, 2025, 08:48:55 AM »
You can write a VB macro and run it using the VB Editor launched from the "Operator" menu.  The functionality is then up to you - it might for example read data from an exported CAM tool table and write it to the M3 tool table.
Re: TOOL INFORMATION FROM GCODE TO MACH3
« Reply #12 on: February 16, 2025, 08:47:53 AM »
I tried to run the export and import scripts but I couldn't get them to work.. could you explain to me how to use them?
Re: TOOL INFORMATION FROM GCODE TO MACH3
« Reply #13 on: February 16, 2025, 10:02:41 AM »
As they are written in Cypress Visual Basic they need an appropriate runtime environment to work, they are not compatible with for example Microsoft VB as far as I know.  Such an environment is built-in to Mach3 to run its scripts (macros) and wizards, either OEM or user-defined.  It's a while since I used these but IIRC you open M3 and then a Script Editor window as in my last post.  Open the script in the window, then either "run" it from a menu or by pressing the green arrow.  Everything happens very quickly for the import/export scripts.  For export for example it exports a text file to the top level of c\mach3\  called ToolTable.txt.  You should then see a message in the Status DRO of the Program Run screen saying something like Tool Table - [N entries exported]  If you want the file to be somewhere else you need to edit the file path in the statement

textFilePath = "C:\mach3\ToolTable.txt"

which is near the start of the code.
Re: TOOL INFORMATION FROM GCODE TO MACH3
« Reply #14 on: February 16, 2025, 02:26:18 PM »
I had already tried to execute the file in the way you described before writing to you but when it exports it creates the file but it is empty..
Re: TOOL INFORMATION FROM GCODE TO MACH3
« Reply #15 on: February 16, 2025, 04:08:15 PM »
Have you checked the file using the tool table editor? Maybe it is empty. I have used this export function and it worked well.
Re: TOOL INFORMATION FROM GCODE TO MACH3
« Reply #16 on: February 19, 2025, 04:32:38 AM »
IT WORKS THANK YOU SO MUCH I PROBABLY DID SOMETHING WRONG
Re: TOOL INFORMATION FROM GCODE TO MACH3
« Reply #17 on: February 19, 2025, 04:38:59 AM »
Excellent, happy to help.