From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CLD-R exam shared variable question

CLD-R, practice exam 2 question 11 reads:


 

As part of shutting down your application, you need to turn off three values by writing false to three variables. Which of the following code segments ensures that the shutdown code executes reliably and all errors are reported?


2 answers out of 4 seems to satisify the requirement:

A.AnswerA

 

D.  Clipboard02.jpg


Answer A is listed as correct. Why?

 

The only difference between A and D that I spot is that the order in which those shared variables will be written to is undefined in D. However, since it is not specified which "Power" are we shutting down and whether and how the "Power" is related to "System Running" and "Output Enable" one can not make a desiciion that "executes reliably" = "shutting down the <<Power>> last".

Am I missing something obvious? 

 

0 Kudos
Message 1 of 6
(3,727 Views)

Its a trick question, maybe the sequence structure ensure the 3 shared variables are all set to false state consequentively by the sequence structure. If there are other writer to the shared variable then at anytime the other shared variable writer may set a variable to True preventing shutdown.

 

IMHO, it one of those way out there questions.

0 Kudos
Message 2 of 6
(3,721 Views)

Every time I see something like this it makes my head explode. I don't care which on you use: A or D. LabVIEW sure as Hell, MI BETTER shut all of them down, reliably. If not then you would be better off throwing LabVIEW out the window as a "data flow" language. Who writes these questions? Smiley Mad

PaulG.

LabVIEW versions 5.0 - 2020

“All programmers are optimists”
― Frederick P. Brooks Jr.
Message 3 of 6
(3,716 Views)

I agree that the wording of the question is a little ambiguous, and you're correct in that it does not specifically state that reliable shutdown execution requires shutting down Power last.  I believe it's just something that is supposed to be inferred from examining choices A, B, and C (all of which write false values in order from System Running -> Output Enable -> Power).

 

CLD-R_2_11.PNG

0 Kudos
Message 4 of 6
(3,688 Views)

I got the answer correct right away but also groaned. Maybe this is why I spend too much time on my LabVIEW projects. If the first fails, why proceed with the next two operations? I understand the contrieved example yet it seems like poor practice to put inferior coding practices out there.

0 Kudos
Message 5 of 6
(3,625 Views)

Hi,

 

As i understood the sequence is playing the role here but why only using sequence loop for it is right choice, when we can control sequence using error wire also.

 

If there is error in switching off first two why to switch off power..

 

So in my opinion B should also be right option,

 

Thanks - HS

0 Kudos
Message 6 of 6
(3,609 Views)