LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how use flush event queue?

Solved!
Go to solution

Hi all

 

So i have some difficulties to use flush event queue, i would like to know how use it before to put it, i use a Vi test very simple.

So if somebody have any idea?

 

Thanks for futur repply

 

Best regarde,

Guillaume.

0 Kudos
Message 1 of 10
(5,201 Views)

What are you trying to do?  Why do you have multiple event structures? Where is your VI?  What version of LabVIEW are you using? In 2013 new event controls were added but looking at your picture I'm not even sure what the goal is so I can't say if these new functions will be of any use to you.

0 Kudos
Message 2 of 10
(5,190 Views)

my Vi is in picture, so very basic. i'm using Labview 2013.

 

I have multiple event structure because in my project i have many buttons, so i prefere to use a simple VI only for test.

 

and i'm trying to enter in my case and controle in my loop some block (in picture it's is only a led), and when i'm in my loop, if i click on my first button (to enter in case) there is a event in queue, so i would like to flush it because when i leave the loop i return it directly.

 

(sorry for my english i'm not very good ^^")

 

i saw event control but i don't really understood how to use it =S

0 Kudos
Message 3 of 10
(5,179 Views)
The question was why you have multiple event structures? You are aware that placing an event structure inside a case statement does not mean the event will only process the event when the case is true, don't you?

Also, a picture cannot be debugged. If you want to post an image, then create a snippet. Posting the actual VI would be better. You should also provide details on exactly what you want to accomplish.
0 Kudos
Message 4 of 10
(5,163 Views)

@Guillaume90 wrote:

my Vi is in picture, so very basic. i'm using Labview 2013.

 

I have multiple event structure because in my project i have many buttons, so i prefere to use a simple VI only for test.

 

and i'm trying to enter in my case and controle in my loop some block (in picture it's is only a led), and when i'm in my loop, if i click on my first button (to enter in case) there is a event in queue, so i would like to flush it because when i leave the loop i return it directly.

 

(sorry for my english i'm not very good ^^")

 

i saw event control but i don't really understood how to use it =S


A picture is worth a 1000 words, but a VI is worth a million.  There are intrisic settings on the VI that don't translate to a picture.  What is the mechanical operation of the buttons?  Latch? Switch? Release?  These are things that a VI can tell me right away.  Also I may incorrectly reproduce the VI and have different functionality.  Also there are things I can't see like what other events are in each structure?

 

Very rarly should you ever have more then 1 event structure on a single VI.  Not because it in it self is bad, but because people get into situations like yours where one event structure is much more simple, and less prone to issues.  Can you have multiple event structures?  Sure, plenty of applications can be done that work fine.  But whenever I see this I suspect that the developer didn't know what they were doing and are causing application issues.

0 Kudos
Message 5 of 10
(5,159 Views)

because i need event when i click on my button, i can use case if i want, event is may be more reliable?

 

Yes i'm aware for event structure and it's my trouble because the first event struct keep in waiting my click on my button start, but if i don't place a second event structure in my case i couldn't have my click on buttons, except if i use case struct.

 

i want to enter in my case with my button start, then switch on my led and then leave, it's work, but after entering in my case, if i puch button start again, the first event struct keep in waiting my click, and when i leave my loop after switch on the led, i return again in my loop... i want juste to avoid this bug, so i want to delete every event of the first event struct in queue. if there are no solution i can hide button with node, i search another possibility to fix it.

 

 Thanks for all.

0 Kudos
Message 6 of 10
(5,152 Views)

you right, so i'm sorry, i'll put my VI on my last answer.

 

and i have two solution, event or case. I search the best way, and it's a way to learn labview.

0 Kudos
Message 7 of 10
(5,149 Views)

Please listen to all the guys who answered you. Having more than a single event structure makes no sense.

You can easily look your VI completely when pressing "stop" first. That is a typical caveat of the event structure and obviously, you have to learn this before moving on for your task....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 8 of 10
(5,147 Views)
Solution
Accepted by topic author Guillaume90
0 Kudos
Message 9 of 10
(5,106 Views)

i read it, and thanks for answers and for all informations.

 

Thanks guys.

0 Kudos
Message 10 of 10
(5,101 Views)