LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Petru_Tarabuta

Option to automatically insert the Merge Errors node when ending an error wire onto another error wire

Suppose that in the scenario seen below we would like to merge the error out terminal of VI 2.vi back into the main error wire. This is, of course, a common programming pattern.

1.png

 

 

 

 

 

 

 

 

 

Currently we would need to insert a Merge Errors node into the existing wire (Pressing Ctrl + Space, typing "erg", then Ctrl + I is probably the quickest way to do this), then wire the error wire as desired. Currently creating a wire from the error out terminal and ending that wire onto the existing error wire results in broken wires, as seen below.

2.png

 

 

 

 

 

 

 

 

 

It would be useful to have an option that specifies that a Merge Errors node would automatically be inserted in this case. That option could be named something like "Automatically insert the Merge Errors node when suitable", and could be located in the Tools >> Options... menu alongside options such as "Place structures with Auto Grow enabled" or "Auto-insert Feedback Node in cycles".

 

When the "Automatically insert the Merge Errors node when suitable" option is ticked, a Merge Errors node would automatically be inserted in the scenario described earlier, as seen below. This would save the few seconds required to execute the Ctrl + Space, "erg", Ctrl + I sequence.

3.png

 

 

 

 

 

 

 

 

 

 

Notes

  • I would be happy if the default value of the "Automatically insert the Merge Errors node when suitable" option would be unticked, which would maintain the current default behaviour.
  • Even if the option would be ticked (enabled) by default, I think it would still make sense from a usability point of view. I suspect that the number of times people intentionally use this feature would be greater than the number of times that people wire error wires together by mistake and would wish for the wires to be broken.

Thanks!

10 Comments
fefepeto_kb
Member

The idea is good in general, but I think some corner cases shall be clarified.

For example if we use in place element node to access data inside DVR and also call a VI inside the in place element node the incoming error wire will usually run at a lower position than the in place nodes. In this case, wiring the error out from either node will cause the merge error to be inserted. But what the order shall be here? More specifically what should define the order? In my opinion the most general solution would be that the wire that is wired later will be added to the next terminal. It would be harder to define which wire was the input, and sometimes the developer might want the freshly created error to be dominant.

 

If the implementation would go this way then adding more than two error wires together could be controlled easily. Inserting new node in the middle could be solved by wiring the new error wire to one of the wires in the middle.

wiebe@CARYA
Knight of NI
wiebe@CARYA
Knight of NI

>But what the order shall be here? More specifically what should define the order? 

 

If the order is wrong, switching is easy with the scissors tool (aka switcheroo tool hoover with CTRL pressed):

Switcheroo tool.gif

 

Of course it would be nice if it's mostly correct in the first place, if it's not it still saves a bunch of clicks.

Petru_Tarabuta
Active Participant

Thanks for linking to the Automatically insert appropriate node when 2 sources are wired together - NI Community idea. The idea I posted above is essentially a duplicate of that idea (posted in 2011). Unfortunately, I hadn't found it during the quick search for similar ideas.

fefepeto_kb
Member

>If the order is wrong, switching is easy with the scissors tool (aka switcheroo tool hoover with CTRL pressed):

 

This only works if you have two inputs. No less no more. That's why I carried on with extending the use case for more than two error wires.

If we consider this specific case, where we are talking about error wire, and I think it has enough value to be it's own idea, since error wires are different from the rest, then we could have something that works well. As an example if an array of errors is wired to an existing error wire we could simply use the merge errors, and call it a day. The same would not be possible with build array for example. There we have the option to concatenate or to increase the dimensions of the array.

wiebe@CARYA
Knight of NI

This only works if you have two inputs. No less no more.

 

Yes, but then the idea "automatically insert the Merge Errors" turns into this one:

Auto-grow build array, string concatenate, build cluster, interleave arrays, build matrix, compound ...

fefepeto_kb
Member

Fair enough. There might be differences in the build array vs the merge error tough, but it might not be a whole separate idea.

cbutcher
Trusted Enthusiast

One use case this would obstruct - often I decide to add a VI in between two others, and for whatever reason the quick-drop Insert isn't appropriate (or I can't easily grab the wires I want to insert onto, or something).

I might then wire from the 'upstream' error wire into my new VI, and then the output of my VI back onto the same area as where I sourced the error wire from. This breaks the error wire, as in your picture, but then I just delete the short joining part and I'm good(ish, considering it will probably be poorly layed-out, but at least functional) to go.

Merging errors here would make my code continue to work (i.e. not break it), and in many cases would make no difference (given common error-passing behaviours), but would be pretty terrible if my VI is mutating or handling the incoming error...


GCentral
Petru_Tarabuta
Active Participant

Thanks for pointing out this use case. I often use it too, but hadn't realised it would be impacted by this idea.

Hmm. Then perhaps a better implementation would be to automatically insert the Merge Errors node only when a modifier key is pressed while terminating the new wire branch onto an existing error wire. In other words, holding down Ctrl, Alt, Shift, or a combination of these keys, while terminating the wire would result in a Merge Error node being created (new behaviour). Terminating the wire without the key modifier would maintain the existing behaviour.

Christina_R
Active Participant
Status changed to: Duplicate

Duplicate of Automatically insert appropriate node when 2 sources are wired together - NI Community


Christina Rogers
Principal Product Owner, LabVIEW R&D