LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

count

Hello every1,
 
am trying to build a program which reads a total of 52 Force Sensing Resistors FSR and perform a number of calculations on these readings. My initial program is just a prototype, which means the readings of the sensors are given. I inserted 52 constants into the program with different numbers. I would like to know if there's a command in labview or a program which counts the total number of the constants which have a reading > 0.
 
I would really appreciate your help. Thank you
 
Safeya
0 Kudos
Message 1 of 5
(3,154 Views)
Well, I assume for my sanity that you have an array of 52 values and want to count how many are >0.
 
 
(If you array can be larger than 2^15, you need ot insert a "to-I32" before talking the sum to prevent incorrect results. The code show is fine for small arrays with e.g. 52 values).
 
 


Message Edited by altenbach on 05-18-2008 03:04 PM
0 Kudos
Message 2 of 5
(3,151 Views)
altenbach
Thanks a lot, that was very helpful and it worked very well. and Yes i have put them 5 arrays in which the 52 sensors are divided 🙂
 
However, I have another question, is there a way to count the sensors up to the last one before they all read zero. For example, if the sensors start reading 3 4 0.2 4 0 1 6 0 0 0 0 ...
I want the program to count all the sensors up to the sensor which reads (6) although some of them read zero before that.
 
 
🙂
0 Kudos
Message 3 of 5
(3,123 Views)
Use "search array" to find the index of the first 6, use that index to take the array subset before further precessing. (I assuming that we are dealing with integers. For floating point arrays this will not work well).
0 Kudos
Message 4 of 5
(3,081 Views)
thanx a lot ,, this was really helpful and it worked perfectly,, 🙂
0 Kudos
Message 5 of 5
(3,049 Views)