03-29-2019 01:42 PM
I am trying to understand how the following can be done, I am trying to recreate a similar step in my application to default all fields ( controls and indicators ) to their default initial values. Why is it important to create the UI references as shown in the figure below and how to do it if I have multiple controls?
Solved! Go to Solution.
03-29-2019 01:47 PM
Are you trying to do this?
03-29-2019 01:52 PM
Yes, I just figured it out now that all values of the VI can be re-initialized by doing it your way.
But why does the example have such elaborate method if it tries to accomplish the same thing?
03-29-2019 02:58 PM
@asukumari wrote:
Yes, I just figured it out now that all values of the VI can be re-initialized by doing it your way.
But why does the example have such elaborate method if it tries to accomplish the same thing?
The answer may be found in the other states where sub-VIs may have to touch the GUI elements or register for Events associated with those controls.
Passing that cluster to sub-VIs will allow them to access the methods that are specific to those GUI objects.
You can browse this album to see images of code that I have developed that uses a similar approach. As you browse through those images, please note there are links to the threads were I used those images to answer questions.
Ben
03-29-2019 03:06 PM
@asukumari wrote:
Yes, I just figured it out now that all values of the VI can be re-initialized by doing it your way.
But why does the example have such elaborate method if it tries to accomplish the same thing?
The example shown can reinitialize controls to other states than simply their default value. If you store values to a file, those values can be initialized each time the program is run. It's very useful (virtually mandatory) for lots of built applications where you want user settings to persist between runs.
04-08-2019 07:55 AM