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.
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.
08-14-2009 03:53 PM
I'm having problems with the "SubVI:Relink to VI" method.
I'm running the code below from the JKI RCF.
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.
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.
08-14-2009 04:34 PM
I made a few changes and a little progress. Below is what I'm now running.
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?
08-24-2009 03:25 PM
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
08-25-2009 08:07 AM
Thanks Darren.
Is there any work around to keep the Relink from clearing the stack?
08-25-2009 09:54 AM
I was unable to find a workaround. If you find one, please let me know.
-D
08-26-2009 12:56 PM
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.