LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Input data during dynamic vi call

Hi guys. Is it possible to input data during a dynamic VI call?

For eg, i have a car.vi When i call this vi dynamically, i want to also input the value turn left or turn right. How do i acheive this in LV?
0 Kudos
Message 1 of 6
(3,090 Views)

hi there

use a invoke node on the VIs reference and call the "Set control value" method to set values of controls during execution of the dynamic VI. Use "Get control value" to retrieve values from indicators.

another possible solution would be the usage of a so called LV2 style global a.k.a. FGV (functional global variable). this needs more drawing but is much more efficient and powerful.

DO NOT use simple global variables.

Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 2 of 6
(3,088 Views)
Thanks for your reply Chris.

I've tried playing around with the "Set control value" method. But the car.vi i'm suppose to call has more than 1 input. Assuming it has 2 Boolean inputs, how do i program it them? How would the method identify which boolean input is for which control in car.vi?

Thanks for the advice on functional global variables, i didn't know there were such things. I'll check it out.

0 Kudos
Message 3 of 6
(3,069 Views)
Look at the method. See the input called Control Name? Each of your front panel controls should have a unique name.
0 Kudos
Message 4 of 6
(3,064 Views)
Ok, so say the car.vi which i want to call dynamically has a Steer left boolean and Steer right boolean. I would need 1 method with Control name string as 'Steer left' with the corresponding value TRUE and another method with Control name string as 'Steer right' with the corresponding value FALSE.

Correct?
0 Kudos
Message 5 of 6
(3,059 Views)
Yes.
0 Kudos
Message 6 of 6
(3,051 Views)