LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug with "Show Constant Folding" in LV 8.2

The attached picture shows where the problem is : LV thinks that the inside nested loop generates a constant.
The vi must be run twice to generate a proper result. The first run always generates an array with a column number corresponding to the previous value of Numeric
Workaround : carefull with the new show option (:() and wait for the next version... 😉
 

Message Edité par chilly charly le 09-01-2006 10:19 PM

Chilly Charly    (aka CC)
Message 1 of 4
(3,683 Views)

Ouch!  This is nasty Smiley Surprised

Some futher details:

  1. I built the VI as you displayed without either constant folding option (wire or structure) enabled, and the VI performed properly.
  2. I then turned on both options, and it still ran properly (with hash marks only shown on the wire out of the pi constant).
  3. I then dropped another For Loop on a different part of the diagram, and suddenly the constant folding showed up as you display, and the performance was incorrect (after deleting the useless For Loop).  The first time I ran the VI in this case the output array was actually empty.
  4. I then turned off both constant folding options, and the VI still performed incorrectly.
  5. I then deleted and re-wired the wire connecting the two "N"s, and the VI performed correctly.  (It appears a "recompile" is necessary to remove the problem - clicking the Run button with Shift held down works as well)

I find it rather troubling that an apparent environment-only setting is actually affecting the behaviour of a VI Smiley Sad

Jaegen

Message 2 of 4
(3,662 Views)
From what I can tell, you cannot disable constant folding. You can only decide to either show or hide the hash marks that indicate folding.
 
Some observations:
  1. The result is correct of you replace the control with a diagram constant.
  2. The behavior is correct if you wire both N to the control instead of relaying throught the outer N (Image top).
  3. The only real use to wire from inside the N is in cases where the outer loop count is determined by autoindexing only. In this scenario the bug shows again (image bottom).

Message Edited by altenbach on 09-01-2006 06:20 PM

Message 3 of 4
(3,646 Views)

Hi all,

This was reported to R&D (# 41422LTO ) for further investigation.

Thanks for the feedback!

Alexandre D

NIF

 

Message 4 of 4
(3,552 Views)