I have a reference to an output terminal of a SubVI call. I execute this code to disconnect the terminal from the wire:
Sometimes it just disconnects leaving the broken wire (which is what I want); and sometimes the wire gets deleted (which I don't want because I need that wire later).
Whether or not the wire gets deleted seems to depend on which particular SubVI (in both cases it's an Express VI), and which particular terminal is involved.
I can't figure out what the difference is that sometimes causes the wire to disappear and sometimes remain intact.
Any chance it has to do with either bends in the wire or branches in the wire? I can't reproduce it right now, but I feel like I've seen wires behave differently if they're straight vs bent or maybe branched vs. single-wired.
@BertMcMahan wrote:
Any chance it has to do with either bends in the wire or branches in the wire? I can't reproduce it right now, but I feel like I've seen wires behave differently if they're straight vs bent or maybe branched vs. single-wired.
That was my first thought; but nope.
Could LV's auto wiring algorithms be kicking in?
Also, is this reproducible and\or consistent?
wiebe@CARYA wrote:
Could LV's auto wiring algorithms be kicking in?
Also, is this reproducible and\or consistent?
Turning off autowiring didn't help.
It's somewhat reproducible. The attached code manifests the problem, but if you edit "BUG.vi", the problem sometimes goes away (and may come back if you edit again).
The loss of the wires happens when
runs in "..\Universal Dialog Box\Support\Common\Utility\Scripting\Disconnect-Reconnect Wires on SubVI.vi"
Just found it: If the wire length is 32 pixels or less, the wire gets deleted, greater than that, and it remains intact.
@paul_cardinale wrote:
Just found it: If the wire length is 32 pixels or less, the wire gets deleted, greater than that, and it remains intact.
Definitely not desirable behavior when you're scripting...
wiebe@CARYA wrote:
@paul_cardinale wrote:
Just found it: If the wire length is 32 pixels or less, the wire gets deleted, greater than that, and it remains intact.
Definitely not desirable behavior when you're scripting...
Same thing happens with manual editing.
Still scratching my head on a workaround.
@paul_cardinale wrote:
wiebe@CARYA wrote:
@paul_cardinale wrote:
Just found it: If the wire length is 32 pixels or less, the wire gets deleted, greater than that, and it remains intact.
Definitely not desirable behavior when you're scripting...
Same thing happens with manual editing.
Still scratching my head on a workaround.
I guess a workaround is to 'record' the wire, disconnect the terminal, and if the wire is deleted, recreate the wire... If there's another terminal, you could use create described wire. If not, well, it's a lot of work... Both cases you loose the original UID...
You could try to re-route the wire (add joints, give it some length) so it isn't deleted. I suppose you can reroute in a way that it's easy to undo the rerouting.
wiebe@CARYA wrote:
@paul_cardinale wrote:
wiebe@CARYA wrote:
@paul_cardinale wrote:
Just found it: If the wire length is 32 pixels or less, the wire gets deleted, greater than that, and it remains intact.
Definitely not desirable behavior when you're scripting...
Same thing happens with manual editing.
Still scratching my head on a workaround.
I guess a workaround is to 'record' the wire, disconnect the terminal, and if the wire is deleted, recreate the wire... If there's another terminal, you could use create described wire. If not, well, it's a lot of work... Both cases you loose the original UID...
You could try to re-route the wire (add joints, give it some length) so it isn't deleted. I suppose you can reroute in a way that it's easy to undo the rerouting.
I discovered that the deletion won't happen if, after the disconnect, there are at least 2 terminals still connected.
So my workaround is:
In the end, this leaves loose wire ends, so I have to remove those after I've reconnected.