08-30-2018 06:38 AM
It's weird, but the practical way to get a project item from a ref is with a brown nodes (not to be confused with the brown note). Without that, I think all project items need to be recursively checked for a Vi with matching name.
08-30-2018 07:38 AM
Well, that Project Item From Ref. property node doesn´t work fom me, since I get error 56004: Project item cannot be found
08-30-2018 08:11 AM - edited 08-30-2018 08:12 AM
@Rashek wrote:
Well, that Project Item From Ref. property node doesn´t work fom me, since I get error 56004: Project item cannot be found
Post your code. Something is wrong... Not 100% sure about the application\project construction. Place probes to see what property\method fails. Any change you have two projects open?
08-30-2018 08:22 AM
Is the VI even listed in the project?
Which application instance is the VI in (Bottom-right corner of the FP).
I ask again: Is the VI in a Packed Library?
Is the VI inlined? Give us some information where we might be able to help........
06-05-2020 10:54 PM
Has anyone found a solution to find all callers of a VI ?
- There is a "Find Callers" property on the ProjectItem, but it throws error 1: "An input parameter is invalid."
- "Callers' Names" and "Callers' Paths" VI properties only return callers in memory.
The only solution I see is opening all VIs in the project 1 by 1 and traversing their diagram to search the specific SubVI, which is very slow for a big project !
A bit frustrating because the right-click function "Find->Callers" is almost instantaneous, so LV must store callers lists somewhere...
06-06-2020 11:07 AM
I managed to make the "Find Callers" property work.
(apparently, it does not work when the ProjectItem is obtained from the descendants of a library opened with "App->Library.Open", you must obtain the ProjectItem from a project refnum).
Unfortunatly, this method still only returns callers IN MEMORY, which is never indicated in its documentation :
"Returns an array of references to all project items that reference the project item you select.
This property is similar to the Find»Callers item on the shortcut menu of a project item."
This problem reminds me of the "Find" tool that only searches for text in loaded VIs, so that you only get half of what you are searching for.
NI should specify clearly when a function only operates on VIs in memory and warn you that you may miss some instances...
...or make these functions work for all VIs (loaded or not).
06-07-2020 04:00 AM
@raphschru wrote:
I managed to make the "Find Callers" property work.
(apparently, it does not work when the ProjectItem is obtained from the descendants of a library opened with "App->Library.Open", you must obtain the ProjectItem from a project refnum).
Unfortunatly, this method still only returns callers IN MEMORY, which is never indicated in its documentation :
"Returns an array of references to all project items that reference the project item you select.
This property is similar to the Find»Callers item on the shortcut menu of a project item."
I would expect that probably it's not possible to detect all Callers of an item that are not in the project/memory. How would that work? Suppose I (on your computer) create a new VI which calls your VI, and save it somewhere else (different project, different directory etc).
Unless my new VI in some way changes your VI (which probably you don't want) it can't be found unless it's in some predetermined list of things to check through (which I'd guess is some sort of linker list when you run the method you have inside the project).
Does the "Find >> Callers" item work differently? i.e. will it find my hypothetical unloaded VI in the case described above?
@raphschru wrote:
This problem reminds me of the "Find" tool that only searches for text in loaded VIs, so that you only get half of what you are searching for.
NI should specify clearly when a function only operates on VIs in memory and warn you that you may miss some instances...
...or make these functions work for all VIs (loaded or not).
Clearer documentation is always a good thing. Perhaps you could submit a support request for this if you have a concrete issue (not sure if it will help, but...)
06-08-2020 04:01 AM
Right clicking a VI in a project, Find>Callers, does return VIs that are not in memory.
So there is a way.
My guess would be LabVIEW runs the "Application.Linker.Read Info From File" method for all VIs and stores that information in some sort of graph (or graphs). The menu can simply look up the dependencies from that graph.
LabVIEW has the luxury of being able to maintain that graph while you're editing. If you want to apply the same trick, you'd need to create the graph each time you need it, which will probably take a while.
03-22-2021 10:55 PM
Apologies for reviving an old thread, can somebody tell me how to enable the "Proj Item From Ref." project property? I have searched up all the "secret" ini settings and enabled them, but I still do not see a property that allows me to enumerate project items
Best regards
03-23-2021 03:42 AM
@laksafan wrote:
Apologies for reviving an old thread, can somebody tell me how to enable the "Proj Item From Ref." project property? I have searched up all the "secret" ini settings and enabled them, but I still do not see a property that allows me to enumerate project items
Best regards
1) I'm not sure which ini key needs to be set... It should be here:
2) On a project invoke node (QD on an invoke node, type Project, CTRL+B), type "get project item from vi ref", then CTRL+SHIFT+B. This will works without the right ini file.
3) If you have the right ini file key set, it should be visible in the class browser as well.
4) Here's a snippet: