LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event cue??

I have an event structure with a "drag ended" event for my graph.  Everytime when the cursors of the graph (2 separate cursors on the graph) is dragged and dropped, the code within the event case will execute.

 

If the user does two "drag ended" events back to back, and the code inside the event case has not completed after the first event, would the second event be ignored?  If so, is there a way to get around this?  Actually, I only want the multiple event to occur before the event case is execuate.  Is there an easy way to do this?  Thanks!

 

 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 1 of 11
(4,020 Views)

@jyang72211 wrote:

I have an event structure with a "drag ended" event for my graph.  Everytime when the cursors of the graph (2 separate cursors on the graph) is dragged and dropped, the code within the event case will execute.

 

If the user does two "drag ended" events back to back, and the code inside the event case has not completed after the first event, would the second event be ignored?  If so, is there a way to get around this?  Actually, I only want the multiple event to occur before the event case is execuate.  Is there an easy way to do this?  Thanks!

 

 


 

Use a dynamic event and unregister it when it is no longer useful?

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 11
(4,017 Views)
If I need to discard events I use the time the event was registered and compare it to the Ms tick count. It would of course be great if we could flush the event queue...
Michael
Message 3 of 11
(4,005 Views)

Can you elaborate on that?  I thought dynamic event is just event trigger inside the software through the generate user event node?  How does that relate to actual event generated by user in the UI?  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 4 of 11
(3,997 Views)

it lets you control at run time what widget triggers the event.

 

Ton taught me I can reregister the event from a constant that never triggers effectively shutting off all new events.

 

See Ton Nugget here.

 

Ben

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

Is it true that when multiple events happen, they are stored in a queue somewhere?  If the program is in still running code for the first event, the second, and third event are not lost, right?

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 6 of 11
(3,979 Views)

I would choose "yes" if asked on a test.

 

As already mentioned above, there is a time stamp in the form of a ms timeer count as to when the event occured and if they are stale (too old) they could be tossed.

 

Ben

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

Events are queued up, yes. In the event structure you can get the control values of the time. If you use e.g. Local variables or the controls themselves in the structure it'll be the current values. Which is preferrable is depending on the application.

If you want to wait for events to finish you can stors ms counter when finished and ditch events that's too old (before the current event finishes)

 

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 11
(3,952 Views)

How do you ditch an event?  

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 9 of 11
(3,933 Views)
Like I said, you cannot. What I do is compare the time in the left event node to the current time then wire the comparison to a t/f case. The rest of the event code will go in the case structure hence the event is effectively ditched, even though it was actually serviced.
Michael
Message 10 of 11
(3,925 Views)