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

Status: New

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!

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

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.