LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create references for multiple type def controls in State Machine architecture

Solved!
Go to solution

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?

 

NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
0 Kudos
Message 1 of 6
(2,788 Views)

Are you trying to do this?

d.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 2 of 6
(2,783 Views)

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?

NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
0 Kudos
Message 3 of 6
(2,779 Views)

@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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 6
(2,747 Views)
Solution
Accepted by topic author asukumari

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

Message 5 of 6
(2,739 Views)
Your album with images was an excellent approach to explain this concept. It helped me to understand the concept.
NI System Configuration:
- NI PXIe-1071, 4-Slot 3U PXI Express Chassis , 1 GB/Slot throughput, Part Number: 781368-01
- NI PXIe-PCIe8381,x8 Gen2 MXI-Express for PXI Express Interface,3m, Part Number: 782522-01
- PXIe-5160 PXI Oscilloscope, 500 MHz, 10 bits, 2.5 GS/s, 2 Channels, 64 MB, Part Number: 782621-01
- Astronics PXIe-1209 2-Channel, 100 MHz PXI Pulse Generator, Part Number: 785033-01
Message 6 of 6
(2,656 Views)