LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Chris V

Diagram Disable Structure More Intuitive

Status: Declined
Functionality already exists and adding more functionality would go against structure paradigm already in place.

The Diagram Disable Structure is not intuitive. As it is, the Diagram Disable Structure is basically a Case Structure; the code in the Disabled case does not run and the code in the Enabled case runs. If I add a Diagram Disable Structure on my block diagram I get this:

 

bad disabled.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The code I selected is disabled.  Makes sense so far.  If I switch to the Enabled case, I see this:

 

bad enabled.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

AKA, no code will run (because there's nothing in the case).  Again makes sense.

 

Now the problem is if I want to switch between enabling and disabling my code.  I could place the code I want to run in the Enabled case, but then to disable the code I must delete it all.  Or I could delete the Diagram Disable Structure.  But then to re-disable the code I must add the Diagram Disable Structure again.  Confusing to follow and annoying to do every time.

 

I wish it worked like this:

 

I add the Disable Diagram Structure and it looks like this:

 

good enabled.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If I leave the block diagram looking like this, the code will run as it appears.  However, if I switch the case on the Block Diagram it should look like this:

 

good disabled.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Again, it will run just as it appears (nothing happens because I see no code).  I can put code in this case that I want to run when the other code is disabled, but basically whatever I see on the Block Diagram when I hit run is what will be executed.

 

I understand that this is a little different than most structures in LabVIEW that run the same no matter what you currently see on the block diagram, but it seems to be the only way to make the Diagram Disable Structure intuitive.

Applications Engineer
National Instruments
11 Comments
GregSands
Active Participant

Have you tried right-clicking the structure and selecting "Enable This Subdiagram"?  Does that do what you're looking for?

AristosQueue (NI)
NI Employee (retired)

All the disabled cases draw as grayed out. The enabled case is not.

 

Are you suggesting that it should be impossible to view the disabled cases? I like being able to flip back and forth between what code might have looked like and what it actually looks like.

crossrulz
Knight of NI

Chris V: "Now the problem is if I want to switch between enabling and disabling my code."

 

GregS is right.  You just right click on the structure and choose "Enable This Subdiagram".  That will turn the currently enabled case into Disabled and the selected diagram to Enabled.


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
9029930714
Member

if u want to swap your diagrams i.e. from disable case to enable case then i think this is the right solution. " just right click on the structure and choose "Enable This Subdiagram". This will swap the diagrams"

 

 

Chris V
NI Employee (retired)

@Aristos, I'm not saying that you shouldn't be able to see the disabled case, but that you should be able to use the diagram to switch between what you want the case to be a runtime, similar to a Case Structure with a constant wired to it.

 

Everyone is correct that you can right-click and choose "Enable This Subdiagram."  The point is that the way it currently behaves is counterintuitive. At least in my opinion. 

Applications Engineer
National Instruments
9029930714
Member

i want to edit something on my post. " just right click only on the Disable structure and choose "Enable This Subdiagram". This will swap the diagrams."

reddog
Active Participant

My one annoyance with the diagram disable structure is that when used with only two subdiagrams (which is 100% of the time for me), disabling the "Enabled" subdiagram doesn't enable the "Disabled" subdiagram.  This leaves the structure with two disabled subdiagrams which breaks the VI.  The work around is to of course first switch to the "Disabled" case and then right click and choose "Enable This Subdiagram".  However, I find this annoying when frequently toggling back and forth between two pieces of code that I'm testing.  The current behavior makes sense if there are three or more subdiagrams in the structure.  However, when there's only two subdiagrams, I wish that both the right click "Enable" and "Disable" commands toggled the structure.

GregSands
Active Participant

Chris: I think I now understand -- your idea is actually to have automatic enabling/disabling based on which subdiagram is visible, rather than which is "Enabled"?  I can agree with that (though I'm not sure it's necessarily more or less intuitive).  I wonder if the title of the idea could be changed to reflect the actual suggestion.

 

As a side note, checking this out led me to find that it is possible to type a description into the selector (in place of Enabled/Disabled)!  Never knew that before, and very useful - e.g.

 

Original.pngFaster.png

C:\Users\Greg Sands\AppData\Local\Temp\Faster.pngFaster.png
RavensFan
Knight of NI

You can have which frame is enabled be based on what is visible.  No other LabVIEW structure has this behavior.  And just scrolling through the structure to look at the other cases efffectively changes your program.

 

As for editing the labels, that sounds nice.  But I don't see the purpose of it when  you can just drop a free label in the case frame.

Sergey_Kolbunov
Member

Ravens Fan just told what I'd like to say. No other LabVIEW structure has this behavior. This kind of change would be confusing.