Saving linuxcnc.var file

More
24 Feb 2021 09:09 #199945 by HalaszAttila
Hello,

if i know right, Linuxcnc is saving variable file (linuxcnc.var - where is the workpiece offset data G54 G55 ... ) when the program is closed properly.
But if the Linuxcnc is freezed for some reason (for example video card) this file would not be saved, and the offset data lost.
After restarting the PC becouse of freeze, the workpiece coordinate offset will lost, and it must set again.
The problem if the workpiece has no more that surface where it first time measured, becouse of roughing job finished.

We made over 50+ retrofitted cnc mahines with LinuxCNC, and time for time happend freezing of Linuxcnc and lost these data.


My question is, what is the reason for saving this file just on closing the program?
If this file would saved for example, every time when the workpiece offset is edited, there would be no such problem.
What is your opinion?

Best regards,
Attila.

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

More
24 Feb 2021 11:31 - 24 Feb 2021 12:48 #199958 by tommylight
Replied by tommylight on topic Saving linuxcnc.var file
I would just change the PC and move on.
Just the time to set things up again will cost more.
BTW, i have two machines that i never turn off except when power goes out but never had issues with X and Y offsets, they are saved somehow. Pretty shure LinuxCNC does copies of the var file as i see also machine.var.bak in the folders.
One of them is on for over 25 days.... not used much though.
Last edit: 24 Feb 2021 12:48 by tommylight. Reason: file name

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

More
24 Feb 2021 12:32 - 24 Feb 2021 12:34 #199970 by Aciera
Replied by Aciera on topic Saving linuxcnc.var file
There are actually two files: linuxcnc.var and linuxcnc.var.bak
I'm not sure I understand correctly how that works but it seems that whenever a change occurs in LCNC it gets written to .var immediately while the var.bak contains the .var data before the change. If LCNC is shut down properly .var gets copied to .var.bak and the two are then identical.
I used to think that if the two files were not identical at startup it would load the .var.bak file but I just tested it on my machine and it doesn't seem to care whether the two files are identical and just loads the .var anyway.
So I guess really I have no idea how it works. .)
Last edit: 24 Feb 2021 12:34 by Aciera.
The following user(s) said Thank You: tommylight

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

More
24 Feb 2021 12:49 #199973 by tommylight
Replied by tommylight on topic Saving linuxcnc.var file
Yeah, var.bak, not old, edited my post to reflect that, thank you Aciera.
I am getting .OLD ! :)

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

More
24 Feb 2021 13:34 #199978 by MaHa
Replied by MaHa on topic Saving linuxcnc.var file
For that reason i call a subroutine, always at the beginning of a program, when all offsets are set. I also write a timestamp, and change the log order to newest entry on top of the logfile. I posted how i done that. The simple version is, overwrite and only have one entry(LOGOPEN), or have an endless file with the most recent at the end (LOGAPPEND). Then just copy the line needed to MDI and recover required offsets.

o<npv_si> sub
(LOGAPPEND,/home/mymachine/NcFiles/LOG/NPV_LOG.NGC)
(LOG,)
(LOG,; G10 L2 P1 X#5221 Y#5222 Z#5223 A#5224 R#5230)
(LOG,; G10 L2 P2 X#5241 Y#5242 Z#5243 A#5244 R#5250)
(LOG,; G10 L2 P3 X#5261 Y#5262 Z#5263 A#5264 R#5270)
(LOG,; G10 L2 P4 X#5281 Y#5282 Z#5283 A#5284 R#5290)
(LOG,; G10 L2 P5 X#5301 Y#5302 Z#5303 A#5304 R#5310)
(LOG,; G10 L2 P6 X#5321 Y#5322 Z#5323 A#5324 R#5330)
(LOG,; G10 L2 P7 X#5341 Y#5342 Z#5343 A#5344 R#5350)
(LOG,; G10 L2 P8 X#5361 Y#5362 Z#5363 A#5364 R#5370)
(LOG,; G10 L2 P9 X#5381 Y#5382 Z#5383 A#5384 R#5390)
(LOGCLOSE)
(MSG,* All Offset saved *   NPV_LOG.NGC)
o<npv_si> endsub [1]
M2
The following user(s) said Thank You: tommylight, HalaszAttila, Aciera

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

More
26 Feb 2021 10:38 #200182 by HalaszAttila
Hello,

I tested a little bit this situation, how the linuxcnc.var and linuxcnc.var.bak files works.
Version 2.7.14 and 15 loose the workpiece offset after power cutoff. This problem is not occure in v2.8.0.

I tested the version 2.7.15 and the linuxcnc.var file is empty (size = 0byte) after power cutoff (not properly closed linuxcnc).
The linuxcnc.var.bak is holding the original values, but after linuxcnc is started both linuxcnc.var and linuxcnc.var.bak files are collected with zeros.

I think this problem is solved in 2.8.0

Using newest version solve the problem. :)

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

More
01 Mar 2021 00:35 #200492 by andypugh
Replied by andypugh on topic Saving linuxcnc.var file
A call to task_plan_synch() should update the .var file:

linuxcnc.org/docs/2.8/html/config/python-interface.html

I can only see any evidence that Axis uses it, though:
github.com/LinuxCNC/linuxcnc/search?q=task_plan_synch&type=code

Perhaps the authors of the other GUIs need to be encouraged to add it.

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

More
01 Mar 2021 01:00 #200494 by cmorley
Replied by cmorley on topic Saving linuxcnc.var file
Do you understand why AXIS forces the var file to be written?

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

More
01 Mar 2021 02:22 #200499 by Benb
Replied by Benb on topic Saving linuxcnc.var file

Yeah, var.bak, not old, edited my post to reflect that, thank you Aciera.
I am getting .OLD ! :)

Attachments:
The following user(s) said Thank You: tommylight

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

More
01 Mar 2021 11:47 #200680 by andypugh
Replied by andypugh on topic Saving linuxcnc.var file

Do you understand why AXIS forces the var file to be written?


I assume that it is to keep the file up-to-date in the event that the system does not have a controlled shutdown.

There isn't much info in the axis.py file, and it only does it in one place (whereas you might expect it after a touch-off, for example, when the .var data is known to have changed.)

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

Time to create page: 0.198 seconds
Powered by Kunena Forum