09-08-2005 10:13 PM
09-08-2005 10:15 PM
09-08-2005 10:33 PM
The reason you aren't seeing any events fired for a change in Num2 is that you don't have an event case defined to respond to the event. I'm not sure what the code is trying to accomplish, but you don't have to explicitly register to receive events related to controls on a VI's front panel. Also you don't have to have a Timeout event.
Mike...
PS: the stop button seems to work just the way it's supposed to...
09-08-2005 10:48 PM - edited 09-08-2005 10:48 PM
Thanks..
The main purpose of the code is to change (num->num2) the source of event dynamically during executing.
Therefore, the controls(num,num2) should be positioned outside while loop, and event from num should be ignored after the second click.
As for stop button, do you mean the way of design (by NI) is to do so?
Please advice me again.
메시지가 09-08-2005 10:55 PM에 labmaster에 의해 편집되었음
09-08-2005 10:57 PM
09-08-2005 11:03 PM - edited 09-08-2005 11:03 PM
메시지가 09-08-2005 11:05 PM에 labmaster에 의해 편집되었음
메시지가 09-08-2005 11:05 PM에 labmaster에 의해 편집되었음
09-08-2005 11:06 PM - edited 09-08-2005 11:06 PM
Hi labmaster,
Here's your VI repaired to work as you desired.
Note: For the Event Structure, In the "Edit Events handled by this case" you need to select the "Dynamic\<Numeric>" NOT "Controls\Numeric"
Message Edited by Dynamik on 09-08-2005 11:10 PM
09-08-2005 11:09 PM
Ok, I see the problem. The trouble here is that you are getting confused by names. The event case that is handling the numeric value change is tied to the wrong one.
Because you are using the register events node to setup a dynamic event for a control on the vi's front panel, when you go to create an event there are two possible events that you can assign to the case that have very nearly the same name.
"Numeric": Value change is the value change event associated with the control on the front panel--for your application, that is the one you do NOT want to use. The other one: <Numeric>:Value Change is the one associated with the dynamic event you registered.
I modified your original code and you'll notice that it triggers the value change event when Numeric is changed the first time. After that, further changes will be ignored and changes to Numeric 2 will trigger the event.
Mike...