Major issues exist with the constructor and destructor

If you think you've found a bug post it here.

Major issues exist with the constructor and destructor

Postby Parkgrr » Sun Jan 22, 2023 2:19 am

Today I started up UCCNC and saw that the last shut down had wiped out 2,300 lines out of my profile. Just deleted. I had to recover from an old profile and re-do a ton of settings, wasting a day of work. I have written an extremely simple M99998 macro to write values to the profile and that only actually executes about 50% of the time, meaning I’m constantly re-entering any custom fields. I wrote a macro on the destructor to return the tool to the tool holder on shut down that fires only about 50% of the time. (And I have ruled out errors in my macros, I once rewrote both const and dest to only pop up a message box and nothing else and just that worked only 50% of the time).

What is going on guys? I have read there are some changes coming to 1.2116, will this be solved?
Parkgrr
 
Posts: 79
Joined: Mon Dec 07, 2020 9:12 am

Re: Major issues exist with the constructor and destructor

Postby dezsoe » Sun Jan 22, 2023 8:35 am

The most important: use the Auto backup profile plugin. Instructions.

I wrote you a mail about the constructor/destructor. However, I must say that I never had any problem with them. (My constructor is 1296 lines long, the destructor is only 34.)
dezsoe
 
Posts: 1823
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Major issues exist with the constructor and destructor

Postby ger21 » Sun Jan 22, 2023 5:24 pm

Never seen this issue either.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2444
Joined: Sat Sep 03, 2016 2:17 am

Re: Major issues exist with the constructor and destructor

Postby cncdrive » Sun Jan 22, 2023 6:28 pm

Non of those macros do anything with the profile file.
Except if you doing profile writting or reading.
It is also not possible that they delete/wipe out things from the profile file, that issue can only happen if you killing the UCCNC process while the UCCNC is writting to the profile file.
E.g. shutting down Windows at the time when UCCNC is writting to the profile file.
cncdrive
Site Admin
 
Posts: 4344
Joined: Tue Aug 12, 2014 11:17 pm

Re: Major issues exist with the constructor and destructor

Postby Battwell » Wed Jan 25, 2023 10:54 am

i have had no problems.
however i now save anything required in profile as its changed by my macros. - so destructor macro isn't required.
i just know my customers will not shut down correctly- and i will get the blame!

cnc drive have made uccnc almost idiot proof
but as my customers have proved- they get around this by evolving into better idiots.
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 728
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Major issues exist with the constructor and destructor

Postby Parkgrr » Fri Jan 27, 2023 10:46 pm

Thanks for jumping in to help guys

I shut down correctly every time unless UCCNC freezes which seems to be happening with increasing frequency. This does not refer to those times.

@Dezsoe, I just sent you my constructor/destructor. If you see some line that would error out I'm happy to be schooled. It is a series of Getcheckboxstates and Getfields + my tool change macro is contained in an 'if' to return the tool to the tool changer if there is one in after asking permission in a dialog. It is 5/10 times that on shutdown that I click "yes" on the dialog but the macros do not run (so M99999 fires the dialog but does nothing else), it is also 5/10 times I open UCCNC after a correct shutdown and none of the fields handled by my M99999 are populated, WCS is wrong, etc. I have error handling in the tool change macro that pops a status message if there is an error but none is thrown. If there is an error would that explain half of my profile being deleted upon proper shutdown?

@Balazs, the mass profile line delete occurred during a completely normal shutdown. After shutting down UCCNC properly I shutdown the PC using the 'shut down' button on windows, then only cut power once the PC is totally powered down. I will use the profile backup plugin.

@Battwell, thanks for the thoughts. "i now save anything required in profile as its changed by my macros." You are doing profile saves in individual macros rather than the destructor? Do you feel like UCCNC is idiot proof? I seem to be dealing with a UCCNC problem every day.
Parkgrr
 
Posts: 79
Joined: Mon Dec 07, 2020 9:12 am

Re: Major issues exist with the constructor and destructor

Postby cncdrive » Sat Jan 28, 2023 12:31 am

UCCNC can freeze only if something freezes it, it could be a macro or a plugin.
The profile writting on shutdown happens in a single cycle now, when the UCNCC writes and flushes all keys into the profile file and ofcourse your destructor macro could write into the profile.
I've never seen the UCCNC frozen when writting profile keys and nobody ever reported such issue.
However as I described you earlier if the UCCNC is killed while writting keys then that can cause the profile file to be corrupted, usually it means the profile file goes empty.
Maybe try a readback of the keys after writting and a compare to see if any errors happened then maybe we could get closer to the root of the issue.
cncdrive
Site Admin
 
Posts: 4344
Joined: Tue Aug 12, 2014 11:17 pm

Re: Major issues exist with the constructor and destructor

Postby Parkgrr » Sat Jan 28, 2023 10:11 am

As mentioned this last time when the profile got wiped out was after a totally proper shutdown. No freezing or force quitting was involved.

Regarding the freezing: I have never had freezing problems until the last update UCCNC update 2 weeks ago. Nothing else has changed. The symptom is a frozen screen, but when I hit the X button and the “sure you want to close?” Dialog comes up the screen comes back alive again, reset button blinking. Then when I click cancel it goes back to frozen screen. I have to do a full system reboot to get the problem to stop.

“Maybe try a readback of the keys after writting and a compare to see if any errors happened then maybe we could get closer to the root of the issue.”

I’m not sure what this means ^. Would you like me to post the profile next time this happens?
Parkgrr
 
Posts: 79
Joined: Mon Dec 07, 2020 9:12 am

Re: Major issues exist with the constructor and destructor

Postby Battwell » Sun Jan 29, 2023 12:36 pm

parkrr.
i supply machines to newbies that have no previous cnc experience. if idiots exist, these will be them.
i do know with my 8 years of using uccnc now that the software is pretty rock solid.
when i was in full production of my products, uccnc would be running long hours daily. never a crash since the old usb controllers.
however it can be broken by bad programming. i know this from my own experience. (definately guilty)

re your question. yes i save things like tool numbers and tool pockets as they are changed by macros.
(my machines are only reliable with correct saving, this is done in fast for i loops)
i do not use the destructor macro any more. ( if uccnc or pc crashes or a power failure, everything important is already saved )
things like offsets i save using a simple macro at the start of my gcode. so once it starts running, even if there is a crash resuming is simple.
i also have the brilliant profile backup plugin enabled. so if anything does get scrambled its a very simple process to talk a customer through getting back running in minutes.
my constructor macro m99998 sets up the system. sets 85 var numbers for machine specific requirements ( different tool changers, tool positions , probe position etc etc)
in fairness i doubt anyone is running a more "complex system" to what i have programmed. (to make everything totally simple for the operator)

things i have noticed.
usb is rubbish :-)
some dongles will only play nice if running via a usb hub.(powered hubs are better) especially if using usb3 ports on pc.
power saving is your enemy.
rogue programs like adobe on the same pc can really mess up your day causing timing issues.
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 728
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk


Return to Report a bug

Who is online

Users browsing this forum: No registered users and 6 guests