LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out our User Interface Code Repository Files or visit the LabVIEW Wiki User Interface Portal


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> Different event cases for same control - possible?
Michael_Aivaliot...
post Jun 19 2003, 06:21 PM
Post #1


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2363
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


With dynamic events, I was wondering if there was a way to have controls with multiple functions. A good example would be a START button that would change into a STOP button. It would be great to have one event case per funtion and determine dynamically which case will execute for the specified button press. I was thinking that you would have to register the control for each individual function you wanted. Then the question arrises, how do you switch registration over to another event case. Any suggestions?
Attached image(s)
Attached Image
 

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


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Jun 19 2003, 06:21 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
Jim Kring
post Jun 19 2003, 06:44 PM
Post #2


Changing the world, one VI at a time.
*****

JKI
Posts: 1692
Joined: 22-October 02
From: San Francisco, CA
Member No.: 17
Using LabVIEW Since:1995
LV:8.2.1 ,8.5 ,7.1.1
United States us_california Nothing Selected My Blog My Gallery


QUOTE
With dynamic events, I was wondering if there was a way to have controls with multiple functions. A good example would be a START button that would change into a STOP button. It would be great to have one event case per funtion and determine dynamically which case will execute for the specified button press. I was thinking that you would have to register the control for each individual function you wanted. Then the question arrises, how do you switch registration over to another event case. Any suggestions?


Here is an example that does this. However, it appears that there is a LabVIEW bug that is causing problems with the reregistration. :?
Attached File(s)
Attached File  Start_Stop.vi ( 47.11K ) Number of downloads: 391
 

--------------------
-----------------------------------------------------------------------------------------------------
| Book | OpenG | LAVA | Champion | VIPM | Builder | Blog | JKI |
-----------------------------------------------------------------------------------------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Michael_Aivaliot...
post Jun 19 2003, 06:56 PM
Post #3


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2363
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


QUOTE
 
Here is an example that does this.  However, it appears that there is a LabVIEW bug that is causing problems with the reregistration.  :?


Wow, I came up with the same thing... and got the same bug as well.
Attached File(s)
Attached File  multiple_events_for_1_control.vi ( 63.15K ) Number of downloads: 354
 

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


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Jon Sweeney
post Aug 7 2003, 08:35 PM
Post #4


More Active
**

Member
Posts: 30
Joined: 3-July 03
From: Long Island, NY
Member No.: 133
Using LabVIEW Since:1993
LV:8.20 ,. ,.
United States us_new_york Nothing Selected


QUOTE
QUOTE
 
Here is an example that does this.  However, it appears that there is a LabVIEW bug that is causing problems with the reregistration.  :?


Wow, I came up with the same thing... and got the same bug as well.


I downloaded your two demo files (one for latched boolean and one for switched boolean) and played with them until they worked. I think the original problem may have been too many events registered.
("If you do not unregister for events, LabVIEW continues to generate and queue the events as long as the VI runs, even if no Event structure is waiting to handle them, which consumes memory and can hang the VI if you enable front panel locking for the events.")

Since the terminal of a latched boolean is supposed to be read in its Value Change event case (ref events caveats and recommendations documentation) and you can't use local variables for the latched boolean, I created a user-event case where the terminal can be read. Not sure why just changing it to a switched boolean doesn't work, but this causes a "class conflict" error. (explanation anyone?)

Jon Sweeney
Attached File(s)
Attached File  Jon_Sweeney_start_stop_multiple_events.zip ( 44.2K ) Number of downloads: 280
 

--------------------
Jon Sweeney


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Jon Sweeney
post Aug 13 2003, 07:34 PM
Post #5


More Active
**

Member
Posts: 30
Joined: 3-July 03
From: Long Island, NY
Member No.: 133
Using LabVIEW Since:1993
LV:8.20 ,. ,.
United States us_new_york Nothing Selected


Since my previous post, I have belatedly read the documentation for "Modifying Registration Dynamically" and have a better understanding of what you were trying to do with the "Not a Reference"s (ie, using them to unregister events) oops.gif . My modified interpretation of why the vi hangs follows:

Assuming the event registration structure is interpretted top-down like a property node is, in one eventcase (the 1st one encountered) you are unregistering and then registering the value-change event (net result=the event is registered). In the second eventcase (which causes the vi to hang) you are registering the event and then unregistering it (net result=the event is unregistered).

If this interpretation is correct, I'm not sure if you can call the behavior a bug or expected-but-unwanted.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 22nd November 2008 - 02:09 AM