LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save a variable that you can over write it later?

I want to convert the value measured by loadcells to force , and I use a 50 gr calibration for it,and i want to ask user if he/she wants to calibrate the system or not and if yes just over write the variable a and b , and if not just used the previous a and b,

Is there anyway that i could save these variables?

y=ax+b

0 Kudos
Message 1 of 5
(2,624 Views)
the typical method for this is to save the cal coefficients in a configuration file.  that way the persist somewhere on your hard drive (or a server) and can be read during your application's initialize routine.  Hint: an action engine is a great way to store them when your app runs.  Don't forget to save the new parameters to file when they change.

"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 5
(2,617 Views)
You store the values for a nd b in shift registers.  Use a case structure or select statement to determine when to continue using the existing value in the shift register, or store a different value in it.
0 Kudos
Message 3 of 5
(2,611 Views)

You could create simple indicators for a and b and write to them anytime.  You would need to create local variables for each to read from them.  However, beware of race conditions.  If you are not sure about, or don't know what race conditions are, use shift registers or an Action Engine.

 

Here are several methods to store numbers.

 

Variables.png

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 5
(2,592 Views)

If you want to stop the application (program) and retrieve the values for the equation later, then you can write the values to a file, such as what Jeff proposed.  I also use xml files, which are easy and great to work with.  If you want to change / re-use values while the application is running, then shift registers are a good way to go, such as proposed by RavensFan.

 

It depends on the type of solution that you are looking for.

0 Kudos
Message 5 of 5
(2,591 Views)