LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need "time" 1D array from DAQ assistant in DAQmx

I am collecting voltage change over a six-second time from six wheatstone bridges.  The V.I. uses the "DAQ assistant" sub-vi to collect the voltage data at 1200 samples per second.  The data wire is a thick, dark blue color, which apparently indicates that it's a "dynamic data."  I can graph the data, in which case it shows voltage vs. time.  I can also convert this "dynamic data wire" into a one-dimensional array wire.  Unfortunately I then lose the time information.

Basically I want to extract the time information from the "dynamic data wire."  Or if that's not possible, I want to create a one-dimensional array where each element simply increases by one throughout the array.  Any ideas?
0 Kudos
Message 1 of 15
(6,905 Views)
Double click on the "Convert from Dynamic Data" that is changing the dynamic data into the 1D array and select Single Waveform from the list. Note that if you want a separate signal for each of the bridges, you should select 1D Array of Waveform.  A waveform is a specialized cluster that includes the data, start time, and time increment.
0 Kudos
Message 2 of 15
(6,899 Views)

Either array is simple. You first need to select waveform type from Convert From Dynamic Data. You can then use the Get Wavefrom Components to get the dt. Creating an array of times or increment by one array is just a matter of a for loop.

Message Edited by Dennis Knutson on 08-03-2006 03:31 PM

Message 3 of 15
(6,901 Views)
I love waveforms.  There are so many different ways to get the same data from them. Robot Very Happy



"XY pairs" is a 1D array of clusters of X and Y.

Message Edited by jasonhill on 08-03-2006 04:39 PM

Message 4 of 15
(6,892 Views)
Thanks for the recommendation!  I changed the converter so it converts the dynamic data stream into a waveform wire, which is now a cross-hatched brownish yellow color.  So I think it's definitely a waveform wire.  But I still can't extract the time information - I can only get t0, which is the trigger time (not sure what that means), dt, which is the time between data points, and Y, which seems to be a 1D array of the voltage.  I can imagine using dt to create a 1D array of increasing time increments, but I'm not sure how.  A "For loop" appears to be my best bet here.  Any recommendations for programming what goes inside it?

Message Edited by Lammers on 08-03-2006 04:54 PM

0 Kudos
Message 5 of 15
(6,890 Views)
Oh, sorry, I posted my reply before I saw the second and third reply to my original question.  I'll give this a try.  Thank you much!
0 Kudos
Message 6 of 15
(6,885 Views)
Dennis, thanks for the illustrated recommendation - it worked perfectly.  Now I need to figure out exactly how it works... I hate to just copy someone's programming without knowing why.Smiley Very Happy
0 Kudos
Message 7 of 15
(6,879 Views)
It's pretty simpe and if you look inside the VIs that Jason mentioned, you'll see something similar done. The Get Waveform Components is expandable and you can also select which component from the waveform cluster you want. It's just like the Unbundle By Name function. The for loop with a shift register and the other if pretty basic LabVIEW programmin. If you wire an array to a for loop, by default, it will auto-index the array input and execute for exactly the array count. I didn't use any of the Y values inside the for loop. It was just to determine the number of times the for loop should iterate. The output of anything in a for loop is automatically auto-indexed when you wire it out. The array creation is therefore automatic.
0 Kudos
Message 8 of 15
(6,872 Views)

Gr8 stuff :-). Worked for me.

0 Kudos
Message 9 of 15
(5,471 Views)

Hey ! 

I am aware I arrive after the battle, but I have a small question going towards this direction ! 

I had the same issue as op, and solved it pretty much the same way as you ( For loop picking dt Y times bla bla bla).

Now I am in trouble for something basic ...

On one side I have the mean calculated from one channel of Data of my DAQ, and the other side this time array builded.

I just want to plot the mean VS this time extracted, and I can not achieve that ...

I tried to build another waveform from it, or concatenate it ... No way to solve that issue ...

Do you guys have an idea ? 

PS : in other words, from my DAQ I get 2 channels of Data. I made the soustraction of one from the other, generated the mean of the result either from Mean.vi or Statistics->Mean vi and try to plot this VS the time data extracted exactly the way you guys explainned here

Thanks !

0 Kudos
Message 10 of 15
(5,073 Views)