From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying main VI waveforms in Subvi front panel

Hi

 

I have four waveforms displayed on the front panel of my main VI. How can I pass and display them on my sub VI when it is called? Is there any way?

 

Thanks in advance

0 Kudos
Message 1 of 3
(956 Views)

Send the data through the connector panel.

 

Pass the data to the subVI via a queue.

 

I would recommend you learn more about LabVIEW from here. How to Learn LV

0 Kudos
Message 2 of 3
(906 Views)

Is it safe to say that you are a relatively new user of LabVIEW?  Although "Top-Level VIs" (the one VI that you run to start your program) and "sub-VIs" (which are all the VIs that are called by other VIs) have the same basic Structure, with a Front Panel having Controls and Indicators and a Block Diagram having "graphical code", there is a significant difference during "ordinary execution" in the treatment of the Front Panel (and the Connector Pane):

  • Top-Level -- Front Panel Controls and Indicators are meant for User Interaction.  The User changes the Controls (by clicking or typing), and "looks at" the Indicators.  The Top-Level VI also has nothing wired to the Connector Pane -- it is at the Top Level, and receives all of its "Input" and "Output" through interaction with the User.
  • Sub-VI -- Front Panel Controls and Indicators are not meant for user interaction, but are the means by which data are exchanged with other VIs, both Top-Level and sub-VIs.  Some Controls or Indicators might be placed there for debugging purposes while the code is being developed/tested, but otherwise it just represents an Input (Control) or Output (Indicator) parameter of the sub-VI, similar to the Input and Output parameters of a function call in other Languages.  The data are passed in or out by having the Control/Indicator wired to the Connector Pane.  A good Practice for most sub-VIs is to include the Error In Control and Error Out Indicator, wired in to the lower left and lower right corners of the Connector Pane.

This being the case, in an ordinary LabVIEW program, you will not be able to see the Front Panel of your sub-VI when you are running your code.  Among other reasons, that is why you place Charts and Graphs on the Front Panel of the Top-Level VI.  You can pass the data to be displayed to a sub-VI for calculations (for example, to do an FFT) and pass the results back to the Top Level for display (for example, a Waveform input, transform, and a Gain and Phase pair of arrays back out).

 

Having said that "ordinarily" you cannot display the Front Panel of a sub-VI while the Main VI is running, there are ways around this.  You could display the sub-VI in a separate Window (but this requires some more-advanced code).  You can also display the Front Panel of the sub-VI is a "sub-Panel" of the Main VI, but this is also more advanced (I learned how/why to do this after about 5 years of LabVIEW work).

 

Bob Schor

0 Kudos
Message 3 of 3
(877 Views)