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.

Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Running a counter in actual time (seconds) with varying values (including decimal values) in each iteration

Hello everyone. 

I am making a program in which a counter starts from 5 and goes to 0 and then a LED light gives an indication by turning on. After that a random event occurs whose value is added to or subtracted from original counter value of 5 and the counter runs again to 0 and then LED turns on. This process repeats itself unless its stopped. Now, the value of the counter due to random event can be in decimals like 4.36, 5.12, 4.89 etc. I want this counter to decrement in real time with counter values to be considered seconds. Currently I am using time delay but it will be applicable only for the initial counter value of 5 and not the later updated values in decimals. Please help me with this issue. I have attached the VI and image of block diagram.

Best regards,

Fahad Bin Zahid

Download All
0 Kudos
Message 1 of 1
(2,524 Views)