LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

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.)

 

 


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 11 of 12
(60 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 Smiley Wink)

 

GauntPulsesPerRevolutionSim.png


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 12 of 12
(52 Views)