05-12-2026 01:44 PM
Hi everyone! 👋
I'm struggling with a VI where I'm trying to calculate RPM based on pulse counting. The main issue is that the indicator keeps flicking to zero every time the counter resets, or it shows erratic values.
My professor suggested implementing a logic to update the value every 9 cycles to keep the reading stable, using a Quotient & Remainder function to trigger the update.
Any help would be greatly appreciated! 📈
05-12-2026 02:15 PM
It is impossible to debug pictures. Please attach your VI.
05-13-2026 06:29 AM
Here's the .vi
05-15-2026 08:49 PM
Hello, Ninja-761. What happened to the preceding 760?
Have you looked at your Block Diagram? Do you see wires running "all over the place", frequently with lots of right-angle bends and not easy to follow from one node to the next?
Thank you for labeling your controls and indicators. Unfortunately, the names aren't helpful -- "knob" doesn't tell us what the control means, just that you "turn it" like a knob (suggesting it might control a "speed", maybe a "loudness". Some things are labeled in a language I don't speak "TEMPS TRANSCORREGUT" (this seems to be very important, since it is "IN ALL CAPITAL LETTERS").
So first, name your controls and indicators so we know something about the data flowing through the wires.
Now, let's clean up the Block Diagram so we can see where the wires are running. Do you see the "broom" icon (the one at the right end of the Block Diagram settings)? Push it (once). Isn't it easier to see/understand your code?
The top While loop has a Shift Register initialized to the integer "0" that gets incremented by one each iteration of the While loop. Do you see the indicator in the lower left corner of the While loop with "i" in a little box? It is there for a reason, it "counts" the While loop -- you don't need to do it yourself.
You are using "Wait until Next ms Multiple". This is a greatly-misunderstood function -- it is designed to synchronize two loops so they run at the same rate. It is (now) almost never used, and when it is (as in your case), it almost always behaves not as the User intended.
Here's a suggestion.
Bob Schor