Force a write of "linuxcnc.var" file from code.

More
9 years 1 month ago #98526 by eneias_eringer
I have the same problem , in my case , i lost the touch probe calibration !!!

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #98578 by cmorley
IIRC Linuxcnc writes out the var file when the mode is switched.
The glade widget offset_widget.py there is code like this:
Code:
if self.status.task_mode != self.linuxcnc.MODE_MDI: self.cmd.mode(self.linuxcnc.MODE_MDI) self.cmd.wait_complete() self.cmd.mode(self.linuxcnc.MODE_MANUAL) self.cmd.wait_complete() self.cmd.mode(self.linuxcnc.MODE_MDI) self.cmd.wait_complete()

This causes a mode switch (from MDI to manual and back to MDI) which writes out the var file.
Maybe you could make an Mcode that calls a similar python routine to do this.
Just another idea

Chris M

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #98580 by eFalegname
Instead, I found a temporary solution to this problem, it's a shame that the definitive solution never came.
www.google.it/search?q=pc+backup+power+s...ygC&biw=1361&bih=645

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago - 9 years 1 month ago #98615 by Askjerry
cmorley: I'll be getting home on Saturday... and I'll verify this again... but it doesn't appear to work.

If you watch my video about 10 minutes in (QUICK LINK) you can see that after setting the home and zero points... I switched between MDI and MANUAL... but after the power fail simulation at 11:30 in the video... when it comes back... the file contains all blanks.

Again... I'll verify this... but looking at the video... you can clearly see where I switched modes a couple of times.

M-Codes: Funny you should mention that... it's the next video I'll write... how to make custom M-Codes. Perhaps if the change is software driven vs. human clicking the screen... it might make a difference. Still looking for that self.variable.write("somefile") kind of command tho.

eFalegname: Yes... it looks like we need a UPS for protection... should actually have that anyway. But the issue has me interested in finding a software fix. I've been lucky... I never had a power failure while running... it wasn't until seeing Peter's video (QUICK LINK) that I even thought about it.

Thanks,
Jerry
Last edit: 9 years 1 month ago by Askjerry.

Please Log in or Create an account to join the conversation.

Time to create page: 0.375 seconds
Powered by Kunena Forum