Jump to content

How to generate a event in by code in vi


MViControl

Recommended Posts

You can also use User Events to fire the same event programatically, though that requires a little more supporting framework. Or, if your events correctly issue messages to parallel loops, you can achieve the effect of firing the event by simply sending the command directly to the parallel loop.

Link to comment

Thanks,

the purpose of thinking this is to reuse the code in the event case created before. e.g. I have created code for a button "value change" event, while in other place of vi, I want to programatically fire the event to excute the code in the event.

mesmith and Daklu,

do you have some simple examples to achive this?

Here are examples of both methods. Of course, in your real program you would want to make sure you do proper error handling and disposal of user events using "Destroy User Event"

Scott

Sorry, those were in LV 2009. Here they are in LV 8.6 if needed.

Trigger Event - Value Signaling.vi

Trigger Event - User Events.vi

Trigger Event - Value Signaling_LV86.vi

Trigger Event - User Events_LV86.vi

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.