Sign in to follow this  

Recommended Posts

Hi,

I am using a variable value component to measure a Hz value of a stirrer that I have. When I turn it off suddenly, the last value is kept. It shows a value of a constant 3Hz for example, even when it is not spinning. NOw obviously this isn't a big deal, but I was wondering is there a way to reset that value to 0 so it doesn't confuse anyone who might see the screen?

I created a frequency channel that is a timer. For the expression on the variable value component I used a conversion that included frequency[0] in it.

Thanks

Share this post


Link to post
Share on other sites

There are a couple ways to do this. One thing you could do before I explain your answer is make it so the background of the value shows in green when it is current and red when it is old. But anyhow, to make it reset to 0 if the data is, say, older than 5 seconds, you'd put this in the expression:

iif(SysTime() - frequency.Time[0] > 5, 0, frequency[0])

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this