07-07-2015 07:25 PM
Hi Everyone,
I have a vi to see if a number falls in a range for a specified duration .The input is at 51.2kHz.I want the vi to do the following ; Say if the input/value is continously in range for a specified duration ( say 5 seconds) it turns on an led and keep it on unless its false and when is false it should reset the time.
I dont know if my current vi is in the tune with what I want,it does its work but i dont know how to reset the time when its false.
I welcome any advise /assistance on this matter.
Thanks a lot,
1sandy1G
07-07-2015 07:57 PM - edited 07-07-2015 07:57 PM
The Elapsed Time function does have a reset input so what you could do is simply have a select function that checks the input range and chooses whether or not to reset the timer.
I would also be careful about how you have the inrange and coerce function configured. It probably won't matter in this case but the default behavior of that function is to include the lower bounds in its check but not the upper bounds. You can tell this based on whether the diamond is shaded. You can change this behavior by right clicking on the function. Again, it probably won't matter with this application but figured it might help you down the road.
07-07-2015 08:35 PM
@Jacobson-ni wrote:
I would also be careful about how you have the inrange and coerce function configured. It probably won't matter in this case but the default behavior of that function is to include the lower bounds in its check but not the upper bounds. You can tell this based on whether the diamond is shaded. You can change this behavior by right clicking on the function.
You know, I always wished that IR&C right click option would fade out and the diamonds would automagically fill when integer data types are wired.
07-07-2015 09:19 PM
Thank you for your reply Matt.can you explain resetting the timer ? do i wite a code in the 'false' case and trasfer a boolean to the true one?
07-08-2015 08:08 AM
@1sandyG1 wrote:
Thank you for your reply Matt.can you explain resetting the timer ? do i wite a code in the 'false' case and trasfer a boolean to the true one?
Since you need to reset the timer when the comparison returns a false, all you need to do is use a NOT straight from your comparison. Then the output of the NOT goes into the Reset of the Time Elapsed VI.
07-08-2015 08:50 AM
@crossrulz wrote:
@1sandyG1 wrote:
Thank you for your reply Matt.can you explain resetting the timer ? do i wite a code in the 'false' case and trasfer a boolean to the true one?
Since you need to reset the timer when the comparison returns a false, all you need to do is use a NOT straight from your comparison. Then the output of the NOT goes into the Reset of the Time Elapsed VI.
Whoops, didn't catch that I said to use the Select funtion to make a boolean decision. I'll be the next post on the Rube Goldberg thread if I'm not careful.
07-08-2015 09:03 AM
@Jacobson-ni wrote:
@crossrulz wrote:
@1sandyG1 wrote:
Thank you for your reply Matt.can you explain resetting the timer ? do i wite a code in the 'false' case and trasfer a boolean to the true one?
Since you need to reset the timer when the comparison returns a false, all you need to do is use a NOT straight from your comparison. Then the output of the NOT goes into the Reset of the Time Elapsed VI.
Whoops, didn't catch that I said to use the Select funtion to make a boolean decision. I'll be the next post on the Rube Goldberg thread if I'm not careful.
The Last time someone said something like that.......
07-09-2015 12:45 PM
crossrulz
Since you need to reset the timer when the comparison returns a false, all you need to do is use a NOT straight from your comparison. Then the output of the NOT goes into the Reset of the Time Elapsed VI.
But when the comparison goes to false the false case is activated and the elapsed time vi is in the true case.So even if i do as you mentioned it doesnt work.
07-09-2015 12:56 PM
@1sandyG1 wrote:
But when the comparison goes to false the false case is activated and the elapsed time vi is in the true case.So even if i do as you mentioned it doesnt work.
Then move it to be outside of the case structure. And just looking at your code, I'm not even sure you need that case structure. Is that Numeric 2 used somewhere else?
07-09-2015 01:20 PM
I needed to start/trigger the elapsed time vi after a condition is satisfied and i thought a case structure would suffice.Disregard the numeric 2,forgot to remove it.How could i do it without a case structure? any alternative?
Thanks