The Daily CLAD

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Serial Event Structures

SercoSteveB
Active Participant

The user runs the following VI and then performs a single left mouse click and release on the control named Boolean.  What is the resulting value of Numeric Value Out?

Serial Event Structures.bmp

NOTE:  Boolean Control is configured for Switch Until Released mechanical action

a) 0

b) 1

c) 2

d) Undefined (the VI does not stop)

Comments
LordNobady
Member

C.

The value Change gives 2 events for a single click and release. one for the click ( change to 1 ) and one for the release ( change to 0 )

And if I am not mistaken the event structure quees the events so even events that where triggered before it was waiting for it, ( not that where triggerd before initalization ) will be executed.


Learning LabVIEW since January 2013
adiveppa
Member

Ans is C

crossrulz
Knight of NI

C

Each event structure has its own queue and each event structure that is registered to an event will see the event.  Events are a lot like notifiers in this regard.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
mini09
Active Participant

Accepted C as well....

RAMESHB
Member

Ans is C.

taper
Member

C, but not for the reason you may think.  Both event structures are triggered by the initial click.  The above vi will finish and display 2 even if you never release the button.  If you had these structures in while loops(like you should), they would each trigger twice on a click and release.  Doesn't matter if the 2nd event structure isn't executed until after the click and release is finished.


--Using LV8.2, 8.6, 2009, 2012--
crossrulz
Knight of NI

taper wrote:


                       

C, but not for the reason you may think.  Both event structures are triggered by the initial click.  The above vi will finish and display 2 even if you never release the button.  If you had these structures in while loops(like you should), they would each trigger twice on a click and release.  Doesn't matter if the 2nd event structure isn't executed until after the click and release is finished.


                   

That's what you call over analysing the question.  The point here is that each event structure will trigger on the first value change of the button.  The second event structure will have the event queued, but won't be able to run until the first event structure is complete.

BTW, I have plenty of VIs running around that have event structures not in loops.  They are dialog VIs and only look for a OK or Cancel.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
SercoSteveB
Active Participant

So taper what are we saying here?  That it doesn't matter what point in the dataflow we have reached, all event structures in a VI (with a particular event registered) will queue that event, when it occurs, and execute it when the dataflow reaches them?

That is my thing to learn today.  Nice one.

MrStevenUND
Member

C

SercoSteveB
Active Participant

Answer: C.  Nice one LordNobady, adiveppa, crossrulz, gnshmrthy, RAMESHB, taper & MrStevenUND.

Just when I think I have got Event Structures down, a snippet of information comes along that aligns things up just that little bit better, thanks taper.