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: 

Dynamically change number of user prompt

Solved!
Go to solution

Dear All,

I was wondering whether we can do something more dynamic in Labview. I am quite new to LV, working on a project. My task is to make a test setup which will grow dynamically upon user request. whole scenario can be explained here.

prompt user.jpg
Get input from user 'how many cycles do you want'?, upon user input number of prompt user dialogue boxes will grow. Let's say user enter 4, then 4 prompt user dialogue boxes should be opened one by one (which further contains 4-5 inputs), Each with different values (Which will further be used in another program).
I know use prompt user (And further making it typedef if needed). But don't know how we can expand or reduce number of dialogue boxes upon user request.

I hope you'll understand the problem.

It would be really appreciated if you could suggest or help me with this.

Thanks

Khan.

0 Kudos
Message 1 of 14
(3,625 Views)

Hi Khan,

 

open the LabVIEW options as an example!

It's made of a listbox and a subpanel container. Each time you select an option topic a different VI is presented in this subpanel container…

 

(When you do the same "in each cycle" you should think about using arrays!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 14
(3,611 Views)

Are these cycles supposed to run in parallel or in series?  If in series, the just use a FOR loop (set N to the number of cycles) and use an autoindexing output tunnel with your configurations for each cycle to store them in an array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 14
(3,597 Views)

Dear GerdW and crossrulz,

That's exactly i need to build which GerdW suggested but could not figure out how? I tried using ideas from both of you and end up with attached VI. But I could not save these values for further use. These individual prompt user values will be further used in a seperate VI as set point of serially connected devices and some delay elements. And yes, the cycles will run in series (One VI will get these inputs serially after one cycle will be finished). I am not sure i could explain it correctly or not. Here i tried to explain in a diagram, hope you will understand.

prompt user problem.jpg

Thanks for help and support.

 

Khan.

0 Kudos
Message 4 of 14
(3,572 Views)
Solution
Accepted by topic author zahidkjatoi

Bundle the data inside of the loop.  The output should be an array of clusters.  Now when you go to run the tests, you just use a FOR loop with an autoindexing input tunnel.  Inside that loop, you just unbundle the data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 14
(3,564 Views)

Dear Crossrulz,

 

Can you attached the VI (in LV2014 format) so that i can better look into it.

 

Thanks

 

Khan.

0 Kudos
Message 6 of 14
(3,557 Views)

I already threw that code away.  It is quite simple: Bundle By Name inside of the FOR loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 14
(3,536 Views)

Dear Crossrulz,

 

I tried to implement it but got one error. I am new to LV that is why don't know much of the things. Can you guide me why this happening?

error.JPG

 

Thankyou so much.

 

Khan.

Download All
0 Kudos
Message 8 of 14
(3,504 Views)
output cluster should be array.
-If you click on Broken wire and Ctrl+H you should be able to read why it is throwing error.
Thanks
uday
0 Kudos
Message 9 of 14
(3,497 Views)

Dear Udka,

Yes i can see error but don't know how to fix this. I tried to put array elements inside it but it does not work. Can you please elaborate.

 

Thanks

Message 10 of 14
(3,493 Views)