LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Merge Transaction (Undo History)

Okay so I have a bit of a question regarding LabVIEW and the Transaction history which keeps track of undo operations.  Using Scripting I can say Begin Undo, do some things, then End Undo, and now when the user uses CTRL+Z it goes back to the way it was before my Begin Undo call.  

 

But lets say I call a subVI that I can't edit, and in that subVI is already a Begin, and then End Undo for that VI call.  Then after that VI is done I do some other things to the VI, so I may have my own Begin, and End Undo.  Now if the user hits CTRL+Z I want the state of the code to go back before the first Begin Undo was called, but what will happen is the user needs to press it twice, once for my stuff to be undone, and then once again for the subVI call.  Is there a way to edit the transaction history to remove the step in the middle? Or a way to merge them?

 

Normally I wouldn't care too much just know you have to press undo twice, but in this case pressing the undo once will usually crash LabVIEW because of the VIs that are temporary and involved in the process.  I'll look into making it not crash, but another solution for me would be to throw away the one undo.  Oh and I also already tried doing a Begin Undo before all of this and that doesn't work because then it throws an error in the subVI that tries to do another Begin Undo.  Any thoughts?  Thanks.

0 Kudos
Message 1 of 5
(2,834 Views)

I looked into it, but could not find any solution. Not having access to the block diagram of that SubVI is unfortunate...

0 Kudos
Message 2 of 5
(2,776 Views)

@Gregory wrote:

Not having access to the block diagram of that SubVI is unfortunate...


Well I didn't say I didn't have access, I said I didn't want to modify it.  It is a VI that is installed with LabVIEW and I don't want to edit it with the install of a reuse package, because then I'd be replacing a system VI from some version of LabVIEW, with a VI of my own.  I did get the crashy-crash to stop happening, so it is back to a minor inconvienience of having to press undo twice.  Maybe I can live with it if no one else has any ideas.

 

BTW the code involving this was posted as a way to insert code from your clipboard using quick drop.

 

https://decibel.ni.com/content/docs/DOC-46893

0 Kudos
Message 3 of 5
(2,762 Views)

Oh I see, is there some license issue with saving a copy of the VI in question?

0 Kudos
Message 4 of 5
(2,754 Views)

@Gregory wrote:

Oh I see, is there some license issue with saving a copy of the VI in question?


No I wasn't concerned with a license issue (but maybe I should be?).  What I was more concerned was this scenario: 

 

Lets say I make a new Insert QuickDrop function, and replace the LabVIEW 2015 QuickDrop Insert with my own.  I can take the 2015 version and use it as a base then make all the changes I want.  Then whenever I want my new insert I just replace the old one on every machine I want.  Then lets say LabVIEW 2016 has some new cool insert functions that fix bugs or generally works better.  Now if I replace the 2016 version of Insert.vi with my modified 2015 version of Insert.vi I won't have those improvements.  This issue actually happened with someone who took the 2012 version of Insert and made changes.  But from 2012 to 2015 there were lots of minor improvements and bug fixes, but they were never rolled into the 2012 version.

 

I wanted to make a new insert, that just calls the currently installed version, regardless of the version you have, so that in any new version it would call the new Insert, and my code would just do some additional work.  I didn't want to have to make a new insert function for every new version of LabVIEW.  Is there a word for this type of issue?  I hate having to spend two paragraphs trying to get my thoughts down.  So if I'm going to call the already installed version of Insert, then it is going to already have a begin undo, and end.  Another solution that I can't really get to work, is to have the insert do its normal work, but just disable the begin, and finish undo...maybe I can do that with package manager with Post Install/Uninstall VIs.

0 Kudos
Message 5 of 5
(2,739 Views)