LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Constant Folding in 2009 vs. 8.2

Solved!
Go to solution

Has constant folding, or the displaying thereof, changed since 8.2? I have constant folding on for structures as well as wires. Notice I have a structure and a wire that do not match...

 

folding.gif

Richard






Message 1 of 5
(3,667 Views)
Confirmation.
In LV2009, I never see constant folding of structures.
No matter how often I save or run the VI, the BD never changes.
Guenter
Message 2 of 5
(3,639 Views)

Has constant folding, or the displaying thereof, changed since 8.2?

 

I certainly hope so.  8.2 had some big bad bugs in that regard.

 

I can't find the bug report right now, but I had a U32 control with a default value of MAXINT.  The first call to the VI was an INIT function, where that control was disregarded.  LabVIEW helpfully tried to allocate 4 billion DBL values, thinking it was doing me a favor.

 

I worked around it then, so I don't know if it was fixed in 8.6 (I suspect so). 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 5
(3,614 Views)

The same comparison holds true for 8.5 and 8.6.

 

As Guenter expressed, I can't get a structure to show folding no matter what combination of saving, running, disabling debugging I try. I guess, unless we hear further, that as of 2009, structures don't get folded?

 

 

Message Edited by Broken Arrow on 10-05-2009 07:21 AM
Richard






0 Kudos
Message 4 of 5
(3,577 Views)
Solution
Accepted by Broken_Arrow
There have been some changes made between 8.6 and 2009 regarding constant folding and I wanted to clear everything up.

First of all, in LabVIEW 2009 structures no longer get constantly folded if debugging is on. Go to VI properties on the execution page, turn off debugging and recompile your code you will see the appropriate structure folding.

 
That being said you will still not see constant folding on the example you posted in 2009. Because the code you wrote does not have any outputs, it will be removed in optimization, and therefore will not be constant folded. Take a look at the example below. This is in LabVIEW 2009 with debugging turned off. The top structures show the folding because they are connected to an indicator but the bottom two do not show folding since they are removed at compile.
Const Folding2009.PNG
Message Edited by Hueter on 10-06-2009 02:01 PM
Message 5 of 5
(3,532 Views)