LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Missing Samples in NI 9219

Highlighted

Missing Samples in NI 9219

I created following VI to measure sensor (own developed) output (in voltage), the excitation voltage given to my sensor and temperature at the same time to compare it with my sensor. I m using cDAQ 9172 and module NI 9219. I need measurement in micro seconds. So, I use no.s of samples as 100K and sample rate as 100k. But I m missing samples after every 100K samples. I checked this error for different no.s of samples and found that, I miss samples after every cycle (no.s of samples) i.e. if I give 10k no.s of samples then I miss it after every 10K samples. If time at 100000 sample is 0.99999 seconds then I get directly 2.07751 seconds at 100001 sample. (I attached screenshot for this.) Please see this and give me suggestion what should I do.

0 Kudos
Message 1 of 22
(684 Views)

Re: Missing Samples in NI 9219

The DAQ assistant, when configured for N samples, is going to run until it acquires N samples and then it stops.  Then the loop has to process the samples thru the formula and write them to a file and meanwhile, the DAQ assistant is not doing anything. Also the device is not doing anything because the DAQ assistant told it to stop.  It's not writing values to a buffer or anything.  So depending on how long it takes to write those values to a file, there will be a gap in your data. 

aputman
LabVIEW 2017
LabVIEW Programming
Message 2 of 22
(654 Views)

Re: Missing Samples in NI 9219

I also tried with continuous samples but same problem. If I remove all things and connect DAQ Assist directly to Write to Measure File, then will I get all readings ? Or any improvement in my VI to get all readings. 

0 Kudos
Message 3 of 22
(634 Views)

Re: Missing Samples in NI 9219

Hi Morya,

 

Or any improvement in my VI to get all readings. 

Get rid of all those ExpressVIs and use simple "plain" functions.

It's really easy!

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 4 of 22
(631 Views)

Re: Missing Samples in NI 9219

Thank you sir. Very soon I will learn this and create for my project. I will upload here. But I have one doubt. I have to use 3 channels of NI 9219 at the same time. Then what should I do ? If you can upload any example VI for this then it will help me lot. Thanks again.

0 Kudos
Message 5 of 22
(625 Views)

Re: Missing Samples in NI 9219

Hi Morya,

 

LabVIEW also comes with a huge library of example VIs.

There are also examples explaining how to read more than one channel from a DAQmx device…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

Message 6 of 22
(620 Views)

Re: Missing Samples in NI 9219

Thank you so much sir. I created one VI using examples given in LabVIEW. Still not sure it will work or not. But I have one doubt. I want to save data in .lvm file. All data should be saved in one file. When I run again that VI, readings should not overwrite old file. It should take next available file name. Is it possible in this VI ?  I also want to show voltage and temperature in different graphs. How to do this ?. Still this VI is not final. I want to improve and still learning.

0 Kudos
Message 7 of 22
(610 Views)

Re: Missing Samples in NI 9219

Hello sir,

Please check my VI. I want to add time column in saved data. How to do that ? Please see my last reply also.

0 Kudos
Message 8 of 22
(576 Views)

Re: Missing Samples in NI 9219

Hi Morya,

 

When I run again that VI, readings should not overwrite old file.

Use a different filename, when you don't want to iverwrite old data…

 

I want to add time column in saved data.

You save your waveform data in a TDMS file, so there already is timing information included.

When you need a different format of the saved data file you need to implement your own data saving routine which doesn't depend in the DAQmx-builtin TDMS saving…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 9 of 22
(573 Views)

Re: Missing Samples in NI 9219

I want time column along with all readings in TDMS file. It means, it should show every fraction of time with respect to its readings. Because at last I have to combine all data and have to generate graph of resistance(which I will get from supply voltage and Wheatstone bridge output voltage)  v/s time. For example, if I run VI for 5 minute, then using all saved data I should able to generate graph of Resistance v/s Time.  I attached one file of my previous readings (I deleted samples after 251 seconds, as file is too large). I want time column like (this is example only), 0.0, 0.000005,0.000010,0.000015, etc.

0 Kudos
Message 10 of 22
(564 Views)