LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Visit the LabVIEW Wiki Application Design & Architecture Portal


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> how to generate a button clicked event
kingson
post Oct 27 2004, 04:21 PM
Post #1


3 more posts to go!


Member
Posts: 7
Joined: 27-October 04
From: Swiss
Member No.: 915
LV:7.1


Hi all,

I intend to programatically generate a Value Changed event for a latched boolean control.
just because I want to reuse the process code for this evnet while it is not convenient to
put it in a sub-vi.
I tried to link a boolean constant TRUE to the property Value(Signaling), but get an error
that this doesnt work for a latched boolean control.
Is there any way out?
Thanks.

This post has been edited by kingson: Oct 27 2004, 04:22 PM


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Oct 27 2004, 04:21 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
kingson
post Oct 27 2004, 05:02 PM
Post #2


3 more posts to go!


Member
Posts: 7
Joined: 27-October 04
From: Swiss
Member No.: 915
LV:7.1


QUOTE (kingson @ Oct 27 2004, 05:21 PM)
Hi all,

I intend to programatically generate a Value Changed event for a latched boolean control.
just because I want to reuse the process code for this evnet while it is not convenient to
put it in a sub-vi.
I tried to link a boolean constant TRUE to the property Value(Signaling), but get an error
that this doesnt work for a latched boolean control.
Is there any way out?
Thanks.
*


I just come up with a workaround in which I use switched boolean instead of latched. I can access its property Value(Signaling).
Then in the Value Changed event process, I wire a FALSE constant to the local variable of
this boolean control to reset the value.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
todd
post Oct 27 2004, 08:58 PM
Post #3


Very Active
***

Member
Posts: 77
Joined: 30-May 03
From: Everett, WA
Member No.: 107
Using LabVIEW Since:2006
LV:7.1.1 ,. ,.
United States Nothing Selected Nothing Selected


Here's how I reset the button and catch errors.
Attached thumbnail(s)
Attached Image
 

Attached image(s)
Attached Image Attached Image
 


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
kingson
post Oct 28 2004, 03:00 PM
Post #4


3 more posts to go!


Member
Posts: 7
Joined: 27-October 04
From: Swiss
Member No.: 915
LV:7.1


QUOTE (todd @ Oct 27 2004, 09:58 PM)
Here's how I reset the button and catch errors.
*


Will the "Delete Selected" Value Changed event executed again when you reset its value?
What I did is examplifed in the attached file.
Attached File(s)
Attached File  latched_boolean_event.vi ( 32.49K ) Number of downloads: 135
 


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
todd
post Oct 28 2004, 04:56 PM
Post #5


Very Active
***

Member
Posts: 77
Joined: 30-May 03
From: Everett, WA
Member No.: 107
Using LabVIEW Since:2006
LV:7.1.1 ,. ,.
United States Nothing Selected Nothing Selected


QUOTE (kingson @ Oct 28 2004, 08:00 AM)
Will the "Delete Selected" Value Changed event executed again when you reset its value?


No. It would execute again If the property was 'Value (Signaling)' instead of 'Value'.
I haven't yet installed 7.1.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
kingson
post Oct 29 2004, 08:53 AM
Post #6


3 more posts to go!


Member
Posts: 7
Joined: 27-October 04
From: Swiss
Member No.: 915
LV:7.1


QUOTE (todd @ Oct 28 2004, 05:56 PM)
No. It would execute again If the property was 'Value (Signaling)' instead of 'Value'.
I haven't yet installed 7.1.
*


Not to make it excute twice is most I am concerned now. The demo above runs well locally
but if I control it remotely from a web browser, it will get executed once again. After spending
quite some time, incidently I popup a dialog in the event processing, and then the second event doesnt show up.
This demo will show two different results when you select to popup dialog or not. Run it by
Tool->Web Publishing Tool...->Preview in Browser
So now I am confused with the Labview event processing. Maybe the popup dialog prevents the second event.

This post has been edited by kingson: Oct 29 2004, 08:54 AM
Attached File(s)
Attached File  latched_boolean_event.vi ( 43.52K ) Number of downloads: 141
 


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
kingson
post Oct 29 2004, 10:38 AM
Post #7


3 more posts to go!


Member
Posts: 7
Joined: 27-October 04
From: Swiss
Member No.: 915
LV:7.1


Finanally I give up singaling value to generate an event. I turned to make the process as a user event, and generate this user event wherever its needed.

This works like the helper function in other language(pseudo code).

void onOKButton()
{
saveHelper()
}

void onSaveButton()
{
saveHelper()
}

void saveHelper()
{
//do the real work
}

You can say this can be done easily in subVI. But in my case, the subVI input parameters consume a lot space which I cant fit it in.
Attached File(s)
Attached File  callback.vi ( 39.77K ) Number of downloads: 169
 


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:06 AM