Page 1 of 1

Retain Custom Settings

PostPosted: Wed Dec 13, 2023 7:52 pm
by Jason
Did some searching on this forum, and looked pretty extensively through the documentation, and not sure if I missed something, or if what I want to do is just not possible. I'll give a simple example vs going over all the possibilities I'm potentially considering:

Let's say I have multiple cooling options for my tool: Air sol. #1, air sol #2 and chemical mist. Any combination of these can be used during a job. The screen has (3) toggle buttons to enable or disable each one - let's call them 20100, 20101 and 20102 respectively. When starting a job, my post processor calls for a startup macro. This macro will do an AS3.Getbuttonstate(20100)... for each button and turn on the appropriate output. At the end of the job, a macro clears those outputs. That is all easily workable without issues.

What I am looking for is a method such that those selections persist with a power cycle / reboot of the PC running UCCNC. What 'user' variables / registers / buttonstates / Led's etc. are settable via a macro, and will automatically be retained until they are changed again by the macro? i.e. similar to a system setting like homing speed.

Thanks in advance for any help.

Re: Retain Custom Settings

PostPosted: Wed Dec 13, 2023 9:01 pm
by ger21
Use the constructor and deconstructor macros to write values to the profile, and read them when UCCNC loads.

Re: Retain Custom Settings

PostPosted: Wed Dec 13, 2023 9:26 pm
by Jason
Excellent. Thank you for pointing me in the correct direction.

Constructor macro: M99998
This macro is called on each software startup. Initial actions like user variables loading and startup
settings could be made using and programming this macro.

Destructor macro: M99999
This macro is called on each software shutdown. User variables and DRO values could be saved or
messages could be shown to the user etc. on the software shutdown with programming this macro