Page 1 of 1

Aspire Direct Output to UCCNC

PostPosted: Wed Oct 30, 2024 12:33 pm
by RsX
Hello,
this is my solution to enable the Aspire direct output function for UCCNC
Let me know if it works for you too and if it can be improved :)

aspire direct output.png
aspire direct output.png (21.74 KiB) Viewed 1074 times

To enable the direct output I added this line into a copy of the UCCNC original postprocessor
The first part is just a name, the second is the ini file that contains the command to execute
Code: Select all
DIRECT_OUTPUT = "UCCNC|UCCNC_run.ini"


Then I put this command into the ini file
What it does is creating a UCCNC subfolder in the temp folder and moves the gcode (%s) into it with a fixed name.
Code: Select all
cmd
/c mkdir "%%TEMP%%\UCCNC\" & move /y %s "%%TEMP%%\UCCNC\Autoload.gcode"


Both files are in the attached zip file and go into this folder, where V is the version of Aspire
Code: Select all
C:\ProgramData\Vectric\Aspire\{Vx.x}\My_PostP


macroloop.png

To make UCCNC load the file I created an M20002 macro and setup a macroloop that starts with UCCNC
The macro continuously checks if there is an Autoload.gcode file in the specified folder and, if UCCNC is stopped, loads it then removes it.
Code: Select all
string AutoloadFile = Environment.GetEnvironmentVariable("TEMP") + @"\UCCNC\Autoload.gcode";
//MessageBox.Show(AutoloadFile);
if(exec.CycleStopped && System.IO.File.Exists(AutoloadFile)){
   exec.Loadfile(AutoloadFile);
   while(exec.IsLoading()){}
   System.IO.File.Delete(AutoloadFile);
}

Re: Aspire Direct Output to UCCNC

PostPosted: Wed Oct 30, 2024 4:34 pm
by sebba
Nice job, I'll try it right after I'll finish my current upgrade.
Thanks for posting

Re: Aspire Direct Output to UCCNC

PostPosted: Sun Nov 03, 2024 1:06 pm
by sebba
regarding M20002 macro, uccnc and aspire have to be installed on the same computer?
what about if aspire run on different computer?

Re: Aspire Direct Output to UCCNC

PostPosted: Sun Nov 03, 2024 1:37 pm
by RsX
No, they don't, but they must have access to the same network folder/disk.
You can modify the Aspire command to move the %s file to the shared folder and the UCCNC macro to monitor that folder.
Maybe this might even work with a onedrive/googledrive synced folder or the direct output can be modified to send the file via ftp... The possibilities are endless
What would you like to use to send the file to the other computer? Maybe I can help

Re: Aspire Direct Output to UCCNC

PostPosted: Sun Nov 03, 2024 5:22 pm
by sebba
Understand, thanks.
I'll let you know when I'll test it in real life.
For now it was just a preview, having a break with my current task.
Thank you,
Seb

Re: Aspire Direct Output to UCCNC

PostPosted: Thu Nov 07, 2024 10:43 am
by Battwell
this works well. modified to work with vcarve pro and tested.
the only annoying thing is it loses the original job name. which i use for pre run file checking.
makes loading one of the last 10 gcode files impossible too.
cant have everything i suppose :-)

Re: Aspire Direct Output to UCCNC

PostPosted: Thu Nov 07, 2024 4:59 pm
by RsX
Yes, it does lose the job name. Aspire names the file something like "Vectric_b35c675c-547a-4db3-8561-1b40ac22b7b9".

I encountered an issue where I cannot reload/rewind the file because it was deleted, so I modified the macro like this.

the command in the ini file creates an "AutoloadUCCNC.tmp" file in the temp folder with the Aspire generated gcode path in it.
Code: Select all
cmd
/c del /F "%%TEMP%%\AutoloadUCCNC.tmp" & echo %s>"%%TEMP%%\AutoloadUCCNC.tmp"


The UCCNC macro now looks for that file and loads the gcode path contained inside.
Code: Select all
string AutoloadFile = Environment.GetEnvironmentVariable("TEMP") + @"\AutoloadUCCNC.tmp";
string gcodeFile = "";
//MessageBox.Show(AutoloadFile);
if(exec.CycleStopped && System.IO.File.Exists(AutoloadFile)){
   //read the file, it should have only one line
   gcodeFile = System.IO.File.ReadAllText(AutoloadFile);
   //clean the string
   gcodeFile = gcodeFile.TrimEnd('\r', '\n');
   //load the gcode
   exec.Loadfile(gcodeFile);
   while(exec.IsLoading()){}
   //delete the tmp file, not the gcode
   System.IO.File.Delete(AutoloadFile);
}

Re: Aspire Direct Output to UCCNC

PostPosted: Thu Nov 07, 2024 8:13 pm
by Battwell
that works a lot nicer.
as the file still exists i can pre file check too.

i cant remember if mach3 used to bring in the file name or not.
i know it had to have registry entries added. long time since since i used mach now!