LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CLD-R Exam 1, Question 22

Solved!
Go to solution

I am sitting the LabVIEW CLD-R exam in a few days & attempting some of the sample questions.

Question 22 has me stumped, I just don't get it.

I tried it in LV 2015, and can't seem to get the correct answer.

 

Can anyone explain to me whats happening here, (I generally don't use recursion, which is why I don't get it I suppose).

I will attach my attempt (that does not work..)

 

Thanks in advance for anyone's help

0 Kudos
Message 1 of 12
(4,984 Views)

Just to help... attached is the actual question, just in case people don't have the exam papers.

And apparently, this is is the correct answer, (the VI attached)

Thanks

Kevin

0 Kudos
Message 2 of 12
(4,937 Views)
Solution
Accepted by topic author kevin57

Your VI-upload contains one error in comparison to the sample exam. You missed to connect the string "ExprOut". Add this to your VI:

grafik.png

There's also a second smaller problem with the suggested solutions from that sample exam: it is written for an environment with a dot as the decimal point. So it you use a comma as the decimal point, that's why I added explicitly the false constant to the conversion to string.

 

Regards, Jens

Kudos are welcome...
Message 3 of 12
(4,929 Views)

Very good... thank you very much.

I cannot believe I missed that... no excuse I know, but it was late at night I was trying these (so obvious now that I see it...).

 

Now that I see it working I get it, thanks heaps.

 

Kevin

 

0 Kudos
Message 4 of 12
(4,899 Views)

Hi you guys.

 

Still I can´t get why answer D is the right one. Probably something related to recursive function? I was learning about this but still can´t get the reason why D is right.

 

Can anyone help me?

0 Kudos
Message 5 of 12
(4,485 Views)
Recursion is a bit of a pain to understand. but you Have to have a way to STOP recusing or, you are gonna curse forever. So, example D chooses if it is appropriate to call itself again where C does not.

"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 12
(4,476 Views)

Thanks Jeff, but, opción B also stops recursing the VI. so whats is different there?

 

0 Kudos
Message 7 of 12
(4,473 Views)

@pcortes2 wrote:

Thanks Jeff, but, opción B also stops recursing the VI. so whats is different there?

 


The only real difference I am seeing is the Result double being stored in a shift register.  I would need to spend a lot more time going through the code to figure out if it really should be there or not (my current thought is NO).


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
Message 8 of 12
(4,465 Views)

@crossrulz wrote:

@pcortes2 wrote:

Thanks Jeff, but, opción B also stops recursing the VI. so whats is different there?

 


The only real difference I am seeing is the Result double being stored in a shift register.  I would need to spend a lot more time going through the code to figure out if it really should be there or not (my current thought is NO).


You are thinking correct.  The result of the incurred step is the output of the case.  so the loop output is not what you want as the result.


"Should be" isn't "Is" -Jay
Message 9 of 12
(4,459 Views)

Thanks !!!

0 Kudos
Message 10 of 12
(4,434 Views)