5
« on: November 11, 2012, 02:28:19 PM »
I wanted to go ahead and post this BETA version of my Dual-Z plugin. Like the script, this plugin works primarily by parsing a loaded g-code file and (among other things) assigning the "Z" axis moves under the tool number(s) of your choosing to another axis of your choosing. For example, changing all "even numbered" tools from Z axis movements to A axis movements (again the particular tool numbers and axis letters can be modified). It does a lot of other things too, such as adding the proper offset from one Z axis to the other, etc. The plugin version is much more robust than the script and also has a built-in configuration window. It is also MUCH faster and can parse files nearly instantly whereas the script took a long time for big files.
I've done some testing on my own G-Code files, but that is all the testing this has undergone, so anyone who uses this, please send feedback. Until you are confident that it works properly with your setup, I'd recommend air-cutting or at least visually inspecting the generated g-code prior to real cutting.
See the readme for more important information, but be aware that this plugin requires the .NET Framework 3.5 and you'll also need to modify the File-Open button script in order to call the plugin. Pretty simple to do and full instructions are in the readme file (which is copied below).
Hopefully someone will find this useful!
ReadMe file is copied below:
Multi-Z File-Open Macro/Script by theminor
Version 0.6
This Plugin is designed to replace the standard File -> Open button in Mach. The plugin works by presenting the a File-Open dialog for the user to open a gcode file. Upon selecting a file, the user is prompted if he wants the file to be parsed (the prompt can be turned-off via the settings such that the parsing happens automatically without prompting). If the file is to be parsed, the script will search for all toolchange operations which select a tool number set by the user in the settings (for example all "even" numbered tools, all "odd" numbered tools, or a specific tool number only). If an applicable toolchange is found, all "Z" axis moves in that toolchange section will be modified to axis movements on the A, B, or C Axis (set by the user) for the user's Secondary Z axis. A "G52" offset command may also be inserted in these sections to accont for the offset (set by user) of the Second Z axis from the First Z axis. Additional codes and options may also be inserted/set, such as M codes that turn the spindles on and off as appropriate in these sections. Once the file is parsed, the file is saved under a new file name with a suffix set by the user. The modified file is then opened in Mach, ready for execution as with any other gcode file. For additional help with this plugin, see the "tooltips" for each option in the configuration page of the plugin.
To install, copy the MultiZ.dll file to your Mach3\PlugIns directory. Load Mach and enable the plugin via the Config -> Config Plugins menu. Click OK and restart Mach. Upon restart, configure the plugin via the Plugin Control -> MultiZ menu.
The plugin requires the Microsoft .NET Framework Version 3.5 to be installed. This can be downloaded for free here: http://www.microsoft.com/en-us/download/details.aspx?id=22 -- If you get an error upon starting Mach, it is likely because you do not have the .NET 3.5 Framework installed.
Finally, to actually invoke the plugin, you will need to modify the button script of the button in Mach that you want to call the plugin to open the G-Code file. My preference is to change Mach's "Open G-Code" button, but any button can be used. The script should be modified with the following code:
Declare Function CallDLLFunc Lib "MultiZ" () As String
Dim file As String
file = CallDLLFunc()
If file <> "" Then
LoadFile(file)
' SetUserLabel (2, GetLoadedGCodeFileName()) ' Uncomment this line (remove the single-quote at the beginning of the line) to Set the Use Label 2 to the file name that is loaded (useful if you use the 2010 Screenset or similar screenset)
End If
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Please see:
http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US
This software is provided "as-is," without any express or implied warranty. In no event shall the author be held liable for any
damages arising from the use of this software.