04-25-2018 04:26 AM
Morning all,
Here is Q34 from the CLD-R practice exam:
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?
Solved! Go to Solution.
04-25-2018 04:42 AM
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.
04-25-2018 04:51 AM
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
04-25-2018 10:19 AM
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.
04-26-2018 03:06 AM
@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.
04-26-2018 07:03 AM - edited 04-26-2018 07:13 AM
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/.