Save Variables

More
04 Dec 2017 11:56 #102656 by HalaszAttila
Save Variables was created by HalaszAttila
Hello,

can someone help me, how can I save variables in Linuxcnc.
I want to save some parameters between exits.
In past i found a custom module for saving to file, but i dont found now.

Best regarsd.
Attila.

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

More
04 Dec 2017 15:13 #102665 by Todd Zuercher
Replied by Todd Zuercher on topic Save Variables
Numbered parameters in the range of 31-5000 can be added to the "linuxcnc.var" file (it should be located in your config dir). Then the values of those numbered parameters you've added to that file will be saved and remembered when Linuxcnc exits and is restarted. However, if Linuxcnc does not exit properly the var file will not get updated and it is possible that the file can become corrupted and all of your variable settings will be lost. This also includes loosing your machine coordinate settings as well. So it is wise to back up that file occasionally.
The following user(s) said Thank You: HalaszAttila

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

More
04 Dec 2017 15:19 #102666 by HalaszAttila
Replied by HalaszAttila on topic Save Variables
Tanks for a quick answer.
How can i access these variables from HAL file?

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

More
04 Dec 2017 15:58 #102667 by Todd Zuercher
Replied by Todd Zuercher on topic Save Variables
You can't. At least not directly. What exactly are you trying to do? Perhaps there is a simpler method.

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

More
04 Dec 2017 16:05 #102669 by HalaszAttila
Replied by HalaszAttila on topic Save Variables
I just want to save the workpiece counter, and the work hour counter state on every exit from Linuxcnc.

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

More
04 Dec 2017 19:14 - 04 Dec 2017 19:14 #102675 by Todd Zuercher
Replied by Todd Zuercher on topic Save Variables
This is a little kludgy, but the simplest way to get a value from a hal pin into a g-code variable in Linuxcnc is to use one of the motion.analog-in-nn halpins.
For example in hal you would connect "motion.analog-in-00" to your hal pin for your timer. Then in your g-code file, when you want to get that value and save it to varaible #3000, insert this.
M66 E0 L0
#3000=#5399

Then you can add 3000 to the list of numbered parameters in your linuxcnc.var file to make it be remembered the next time Linuxcnc is started
Last edit: 04 Dec 2017 19:14 by Todd Zuercher.

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

More
04 Dec 2017 19:32 #102678 by HalaszAttila
Replied by HalaszAttila on topic Save Variables
What do you think about these custom modules?
Can I use for saving some variables, and working hour?
Does anybody used these?

wiki.linuxcnc.org/cgi-bin/wiki.pl?Contri...ents#Parameter_Saver

or:

github.com/torvn77/LinuxCNC-Work-Counter

Unfortunately i never install a custom linuxcnc modules.
Is these a documentation step by step how to compile it in linuxcnc project?

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

More
06 Dec 2017 16:52 #102722 by andypugh
Replied by andypugh on topic Save Variables
Does your part counter originate in G-code or in HAL?

I can think of different ways to do this for each situation.
The following user(s) said Thank You: HalaszAttila

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

More
07 Dec 2017 09:21 #102735 by HalaszAttila
Replied by HalaszAttila on topic Save Variables
The counter is in HAL code. A dont know how can i count the parts from G code.
Is there a documentation how to install custom C HAL module. For me, will be very useful the param saver module. What you think about? Can i use this for general purposes, i want just to save some parameters that changes over time.

Thanks Attila.

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

More
07 Dec 2017 12:00 #102736 by BigJohnT
Replied by BigJohnT on topic Save Variables
Yes in the HAL section of the documents.

JT
The following user(s) said Thank You: HalaszAttila

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

Time to create page: 0.077 seconds
Powered by Kunena Forum