LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Wim.Tormans

Add the ability to replace a disable structure with a case structure

Status: New

Hi,

 

when I have to rework a vi, i usually start by putting the existing code in a disable structure

and then start working in the disabled 'case'.

 

Quite often I end up trying to replace the disable structure with a case structure to test the new or reworked vi.

 

Now I have to copy everyting into a temporary vi, remove the disable structure, put a case structure in place, paste again and rewire iputs and outputs.

 

Please add the ability to replace the disable structure with a case structure.

16 Comments
dthor
Active Participant

I really wish this Idea would gain more momentum... Smiley Sad

SeanJ
Active Participant

I totally agree. 

 

It's extremely tedious having to take out the case when a simple replace with state diagram would do the job.

 

Another reason not to use the disable/ enable structure, unfortunately I have to work with others peoples code and they don't share the same sentiment!

RavensFan
Knight of NI

Diagram Disable.

 

This comment added to help future searches based on this idea.

GregSands
Active Participant

A (slightly) easier work-around than creating a temporary vi is to enclose with a case structure, duplicate the case frame, and then remove a different disable frame inside each case frame.  Still not as easy as a direct replacement.

drval
Member

This is a GREAT idea and, yes, Casing the entire disable structure and duplicating then editing each frame works, but it's a kludge or a workaround.

dthor
Active Participant

I love this Idea, and I voted for it so long ago when it was first posted. But I just came up with some questions and answers, so here they are. Also, I'll be replacing "Diagram Disable" with "DD" because I'm lazy.

 

What is the resulting case structure's input terminal data type?

I see it as boiling down to two options: Boolean and Integer.

A. Boolean: only works for two-case DD structures

B. Integer: works for all DD structures.

C. Boolean and Integer: this one would be adaptive: 2-case DD structures would end up as BOOL, and multi-case DD structures would end up as INT

I like option C myself, but this might cause some confusion when users expect one and get the other.

 

Which case ends up as TRUE (or "0, Default")?

A. The currently visible case ends up as TRUE / "0, Default"

B. The active case ends up as TRUE / "0, Default"

C. The first case (as in what shows up in the Reorder Cases dialog) ends up as TRUE / "0, Default"

Here, option B has an issue: There can be case structures that do not have an active case (although this results in a broken vi). I like option A the best.

 

What happens to the tunnels?

A. They stay as "use default if unwired"

B. constants are created on unwired tunnels

C. A wire is created from the right side of the structure to the left, allowing for pass-through data, on unwired tunnels

I think the obvious option is A. For B, you have a chance of making a whole lot of clutter with constants being created all over the place.

garrettmarsh
Member

While we're at it, the reverse would be quite useful as well: right-click on a Case Structure and have the option "Replace with Diagram Disable Structure". In 2011, the only 'replace' option for case structures is Stacked Sequence.

X.
Trusted Enthusiast
Trusted Enthusiast

For what it's worth here is a workaround for this missing feature:

 

-surround each case content by a sequence structure. Make sure you encompass each input and output without cutting corners to that their layout is preserved. Label the sequence structure with the case name. Drag the sequence out of the disable structure somewhere nearby on your diagram.

- repeat for each case.

- delete the disable diagram structure and replace by a Case structure

- move back each sequence structure in a case

- label each case with the name of the sequence it contains (or whatever you wish). Reconnect inputs and outputs. Remove the sequences (Right-Click >> Remove Sequence).

- Voila.

 

PS: at no time should you Ctrl-B (Ctrl-Bomb) your diagram, as this could have pretty disastrous effects.

 

We REALLY need a native shortcut for that...

ouadji
Trusted Enthusiast

already almost five years and still nothing.

too bad !  Yet this feature would be very useful

tst
Knight of NI Knight of NI
Knight of NI

If you really feel you need this, you could write code which would do this yourself (by doing something like what X. describes). In LV 2015, you can also add it to the context menu.


___________________
Try to take over the world!