Hello Guest it is November 10, 2024, 09:18:01 AM

Author Topic: Install directory c:/program files/mach4  (Read 1524 times)

0 Members and 1 Guest are viewing this topic.

Install directory c:/program files/mach4
« on: June 06, 2024, 06:18:55 AM »
Hi to All

Very recently I bought the hobby version of Mach4, got my licence, downloaded the files and started to get
my  cnc working. That took some time, to figure out all the settings, but I got almost all hardware working.
Already figuring out the Lua language etc. And already adapting mach4 to my needs.

But. I checked the forum for the following issue but did not find anything.
So hereby my first post.

When you install the program in c:/program files/mach4 and you want to use the probing
function of the program  mach4mill, -> tab tool information -> probing
you get an error cannot run c:/program.... with a pop up. It is a Windows error..

So then with edit screen, and finding out the following (already changed) script for the button probing...

----------------------------------------------
--Launch Probe
----------------------------------------------

local screen = "wxProbe";
local port = "127.0.0.1";
local inst = mc.mcGetInstance();
local path, rc = mc.mcCntlGetMachDir(inst);
local exepath = path .. "\\Mach4GUIR.exe";
if(wx.wxFileExists(exepath))then

   -- exepath = exepath ..  " /s" .. screen .." /r" .. port

   exepath = '"'.. exepath .. '"' ..  " /s" .. screen .." /r" .. port

   local screenpath = path .. string.format("\\Screens\\%s.set", screen)
   if(wx.wxFileExists(screenpath))then
      exepath = 'START "Probing" ' .. exepath
      
      local rval = os.execute(exepath);
      mc.mcCntlSetLastError(inst, tostring(rval));
   else
      mc.mcCntlSetLastError(inst, screen .. ".set Not Found" );
   end
else
   mc.mcCntlSetLastError(inst, "Mach4GUIR.exe Not Found" );
end

The error is where the string "local rval = os.execute(exepath);" send to cmd.exe is setup wrong.

Send to windows is .. Start "Probing" c:\program files\mach4\Mach4GUIR.exe /swxProbe /r127.0.0.127
The program gives error and the probing function does not working
By changing this to Start "Probing" "c:\program files\mach4\Mach4GUIR.exe" /swxProbe /r127.0.0.127
it works...

By changing line

   exepath = exepath ..  " /s" .. screen .." /r" .. port
   to this
   exepath = '"'.. exepath .. '"' ..  " /s" .. screen .." /r" .. port

The program works fine if it is installed in a path where a space is used.
I think this should be solved in the next update..