LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Export Waveforms to Spreadsheet File Function using Continuous Acquisition

I am using a cDAQ-9178 chassis with an NI 9236 strain gauge module to collect analog strain inputs from 3 gauges. I want to sample at 100 Hz but this strain gauge module has a minimum sampling frequency of 794 S/s, so instead I am sampling at 1 kHz and decimating my data to 100 Hz. I currently have a program that works well for what I want to do (attached as Strain_Finite.vi), except it uses finite acquisition. I would prefer to use continuous acquisition so I can see my strain-time curve develop during my experiment. 

 

The problem I am having is that once I switch to a program that uses continuous acquisition (attached as Strain_Continuous.vi), my Export Waveforms to Spreadsheet File function only records the first data point in the spreadsheet. I need help configuring my Export Waveforms to Spreadsheet File function to record all my data points. I suspect the issue stems from having the For loop inside the While loop but I'm not entirely sure. Any suggestions for this issue would be greatly appreciated!

 

I previously submitted a message post asking for help on how to use the Export Waveforms to Spreadsheet File function in a continuous acquisition configuration, linked below. I am using the Export Waveforms to Spreadsheet File function as opposed to the Write to Spreadsheet File function to write my data to a spreadsheet since this allows me to have data headers and a time column.

http://forums.ni.com/t5/LabVIEW/Write-Continuous-Analog-Strain-Inputs-to-Spreadsheet-with/td-p/32754...

 

Thank you,

 

Alberto M.

 

Download All
0 Kudos
Message 1 of 4
(3,158 Views)

Two comments.  First, I usually wire the number of samples I want to collect into the DAQmx Read function.  Second, I don't have much experience with the Export Waveforms to Spreadsheet function, but if timing is an (or even it if is not), you might consider using a Producer/Consumer pattern, where you put your Strain Data on a Queue, send it to the Consumer loop where it is dequeued and written to the Spreadsheet.

 

Another thing you might try is to simply simulate your situation.  Copy this VI, remove the DAQmx stuff, and create a clocked loop inside the While Loop that generates N points at 1 KHz (so if you are generating 1000 points at a time, you'd generate 1000 points per second) (incidentally, just how many points are you generating with your Continuous Sampling?).  You'd pass that data to your Decimator, then to your Spreadsheet.  This way you can easily test "everything but the DAQmx" and make sure that code, at least, is OK ...

 

Bob Schor  

0 Kudos
Message 2 of 4
(3,138 Views)

martiaa3 a écrit :

I am using a cDAQ-9178 chassis with an NI 9236 strain gauge module to collect analog strain inputs from 3 gauges. I want to sample at 100 Hz but this strain gauge module has a minimum sampling frequency of 794 S/s, so instead I am sampling at 1 kHz and decimating my data to 100 Hz. I currently have a program that works well for what I want to do (attached as Strain_Finite.vi), except it uses finite acquisition. I would prefer to use continuous acquisition so I can see my strain-time curve develop during my experiment. 

  


You could use Average DC-RMS.vi function from the Waveforms Measurements VIs palette, this vi accept an array of waveform. Set sample to read to 10 on the DAQmx Read vi. Instead of decimating you will average the 10 reading and the output waveforms will have a dt of 0.001. You might have to tweek some parameters of the Average function, you'll have to try.

 

strain continuous.png

 

Ben64

Message 3 of 4
(3,119 Views)

Thanks for the reply! I've never used the Average DC-RMS.vi function before but I'll give it a try.

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