Hello Guest it is April 27, 2024, 06:51:27 PM

Author Topic: Load FIle in MDI Button  (Read 554 times)

0 Members and 1 Guest are viewing this topic.

Load FIle in MDI Button
« on: November 21, 2023, 09:29:42 PM »
Hello All, I have several MDI files that I use regularly and am trying to automate loading them to the MDI window. Currently, I have them saved as text files and when I need them I cut and paste to get them in the MDI window. I would like to create a button for each file that would load it into the window without cutting and pasting... Is this possible? I can create the buttons but can't get past there... Seems like it should be relativly easy to do but I can't figure it out. Thanks in advance for any help.
Hit the e-stop! Hit the e-stop!

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Load FIle in MDI Button
« Reply #1 on: November 23, 2023, 10:52:55 AM »
You could turn your code into a macro and call it with an M code in the button script.
Without engineers the world stops
Re: Load FIle in MDI Button
« Reply #2 on: November 25, 2023, 12:37:21 PM »
Hi,

I have created this drop list that will display all files within a folder. It will look for files in 'C:\Mach4Hobby\MDI Files'. You can then select the file from the drop down and it will load it into the MDI window and you can run it as normal. I've also added a save button so you can easily create and save new files.

All the code is self contained within the MDI tab. I have exported it so you can easily import it without having to copy and paste code. First extract the attached .zip file. To import, go into the screen editor, right click 'nbGCodeMDI' and click import. Then select the .setc file you just extracted. Make sure the controls are named as in the picture otherwise it will not work. It may be best to delete your current MDI tab before importing. Also make a backup of your screen file before doing anything just in case!
Re: Load FIle in MDI Button
« Reply #3 on: December 08, 2023, 04:59:14 PM »
Hey SwiftyJ,

I added your MDI tab to my Mach4 screenset and love it! I used to copy and paste MDI Gcode from notepad but thinks makes it so much easier.

Thank you!

Kenny