LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read array and proof for zero

I have a problem with an array:
I get an 1D-array with zero or values which reperesents failure codes. I want to proof this array to not equal zero. If there is a value, the programm has to stop an show a text with the failure number
But I don't know how to prof the array an set a flag. Is it possible with a FOR loop?
0 Kudos
Message 1 of 4
(2,769 Views)
Sebastian;

You can use the "Equal to 0?" function under the Comparison palette. It will generate an array of true/false values, true meaning that the corresponding value is equal to 0. Then you can "And" the array using the "And array elements" function, which is under the Boolean palette. If there is a value other than 0, the result will be "False".

I attached a vi that do the non-zero check.

Enrique
www.vartortech.com
Message 2 of 4
(2,769 Views)
Check out the "Search 1-D array" Function located on the array palette.

It will return a -1 if you search your array for a 0 and it is not found. If it was found, it will give you the index where it found the first.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 4
(2,769 Views)
jus a clue
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
Message 4 of 4
(2,769 Views)