LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

blanks in array data using formula node

Solved!
Go to solution

I have 2 1-d arrays of data going into a loop. Inside the loop, there is a formula node that combines the numbers from the 2 arrays and does some math to them. If the result of the calculation is 0, that means the value is invalid. Anything other than 0 is a good value. The result of the calculation comes out of the formula node, and leaves the loop becoming a 1-d array. Then my array gets saved to a spreadsheet. The 0's really screw up my graphs, and I would like to have them just be blanks instead. I tried using NaN's instead of 0's, but that also screws up my graphs. How can I put blanks into the output array instead of 0's?

0 Kudos
Message 1 of 6
(2,760 Views)

It is better if you post your VI along with some typical data.  It is hard to diagnose a problem from a written description of the VI.

 

It may be that you need a test for zero and then place the elements in the array only if the data is non-zero.

 

Lynn

0 Kudos
Message 2 of 6
(2,754 Views)

Perhaps one way to do it would be to leave the zeros in the array and change the color to transparent if the value is zero?  

I was able to modify the below example to only output 1/2 a sine doing this Smiley Tongue

http://zone.ni.com/devzone/cda/epd/p/id/4467

0 Kudos
Message 3 of 6
(2,748 Views)

Thanks for the reply. Here is the VI. This VI is called by another bigger program that gives it the input array and saves the output array to a spreadsheet. Right now it is putting in NaN's which mess up the graphs in excel when I look at the data later. The input array is just a big 2-d (1920x25)array in which all numbers are from 0-255. I would like to just have gaps in the data, like I said before. This way, I can see on my graph where the points are missing from. That's why I not just selectively adding to the array.

0 Kudos
Message 4 of 6
(2,738 Views)
Solution
Accepted by topic author drhoff

It seems that your real problem is defining what will make Excel leave gaps.  For LV graphs NaNs do what you want.

 

You might also consider making the output array a string array. There may be string values (NUL?) which will cause Excel to skip.

 

Lynn

Message 5 of 6
(2,727 Views)

I think you are right. I was hoping there would be a better solution than converting it to strings to use NUL. Thanks.

0 Kudos
Message 6 of 6
(2,716 Views)