취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Is there a way to fire an interface event programmatically?

해결 완료!
솔루션으로 이동

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 포인트
1/4 메시지
8,006 조회수
솔루션
주제 작성자 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.

2/4 메시지
8,002 조회수
Write to the control's Value (Signaling) property.
0 포인트
3/4 메시지
8,001 조회수

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 포인트
4/4 메시지
7,989 조회수