# Challenge: figure out why this loop doesn't stop

## Recommended Posts

I have a challenge for you: looking at this VI snippet, it appears that this loop should stop after 11 iterations. However, when you click Run Once, it doesn't stop. See if you can figure out why it doesn't stop.

Hint (if it really is much of a hint): it uses a trick I sincerely doubt you've ever seen before!

If you don't have LabVIEW 2015 (or don't feel like loading it from a VI snippet), here's a version that should work on versions as far back as 2009:

LV2009.vi

:-S What did you DO to the subtract node?!

+ and - primitives use the compound arithmetic node, IIRC. I expect you set the first terminal to invert?

What do we win if we get it right?

Edited by ShaunR

+ and - primitives use the compound arithmetic node, IIRC. I expect you set the first terminal to invert?

What do we win if we get it right?

It's clearly not a compound arithmetic node. Is there a way to make one look like a regular subtract node or something?

And you don't win anything; I'm just curious if anyone will figure it out.

Edited by flarn2006

Did you wire up the minus as 2-(shift reg), then move the wires around to make it look like (shift reg)-2?

Then the shift reg would go 10, -8, 10, -8,â€¦ and never be less than -10.

Replaced subtract node and now works as it should Why I have no idea ...

Did you wire up the minus as 2-(shift reg), then move the wires around to make it look like (shift reg)-2?

Then the shift reg would go 10, -8, 10, -8,â€¦ and never be less than -10.

I guess you are right, however the wires are not wired around, the Subtract function is actually flipped horizontally :

I'm still trying to figgure out how you did that, flarn2006...

Please tell me if it is not possible from within LabVIEW or I die before solving this

I'm guessing h

I guess you are right, however the wires are not wired around, the Subtract function is actually flipped horizontally :

I'm still trying to figgure out how you did that, flarn2006...

Please tell me if it is not possible from within LabVIEW or I die before solving this

I'm guessing he used his backdoor VI editor (https://lavag.org/topic/19178-low-level-vi-data-editor-warning-not-for-production-use/) to create a mutant subtract node

dcoFiller=0x2 apparently swaps mapping of parameters to instruction, and also prevents the top wire from becoming a stomper. 0/10, would not recommend; stick to dcoFiller=0x3

I'm guessing he used his backdoor VI editor (https://lavag.org/topic/19178-low-level-vi-data-editor-warning-not-for-production-use/) to create a mutant subtract node

That is cheating!

... But I guess you are right.

dcoFiller=0x2 apparently swaps mapping of parameters to instruction, and also prevents the top wire from becoming a stomper. 0/10, would not recommend; stick to dcoFiller=0x3

Hehehe... Found a new toy to trouble our trainees with.

Edited by LogMAN

I'm guessing h

I'm guessing he used his backdoor VI editor (https://lavag.org/topic/19178-low-level-vi-data-editor-warning-not-for-production-use/) to create a mutant subtract nod

Correct!

More specifically, I switched the "bounds" properties of the two input terminals.

Correct!

More specifically, I switched the "bounds" properties of the two input terminals.

Don't worry; the default palette is 100% organic.

Edited by flarn2006
• 6 years later...

Replacing the Subtract operator by the Compound Arithmetic one fixes the sickness.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×