LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why don't i get any value reading from index array

Hi, 

I trying to build my first VI and struckleíng with getting a numeral value from my reading, just give NaN as output, but my chart works fine. 

What am I doing wrong?

Download All
0 Kudos
Message 1 of 4
(1,760 Views)

Until give index value to index array it'll give output as 0th index values. Check row0 whether its having values or not.

0 Kudos
Message 2 of 4
(1,751 Views)

Hi M.,

 

you get a mean of NaN when the "subarray" is empty. Simple as that.

 

  • When reading "N chan N samples" from DAQMxRead you should provide a number of samples to read.
  • You should check the error out of DAQmxRead - already inside the loop.
  • Notice that error number found in your "Selftest" list? It has a meaning, explained easily by using an error indicator and its context menu. Read that explanation…
  • Why are there 4 DAQmx channel controls? Why not use just one control and select several channels with it?

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 4
(1,737 Views)

Your chart must have some old data. You need to tell the DAQmx Read how many data points that you want to read. Currently you are getting an empty array - and that's why you're getting the NaN.

 

Edited to note that GerdW beat me to the punch.

0 Kudos
Message 4 of 4
(1,728 Views)