LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error with subvi that calculates a count

I think that a single loop is sufficient. See if this works for you (may need a few tweaks. It both arrays transition at the same time, it will only count it if this happens at the second hall pulse, probably a reasonable choice, but modify as needed if you want something else.)

 

CountPulsesPerRevolution.png

 

It will stop once the second hall pulse is received. No need to continue.

(The "to I32" is only needed if you expect more than ~32k pulses per revolution.)

 

 

0 Kudos
Message 11 of 12
(282 Views)

You actually could take the orange comparison out of the loop.

 

To understand the code, here's a quick simulation, tapping and graphing some inner data. I am sure there are several other (potentially even simpler) ways to do about the same ... (there could even be bugs ;))

 

GauntPulsesPerRevolutionSim.png

0 Kudos
Message 12 of 12
(274 Views)