From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reset counter while running VI and continue counting (LabVIEW NXG)

Hi, 

I want my counter to reset when I click the button and continue counting from the initial value (0) right away. Do you have any idea of how this could be done without stopping the task?

0 Kudos
Message 1 of 4
(2,143 Views)

Hi, can you explain further about what counter are you planning to use?

If what you meant was the Iteration [ i ] Terminal inside a While Loop, then no you can't reset it. You can instead make your own counter. Refer to:

Can I Reset the Iteration Terminal on a While or For Loop?

 

Hope that helps.

0 Kudos
Message 2 of 4
(2,122 Views)

Thank you for your reply, Gabriel! I meant a detector that works as a counter 🙂 It counts in "counts per second" and sends it to my VI. 

0 Kudos
Message 3 of 4
(2,086 Views)

The example from that link should still apply for your application then.

Maybe you can make something like this.

 

image.pngReset Counter.png

As how to "read the detector", it should depends on your device.

But if what you mean is how to get data and reset the counter on a "detector with internal counter", then it's an entirely different story.

0 Kudos
Message 4 of 4
(2,076 Views)