Jump to content

How can I check the UI event in code?

Recommended Posts

In my program, a recursive state is being used. The state judge some conditions,and call itself or exit.

In the state, I want check the UI event. I adds "Idle" state in the front of the state queue,but found it will empty the queue.


My question: How to check the UI event or Jump to "Idle" state programly?

Link to post
Share on other sites

I am not sure what you mean by "it will empty the queue", but here is what you should do.


  • Make sure that you have a timeout different from -1 for the event structure (ex: 100)
  • Make sure that you append in the front of the queue
  • Make sure that the remaining state is connect to the state in of the "add states to queue" vi in every frame (this could explain your empty queue).


If you do all of the above, this should work fine.


Below is a screenshot and an example written in LabVIEW 2010.


5-25-2011 9-44-17 AM.png


Hope it helps.



SM question.vi

Link to post
Share on other sites

Join the conversation

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

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.