LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional autoindexing Boolean output Bug

Solved!
Go to solution

This is a bit subtle, so I apologize in advance for the possible confusion.

 

Start with a While Loop and conditionally autoindex a scalar:

 

Example 1

Screen Shot 2015-02-23 at 11.58.25.png

 

As indicated, the boolean output is a scalar.

 

Now try the same with a For Loop (DO NOT REPLACE THE WHILE LOOP above by a For Loop. CREATE A BRAND NEW FOR LOOP):

 

Example 2

Screen Shot 2015-02-23 at 12.00.42.png

 

OK, so now, the boolean output is an array. Cool, that's what I wanted with the While Loop above, but was unable to achieve.

 

Now you can play with replacements:

 

In Example 1 above, replace the While Loop by a For Loop. Here is what you'll get:

 

Screen Shot 2015-02-23 at 12.02.39.png

 

So you CAN output a scalar Boolean in a For Loop, but you have to go through a While Loop to obtain this.

 

Now replace the For Loop in Example 2 by a while Loop:

 

Screen Shot 2015-02-23 at 12.03.52.png

 

Alright, here is my Boolean array output. But I had to go through a While Loop to do so.

 

I'd say this is a bug and the conditional indexing boolean output should be an Array (not sure whether there would be any point to have it be a scalar; last value output?).

 

Tested in LavBIEW 2013 SP1 64 bit

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

My guess for the reasoning for this is that the default of a for loop is to index the outputs whereas for a while loop it is an index? To be honest, I can't say I'd noticed that there was any sort of output on the conditional terminal... 

 

(I guess the bug is that it should either always be an array or you should be able to right click on it to disable indexing?)


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 6
(3,143 Views)
Solution
Accepted by topic author X.

Sam is correct: the conditional terminal is not an output of the for loop. When you "dragged it through" to the sequence you were actually creating a (non-conditional) indexing boolean array output. Click "diagram cleanup" and you'll see this. (I suppose it could be a bug that LabView allows the two nodes to stack on the same place on the loop.)

 

By the way, you can always output a scalar from a for loop. Right click on the tunnel, set it to "last value". 

Message 3 of 6
(3,124 Views)

Darn! I never use the Diagram cleaning tool and indeed, I had been a bit puzzled about the way the marching ants where drawn when I was trying to pull a wire from the Boolean "output" (which isn't one, as we now agree).

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

Now, if only LabVIEW was more vigilant about overlapping stuff... Smiley Wink

 

And you wanna know the real irony of that whole story? I actually already posted the same idea before and forgot about it.

 

Well, at least I can see that both I and the rest of the community are fairly consistent.


___________________
Try to take over the world!
0 Kudos
Message 5 of 6
(3,080 Views)

I knew that was coming. I was thinking the same way, except that I am a big "overlapper" myself...

In that specific instance, I would be ready to live with the rule that no shift register or any gizmo living on the edge of a structure can hide a wire (or any other thing for that matter). Just leave me the rest of the diagram to hide stuff wherever I wish.

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