LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

indicator change with time using event structure

Solved!
Go to solution

Dear all,

 

I am using a event structure to sense for change in state of a indicator. Right now, i am wondering is there any way i can monitor this change in state within a time interval?

 

Meaning how can i fire the event only when the change in state is sufficiently long ( say 5 sec), if it there is a change in state but subsequently return back to normal state (less than 5 sec), the event will not fire.

 

Thanks and hope anyone can give me some hints on how to do that?

 

 

0 Kudos
Message 1 of 10
(3,812 Views)

hi joven,

 Can you explain a little more clearly?

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 2 of 10
(3,782 Views)

Hey Joven.

 

You could try something like this where you monitor the mouse down and mouse up cases on the same boolean. If the time between the two is greater then 3 then you can execute some code in the case structure.

 

- Rkll

22232i29F5AF688AA2CC57

0 Kudos
Message 3 of 10
(3,771 Views)

Hi,

I am sure we can help you better when you just post a small code what you want to do.

0 Kudos
Message 4 of 10
(3,763 Views)

Here is some simple code that will compare a boolean to its last state.  If changed, it waits 2 seconds and reads the boolean again.  If still changed, it displays a message.  You can adapt to your use.  Written in LV2009.

 

I used regular polling.  I tried using dynamic events, but ran into a problem with the dynamic event locking the front panel so that I could not change the boolean after the event was fired.  When using dynamic events, there is no checkbox to disable or enable front panel activity, like there is in a regular event.  So during the two second wait, I could not change the boolean.

 

22268iE2E998481DBC34E5

- tbob

Inventor of the WORM Global
Message 5 of 10
(3,733 Views)

Here is how I would do it so the code never gets stuck.

Tim
GHSP
0 Kudos
Message 6 of 10
(3,720 Views)

Tim, I think you need to re-read the original post.  It is an indicator whose change fires an event.  The OP doesn't want to prevent another change, he wants to fire the event only if the change stays for 5 seconds or more, i.e, it doesn't change back after 4 seconds.

- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 10
(3,715 Views)
Solution
Accepted by Joven

Sorry for not reading this completely. Here is a version that works and does not get stuck waiting.

Tim
GHSP
Message 8 of 10
(3,703 Views)

Yes, that's how it is supposed to work.  I think I like your solution better than mine.

- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 10
(3,699 Views)

 

Dear asest and Tbob,

 

Thanks all for your help. You have given me some ideas on how to proceed from there.

 

0 Kudos
Message 10 of 10
(3,676 Views)