LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the "Make Current Values Default" as a control on the front panel

Solved!
Go to solution

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

0 Kudos
Message 1 of 23
(6,213 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 23
(6,203 Views)

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.

Message 3 of 23
(6,202 Views)

@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.

Message 4 of 23
(6,198 Views)

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.

=====================
LabVIEW 2012


0 Kudos
Message 5 of 23
(6,196 Views)

 


@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.

 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 23
(6,190 Views)

Hi mhaque,

  Yes,it is very much possible to create a boolean control,name it as "Make current values default" and place the controls..After that you need to make use of shift registers..Please look at the attachment..

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 7 of 23
(6,185 Views)

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

0 Kudos
Message 8 of 23
(6,166 Views)

You are going to have to use a configuration file. Click here for a tutorial

0 Kudos
Message 9 of 23
(6,163 Views)

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

0 Kudos
Message 10 of 23
(6,145 Views)