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.

19 Comments
ABCPrograms
Active Participant

Can't you just right click on the disable frame, remove it, and drag a case structure over the code?

Kind regards,

- Bjorn -

Have fun using LabVIEW... and if you like my answer, please pay me back in Kudo's 😉
LabVIEW 5.1 - LabVIEW 2012
JackDunaway
Trusted Enthusiast

@ABCPrograms wrote:

Can't you just right click on the disable frame, remove it, and drag a case structure over the code?


No, because only the code in the visible frame will be preserved. Code in the non-visible frames will be deleted with the structure.

Wim.Tormans
Member

@JackDunaway that is the main reason why I added my 'Idea' to the Idea Exchange Smiley Wink

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.