"Flame suit on!"
Hi Jiri,
Data Flow is working!
What I think you are seeing is a combination of two factors.
1) What do you get from a FOR loop that does not iterate?
and
2) Code optimization.
re:1
Asking this question is like asking "Where do I end up if I sit in my car but don't drive any where?" Answer: The same place you started!
re:2
This is where optimization kicks in. LV has gotten pretty smart about optimizing code. If it can detect something is going to be the same at run time as it is at edit time, it just puts the answer where it should eventually end up. In the case of the constants, LV can see that no matter how many times the loop iterates, the final result will always be the constant. You can prove this to yourself by modifying y
our example to an even more bizarre form. Break the wire inside your FOR loop that caries the Strinf control data. Drop a constant inside the FOR loop and wire it to the output tunnel. Run your VI and you will find that even though the FOR loop does not iterate, the output tunnel returns you contant! This is agian because LV recognizes (at compile time) that the output tunnel can only have one value.
I have read postings from Rolf Kalbermatter re:passing data through FOR loops. If my memory serves me he suggests;
1) Never wire data through a FOR loop that is not used. Wire around the loop.
2) Outputs from a for loop should come from a shift register that is initialized with the default value before the loop iterates, to handle the possibility the loop never iterates.
That is my rad on this Q. I will watch for other opinions.
I hope this helps,
Ben
"Flame suit off!"