LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compiler is Too Smart for My Own Good

Solved!
Go to solution

cc.png

Here the "FP.Close" runs before the case structure!  The darned compiler knows that the reference will be unchanged, so it doesn't wait for the case.

"If you weren't supposed to push it, it wouldn't be a button."
Message 1 of 55
(1,129 Views)

@paul_cardinale wrote:

cc.png

Here the "FP.Close" runs before the case structure!  The darned compiler knows that the reference will be unchanged, so it doesn't wait for the case.


So you're trying to be cute (but also correct) by wiring the reference through the case structure to create an "artificial" dataflow dependency, and the compiler outsmarts you by compiling as if you had the reference wire outside the case structure.  So how did you fix it?  Error cluster inside the case structure going to error in on front panel close?

 

This is alarming to me.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 55
(1,124 Views)

Well, I believe NI says not to wire through a structure unless something somewhere in the structure needs the data, so I guess there's that...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 55
(1,112 Views)

@billko wrote:

So you're trying to be cute (but also correct) by wiring the reference through the case structure to create an "artificial" dataflow dependency, and the compiler outsmarts you by compiling as if you had the reference wire outside the case structure.  So how did you fix it?  Error cluster inside the case structure going to error in on front panel close?


Synchronize Data Flow.vim could be used (one input being the panel reference, another being the error).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 55
(1,097 Views)

@crossrulz wrote:

@billko wrote:

So you're trying to be cute (but also correct) by wiring the reference through the case structure to create an "artificial" dataflow dependency, and the compiler outsmarts you by compiling as if you had the reference wire outside the case structure.  So how did you fix it?  Error cluster inside the case structure going to error in on front panel close?


Synchronize Data Flow.vim could be used (one input being the panel reference, another being the error).


Nice.  I suffer from being too lazy to learn all the new stuff from version to version.  In fact, it's posts like yours that cause me to add another tool to my tool bag.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 5 of 55
(1,086 Views)

@billko wrote:

@paul_cardinale wrote:

cc.png

Here the "FP.Close" runs before the case structure!  The darned compiler knows that the reference will be unchanged, so it doesn't wait for the case.


So you're trying to be cute (but also correct) by wiring the reference through the case structure to create an "artificial" dataflow dependency, and the compiler outsmarts you by compiling as if you had the reference wire outside the case structure.  So how did you fix it?  Error cluster inside the case structure going to error in on front panel close?

 

This is alarming to me.


Here's how I fixed it:

cc2.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 6 of 55
(1,083 Views)

@paul_cardinale wrote:

@billko wrote:

@paul_cardinale wrote:

cc.png

Here the "FP.Close" runs before the case structure!  The darned compiler knows that the reference will be unchanged, so it doesn't wait for the case.


So you're trying to be cute (but also correct) by wiring the reference through the case structure to create an "artificial" dataflow dependency, and the compiler outsmarts you by compiling as if you had the reference wire outside the case structure.  So how did you fix it?  Error cluster inside the case structure going to error in on front panel close?

 

This is alarming to me.


Here's how I fixed it:

cc2.png


Looks like "Rube-ish" (pun intended) at first glance, but when you know the reasoning behind it...

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 55
(1,074 Views)

I, for one, am very interested to see how you figured this one out!

0 Kudos
Message 8 of 55
(1,050 Views)

I guess this is Stupid Question Time (for me at least)...why aren't you wiring that error wire to the FP.Close Invoke Node?

0 Kudos
Message 9 of 55
(1,045 Views)

@BertMcMahan wrote:

I, for one, am very interested to see how you figured this one out!


Fortunately Highlight Execution worked in finding it.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 10 of 55
(1,031 Views)