The Daily CLAD

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

Re: Event Structures Boolean Controls #2

SercoSteveB
Active Participant

The following VI is run.  Some time later the user performs a left mouse button click and release on the 'stop' control.  What is the value of Numeric Value Out following the left click and release on the 'stop' control?

 Event Structures #2.png

 

 

a) -1

b) 0

c) 1

d) Undetermined (the VI does not stop)

Comments
srinath@elsys.in
Member

Ans D

the VI will never stop. Here we are disabling stop button so event never execute.so VI never stop

sumasbhat
Member

Ans D.

we are disabling stop button. so we can not stop VI.

srinath@elsys.in
Member

your correct sumasbhat.....

Gabe712
Member

D)

stop button is disabled, can't click on a disabled FP object.

<<Taking CLAD exam tomorrow thanks to all! These exercises have been tons of help!

Wish me luck!

SercoSteveB
Active Participant

Good luck Gabe712. 

When you get back, can you please post your thoughts on the exam, suggest additional topics for us to to cover and anything else that you think might be of use to CLAD takers?

Steve

RustyStrings
Member

what everyone else said

mini09
Active Participant

I agree with Srinath, Gabe712  and Sumasbhat.

SercoSteveB
Active Participant

Answer: D  Nice one srinath, sumasbhat, Gabe, RS and gnshmrthy.  Yep, unlike the Mouse Down event (in yesterdays question) we cannot generate a Value Changed event on a disabled control.

giulio91
Member

I would have answered B: since the default value of Numeric Value Out is 0, and isn't written that its value was changed, I assume the value when starting the vi is still 0.

"What is the value of Numeric Value Out following the left click and release on the 'stop' control?"

the click and release of the button does not trigger that event, so while is true that the vi does not stop, it's also true that Numer Value Out is 0 after the user interaction.

Steve, could you give any comment please?

Giulio

RustyStrings
Member

you make a good point the indicator still has a value that is readable and would default to 0, and would still be zero even if you click on the control

but I think the main point demonstrated here is that a disabled control will not change value and not trigger the event, so the the code will not stop which is correctly stated in answer D

perhaps if the indicator was initialized with a random number first and hidden, then changed to a known value and shown in the stop even there would be no other way to think about it

crossrulz
Knight of NI

sometimes you just have to go with the "best" answer.  Part of D is stating that the VI does not stop, making it the better answer.

And if you want to split hairs, you could claim that somebody put a random value into "Numeric Value Out" before the VI was ran or it has some random default value.  So the value would still be whatever value it was set to before the VI was ran.


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

Crossrulz make a good point the value could have been changed

SercoSteveB
Active Participant

Hi giulio91 you are correct I didn't think about that one when writing the question.

I would say that as a general rule for CLAD type questions it is a good idea to go with the obvious, as crossrulz suggests, and try to avoid over thinking it, we'll leave that for CLD's and CLA's questions....and anybody else who wants too.  When creating questions I think about a concept and attempt to write a question around it.  The concept for this one was definitely that if you Disable and Greyed Out a Control via a property node can you subsequently fire a Value Change Event via the Front Panel.

I bin loads of 'The Daily CLAD' questions following a 'what if, what then' type conversation with myself.  There are always going to be 'what ifs' that don't occur to me and its great for people to point them out here and spread the love.

giulio91
Member

Thanks to all of you, good points.

I have my clad exam in a week and this daily clad is very useful!!