Page 1 of 1

New file auto load from vectric

PostPosted: Fri May 07, 2021 12:54 pm
by Battwell
Mach 3 has an auto gcode file load .dll

In vectric you can tick “ send direct to machine” when saving a toolpath.
This was very handy if for instance you had to re calculate a toolpath and re save.
The new file would then replace the old file in mach 3. Without having to re load the file manually.

Re: New file auto load from vectric

PostPosted: Fri May 07, 2021 11:07 pm
by cncdrive
If Vectric creates a g-code file and overwrites in then a plugin could check that file for changes and could reload the file when it changed.
So yes, it is possible in my opinion to write a plugin which could do that, but I have no Vectric, so...

Re: New file auto load from vectric

PostPosted: Sat May 08, 2021 6:00 pm
by eabrust
Hi Battwell,

I took a quick look w/ VCarve and Mach3 post. In this instance, I did not have Mach3 open, and hit output to machine. It results in an error, folldowed by second error saying it can't find running Mach3. This indicates to me VCarve isn't saving out a file and notifying Mach, it it connecting direct to Mach via an API interface.

VCarve to Mach.PNG


VCarve to Mach2.PNG




I think it would take a VCarve side plugin combined w/ a UCCNC plugin or update as well. Other possibility would be saving/overwriting a GCode file to a directory from VCarve that UCCNC plugin watches and loads file when it sees an update happen.

regards
Eric

Re: New file auto load from vectric

PostPosted: Sat May 08, 2021 10:14 pm
by dezsoe
You don't need a plugin to check for a file change. Here is my macroloop to check it:

Code: Select all
// ================================================================================================
// Check file change
// ================================================================================================

string sFileName = exec.mainform.filenametoload;

if (!exec.GetLED(54) && System.IO.File.Exists(sFileName))                       // Check cycle start and valid file name
{
  if (++counter == 20)                                                          // Check every second
  {
    counter = 0;
    if (sFileName == lastFileName)
    {
      if (lastDateTime != System.IO.File.GetLastWriteTime(lastFileName))
      {
        if (MessageBox.Show(exec.mainform, "Reload file?", "Loaded file changed!", MessageBoxButtons.YesNo) == DialogResult.Yes)
          exec.Callbutton(555);                                                 // Reload file
        lastDateTime = System.IO.File.GetLastWriteTime(lastFileName);
      }
    }
    else
    {
      lastFileName = sFileName;
      lastDateTime = System.IO.File.GetLastWriteTime(lastFileName);
      // exec.AddStatusmessage("Opened file changed");
    }
  }
}

// ================================================================================================

#Events

// ================================================================================================

string lastFileName = "@";
int counter = 0;
DateTime lastDateTime;

// ================================================================================================

If the loaded file is changed then this macroloop asks if you want it to reload the file.

Re: New file auto load from vectric

PostPosted: Sun May 09, 2021 1:25 am
by ger21
This indicates to me VCarve isn't saving out a file and notifying Mach, it it connecting direct to Mach via an API interface.


I believe this used to work with older versions of Mach3, but stopped working with newer versions. I think if you do some Googling you'll find some registry hacks that will enable it.

Re: New file auto load from vectric

PostPosted: Sun May 09, 2021 12:25 pm
by eabrust
Hi Gerry,

I tried it w/ Mach vers 3.043.066 i have installed, and it still worked fine with no registry tweak necessary. Can't say I ever used the feature back when I used Mach3 though, I only just tried it out of curiosity of Battwell's request to see what it really did behind the scenes :)

regards
Eric

Re: New file auto load from vectric

PostPosted: Fri May 21, 2021 11:25 pm
by Battwell
Yes I had to add the Reg edit file to a few later machine builds , but it was a very useful feature. Especially if you saw a fault in the code and re posted it. It would automatically re load ready to run .
also the recent file button was extremely handy. As often a part is made of a few different files . E.g. Drilling/ routing using 2 different posts .
I still use Mach 3 on one of my complex machines as uccnc doesn't support the analog loop controllers yet . Hint hint balaczs. ( will the analog control capable uccnc ever happen )? )