From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delay during acquisition and writing (but no missed point)

I am using NI DAQ USB 6259 with Labview 7.1.

To measure an analog signal ( a voltage), I designed the attached VI. It gives me a problem: for acquisition rate greater than 100Hz, the .dat file I obtain after a measurement contains only a few of the points I expect.

To explain it better, if I perform a 5 seconds measurement at 1000Hz, I expect to find in the file 5000 points recorded, instead, actually there are only about 600.

They are (I suppose) the first ones for as the time stamp is reguler and progressive, without "holes".

The task I use is set as Continuous acquisition and the rate and buffer size I see in MAX are different from the one I specify in the VI (but the latter should overwrite).

The buffer size I chose is 100000.


LAST remark: if I put the writing express VI out of the while cycle, sometimes it works, sometimes not... so I left it inside.

Can somebody spot the reason of my problem?

Thanks,
Roberto Rodio

0 Kudos
Message 1 of 5
(2,364 Views)
Hi,

First I guess your post is a little misleading. Are you tring to measure 5000 samples from one channel or 1 sample from many channels? (your DAQmx Read VI is set for N channel 1 sample)

I am going to assume you are going to use Single Channel Multiple Samples instance of the DAQmx Read VI instead. Here all you need to do is wire the Buffer Size input of your DAQmx Timing VI to the Number of Samples Per Channel input to the DAQmx Read VI. This will ensure that everytime the function reads from your DAQ card, it will read in the correct number of samples.

Please let me know how this goes.


Abhinav T.
Applications Engineering
National Instruments India

LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
Measurement Fundamentals
0 Kudos
Message 2 of 5
(2,360 Views)
I am sorry that my question was incomplete; My task includes 2 channel and I wish to read them CONTINUOSLY at a rate that is, In the case of my attempt, 1kHz.

Does your suggestion still applies? I think not, the terminal you mentioned are both inputs.

Thank you,
roberto rodio
0 Kudos
Message 3 of 5
(2,352 Views)
Hi Roberto,

What I would suggest you do is instead of starting with DAQmx code from scratch is to use one of the example programs instead. In LabVIEW if you go to Help >> Find Examples >> Hardware Input and Output >> NI-DAQmx >> Analog Measurements >> Voltage >> Cont Acq&Graph Voltage-Int Clk.vi

This is the most basic continuous multi channel acquisition VI. From here you should be able to put the Write to Measurement File express VI in the loop and setting the option to append to file if the file exists. Once you place this in your loop it log your data without any problems.

Below is the block diagram I came up with. You should be able to use the following code to log all the data you read from 2 channels.



Please let me know if this works.

Message Edited by Abhinav T on 07-17-2007 07:14 AM

Abhinav T.
Applications Engineering
National Instruments India

LabVIEW Introduction Course - Six Hours
Getting Started with NI-DAQmx
Measurement Fundamentals
0 Kudos
Message 4 of 5
(2,350 Views)
It seems to work quite well!


I thank you very much!

Roberto
0 Kudos
Message 5 of 5
(2,340 Views)