View Single Post
  #18   Spotlight this post!  
Unread 22-02-2010, 15:36
Omar's Avatar
Omar Omar is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Huntsville, AL
Posts: 122
Omar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of lightOmar is a glorious beacon of light
Re: LabView question

Well you want something a little different. You want to delay the reaction to a Boolean changing state.
You want to “hold back” the Boolean state by some amount.

This is what I came up with.
My first cut was fairly simple, but failed in what was to happen if the BooleanIn changed back to it’s original state before the delay timed out?
So I had to rethink it.

Each time the Boolean In changes state I calculate the delay time and take the state and “queue” them in an array.
Then I check the 1st item in the array to see if the time has passed, if so the Boolean state is passed to Boolean out and that item is removed from the array.

If the array is empty the current state of Boolean IN is just passed to Boolean Out.

The Boolean Out state will track the Boolean IN state but delayed by a set about of time.

This VI is Reentrant so you can use it in multiple places

Enjoy
Attached Files
File Type: vi BooleanDelayReaction.vi (14.3 KB, 28 views)
__________________
Omar
Reply With Quote