05-11-2012 05:33 AM
Dear All Expert,
Is there a way to disable or put the Event case structure to sleep until when we need its respond. The reason I am asking this is because when I am moving through a sequence of action and the event case of let say a mouse click occur, it will "memorise" that a button had been click.
When my sequence move to polling the event case for mouse click, without clicking the mouse button, this sequence is already completed as memorising the previous mouse click.
I wanted to ignored any event case happening during my sequencing until I poll it during one of the sequence and continue,
Is there a way to disable the event first? Pls help. Thanks a lot
05-11-2012 05:42 AM
Ciao Paradigm,
I'm not an expert but I'd like to share my experience: I tried to do this but I've not been able to do it, and as far as I understood it is not possible. I got rid of it having care to disable all of the controls I didn't wanted to "buffer" actions.
Regards,
Andrea
05-11-2012 06:07 AM
Putting the event structure inside one of the cases of a state machine can be a perfectly valid application architecture. A quick fix would be to wire the timeout node.
However from your description, I would be more inclined to use a Queued state machine, with the event structure (producer) feeding extra states to the consumer. Thus the QSM can sit happily doing its thing and queuing the next state to itself and still allow quick responses to user events.
05-11-2012 06:28 AM
@yenknip wrote:
Putting the event structure inside one of the cases of a state machine can be a perfectly valid application architecture. [..]
This is indeed a valid application architecture, but the event structure is still "armed". So the event mechanism still enqueues, but they will not get worked on.
So i doubt that this helps the OP.
Norbert
05-11-2012 08:31 AM
You could use the "Pane:Mouse Down?" event handler and set Discard? to prevent FP objects from triggering and then reset when needed.
05-11-2012 08:35 AM
2 solutions:
1. Use a case inside the event and do nothing.
2. Use dynamic event and register Void (look at mouse drag example)
/Y
05-11-2012 08:36 AM
Sear4ch this site for
State Diagram
and
"Ton Nugget dynamic event"
The first search is to learn about state machines which should be used in place of sequence strcures even if the flow is straight line.
THe second will show a wonderful Nugget posted by Ton that taught me how to use Dynamic Event Registration which in layman's terms is a technique that lets you turn events on and off wheneve you need to do so.
Have fun!
Ben
05-11-2012 11:04 AM
Check out our presentation from the last Chicago LabVIEW User's Group meeting. The entire meeting was covering events including the ability to arm/disarm events programmatically. I also posted something related in this thread.
05-11-2012 11:16 AM
Hi Mark,
I had read the Ton dynamic event and I am using a SM design although its not a QSM. My SM is non linear and had a page for Result waiting for user to click on the same 2D pictures and display the results.
I dont know how can the dynamic events helps in this case since all the event for all the 2D pictures is a mouse down event. When the mouse is click on any of the 2D pictures, it already register the event. When I come to the result state, it will straight away display the result without having the click on any mouse button again.
That is why I want the event to respone only when I am in the result state. Pls help. Thanks
05-11-2012 11:24 AM