LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create 2d array from 1d array

Solved!
Go to solution

Hi everyone,

I have code to pull a spectrum which is a 1D array from a USB connected instrument but I would like it to run the data collection many times and output the data each time to a 2D array that it builds over the run. I am showing my code below, I figured out how I can press a button "start acquisition 2" which will loop the data collection portion "times run". The problem is how to build the 2D array, If this was python or something I'd just initialize the array outside the loop and then just append the data each time but I can't quite get it to work that way here. I initialize the array with 0s outside the loop and carry the loop in but each time the while loop runs it pulls the blank array instead of continuing to build itself. 

 

What is the preferred method of building an array for a method like this? I am using version 8.6 (I know a little old but I don't want to break the compatibility of the spectrometer)

 

Thanks so much!

0 Kudos
Message 1 of 4
(3,495 Views)

The VI in case in helps, sorry for the broken modules!

0 Kudos
Message 2 of 4
(3,478 Views)
Solution
Accepted by topic author stephen.jensen

Perhaps a First Call? and a Select node.  Or case structure with a boolean that resets after the first loop:

Example_VI.png

Message 3 of 4
(3,476 Views)

This totally worked, thank you so much for your help!

0 Kudos
Message 4 of 4
(3,452 Views)