08-28-2018 06:31 AM
Hi all,
I would like to ask, whether it is possible to programmatically find out callers of certain VI in project, just like Find - Callers in project tree does.
08-28-2018 07:32 AM - edited 08-28-2018 07:33 AM
08-28-2018 08:28 AM - edited 08-28-2018 08:30 AM
I believe Rashek is looking for all of the callers of the VI, not the call chain.
Try the 'Callers' property node. Wire the VI reference to a property node and there are two properties - 'Callers Names' and a 'Callers Paths' that should get you what you are looking for, if I understood correctly.
Edit - the 'Callers Paths' is a private property, however you should be able to use the 'Callers Names' property without any additional work.
08-28-2018 08:37 AM
The callers of a VI only gives callers in memory, while the callers in the project returns all callers I the project, including VIs that are not in memory. You'd need scripting on the project to get that information.
08-30-2018 03:46 AM
Exactly, that´s what I am looking for - scripting function which would allow me to find all callers inside project. I thought that maybe getting project reference and using some property/method from there... however, as far as I know there is no way to get project reference from a VI, so I am looking for an alternative solution.
08-30-2018 04:28 AM - edited 08-30-2018 04:29 AM
Well, you can start by getting the project which owns the VI.
This code illustrates the difference between "OwningProject" and "ActiveProject". If you have more than one project open, selecting one project window over another will alter the value of "ActiveProject*" but "OwningProject" will remain the same (assuming you add the running VI to one of the projects).
Never mind the terrible reference handling..... just a 1 minute illustration VI.
08-30-2018 05:00 AM
I already tried this, the problem I have with this approach is that if VI is part of library, you get only reference to given library. What I would like to do, is to get reference to the entire project, so that I can find callers even outside library
08-30-2018 05:12 AM - edited 08-30-2018 05:20 AM
Are you sure the VI Property "OwningApp" gives back a library reference?
The type of the VI Server reference is of type "Application", which seems seriously incompatible with giving back a Library reference......
Edit: I just tried putting the VI in a Library, still worked fine. I got back a reference to the owning project.
Edit 2: Do you have the VI in a PPL by any chance? No idea how that would affect things.
08-30-2018 06:09 AM
08-30-2018 06:24 AM - edited 08-30-2018 06:25 AM
Hmmm, project Item from Ref. I need to re-activate the supersecret INI setting.....