01-23-2010 12:43 PM
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
Solved! Go to Solution.
01-23-2010 12:48 PM
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.
01-23-2010 12:52 PM
01-23-2010 01:14 PM - edited 01-23-2010 01:20 PM
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!