Sharon_ Posted December 29, 2010 Report Share Posted December 29, 2010 (edited) 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 ? I dont think it is possible without adding some codes (like passing to the event structure state before moving to the next state) right? Exp.vi Thanks, Sharon Edited December 29, 2010 by Sharon_ Quote Link to comment
jcarmody Posted December 29, 2010 Report Share Posted December 29, 2010 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. Quote Link to comment
SuperS_5 Posted December 29, 2010 Report Share Posted December 29, 2010 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.