Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog values got stuck when reading from DAQmx

Hello,

I am using NI USB-6229 to read analog inputs. Sample mode is set to continuous samples with onboard clock at 8000Hz.
I read 10 samples from 30 channels at a time (40ms steps). After several hours of correct function the analog values acquired from DAQmx Read VI stop changing. The VI indicates no error or warning. It just returns the same values from now on.
DAQmx Read property AvailSampPerChan tells 10 samples are available before the DAQmx Read is called.
If the task is closed and reopened the reading is correct again.
Alongside the AI operation the digital lines are set and read without problems.

 

Thanks.

 

Z.P.

 

0 Kudos
Message 1 of 5
(3,707 Views)

Hey ZdenekP!

 

Could you please tell me what version of LabVIEW you use?

And some other questions:

 

  • What type of signal do you acquire?
  • What is the frequency of the source (or DC)?
  • Could you please share your code with me?


I tried to replicate the error, but seemingly that doesn't behave like yours. Maybe we need to reconsider the timing of the reading process.

For example: DAQmx Read should be configured for Analog 1D Waveform, NChan, NSamp. Your sample rate will be (8000/30) 267 Hz/channel, to read only 10 samples per channel would be questionable, don't you think? Please, help me with sharing details!

 

Have a nice day!

Matyas

0 Kudos
Message 2 of 5
(3,672 Views)

Hi Matyas, 

The measuring is running on W2k, NIDAQmx 9.0 and LabVIEW 8.5. Besides USB-6229 (used 30 AI and 80 DI) there is also connected USB-6008 (used 4 DO) to USB 1.1 port!

I've tried to simulate the problem on another machine with WinXP and USB 2.0 but it didn't occur. But there was only attached USB-6229 and I read only 8 DI lines. During weekend I will try to connect this machine to the real application.

2/3ds of analog signals is DC voltage 5V +/- 1V, the rest is SMPS voltage with RMS 0-6V.

DI lines are read at the same speed as AI lines.

The pictures show how DAQmx is opened and cyclically read.

Thanks for your effort!

Zdenek

  
Download All
0 Kudos
Message 3 of 5
(3,653 Views)

Hi Zdenek,

 

I have a few questions:

 

  • I need to understand the timing of your loop. It may have the strongest influence on you CPU. Could you please, send a picture with your loop visible?

 

  • I don't understand why you use 0 timeout with DAQmx Read? It's pretty dangerous: what is it supposed to mean? Gives error messages every time it's waiting for a sample >> samples cannot arrive in 0 time.

 

  • Are you sure you need to acquire 8000 samples/s from 30 DC signals? You might need to decrease the sample rate in order to spare resources for other tasks.

  • You might think of using producer/consumer architecture for acquisition and analysis (averages). It can help you further optimizing your code without losing data >> FIFO. You can find more in LabVIEW >> New... >> VI from Template >> Producer/Consumer


I wish you success... 🙂

Matyas

0 Kudos
Message 4 of 5
(3,634 Views)
Hello Matyas,As I said I tried to run the application on another machine and it works fine. I am not sure what helped more – faster computer or USB2.0. Anyway I wonder why I did not get any error message from DAQmx Read on the old machine. The data should not be destroyed after DAQmx Read because I logged them to a file just after the read. To your questions.My intention is to create more or less general test application to check the functionality of our boards. The application has two main parts. One (called GBI) is writing and reading data to DAQs and other interfaces the second handles a test script working on 100ms steps. It is like producer/consumer architecture as you suggested.I do not want GBI to stay in IO timeouts for some tasks. The shortest AI measurement timeout is 1s which is too long. I will rather have sometimes no data (but they are usually in a buffer) than get data too late for the 100ms step.I will not always use the application for measuring DC signals and I want to know the capability of this concept.I attached the GBI loop but I am not sure if it is helpful without description. I just note that DAQ is read by GBI|read VI. Thanks for all your advices! 

Zdenek

 

0 Kudos
Message 5 of 5
(3,599 Views)