From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Relink to VI problem

I'm having problems with the "SubVI:Relink to VI" method.

I'm running the code below from the JKI RCF.

Relink Problem.png

The code works fine. The VI is created, a new connector pane pattern is set and it relinks. The problem comes when you decide to use Undo after creating the new SubVI. I've had two different problems.

  1. First I was seeing all the undo information erased
  2. Now when I try to undo, LabVIEW crashes

If I disable the Relink method, everything works fine. I've tried wrapping the Relink method in its own Undo Transaction, but it doesn't help.



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 1 of 6
(8,649 Views)

I made a few changes and a little progress. Below is what I'm now running.

Relink Problem2.png

I decided to try ending the Undo Transaction started by the JKI RCF right after the new SubVI is created. Then wrap a transaction Start/Stop around the connector pane change and another around the Relink method.

This works without errors or crashing. I can now undo the Relink operation, but that's it. The Connector Pane Change and Create SubVI undo transactions are not available in the Edit menu and Ctrl+Z doens't work. And yes, I have my Undo Steps in the Options set to 99.

Am I just not understanding how the Undo Transactions are supposed to work? Can they not stack up like they do during normal editing?



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 2 of 6
(3,408 Views)

I was able to reproduce this, not only with scripting, but also in the editor.  Try relinking a subVI, then undoing it.  The undo stack is cleared, just like it is in scripting.  You're not doing anything wrong (that I can see), it's just a bug with trying to undo a subVI relink.  I've filed CAR 184029 against this issue.

-D

0 Kudos
Message 3 of 6
(3,408 Views)

Thanks Darren.

Is there any work around to keep the Relink from clearing the stack?



Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 6
(3,408 Views)

I was unable to find a workaround.  If you find one, please let me know.

-D

0 Kudos
Message 5 of 6
(3,408 Views)

Workaround:

Step 1. Visit all in memory callers of the VI you're modifying and delete the subVI node from their block diagrams.

Step 2. Modify the VI.

Step 3. Put the subVI node back on all the callers.

This avoids any need for Relink.

0 Kudos
Message 6 of 6
(3,408 Views)