LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

basic question on event

Dear,
 
Recently, I bought a book to study the advanced operation in LV 7.1.
Now I am studying about event.
Could you please open my attachment.
 
I made the vi as shown in the book but the result couldn't be expected.
The purpose of the vi is to control the event source.(Num->Num2)
But I can't obtain the event from Num2.
do you identify my error in the vi?
 
Second, why don't change the status of the stop button in prressing the button?
I can check it the status should be changed in case of withouting event routine.
How can I understand it?
 
Thank you in advance.
0 Kudos
Message 1 of 8
(3,281 Views)
As my other question, I am looking for some tutorials (hopefully, with examples) to study new in LV7.0.
 
0 Kudos
Message 2 of 8
(3,273 Views)

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...


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 3 of 8
(3,271 Views)

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에 의해 편집되었음

0 Kudos
Message 4 of 8
(3,271 Views)
Labmaster, if you would like to see the STOP button turn GREEN and _stay green_ (to indicate True) ....
then, right-click on the button and set "mechanical-action" to "Switch when pressed"
 
cheers
When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 5 of 8
(3,257 Views)
Thank you, Dynamik
I don't like to change the button property.
I am just want to know the principle of operation in event structure.
Why there exist the difference of the button(with same property) between event and normal while structure?
(for example, data manipulation or design rule of NI?)
Thank you.

메시지가 09-08-2005 11:05 PM에 labmaster에 의해 편집되었음

메시지가 09-08-2005 11:05 PM에 labmaster에 의해 편집되었음

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

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

When they give imbeciles handicap-parking, I won't have so far to walk!
0 Kudos
Message 7 of 8
(3,247 Views)

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...


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 8 of 8
(3,244 Views)