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: 

Control instances of a subVI

Solved!
Go to solution
Solution
Accepted by topic author danthecoffeecan

@danthecoffeecan wrote:

you would have a for loop (controlled by user input) that calls a function for each instance of the for loop. In this example, if you input "3," the loop will call the function three times with the frequency as an argument which correlates to the base frequency and iterations of the loop.

 

I just don't know how I could "call" the reentrant subVI at different amounts set by the user.


LabVIEW has For loops too. You just put your function inside the loop, and voila, it's called multiple times. It doesn't even have to be reentrant. For this use-case, only one thing can output to your sound card at a time, so you will have to pre-generate the sound you want, then play it.

 

tones.png

 

If you have LV Full you can also use the Multitone VI's to generate multiple-tone frequencies all in one VI:

 

 

0 Kudos
Message 11 of 13
(399 Views)

Or all in one loop, of course:

 

altenbach_0-1591133256571.png

 

(even easier would be to place the addition into a i!=0 case. There are many alternatives)

 

Message 12 of 13
(384 Views)

Ah I see, thank you! This helps.

0 Kudos
Message 13 of 13
(352 Views)