LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

regist dynamic event no response

Hi,everybody.

I'm wondering why my program like this didn't work while I know the way it work.

I just wanna know how the regist dymamic event works

--------------------------------------------------------------------------------------------------------------------

When my program is written like this

 未命名.jpg

the event "value change" is triggered once , and the interface is then dead, with no response to mouse or kBoard.

(the time-out frame is still working, only interface is dead)

 

When I change the program like this:

未命名1.jpg

It works fine.

 

And When I do this

未命名2.jpg

It also works well.

 

So

---------------------------------------------------------------------------------------------------------------------------------------------------

I want to know why in the first condition there is problom.

how the regist dymamic event works???????

 

Thank you. 

----------------------------------------------------------------------------------------------------------------------------------------------------

Thougn my LB version is chinese, I think you know what I'm saying.

Neko

0 Kudos
Message 1 of 3
(2,345 Views)

I did not code this up for testing (so take this with a grain of salt if I am wrong), but to me I would guess the following:

 

2nd case: event registered once outside the while loop.  Should work as intended.

1st case: event registered OK first time through the loop so should work once.  Second time through the loop event is re-registered so I am assuming since it already exists an error is thrown and now you are wiring up an invalid event to the structure (which will likely override the original)

3rd case: event is registed and unregistered each time.  Should work OK but inefficient.

 

I would probe the event reference in the 2nd case and see what is passed to the event structure after the first event

0 Kudos
Message 2 of 3
(2,330 Views)

Thank you, Don.

I think it is beacause a handle is created but not  closed, while the new handle gives the control a new handle.

So the old ones still responses the event but can not find the indicator and this will cause a dead interface,

I found it in LB help ,there's some similar hint "If you don't close a registed handle after the while loop but still produce event, the Interface is then dead."

 

=.=~ hohohoho

0 Kudos
Message 3 of 3
(2,308 Views)