Jump to content

Event Structure inside statemachine


Recommended Posts

Hi all,

I have a small problem here with my labview. There is an event structure in my vi which is placed inside a statemachine. If there is an event- the event struct responds only when the current state is equal to the 'even struct' state. Can I make my VI to respond to the events, anytime regardless of the current state ? :lightbulb:

I dont think it is possible without adding some codes (like passing to the event structure state before moving to the next state) right?:wacko:




Edited by Sharon_
Link to comment

I can't look at your 2010 code, but can you move the Event Structure out of your main loop? I don't know if I'm suggesting something that you already know, but take a look at the Producer/Consumer-Events design pattern.

As for your suggestion:

passing to the event structure state before moving to the next state

I use the JKI State Machine and do this when I have a repeating loop of states and still want to respond to user input. More often, I'll launch a separate process for tasks that will take longer than I want the UI to be unresponsive.

Link to comment

If you want the event structure to be responsive, you must make it the bottleneck in the loop execution. So execution should be mostly waiting for an event, not a millisec timeout. If the wait primitive is required, you will have to fallow what jcarmody has said. Any state that makes the execution wait for any undesired amount of time will cause the UI to be unresponsive.

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.

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.