LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to fire an interface event programmatically?

Solved!
Go to solution

Hi all!

 

I'm doing practice with LabVIEW. In this moment i'm dealing with events, both interface events (those associated with controls and indicators) and user events (those i created).

 

When a particular event occurs (not related to the interface), i need to execute code which is the same i manage in an event case for an interface event.

 

The question is simple:  is there a way to "re-use" the code used to manage that interface event firing it programmatically after the particular event occurs or i need to create a user event with the same code (wasting time, memory, etc...)?

 

Thankz

0 Kudos
Message 1 of 4
(7,716 Views)
Solution
Accepted by aRCo

It depends on what the interface event is.

 

If it is something like a button press or a change in a numeric control, you can use the Value(Signalling) property node.  So if you want to simulate the press of a boolean button, you can wire a True boolean constant to the value signalling property node for that boolean control.

 

If there are other types of interface events you want to handle such as a mouse down, panel move, .... , it might be a good idea to put your real code inside the user event, and have the Interface event just have code in it that fires the user event.

Message 2 of 4
(7,712 Views)
Write to the control's Value (Signaling) property.
0 Kudos
Message 3 of 4
(7,711 Views)

dynamice.PNG

Here is one way to do it.  This vi creates a user event of boolean type (like condition) and registers that event for the event structure.  When boolean is true The top case causes User Event to occur and resets the boolean (shown this way for simplicity- but you would use a condition of your test to fire the event)

The event structure will execute the same code (here nothing) when either the boolean is set true OR the front panel is resized 

 

Obviously you would want the structures in independant loops- I rushed and still got out posted twice!

Message Edited by Jeff Bohrer on 01-23-2010 01:20 PM

"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 4
(7,699 Views)