LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building with data from block diagram then using that array

I am trying to get LabView to record data points from a waveform input into an array that I can then search for a trigger. I have figured out how to store the data into an array from the block diagram but the array function can only be configure to have an input OR and output. Not both. 

 

I am trying to do this for 2 reasons. The first is set up a VI to show real time data on a chart but then also save that data once the execution is complete. The second is to search the array with the "fractional index or x" function to find the time that an event occurred. The raw data type that I am collecting is a waveform or dynamic data for both.

 

Any help would be greatly appreciated.

 

Thanks,

Jack

0 Kudos
Message 1 of 6
(2,357 Views)

Hi Jack,

 

Think of the data as being on the wire, not in an indicator or control. You can branch a wire as much as you want.

0 Kudos
Message 2 of 6
(2,355 Views)

Meaning what exactly? If I try putting the data directly into any type of analysis function it appears to record each data point as a 1x1 array and just overwrites the last value. 

 

Is there a specific way to store data in an array-like format that is kept in the LabView code has is formatted so as to allow analysis. Or is this an issues where I will need to save it offsite and then upload the data to analyze it?

 

Thanks,

Jack

0 Kudos
Message 3 of 6
(2,346 Views)

Your description isn't clear, but it sounds like you're looking for a local variable.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 6
(2,336 Views)

On the uploaded VI I am trying to pass data into the function on the right. I can collect this data as a waveform or 1D DBL array. 

 

I am attempting to record a time at which a voltage crosses a specific point and then do calculations with that time variable. If there is a better way of doing this I would be open to that as well. 

0 Kudos
Message 5 of 6
(2,300 Views)

You have a couple problems. The obvious one, which won't let you run your code, is that you've wired a 2D array to a 1D array. The other thing is that you have told your while loop to never stop, so anything waiting for data from that loop will NEVER run. Also, for data collection you want to setup the task before the loop, read the data in the loop, and cleanup the task after the loop.

 

To get a 1D array coming out of your loop, you can wire the data out. Right click the new terminal and select "tunnel mode > concatenating". But, I'm not sure this is really what you want, and you will have to address the other problems as well.

0 Kudos
Message 6 of 6
(2,287 Views)