LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NaN problems during Acquisition

Hi, I m having problems with acquiring values. NI Labview 7.1, NI Max 4.4.1, NI DAQmx 8.7.1 and 8.5 and NI USB-6221 are used. In the standalone PC, my application runs fine and acquire many testpoints for 50 plus tests but then it started producing NaN values. And at this point, there are no responses from the NI USB-6221's digital inputs, unlike the usual procedures or test. I checked NI MAX and found that it is still active and I reset it. Without booting PC, I started my program and it went fine again. This problem has occurred a few times after 50 or 10 plus tests. Why is this so? Is it my program, NI Max or NI USB 6221? Possible that my program can cause malfunctions to Ni USB-6221? 
0 Kudos
Message 1 of 5
(4,008 Views)

Is it possible that at some point your program is reading values faster than they are being acquired?  This would result in NaN.

 

Greg

v7.1
0 Kudos
Message 2 of 5
(3,982 Views)

Actually, I believe that the situation Greg describes results in a buffer underflow error message.

 

I've done a fair amount of work with the USB 6221 -- one of the programs I wrote for it runs continuously for days -- and have not seen this problem where the board appeared to be fine but had quit responding to the software.  So, I'd have to guess that the problem is somewhere in your code.  Do you have any kind of error handler that you check periodically?  Is "automatic error handling" enabled or disabled?  I ask these questions because perhaps the board IS throwing an error that you aren't catching.

 

Another question:  does your code display this behavior if you run it with a simulated board instead of the actual hardware?  Trying that would help to narrow down the source of the problem.

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

Diane, you're right.  I looked back at a program of mine where I had a NaN issue from DAQ read and saw that the NaN was actually showing up in the result of the mean VI where I was averaging non-existent data from the read VI.  Slowing the read fixed the problem, and that's all that I recalled and regurgitated here.

 

Whoops!

 

Greg

v7.1
0 Kudos
Message 4 of 5
(3,962 Views)

I suspect there's some error causing this problem. 

Try wiring error cluster through VIs.

If you've a loop, read error status, and stop a loop, if there's an error.

At the end of the loop, use error handle to show error dialog.

If you don't know how to do this, refer to DAQmx example in example finder.

Then, post back what's an error you found.

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