LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event strcture

I created a event structure in a vi.  I added a event, say "Value change" for button Boo.  I wanted to call this event as soon as I enter this vi without pressing button Boo.  How do I do this?
 
thanks
--trupti
0 Kudos
Message 1 of 8
(3,501 Views)

You can invoke value change events (and only them) by using the Value (signaling) property.

Create a property node for the control you registered, select that property and wire the value into it.


___________________
Try to take over the world!
0 Kudos
Message 2 of 8
(3,494 Views)

Thanks for your help

Can you please explain that step by step?

Here what I did..

1. Opened a blank vi

2. Added button "Boo"

3.  Created a even structure.  Added "Value change event".  Added message Box "Hello"

4.  Outside event structure created property node for value.  Wired button Boo control to this propery.

5. Ran the vi.  Nothing happend till I pressed button Boo

Did I miss anything?

--trupti

 

0 Kudos
Message 3 of 8
(3,486 Views)

@Trupti wrote:

4.  Outside event structure created property node for value.  Wired button Boo control to this propery.

Did I miss anything?


 

Yes. I didn't say you should use the value property but the Value (signaling) property. Also, you don't need to wire the button into the property. It's enough that you wire a T or F constant. You should note that if your button has a latched mechanical action, you will get an error if you try to write a value to it.

You should read on events before using them, because it's easy to make mistakes which will cause your VI to get stuck. You can find some stuff on this site.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 4 of 8
(3,481 Views)
Here's an example demonstrating what you are wanting to do. Note that with this technique the boolean control can't have a mechanical action, so the code has to explicitly reset the button state in the event. Note also the 100 msec delay before the button is reset. The purpose of this delay is to provide better operator feedback. Without this delay the button will sometimes reset so rapidly that the operator won't see it in the depressed state and so could be left wondering whether the click even registered.
 
Mike...
 
PS: the code is in V7.0

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 8
(3,479 Views)
If you don't need the timeout event (I rarely do!), you can also add timeout  to the boo event. Feed the timeout in a shift register initialized with zero, but make it infinite (-1) at the right boundary disabling the timeout at later iterations.
 
This way you don't need any property nodes or local variables and you can even leave the boo button at "latch action".
 
I took the liberty to modify Mike's VI to illustrate my suggestion (LabVIEW 7.0). 🙂
 

Message Edited by altenbach on 09-11-2005 04:54 PM

0 Kudos
Message 6 of 8
(3,477 Views)

Another good idea. But shouldn't you have named the VI: Boo Who Too.vi   Smiley Very Happy

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 8
(3,473 Views)


@mikeporter wrote:
Another good idea. But shouldn't you have named the VI: Boo Who Too.vi   Smiley Very Happy
It's a bit early for a halloween themed VIs, but then we would also need a pumpkin colored FP. 😄
0 Kudos
Message 8 of 8
(3,469 Views)