From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

stacked sequence dynamically

Hello,

 

This is what I am trying to do (maybe stacked sequence is not a good option):

 

1. User enter no of iterations

2. Lets say user enters"2", then i want 2 different plots, 2 different indicators to be displayed

3. If the user enters "3", then i want 3 different plots, 3 different indicators to be displayed

3. Since i want 2 different indicators, I dont wanna use for loop. As for loop will give me an array and I can probably index the array, but then i would have to control the display as well and it is manageable if i have less iterations, however, if i have more iterations then it would be an issue

4. So I was thinking if I can dynamically change the number of sequence in stacked sequence then depending on no of iteration, I would have corresponding sequence with each sequence doing the same thing. The benefit being i dont have to do any post processing

 

Please let me know if this is the right thought process?

 

Thanks

0 Kudos
Message 1 of 5
(2,344 Views)

Dynamically changing the number of sequences in a stacked sequence is going to be very hard.

 

My thoughts on this would be why not simply use a 2 dimensional array with N+1 rows where N is the user input number, from there you could plot all of the relevant plots onto a single graph which I am assuming will be using the same axes, and use an array of boolean indicators for the indicators. 

 

This seems like it would be a lot simpler then trying to change the number of stacked sequence sequences but then again I am not entirely sure what it is that you want.

0 Kudos
Message 2 of 5
(2,335 Views)

Hi gyg,

 

when you want to process several defined steps in a program with also defined transistions between those steps you should use a state machine!

Best regards,
GerdW


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

You can create an array of clusters with a plot indicator in the cluster, then you can easily add/remove what's shown.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 5
(2,286 Views)

Use a FOR loop.  Wire the i straight into the case structure's selector.  Now you basically have your sequence structure, but you can choose how many iterations to have based on N.  The sequence structure must run straight through no matter what.

 

But a state machine is probably really what you want.


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 5 of 5
(2,269 Views)