LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i output multiple arrays from a case structure to create one larger array

I currently have a vi that has one hardware input that i needed to take a measurement then be moved and take a similar measurement at a different point.  To accomplish this i used a while loop inside a case structure.  The while loop takes the measurement  and finds the numbers i need while the case structure is changed per the new measurement location.  I want to take the data points i have created in each case and output them into a single table.  I assumed to do this the best way would be to get the data from each case into its own built array and build a larger array but I cant get the information out of the case structure so that it all inputs at different places.

 

thanks for your help

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

I'm not sure what you are wanting to do.  Only one case will execute.  The others won't produce any data.  So what are you trying to combine?  Unless you plan to put the code into a loop where a different case may execute on each loop iteration.  In that case you can use a shift register.  Initialize it with an empty array.  us build array to concatenate the case output with the shift register value.  This will build one large array of all of your case outputs.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 5
(2,707 Views)

Hi Ross,

 

attached you will find a solution for your table building problem.

 

I would suggest thinking about program design - having the same case content in several cases doesn't make sense. I also would not want my user to press several stop buttons depending on choosen measurement...

Best regards,
GerdW


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

Thank you so much for your help with that problem.  And, yes I agree I would of prefered it to have just been in a loop.  But, I couldn't think of another way to code it that would output into seperate numberical indicators and that the user would be able to pause between measurements to move to the new location.  The case structure become my default solution is there a better way for me to accomplish my goal without the redundent loop?

0 Kudos
Message 4 of 5
(2,690 Views)

Hi Ross,

 

what about using subVIs for the same functionality in the different cases?

Best regards,
GerdW


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