Jump to content

How can I check the UI event in code?


sironline

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

 

Philippe

SM question.vi

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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