Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: alby on August 05, 2022, 12:11:27 PM

Title: Interact with MACH4 from another running external program
Post by: alby on August 05, 2022, 12:11:27 PM
I am wondering the best way to Interact with a running Mach4 with ESS to do the following from another program

Home Ref All
Send Gcode to Mach4
Run the Gcode
Read the current state of Mach4 (Running, Idle)
Read some input values from the ESS
Write some output values to the ESS

I realize Mach4 and ESS are doing many functions which I don't want to try to duplicate.

After searching and reading the Forum, I believe this is doable, but not sure how to proceed and not over do it.
Not sure if I do this with an external LUA or C Program or how to go about this

I would most appreciate direction from those who understand this. THANKS!!
Title: Re: Interact with MACH4 from another running external program
Post by: smurph on September 14, 2022, 01:11:43 PM
You can use the Mach4GUIR.exe Remote GUI pretty easily.  Install Mach on the remote PC.  You will have to make a shortcut to launch the remote GUI and pass parameters to it.  A license is not required for the remote PC.

Mach4GUIR </r mach4.ip.address> </s screen name> [/e] [/f] [/m]

/r is required.  substitute mach4.ip.address with the ip address of the PC running the licensed Mach4.
/s is required.  It is the name of the screen set that the remote GUI uses.  You probably want to make your own custom screen set that does just what you want.  It has to be located in Screens directory of the remote PC.
/e is optional -- start the GUI in screen edit mode.
/f is optional -- start in full screen mode
/m is optional -- remove the menu.

You have to launch the remote GUI AFTER Mach is started on the controller PC.  There is no way to remotely start Mach with the remote GUI.  However, you can do Windows remote execution methods, given it is setup properly, with psexec.  https://ss64.com/nt/psexec.html (https://ss64.com/nt/psexec.html)

Steve
Title: Re: Interact with MACH4 from another running external program
Post by: Steve Stallings on September 15, 2022, 08:22:07 AM
Note: Mach4GUIR.exe is part of the standard Mach4 install and will be found in the regular Mach4Hobby folder.