07-24-2013 04:31 AM - edited 07-24-2013 04:32 AM
Edit: logged into wrong account.
07-24-2013 04:35 AM
Thanks very much Darren, that worked perfectly for the test project.
It has also worked for the actual project that I want to use as a template. There were multiple VIs that used the same RTM file, what would be the best way of finding them programmatically? I tried doing "Open VI Reference" -> "Callers' Names (property node)" but that doesn't seem to work for RTMs. In the end I changed all of the VIs that use the RTM to top level in the LLB, and then I used the "Get Top Level from LLB" (I can't remember the exact name, it's one of the OpenG VIs). That worked fine for me, I was just wondering if there's a better way.
Thanks again.
07-24-2013 09:40 AM
@Orbital wrote:
That worked fine for me, I was just wondering if there's a better way.
Thanks again.
convert the LLB's to lvlibs. That would be the better way
07-24-2013 10:23 AM
@Orbital wrote:
There were multiple VIs that used the same RTM file, what would be the best way of finding them programmatically?
You'll notice that in the scripting VI I attached, I use the "Get All Descendents" method of the ProjectItem class to find everything of type "VI". In your test project, there was only one VI. So for your actual use case, you would use the same approach, but then search the resulting array for the VIs you want to relink. Here's how it would work:
07-24-2013 01:27 PM
It was getting the VI names programmatically that I was trying to do, e.g. for the code in your last post: a way to obtain the list of VIs in your array of strings without having to write them out manually.
I found one way of doing it using the project:
But I was wondering if it is possible without going via the project, something like the "Callers'" property node (see below), but that works for RTMs.
Basically I can't figure out how to open a reference to an RTM without going through a project. Is it possible? This isn't really related to the original question anymore, your script worked great for fixing the template problem, I was just interested if this is possible.
Thanks for all of your help, it's been really useful to get the template working for our project.
07-24-2013 02:37 PM
A VI maintains a link to the RTM that it uses, but I don't believe RTMs maintain links to the VIs that use them. So to programmatically obtain the list of VIs (instead of maintaining the static list), you would simply iterate over every VI in the project to see if it links to the RTM, then change its link if it does:
07-24-2013 03:54 PM
@Darren wrote:
A VI maintains a link to the RTM that it uses, but I don't believe RTMs maintain links to the VIs that use them.
I wasn't sure about how they worked, that makes sense though, thank you.
08-21-2014
03:14 PM
- last edited on
08-13-2024
05:15 PM
by
Content Cleaner
CAR 418414 discussed in this thread was fixed in LabVIEW 2014. For a more complete list of bugs fixed in LabVIEW 2014, check the LabVIEW 2014 Bug Fixes. You can download an evaluation copy of LabVIEW 2014 at https://www.ni.com/en/support/downloads/software-products/download.labview.html or if you have an earlier version of LabVIEW installed and an active SSP subscription, you will be able to download the latest version of LabVIEW through NI Update Service.
Regards,
Jeff Peacock
Product Support Engineer | LabVIEW R&D | National Instruments | Certified LabVIEW Architect
03-26-2024 09:42 AM
Today I am working in LabVIEW 2020 and I have a similar problem. A .rtm file in a lvclass, that's part of a library. When using Save As on a lvproj to clone the entire project, everything but the rtm files are properly cloned and relinked. The issue here is although the clone is fine the original source code gets relinked to the new rtm files!
03-26-2024 09:53 AM
I can't reproduce this in LV 2024 Q1. I wonder if it was a bug that got fixed?