Cat Posted April 22, 2009 Report Share Posted April 22, 2009 I'm not sure if this is a bug or just really really annoying, but... Open Project A and edit A.vi. Realize there's some code in Project B you can reuse. Open Project B. Find and open B.vi and copy some code from it (Ctrl-C). Close B.vi. Close Project B. Attempt to paste (Ctrl-V) code into A.vi. It's not available anymore to be pasted. Note that if code is copied directly from B.vi without going thru Project B, it still exists on the clipboard even after B.vi is closed. Unfortunately, B.vi could be buried several directories down, and accessing it from the Project is usually much faster. What gives? Does each project maintain its own clipboard?? Now I just need to write 100 times, "Do not close Project B until code is copied to Project A. Do not close Project B until code is copied to Project A. Do not close Project B until code is copied to Project A..." Quote Link to comment
Yair Posted April 25, 2009 Report Share Posted April 25, 2009 QUOTE (Cat @ Apr 21 2009, 09:52 PM) What gives? Does each project maintain its own clipboard?? The check is fairly simple - load two projects, copy code in both of them and see if the first still remembers its code. The answer is no. I'm guessing that this is just an extension of what LabVIEW does with standard VIs. If you close the project, all the VIs in the project are closed as well (even if they have their FPs/BDs open, for instance. The clipboard itself is not owned by the project (at least not when you look at how it appears in the hierarchy windows), so this might actually be a bug. You should note, however, that in past versions, as long as the VIs were in the clipboard they didn't leave memory and then you could have all kinds of issues if you weren't careful (cross linking, unsaved VIs, etc.), so it's possible NI did this on purpose. Quote Link to comment
Rolf Kalbermatter Posted April 27, 2009 Report Share Posted April 27, 2009 QUOTE (Yair @ Apr 24 2009, 03:39 AM) The check is fairly simple - load two projects, copy code in both of them and see if the first still remembers its code. The answer is no.I'm guessing that this is just an extension of what LabVIEW does with standard VIs. If you close the project, all the VIs in the project are closed as well (even if they have their FPs/BDs open, for instance. The clipboard itself is not owned by the project (at least not when you look at how it appears in the hierarchy windows), so this might actually be a bug. You should note, however, that in past versions, as long as the VIs were in the clipboard they didn't leave memory and then you could have all kinds of issues if you weren't careful (cross linking, unsaved VIs, etc.), so it's possible NI did this on purpose. Well cross linking probably isn't the issue here as the Clipboard resides in the global LabVIEW context wheras each project has its own context. I think that Yair has it right that it is a side effect from the project maintaining links to all VIs that it has opened somewhere and that includes VIs placed in the clipboard. On closing of the project all such VIs get closed too. Is it a bug? Well strictly speaking I would say no. Could it be made to make an exemption in the case of clipboard code? I have really no idea. At first glance it would seem possible but I might just as well oversee a big pitfall in doing so. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.