Hello Guest it is November 27, 2021, 04:42:16 PM

Author Topic: Mach 4 Automaticly open GCode ?  (Read 643 times)

0 Members and 1 Guest are viewing this topic.

Mach 4 Automaticly open GCode ?
« on: August 21, 2019, 03:56:20 PM »
Looking to see if anyone can help me

I made a little program in VB.NET to make some gcode
I am looking to see if it is possible when i click the save button
it will automatically open my file in Mach4 

Would anyone how to do that ??
 
Thanks
Re: Mach 4 Automaticly open GCode ?
« Reply #1 on: August 22, 2019, 11:37:33 AM »
Mach4 takes a few command line parameters like the /p for what profile to use and also a /o for which gcode file to load.  Your VB script would have to construct a command line with the profile and file.

C:\Mach4Hobby\Mach4GUI.exe /p MyMillProfile /o "C:\Mach4Hobby\GcodeFiles\FileToRun.tap"
Re: Mach 4 Automaticly open GCode ?
« Reply #2 on: August 22, 2019, 01:31:49 PM »
use the dll option
i use it a lot very powerful
i have "work list" that load the program and run it on 2 computers with 2 mach system(labeling and cnc)

Re: Mach 4 Automaticly open GCode ?
« Reply #3 on: August 22, 2019, 02:52:04 PM »
This is what i ended up using

Dim p As New ProcessStartInfo
        p.FileName = "C:\Mach4Hobby\Mach4GUI.exe" 'Apostrophes in a file path? eek
        p.Arguments = " /p Mach4Router /o C:\Mach4Hobby\Subroutines\run.txt "
        p.WindowStyle = ProcessWindowStyle.Maximized 'can be hidden
        Process.Start(p)

I am guessing the DLL option might work better ??
Re: Mach 4 Automaticly open GCode ?
« Reply #4 on: August 22, 2019, 03:17:56 PM »
dll work perfect
can do any thing
Re: Mach 4 Automaticly open GCode ?
« Reply #5 on: August 22, 2019, 03:25:06 PM »
you can see the attach(sorry for the language)
customer even not need see mach interface
then mach write status on text file and i can read it as event in my c#
Re: Mach 4 Automaticly open GCode ?
« Reply #6 on: August 22, 2019, 10:19:57 PM »
That's Awesome