05-18-2018 01:24 PM
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
05-18-2018 01:27 PM - edited 05-18-2018 01:39 PM
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.
05-18-2018 01:43 PM
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
05-18-2018 01:55 PM
Your description isn't clear, but it sounds like you're looking for a local variable.
05-18-2018 02:48 PM
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.
05-18-2018 04:24 PM
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.