08-26-2013 12:58 PM
Please could someone give me the correct answer to this question taken from a CLAD exam paper.
What mechanical action of a Boolean would you use to mimic a button on a Windows dialog?
a. Switch until released
b. Switch when released
c. Latch until released
d. Latch when released
The following is a straight cut and paste from the LabView help window 'Changing the Mechanical Action of a Boolean Object'
Latch when released—Changes the control value only after you release the mouse button within the graphical boundary of the control. When the VI reads it once, the control reverts to its default value. This behavior works in the same manner as dialog box buttons and system buttons. You cannot select this behavior for a radio buttons control.
Suggesting to me that the answer is 'D'. No other descriptions in Labview help mention dialog or system buttons.
However the answer has been given as 'B' Switch when released which I don't believe is correct.
The correct definitive answer would be most welcome as my exam is rapidly approaching.
Thanks again in advance.
Solved! Go to Solution.
08-26-2013 01:04 PM
I would go with D.
08-26-2013 01:10 PM
Thanks Altenbach, much appreciated although I would have been miffed on the day to be marked down for it.
08-26-2013 01:10 PM - edited 08-26-2013 01:12 PM
Actually, I believe "B" to be correct - and the cited NI documentation incorrect. I draw this conclusion from a simple test. On any typical Windows App, click and HOLD the mouse button on an application button of your choice. You will note that nothing happens until you let the mouse button go. Of course, the button will depress, but the event doesn't fire until "mouse-up." In fact, if you mistakenly click a button, you can always hold it down and move your cursor to a "safe" place and "mouse-up." The button event will not fire. The reason why I say "safe" place is because if you "mouse-up" over another button that event will fire!
[edit]
read it wrong. D is correct.
08-26-2013 01:17 PM
Thanks Bilko. I just created an event state machine activated by a boolean with a 'Latch When Released' mechanical action and it behaved exactly as your description. I think if the question comes up I will go with 'D' and hope NI have corrected the error.
Thanks again all.
08-27-2013 06:34 AM
If the "button" in question is e.g. a tick-box, then the answer is B. 🙂
/Y
08-27-2013 07:57 AM
A tick-box is not a button. 😉
(If the button is a car horn, the answer would be A :D)
08-29-2013 10:42 AM
Does anyone else find it "interesting" that a certification exam would rely on knowledge of the workings of a different software application?
Yes, Windows is "fairly" common and familiar to all, even die-hard Mac OS users. I have been using computers since the IBM PC-XT days and have never been a Mac person except when forced to use them for certain college courses. But I don't know the exact behavior of dialog buttons!
Jeff
08-29-2013 11:02 AM
So the switch/latch clearly happens when the button is released, but which is it? My experience is that it switches. Normally the dialog window closes right away, and the distinction is irrelevant, but when something is slow it seems the button remains pressed. Of course it is always hard to distinguish between a button remaining pressed and a UI not being refreshed...
The real question is, what should you use (not what Windoze may or may not do). I would say switch when released, B.
08-29-2013 12:49 PM
@Darin.K wrote:
Of course it is always hard to distinguish between a button remaining pressed and a UI not being refreshed...
In LabVIEW, the latch action button remains ON until it is read by the code, so if things are slow, it could also be that the buttons has not been read yet by the code due to some other slow process.
DIalogs often have also an [Apply] button, which keeps the dialog open. Here it is more easy to tell that it is latch action.
Sidenote: A more interesting distinction is between "latch when released" and "latch when pressed". Latch when released allows a small safety net. If you press down and immediately notice that you pressed it by mistake, you can move the mouse off it and it will not trigger. With "latch when pressed", once you press down, you can no longer change your mind about firing that nuclear missile. ;).