LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid NaN

Hey guys,
 
I have a "little" big problem: Data acquisition in LabView!
I have to acquire data from a BNC 2090 fed by a generator. I use a PCI 6221card.
The VI Express (DAQ assistant) return a NaN (not a number code) that I have converted. The "error" is still there.
How could I solve the problem in order to have numerical values instead of this "NaN"? (see the file below! Labview 7.1)
 
The next problem is, I would like to transpose a 3D-array. is it possible and how?
I founded no solution with the 2D-array transposer!
 
thanks a lot for your help guys.
 
Lauvia.
 
PS: I express myself in german and french. I hope my english is not to bad!
 
0 Kudos
Message 1 of 37
(5,304 Views)
Hello,
 
Sorry but I don't have labview 7.1. So I can't post my example.
 
But let's see if I can help you only with some words. Using the numbers that you have on the code diagram:
 
1 - click twice and change "2D array of scalars - rows are channels"
 
 
Delete the constant "8" of the "Loop Count". And turn on the Autoindex of the input array. Like in the next picture.
 
Now, each for iteration, it's  a channel. The "array size" should be 1K now. If not, it's a little problem in the array.
 
Do you really really need the 3D array? In 3 years working in this aread, I never leave a solution with that size. Try to simplify it!
 
If you still want more help. Try to give me the 2D array connected to the "FOR" cycle as an array constant.


Message Edited by Jorge Amaral on 05-02-2008 06:53 AM
Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 2 of 37
(5,278 Views)
Lauvia,
At what point in your Vi are you getting the NAN?  Right out of the DAQ Assistant, after the conversion, or elsewhere?
Jim

LV 2020
0 Kudos
Message 3 of 37
(5,268 Views)
Hey,
thanks for your prompt message.
This is the new graphic!
 
I tried it already but the auto-indexing solution does not work. In this case the program returns no value at all
The major problem ist the conversion at point (1.). If the  program still returns NaN at node (1.)  it's normal that  the size-array (node 2) no value returns. The return value here ist zero.
If we can convert node 1 successfully from dynamic data to numerical I think the problem will be solved. The conversion VI seems no to work!
 
best regards
 
0 Kudos
Message 4 of 37
(5,259 Views)

Hey Imtis,

thanks for the mail.

I have used  probes at point (1.) directly after the DAQ assistant, point (2.) next to the conversion VI (dynamic to numerical). Up to here  Probe does not return  any value. Right after the For-cycle and at point (5.) probe returns NaN. This means the acquisition data are missed! (see the graphic below! Labview 7.1)

Thanks for helping me Smiley Happy

 

Lauvia

0 Kudos
Message 5 of 37
(5,253 Views)
Hi Lauvia,
I don't use DAQ Assistant, but if I understand what you are doing, it is returning data arrays for 8 channels.  If this is correct, then Jorge was correct in his post.  Also, if this is correct, could you not replace the sum, array size, and divide with a mean function?  Try placing probes on each of the wires in the data path, and take a screen capture to help us see what is happening, since we don't have your hardware.
Jim

LV 2020
0 Kudos
Message 6 of 37
(5,244 Views)
If you areen't getting any data from the DAQ Assistant, then it's probably generating an error. Do you have automatic error handling turned off? If you do, either turn it on or wire up the error out cluster of the DAQ Assistant and see what is being returned.
0 Kudos
Message 7 of 37
(5,238 Views)
Hi Guys,
 
Jorge, Jim, Dennis, ImtisThanks for being kept in touch.
I did as you tell me for a couple of days but the results are still the same. so I kept thinking in the same way!
I've split the DAQ main wire in 8 channels (see file neu_2_2_3.Vi).
 
So you can see the joined files (neu_2_2_3_3.jpg  and neu_2_2_3_4.jpg) I was expecting numerical values returned by the upper array.
I've replaced the array size with the constant 1000 (number of samples) and the NaN (occurs because of the division by 0, array size doesn't returns a "0" value ) has disapeared. I think the DAQ assistant doesn't work at all. (Files neu_2_2_3_5.jpg  and neu_2_2_3_6.jpg).
With one "for-cycle" I can read the 8 channels at once!  I've tested the circuit this weekend at hom under the virtual card an this was ok. Since I've been working this morning in the office seems that not to be the case any more, neither with the virtual card PCI 6221 nor with the real hardware card. What ist the problem?
guy, you can do by yourself, you have a virtual PCI 6221 card on your pc. (DAQmx, M-serie). Tell me if this works!
Download All
0 Kudos
Message 8 of 37
(5,187 Views)
the rest of the files:
 
Download All
0 Kudos
Message 9 of 37
(5,187 Views)
Hi Lauvia,
this works for me. I have a simulated PCI 6221.
Mike
0 Kudos
Message 10 of 37
(5,167 Views)