Jump to content

User Events


Recommended Posts

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.It didn't say that the event structure can't handle user events that were registered in other VIs

The attachment is my VIs.Hope your suggestion.

William

Download File:post-3059-1129791584.vi

Download File:post-3059-1129791618.vi

Link to comment

Hi Michae:

Thanks for your suggestion.

But I think there also must be some misunderstanding

First,

The front panel of Tmp_Called.vi MUST be opened before it can register for events. So the panel must be opened and then the Vi must be run.
I have tried all the squence,open VI->sent value->run VI / sent value ->open VI->run VI / sent value->run VI->open VI / open VI->run VI->sent value / run VI ->open VI->sent value / run VI ->sent value->open VI, before I creat that topic.But nothing happend,the case structure can't handle the event.

Second,

Also why not send a TRUE event to BooEve? How can you tell if it's working if you are sending a FALSE?
I can tell the case structure has worked well if the Tmp_called.vi stopped after the Tmp_called.vi stopped.

This time I edit the VIs.And if the case structure handled the user event,Tmp_Called.vi will unload itself.Otherwise,the "NG" light will be lighted.I hope you try more than twice.Because sometimes,this structure can work normally at first run,but can't react the second time you call it.

By the way,can you tell me where I can find the same information,just like how the user event work.I really want to know that. I haven't seen that in the manual which only tell me how can I use user event but not how the user event work.

Hope for your help.

william

Download File:post-3059-1129859412.vi

Download File:post-3059-1129859454.vi

Link to comment
I use LabVIEW 7.0

This problem is that after you call the TMP_Main.vi more than one time,the TMP_Called.vi won't unload itself even after the TMP_Main.vi stopped.That means the event structure cann't handle the user event,"BooEve",which was registered in the TMP_Main.vi.

see the attachment

william

It works fine for me in 7.1. The Tmp_Called.vi unloads itself properly. There were some bugs in 7.0 that were fixed in 7.1. Also, try using the older method of closing the panel. I've attached an image that shows the Front Panel Open Property set to False. You also don't need the Abort VI method. Remove this.

As a general comment, I'm struggling to figure out why you are jumping through these hoops. There are simpler methods to acomplish your goal. Have you investigated queues or notifiers? These open a named reference that is easier to manage.

post-2-1130136931.gif?width=400

Link to comment

Hi Michael

Thanks for your suggestion.I've amend the VI according to your suggestion,and it worked well now.

And also thanks for your comment. Because I only used VB brfore I use LabVIEW,and VB is my first programm develop tool.So I think that's my habit to resolve these question in that way(Use event structure).I will try to investigate the queues and notifers later.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.