LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

User Events

Dear all:
    I've made two VIs,Tmp_main.vi and Tmp_called.vi. A user event,"EveBoo",was
created and registered in the Tmp_main,then I called and executed the
Tmp_called.vi on which an event structure used to handle the "EveBoo" event
was placed by VI server. After that I generated the "EveBoo" event,the strange
thing happened.The case structure can't handle the evemt.
    I viewd the manual but can't find anything help.
    The attachment is my VIs.Hope your suggestion.
William
Download All
0 Kudos
Message 1 of 8
(3,742 Views)
Hi William
 
I just tried your vis and I just can say, that the event is processed in Tmp_Called.vi. But it is just processed once, because there is no while-loop. That's why the vi stops after the first event.
 
So you always have to have a while-loop around an event-structure.
 
But why do you handle the event in a separate vi? Is there a special reason?
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 8
(3,722 Views)

Ha :

    Thanks.But,how you tried about that twice.I know the best way to use case structure is to place that in a while loop.But this doesn't help this VI.The first time after I use the Tmp_main.vi, the Tmp_called.vi will stop. But the second time,you close the Tmp_Called.vi and than you run the Tmp_main.vi, after the tmp_main.vi stopped the tmp_called.vi won't stop..And also during the Tmp_main.vi running,a strange thing happen,the case event structure can't handle any event even the static event --the stop button's value change.

0 Kudos
Message 3 of 8
(3,705 Views)
Hi
 
"The first time after I use the Tmp_main.vi, the Tmp_called.vi will stop. But the second time,you close the Tmp_Called.vi and than you run the Tmp_main.vi, after the tmp_main.vi stopped the tmp_called.vi won't stop"
I still can't reproduce what you describe. I just can repeat, that the event-structure is stopped, right after processing the first event. You have to put it inside a while loop, otherwise it won't work! Read about the event-structure in the LV help-system - there are more points to look at, if you use an event-structure.
 
I had again a look at your vis and modified Tmp_called.vi a little bit. Now it won't stop until you push the stop button. I also added a array, to simply buffer the time when an event occurs. So after stopping the vi, you will see the according times.
 
Hope this helps.
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Download All
0 Kudos
Message 4 of 8
(3,698 Views)
Hi Thomas
     Thanks for your help.
     But I still don't know why the TMP_Called.vi can't handle the user event in my PC.I use LabVIEW 7.0 and Win2000.
     You can see the problem in the attachment.The array,Event-Times,was still empty after the TMP_Main.vi stooped. 
0 Kudos
Message 5 of 8
(3,670 Views)
Hi
 
Did you stop TMP_Called.vi by clicking the stop button?
 
Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 6 of 8
(3,658 Views)
No,and as you can see theTmp_Called.vi haven't been stopped yet.
But now I know wthat's the problem.If I use the property node "FP.Open" instead of the method "Abort VI" to stop and unload the Tmp_Called.vi,there will be no question. (Another told me that there is some bugs in LabVIEW 7.0)
Thanks for you help.
0 Kudos
Message 7 of 8
(3,652 Views)
Hi
 
Maybe first a little explanation - I modified Tmp_Called.vi so that you have to push the stop-button. This will stop the while-loop and you should see the times when the events occured in the array.
 
"No,and as you can see theTmp_Called.vi haven't been stopped yet."
Referring to the sentences above, Tmp_Called.vi could not have stopped if you did not push the stop-button.
 
"property node "FP.Open" instead of the method "Abort VI" to stop and unload the Tmp_Called.vi"
You definitely do not stop and unload a vi by calling FP.Open. It would be a contradiction to use a function, which opens something, to stop and unload something.
 
So just try my attachments again and do the following:
1. Start Tmp_Main.vi
2. Wait until Tmp_Main.vi terminated
3. Stop Tmp_Called.vi by pushing the stop-button.
 
Hope it is a bit clearer now.
 
Thomas
 
 
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 8 of 8
(3,645 Views)