LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

working with DAQmx data

This VI collects analog voltage over time.  I am currently using 1 Channel and N Samples.  Using the Write to Measurement File.vi, I can view the .lvm data nicely in Excel, with time in the first column and voltage in the second column.  However I would like the data in an array, with time and voltage, that I can work with and not just in .lvm format, like wiring it to the Write to Spreadsheet.vi.  When I wire the data from the DAQmx read VI to Write to Spreadsheet.vi, only one voltage value is listed.  I have tried the Build Array function but it just lists voltages across the first row (I want them in 2 columns), and it doesn't list all of them either.
0 Kudos
Message 1 of 7
(3,220 Views)

Hey,

 

What you get from your DAQmxRead.vi is just a DBL Array of the measurement values, there is no timestamp included, so would need to build this additional column bei yourself. Another way would be to change the datatype of DAQmxRead's output to "waveform", there you get the T0 as timestamp and the dt as DBL value, which you can use again to build your time column.

 

Hope this helps,

Christian

0 Kudos
Message 2 of 7
(3,208 Views)
Hi, Daqmx gives only the channel data and not the time stamp. Its the LVM file driver that generates the time stamp based on the input data. Just generate the time stamp and append it to output of the Daqmx and write a spreadsheet string to an ASCII file. Post back for queries.
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Message 3 of 7
(3,205 Views)

How would I go about building a time stamp column and appending it to the output of the DAQmx?  I tried the tick count (ms) function and the elapsed time function, then built an array, but neither did what I wanted.

 

I also changed the output to waveform and used the Export Waveforms to Spreadsheet File.vi, but I don't like the Date/Time stamp.  I just want a millisecond count, starting at zero.

0 Kudos
Message 4 of 7
(3,187 Views)

Hey,

 

With your VI you could do something like this:

 



blockdiagram
0 Kudos
Message 5 of 7
(3,162 Views)

Thanks so much for the suggestion and screenshot, but I tried it and it doesn't quite work... what's the reciprocal and addition for?

0 Kudos
Message 6 of 7
(3,095 Views)

The reciprocal is to get the reciprocal of the SampleClock, which is the time between Samples also known as Sample Intervall dt.

The Add is to fill the array up with this dt's to get your time channel.

 

So what exactly did not work?

 

 

Christian

0 Kudos
Message 7 of 7
(3,081 Views)