The Daily CLAD

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

Re: Event Structures and Dataflow

SercoSteveB
Active Participant

The following VI is executed.  Assuming the default values for Boolean Value 1-5 are FALSE, if the user performs a left mouse press and release on the Boolean Value In 3 control, what is the value in Boolean Value Out?

untitled.bmp

a) TRUE

b) FALSE

Comments
thinnker
Member

Its (b) false is the answer.

Here we used event triggered on Mouse Up not the value change.

so previous value(FALSE) will passed to boolean value out

Anagha.G
Member

i think a is the answer

Calvin_Fernandez
Member

hi everyone,

could someone please explain to me how this vi-works. i`d like to work it out. thanks a tonne for the help.

regards
calvin
SercoSteveB
Active Participant

Hi Calvin.  Welcome to 'The daily CLAD'.

The box is called an Event Structure.  You can configure this type of structure to respond to events (keypresses, mouse clicks, mouse moves etc. etc).  In the question we have configured the Event Structure to respond to a Mouse Up event on any of the controls Boolean Value In 1-5. 

Because we haven't wired a value to the Timeout (egg timer shaped) Terminal, this event structure will wait forever for any of the configured events to occur.  When an event occurs the code inside the structure (for the appropriate event) is called. 

As we have not included this Event Structure within a looping structure, this VI will only respond to one event and then finish.

A little hint.  This question is not really about how an Event Structure works (although you need to know to answer the question).  This question is more about something fundamental to LabVIEW.

Hope this helps

Steve

ROSEJ
Member

answer is b

mini09
Active Participant

Yeah i go with all who says B.

Anagha.G
Member

yah now i too think ans is b coz value really doesnt change on mouse up and release

Calvin_Fernandez
Member

thanks steve.....:-)

regards
calvin
JÞB
Knight of NI

would be interesting to put the event in a loop- declare the MA of each bool and ask again


"Should be" isn't "Is" -Jay
BenoitP.
Member

I agree with JeffBoher, you can't answer to this question without the type of Mechanical Action for each control. And a Timeout could be define to let people think about the main question !

JÞB
Knight of NI

you can't answer to this question without the type of Mechanical Action for each control

Not quite.  As shown the event structure input tunnels will have all have a false as soon as the vi runs waiting for the event to fire. fire event and the PREVIOUS data enters the event All false OR'd = False out.

Its actually a race condition.


"Should be" isn't "Is" -Jay
SercoSteveB
Active Participant

Answer: B  As JeffBohrer states, the values of the Boolean Controls 1-5 are read when the VI runs, before the left mouse press and release is performed.  When the mouse left press and release is performed, the values at the input tunnels of the event structure are all FALSE.

Nice comments guys.  As I think Jeff is indicating in his last comment; I don't think you need to know the mechanical action of the controls to work out the answer to this one.  This is a dataflow question masquerading as an event structure question. 

If we had a loop around the event structure and the terminals then it would be a different story (thanks Jeff; a future Daily CLAD question defined).

JÞB
Knight of NI

Certainly, a good way to point to the caveats on using Event Structures and Latchers!  a must learn for any CLAD candidate!


"Should be" isn't "Is" -Jay