01-10-2011 11:17 AM - edited 01-10-2011 11:18 AM
Hi
I am building a VI that uses a lot of numeric controls. I want to use the "Make Current Values Default" as a boolean control on the front panel for the user.
Is this possible to implement while the program is running? What would be an alternative if this was not possible?
Thanks
Mhaque
Solved! Go to Solution.
01-10-2011 11:23 AM
Use an event structure in a while loop to capture your UI events (You can do lots of other things with the event structure as well) and use the "Value Change" for a boolean button. When this button is pressed use the "Invoke Node" method to return all values to their defaults or use individual "Invoke Nodes" for each control you want to default if you will not be changing all values.
01-10-2011
11:23 AM
- last edited on
05-09-2025
10:43 AM
by
Content Cleaner
I'm not sure if this is possible. I assume you are going to distribute this as an executable and that's why you cannot just click "edit" on the toolbar. If it is not possible, you can make a .ini file. You can load the .ini file on startup (or when the user presses button) and save it on close (or when the user presses a button). I believe this is called using a configuration file.
01-10-2011 11:27 AM
@Mark Yedinak wrote:
Use an event structure in a while loop to capture your UI events (You can do lots of other things with the event structure as well) and use the "Value Change" for a boolean button. When this button is pressed use the "Invoke Node" method to return all values to their defaults or use individual "Invoke Nodes" for each control you want to default if you will not be changing all values.
It seems like you are describing how to return a value to its default, but I think he is actually asking how to let the user set new defaults, but I may have misinterpreted.
01-10-2011 11:27 AM
If you change the default then the vi will have to be recompiled and resaved.
An alternative is to use flatten to string or flatten to xml in an event and save that to a file. When the program starts you read that file, unflatten and restore the values.
01-10-2011 11:28 AM
@Gregory wrote:
@Mark Yedinak wrote:
Use an event structure in a while loop to capture your UI events (You can do lots of other things with the event structure as well) and use the "Value Change" for a boolean button. When this button is pressed use the "Invoke Node" method to return all values to their defaults or use individual "Invoke Nodes" for each control you want to default if you will not be changing all values.
It seems like you are describing how to return a value to its default, but I think he is actually asking how to let the user set new defaults, but I may have misinterpreted.
Oops. I misread the initial post. In that case you will need to use a configuration file of some sort to achieve what you want.
01-10-2011 11:34 AM
01-10-2011 12:03 PM - edited 01-10-2011 12:04 PM
Hi Mark
I am not too fimiliar with the invoke node method since I am relatively new in using LabVIEW. Perhaps the solution is not that hard but let me clarify a little further.
I want 1 "Save" boolean to save the values in "Stop Timer A1", "Matrix A1" and "steps A1".
When I close and open the VI again, I want the values to be saved to the new values and so on and so forth.
Thank you for your time.
mhaque
01-10-2011
12:05 PM
- last edited on
05-09-2025
10:44 AM
by
Content Cleaner
You are going to have to use a configuration file. Click here for a tutorial
01-10-2011 12:55 PM
I can save the stop timer A1 and steps A1 but how do i take care of Matrix A1? I can't wire them since it is giving me an error message.
mhaque