LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting on sensors

Hi collin,

 


@collin_g_10 wrote:

But what it the best way to count the ammount of times that the blade will pass through.


You "just" count how often the voltage rises above a certain limit…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 11 of 27
(724 Views)

Would you please post your code so you can get help? 

0 Kudos
Message 12 of 27
(710 Views)

Yeah I am not sure how to create a code count everytime that is hits the voltage of 10.5557 but here is the code I have so far. 

0 Kudos
Message 13 of 27
(698 Views)

Hey my friend,

I got you. 

See the attached code. For more questions or help request, feel free to ask. People would be glad to help you.

 

GRCK5000

0 Kudos
Message 14 of 27
(692 Views)

@collin_g_10 Test the code above ☝️ and let me know if it works for you. If not, we will look further what's going on.

0 Kudos
Message 15 of 27
(683 Views)

So I had used your code that you had given to me, The program is not reading the propeller fast enough. Is that something that is happening because of the program, or do you not think that the sensors can read the propeller fast enough

0 Kudos
Message 16 of 27
(618 Views)

@collin_g_10 wrote:

So I had used your code that you had given to me, The program is not reading the propeller fast enough. Is that something that is happening because of the program, or do you not think that the sensors can read the propeller fast enough


 

Integrate your working module in the attached VI and Map the output of the data acquisition to the comparator.

Whenever it meets the Values it gets incremented else it maintains the same count 

CountValues.png

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 17 of 27
(611 Views)

Stay away from expressed VI. It has built-in configuration that can affect your program performance. Use Daqmx VIs. 

0 Kudos
Message 18 of 27
(607 Views)

@PalanivelThiruvenkadam The problem with your code is that it will keep counting if the led stays ON. I have attached the code to see the difference. I would say let the LED ON for 5 seconds and you will see your counter will keep counting. The OP wants to count how many times it goes above 10.5.

The only inconvenience with mine is slow at counting you start increasing loop timing and it looks convoluted. For example: 1000 ms. I have attached a code that combines yours and mine to see what I am talking about. 

 

0 Kudos
Message 19 of 27
(594 Views)

@GRCK5000 wrote:

@PalanivelThiruvenkadam The problem with your code is that it will keep counting if the led stays ON. I have attached the code to see the difference. I would say let the LED ON for 5 seconds and you will see your counter will keep counting. The OP wants to count how many times it goes above 10.5.

The only inconvenience with mine is slow at counting you start increasing loop timing and it looks convoluted. For example: 1000 ms. I have attached a code that combines yours and mine to see what I am talking about. 

 


Since its not a Boolean button which will always be true, Whenever the acquired data is greater than 10.5 it will increment else maintains the same number.

 

If the requirement is only to count whenever there is transition (Low -high), then I my logic needs to be changed - Simple implies function do the job (Still I won't recommended feedback node).

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 20 of 27
(590 Views)