06-20-2016 04:08 PM
Normally I leave the constant folding display turned on for both wires and structures. Today I noticed this:
You'll notice that not only is the case structure marked as being folded, but so are the wires connected to controls on the front panel. After playing around with it a bit, I discovered that you can make the folding go away in one of a few ways.
Interestingly, putting a sequence structure around the first case structure does NOT correct the problem. For those of you who like code (I hear you Bob!) the VI is attached.
Mike...
PS: Oh yes, this is in LV2015sp1
06-20-2016 08:40 PM
Wow! I don't understand anything about this Post, including its title. I don't even think I could create this by myself from scratch. What am I supposed to see? What's wrong? I am so puzzled ...
BS
06-20-2016 09:04 PM
Constant Folding is when the compiler can turn part of your code into a constant. Needless to say, that can greatly increase the performance of you code. You can have the editor show you when constant folding is happening from a setting in the Options->Block Diagram. For wires, they will look fuzzy to show constant folding. Structures show faded stripes in them.
06-20-2016 09:16 PM
06-20-2016 10:11 PM
Thank you for the explanation. I must confess I've never paid much attention to this setting, and had never turned it on. Doing so, of course, dramatically changed the appearance of Mike's VI (to match the picture in his post -- needless to say, when I opened it in my LabVIEW 2015 SP1, with the options cleared, there were no wavy lines nor filled-in Case structures).
Bob "Still Learning" Schor
06-21-2016 12:07 AM - edited 06-21-2016 12:23 AM
We discussed a similar observation elsewhere recently. The important point is the presence of the feedback node, which is anchored to a invisible single iteration loop scaffold surrounding all code (similar to a shift register). This means that the case structure is folded as loop invariant code.
I agree this is somewhat confusing.
06-21-2016 07:02 AM
06-21-2016 08:18 AM
@crossrulz wrote:Constant Folding is when the compiler can turn part of your code into a constant. Needless to say, that can greatly increase the performance of you code. You can have the editor show you when constant folding is happening from a setting in the Options->Block Diagram. For wires, they will look fuzzy to show constant folding. Structures show faded stripes in them.
Honestly I was thinking something happened to my LabVIEW which started showing Fades on wires till now.
06-21-2016 08:59 AM
Well aside from the fact that the max of 0 and an U32 is a no-op (and therefore can actually be removed by the compiler) Ifind the display of what is constant folded and what not to be, let'sput it politely, hard to decipher.
06-21-2016 09:12 AM
@mikeporter wrote:
Where was that discussion at? I looked on the forum and didn't find anything.
I am pretty sure that conversation was during the latest beta.