LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable event structure until in need

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

0 Kudos
Message 1 of 27
(5,384 Views)

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

0 Kudos
Message 2 of 27
(5,382 Views)

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.

_____________________________
- Cheers, Ed
0 Kudos
Message 3 of 27
(5,375 Views)

@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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 27
(5,372 Views)

You could use the "Pane:Mouse Down?" event handler and set Discard? to prevent FP objects from triggering and then reset when needed. 

0 Kudos
Message 5 of 27
(5,355 Views)

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 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 27
(5,351 Views)

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

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 27
(5,347 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 27
(5,324 Views)

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

0 Kudos
Message 9 of 27
(5,316 Views)

Show us some code

 

0 Kudos
Message 10 of 27
(5,311 Views)