Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

problems with multi-function DAQ

I have a 6035E PCI card, and I am using it to acquire voltgae data from 4 channels (Ch 0,1,4,&5), through a while loop and using a muti AI express VI, and then writing the data to a file using write-file express VI. I also generate two sinewave functions and send them to two voltage output channels (a0, a1), to the same card, using A0-wave express vi, which does that continuously--the function is generated only once and simply gets played continuously by the NI card.  I am doing fatigue testing, and sending 2 function generator signals to two actuators, and acquiring sinewave signals of strain and load.
 
The problem that I have been facing is in the data acquisition AI:  some data is skipped at the beginning of each segment that is acquired.  For example, samples/channel= 1000, and sampling rate =1000 will result in data stored in the file as follows:  the  first 1000 points will show up with a time increment of 0.001, up to time=9.999 (does not show time=1.000), BUT the second segment will start at time = 1.067 INSTEAD of 1.001.  This time difference of 0.067 occurs at the beginning of every segment of AI, and so after let's say 1000 segments, the time error becomes significant.  MORE IMPORTANTLY, the data skipped between time of 1.000 and 1.067, for example is badly needed, for a sine wave of 1HZ.  In other words, it is not acceptable to have this skip in data.  I varied sampling rate and samples/channel and that made it worse.  I do use AI config and AI clear before the while loop and A0 config and AO clear as well.  Even without clearing the buffer I still get the problem.  I do not use triggers.
 
I tried to use DAQ assistant with continuous sampling but it gave me the same problem.
 
I do not know if this is a hardware limitation, or a PC clock accuracy, or simply not a correct programming.  I would appreciate any help. The program is attached
0 Kudos
Message 1 of 2
(2,943 Views)
 

Hello jeries,

It is possible that issue relates to your system performance and the limitation you are seeing is due to performing at the upper limit of your systems capabilities. To check on this, I would recommend that you open the Windows Task Manager and examine the CPU usage when the program is running. Does it appear to stay very high during execution? If the CPU usage is high, you may want to examine this KnowledgeBase which discusses high CPU usage with NI-DAQmx. You did not say what driver you are using, but based on the fact that you mentioned the DAQ Assistant I assumed you are using NI-DAQmx.

To help determine whether this issue is related to system performance or program structure, I would recommend that you build up from a simple program to determine when the issue starts to occur. You mention that the code was attached, but I do not see any attachments to your post. You may want to try again, attachments can be removed if you preview your post, so you may want to make sure that everything is attached and posted correctly. Other than looking at your code, I would recommend that you start with shipping examples that come with the driver to see the best programming practice. Specifically, I think the following order would help with this issue:

1. Run the Cont Acq&Graph Voltage-Int Clk.vi example from the NI Example Finder to collect 4 channels of data at the sample rate you require. You can find the NI Example Finder by going to Help>>Find Examples... in LabVIEW.

2. If the example from step 1 runs without missing any data, run the example called Cont Acq&Graph Voltage - Write Data to File (TDMS).vi. This example writes data to a TDMS file, which is the streaming format of NI's Technical Data Management (TDM) data model. To find out more about TDMS, you can view this tutorial online.

3. If the example from step 2 runs without missing any data, you can try to add the Write to Measurement File Express VI to the Cont Acq&Graph Voltage-Int Clk.vi example from step 1. The express VI has more overhead than the TDMS VIs, and will run slower than these low level VIs.

4. If the modified example mentioned in step 3 runs without missing any data, you can add the analog output express VIs to the same code to determine if that may be the reason for the missed samples.

If you continue to have problems, post back and let us know where exactly you're running into the issue.

 

Matt Anderson

Hardware Services Marketing Manager
National Instruments
0 Kudos
Message 2 of 2
(2,926 Views)