LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a VI with variable number of parameters like in Index Array

Hello,
I would like to create a VI that have 2 "static" inputs, and as many outputs as "dynamic" inputs, exactly like "Index Array" VI.


Example:

Case 1: 1 dynamic parameter
-parameterA input
-parameterB1 input
-parameterC1 output

Case 2: 3 dynamic parameter
-parameterA input
-parameterB1 input
-parameterB2 input
-parameterB3 input
-parameterC1 output
-parameterC2 output
-parameterC3 output

How to create a VI with a variable number of parameters?
0 Kudos
Message 1 of 8
(4,814 Views)
You can't get the same "drag to expand" functionality as the in-built array functions have, but you can send the input parameters to the sub-VI as an array and get the output as an array. Just make the code inside the VI so that it will scale dynamically to the number of parameters given in the array.
0 Kudos
Message 2 of 8
(4,814 Views)
Thanks a lot for your answer.

It could be a could improvement for the next versions.


I'll follow your advice.
0 Kudos
Message 3 of 8
(4,814 Views)
Hi Nicolas,

As a continued effort to improve our products, NI has a Product feedback (suggestion) link on http://www.ni.com/ >> Contact NI >> Product Feedback.

Sincerely,
Feroz
0 Kudos
Message 4 of 8
(4,814 Views)

Hi Feroz,

 

Any news with this topic?

 

Regards,

--

Łukasz

0 Kudos
Message 5 of 8
(4,324 Views)

Given that this thread is 8 years old, a lot of things have changed sice. What is wrong with the array solution given earlier?

 

(I am no expert here, but xnodes might be a possible solution but they are unsupported and undocumented.)

 

Anyway, the product suggestion center is now the LabVIEW idea exchange. If you think you have a good idea, feel free to post it.

0 Kudos
Message 6 of 8
(4,317 Views)

Hi,

 

Thank you for the reply. My first guess was that in case of arrays everything inside the VI should be closed in a loop and perhaps with varying number of inputs the loop could be avoided and this would improve simultaneous execution for multi-core CPUs.

 

--

Łukasz

0 Kudos
Message 7 of 8
(4,175 Views)

lukko wrote:

Thank you for the reply. My first guess was that in case of arrays everything inside the VI should be closed in a loop and perhaps with varying number of inputs the loop could be avoided and this would improve simultaneous execution for multi-core CPUs.


I would not base all conclusions on first guesses. 😮

 

Working with arrays is typically significantly more efficient (e.g. SIMD). We also have the parallel FOR loop where several iterations can be executed in parallel, thus fully supporting simultaneous execution.

 

How exactly are you expecting the code to look like if you have a variable number of connectors?

0 Kudos
Message 8 of 8
(4,171 Views)