07-23-2015 09:19 AM
I am trying to stop a while loop using a countdown timer with the ability to stop by using the stop button. However when the timer hits 0 the vi doesnt stop.
Solved! Go to Solution.
07-23-2015 09:23 AM - edited 07-23-2015 09:28 AM
07-23-2015 09:30 AM - edited 07-23-2015 09:31 AM
zain,
what happens when you check the millisecond timer just one millisecond later (oer earlier)? Your comparison with zero will give a FALSE output…
Easy solution: use a more "robust" comparison function here, which also outputs TRUE, when time is over.
Or use the ElapsedTime ExpressVI, which does this thing right!
07-23-2015 09:31 AM
Oh sorry for not elaborating. I created a countdown VI and it works on its own but when I try and integrate it to my getDataV2 vi the code doesnt work and I cant figure out whats going wrong.
07-23-2015 09:32 AM
07-23-2015 09:49 AM
Oh sorry didnt save it before upload. I used the elapsed time vi to achieve it. Thanks guys
08-03-2015 11:08 PM
Hello Sir, above attached is the error i faced. What i wish to achieve is that when the reading the lesser than-0.4 or more than 0.4, i want to have a timer to let it have a delay of 5 seconds before i would actually trigger the alarm meaning to say that if the value lesser than -0.4 or more than 0.4 is less than 5 seconds. There would actually be no alarm. I've tried earlier when i put in a timer, it would actually buffer once every 5 seconds. Please guide me along if you guys got any ideas regarding this issue. Thanks.
08-04-2015 06:49 AM - edited 08-04-2015 06:51 AM
@edwardanthony wrote:
Hello Sir, above attached is the error i faced. What i wish to achieve is that when the reading the lesser than-0.4 or more than 0.4, i want to have a timer to let it have a delay of 5 seconds before i would actually trigger the alarm meaning to say that if the value lesser than -0.4 or more than 0.4 is less than 5 seconds. There would actually be no alarm. I've tried earlier when i put in a timer, it would actually buffer once every 5 seconds. Please guide me along if you guys got any ideas regarding this issue. Thanks.
All you need is an In Range And Coerce and an Elapsed Time.