januar Posted May 2, 2006 Report Share Posted May 2, 2006 I have found a strange behavior of Insert Into Array in LV 8.0 I have used it many times in LV 7.1. If I use Insert Into Array in a loop (While loop) then I will get an array which is going bigger. As input of n-dim array I use the output of initialize array which is the same all the time and I insert a fix element into the first place. See the attachment. Jan Download File:post-4552-1146552271.vi Quote Link to comment
Ulrich Posted May 2, 2006 Report Share Posted May 2, 2006 I have found a strange behavior of Insert Into Array in LV 8.0 I have used it many times in LV 7.1. If I use Insert Into Array in a loop (While loop) then I will get an array which is going bigger. As input of n-dim array I use the output of initialize array which is the same all the time and I insert a fix element into the first place.See the attachment. Jan Hi, If you chance the value of the element from the initialize array it starts from the begining. Change the Indicator "initialized array" into a control instead of the initialize array the VI will work fine. very strange. Uli Quote Link to comment
James N Posted August 21, 2006 Report Share Posted August 21, 2006 I had the same problem. Here's a portion of NI support's response: _____ This appears to be a constant folding bug. I apologize if this is review, but constant folding is the process by which the compiler takes the code and wraps the constants into the compiled machine code itself rather than allocating storage in memory for them like variables. LabVIEW appears to be tricked into thinking that it doesn't need to recheck the color control array input again, since all the inputs it receives in the loop are constants. We have seen similar issues on rare occasions with loops and constants in LabVIEW 8.0, though not this particular instance. I am quite confident you would see the same behavior with a For Loop in your code. I will add your information to those existing reports for further investigation by R&D. This will be a high priority for us to say the least. In the meantime, I would recommend one of the following workarounds. First, as you mentioned, you could place the Index control inside the loop, which will short circuit the constant folding that causes this bug. Alternatively, you could leave the Index control outside the loop and turn its wire tunnel on the loop frame into a shift register. Then just wire the data through from the left shift register node to the right one. That will force LabVIEW to reread the control value every time. ____________ -James Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.