From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
AristosQueue (NI)

Both disable structures should have less effect on diagram synchronization

Status: Declined

Declined for reasons listed by AristosQueue in the comments thread. The specific comment is pasted here for convenience:

 

"So... I originally proposed this idea in 2009. In the time since then, I've been lobbied and debated by both sides. I think I have to concede the idea. It appears that structure nodes on the block diagram mentally serve as synchronization boundaries for a majority of users -- even if the job of the structure node is to comment out code. I have not done a scientific survey of this, but I definitely find more people who think it should sync than who don't. And that appears to be the same opinion heard by my peers on LV R&D.

 

The LabVIEW NXG development did discuss this question and decided to maintain the existing behavior.

 

I think it is time to close this idea as "Rejected." It's been discussed many times. I don't see it changing ever at this point."

Both the diagram disable structure and the conditional disable structure are intended to allow easy enabling or disabling of blocks of code. These nodes ought to have no effect on a diagram except to remove or add sections of diagram. But they currently have the side effect of formalizing the blocks of code they surround, as if they were a sequence structure. There are two cases where this is undesirable.

 

1. Without the disable structure, these two loops would run in parallel. 

 conddis_unwantedsync.png

2. This VI arguably ought to terminate because that wire dependency from the loop to the Stop primitive is only created because whatever is in the disabled frame needs the result of the loop, but the code in the enabled frame does not. But because the disable structure acts as part of the code, this loop runs forever.

 conddis_shouldterminate.png

26 Comments
AristosQueue (NI)
NI Employee (retired)

> Have you ever so conveniently laid out your code such that the two operations in parallel ops could be disabled by the same rectangle?

 

Yes, particularly in those cases where I intended the code to be an option from the outset. It is particularly common with the Conditional Disable structure where I intend certain aspects to be compiled in on Platform A but not on Platform B.  I wrote several VIs like the one shown when the disable structure first appeared before I realized what it was doing to my performance.

JackDunaway
Trusted Enthusiast

Ahhh... that's legit, when you talk about the Conditional Disable structure (not just the vanilla Diagram Disable) and building for different platforms.

 

Even still, I would not pursue this idea, but that's only because I wouldn't use it. If it would take an R&D developer one week to completely implement, test, and forget this feature, then go for it! Otherwise, not worth it.

Neil.Pate
Active Participant

I would not be hugely happy with this idea. To me dataflow is so fundamental, and is so ingrained in my brain now that it would be counterproductive to work agains it.

 

In your first picture you have had to place the second loop to the right just to allow the diagram disable structure to interrupt the data flow. Almost all of my parallel loops are vertically aligned on the BD.

Edi_001
Member

I have programmed in side of a loop a Stop from "Application Control", later I used disable structure around that stop. It was working fine, but after removing disabled structure containing the disabled Stop my application stops even there was no reason to stop. Later I have experienced that removing the disabled structure leaves hidden object in the code and some how they get executed and it is no way debugging due the objects are invisible.

I am worried that this is a bug in Labview !

(Edi)
AristosQueue (NI)
NI Employee (retired)

> Later I have experienced that removing the disabled structure leaves hidden object in the code

 

I am very certain that isn't true. But if it is somehow true, you should post on the main forums a VI that shows that problem so that it can be investigated.

ghighuphu
Active Participant

I would argue that it goes against the flow - against the LabVIEW data-flow. I am happy, that all(!) structures work sequentially and they all work the same: collect all inputs, process the data, output the results at once.

Intaris
Proven Zealot

I'm going to go against the apparent general opinion on this one.  I would LOVE this to be implemented and I think it's the only option which can be logically supported when the actual use case of the structures is considered.

 

I feel that the reson the disable structures exist is NOT to alter dataflow.  If someone is misusing them for that reason, then I'm sorry if this change will affect your code but I think it's ridiculous that having a disable structure or a conditional disable forces dataflow where there should be none.  A disable structure is not a code construct, it's an editor construct and should (to me) be completely invisible to the compiler.  I would even suggest making the outline of the structure less visible or simply removing the tunnels, thus making it clear that this is NOT a structure in a coding sense.

Eric_Pope
Member

 

Here's an example of how diagram disabling a parallel process can change the meaning of the code, and prevent the process from running in parallel. 

disable diagram dataflow effect example.png

AristosQueue (NI)
NI Employee (retired)

The diag disable structs acting as a synchronization boundary is a different topic than the compiler optimizations. The diag disable synchronization is a topic that has been discussed elsewhere. There are pros and cons on both sides and there isn't a clear best answer. I happen to agree with Intaris. Here's the idea I posted to do this:

http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Both-disable-structures-should-have-less-effect-on-dia...

 

crossrulz
Knight of NI

Nothing like a recursive link...


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