The Daily CLAD

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

Re: Value Changed Event

SercoSteveB
Active Participant

Assuming initial values for Boolean 1, Boolean 2 and Boolean 3 of FALSE.  If the user runs the VI and then performs a left mouse click on Boolean 2 that fires the Value Change event shown in the snippet, what value is passed to Numeric Value Out?

NOTE:  There are no hidden cases in the Event Structure.

Value Changed Event 18_08_2016.png

a) 0

b) 1

c) 2

d) 4

Comments
crossrulz
Knight of NI

A


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
Hirren
Member

1) Stop connect to ?

2) Loop condition stop button connect to event how no errors?

Please explain ?

crossrulz
Knight of NI

Hirren wrote:


                       

1) Stop connect to ?

2) Loop condition stop button connect to event how no errors?

Please explain ?


                   

These are not important to the question, but what it looks like (I have not tried loading the snippet) is that Steve has another event case for Stop: Value Change in which there is a TRUE wired to the tunnel to the stop condition.  But yes, the stop button should be inside of its event case purely so the button can unlatch.


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
Hirren
Member

Seems like it ,if it is then it's T or F   

LordNobady
Member

A


Learning LabVIEW since January 2013
SercoSteveB
Active Participant

Good points.  Question modified.

AGriffiths
Member

I fell into the trap of thinking it would be C, but looking at everyone else's answers and then back at the question I see where I went wrong. Writing it out to test my understanding and hopefully explain it for anyone else who gets tripped up.

Each Boolean has already transmitted its value before the case structure starts waiting on a value change, so that even though Boolean 2 NOW reads true, the false it has already transmitted is the one that goes on to be processed. To have a result of 2 rather than 0, you would have to put the Booleans INSIDE the event structure.

Or click another boolean, as the next time the case structure executes it will output 2.

Good question!

majumdar
Member

can plz tell the logic bhind the ans thanks

AGriffiths
Member

The catch is in the order of operations. It doesn't process the values of the booleans until one of them changes, but it READS them immediately. So, when one of them changes it gets to work on the values they had before they changed.

To make it do what it looks like it should, you'd have to put the booleans inside the event structure.

nik35324
Member

A

dhans
Member

Answer is (A)

Best Regards,
Dhans 😉
Kudos are welcome 😉
Aspirant Labview Programmer (Labview 14) 😉
MrStevenUND
Member

A

SercoSteveB
Active Participant

Answer: A.  Nice one crossrulz, LordNobady, nik35324, dhans & MrStevenUND

Oh that Dataflow Paradigm, I have been caught out by this type of thing on more than one occasion.