From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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 2, Question 34

Solved!
Go to solution

Morning all,

 

Here is Q34 from the CLD-R practice exam:

 

Exam 2, Q34.PNG

The answer sheet says that answer 'c' is correct. However, I've just tested that code and it runs indefinitely until I hit stop, so I would say that answer 'b' is correct.

 

Which answer is correct? If it is 'c', why do I not observe the expected result of a run time error?

0 Kudos
Message 1 of 6
(3,045 Views)
Solution
Accepted by topic author Mitch_Peplow

There is a run time error coming from the property node. But you have to enable automatic error handling to see it (but please don't).

 

The property gives an error since latched Boolean controls can't be set by a local (edit time error) or property (run time error).

 

The VI does not run indefinitely, as is stops when you press the button.

 

So, definitely C, AFAIC.

Message 2 of 6
(3,043 Views)

Ah of course, and now I think about it I've had that exact problem before! Silly me.

 

Regarding the run indefinitely, my interpretation of that was the VI would run indefinitely until the Stop button was pressed as the property node was having no effect on stopping the loop. I agree the answer is C though Smiley Happy

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

wiebe@CARYA wrote:

There is a run time error coming from the property node. But you have to enable automatic error handling to see it (but please don't).

 

The property gives an error since latched Boolean controls can't be set by a local (edit time error) or property (run time error).

 

The VI does not run indefinitely, as is stops when you press the button.

 

So, definitely C, AFAIC.


I actually like automatic error handling turned on in the development environment because error can get swallowed and you'd never notice otherwise - exactly as what happened in the example defined above.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 6
(2,991 Views)

@billko wrote:

wiebe@CARYA wrote:

There is a run time error coming from the property node. But you have to enable automatic error handling to see it (but please don't).

 

The property gives an error since latched Boolean controls can't be set by a local (edit time error) or property (run time error).

 

The VI does not run indefinitely, as is stops when you press the button.

 

So, definitely C, AFAIC.


I actually like automatic error handling turned on in the development environment because error can get swallowed and you'd never notice otherwise - exactly as what happened in the example defined above.


I personally hate it, but I know some love it. Just one of those things.

 

AFAIK, it's not recommended by NI anymore (references needed...).

 

I would not be surprised if NXG won't have that feature.

0 Kudos
Message 5 of 6
(2,960 Views)

wiebe@CARYA wrote:

@billko wrote:

wiebe@CARYA wrote:

There is a run time error coming from the property node. But you have to enable automatic error handling to see it (but please don't).

 

The property gives an error since latched Boolean controls can't be set by a local (edit time error) or property (run time error).

 

The VI does not run indefinitely, as is stops when you press the button.

 

So, definitely C, AFAIC.


I actually like automatic error handling turned on in the development environment because error can get swallowed and you'd never notice otherwise - exactly as what happened in the example defined above.


I personally hate it, but I know some love it. Just one of those things.

 

AFAIK, it's not recommended by NI anymore (references needed...).

 

I would not be surprised if NXG won't have that feature.


I don't "love" it, but most of my property nodes error out connectors are not terminated.  During development, it reminds me if I've gone and done a more subtle version of what just happened in the exam question above.  I don't even think much about it because I rarely see a popup, but then I do, it's always been helpful.  I don't rely on it to do my error handling, but it helps to discover errors during development.  By the time the code is into the beta stage, I guess it doesn't really matter any more, because by then all my expected errors are handled explicitly, and unexpected ones are trapped and reported behind the scenes.

 

The reason why it's not recommended is that it teaches noobs bad error handling habits and they'll be in for a nasty surprise if they ever build an executable out of their code.

 

Here's an interesting discussion about automatic error handling and everyone has great input: https://lavag.org/topic/8349-automatic-error-handling-what-do-you-do/.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 6
(2,950 Views)