LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV8.2 : General programming : bug (?!)

Hi,
 
I met very strange behaviour in LV8.2. I believe it is bug... but, maybe something is wrong on my PC or LV installation (Win2K, LV8.2 + DSC + RealTime). Attached zip file contains example VIs.
 
Run "Test Data Container 1.vi" with different value of "Value selector" control and pay attention to execution time ("Time elapsed" indicator). On my PC, I observe HUGE difference (ten times)! Looking at the code you can see that difference is only a value passed to "Data Container 1.vi" subVI (LV2-style global), the value is used as index of array element there.
 
I have no idea why time of access array element depends on element index, except a guess it may be a result of wrong compilation. Pay attention that "Data Container 1.vi" uses the same control for passing array size and element index in different modes. The attached file also contains 2 another VIs ("Test Data Container 2.vi" and "Data Container 2.vi") that use separate controls for array size and element index. These VIs work properly, i.e. time of access data element does not depend on element index.
 
Could anyone confirm and/or explain this?
 
Kind Regards
 
0 Kudos
Message 1 of 6
(4,442 Views)
It should be easier to look at the problem if the vis were attached 🙂
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 6
(4,439 Views)
oops... sorry... attached now
0 Kudos
Message 3 of 6
(4,437 Views)
The problem disappears when the index/size is placed inside the loop (outside the case structure). Could this be related to constant folding ?
Chilly Charly    (aka CC)
0 Kudos
Message 4 of 6
(4,427 Views)
Some additionnal comments
I have added a counter to the DataContainer 1.vi. With the vi FP opened, the counter display jumps to i+5000 then displays each iteration. When the index/size control is moved inside the while loop, the counter jumps directly to i+10000.
A similar result is obtained when moving the string control inside the loop.
Moving the action control has no effect.
 

Message Edité par chilly charly le 10-23-2006 05:21 AM

Chilly Charly    (aka CC)
0 Kudos
Message 5 of 6
(4,421 Views)
I can't definitively classify this as a bug just yet, but it looks like one to me.  The workaround chilly charlie posted is good, and I agree it does act like a strange side effect of something constant-folding related.
 
This was reported to R&D (42M6QJ1W) for further investigation.
Message 6 of 6
(4,374 Views)