LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve permanent caller RefNum

Solved!
Go to solution

Hello,

 

I thought that if a Caller VI doesn't go out of scope there must be a way for the SubVI to retrieve a non changing RefNum to its Caller.

I want to use the same FGV Logger throughout many modules running in parallel, without changing the FGV's names.

So I store the different logs seperated by a Ref in a map. I can't use the name here for seperation.
Unfortunately the RefNum I am retrieving right now is changing throughout the calls.

logger.png

caller.png

 

0 Kudos
Message 1 of 3
(8,647 Views)
Solution
Accepted by topic author Quiztus2

Hi Quiztus2,

 

Why can't you use the VI name from the call chain exactly ? It uniquely identifies the VI in memory, and is different for each clone for reentrant VIs:

raphschru_0-1705667367472.png

 

PS: The fact that multiple refnums to the same VI clone are not considered the same is specific to maps because they use the numeric value of the refnum instead of checking if it actually represents the same object in memory (see this discussion). You don't have this issue if you use an array and the function "Search 1D Array".

 

Regards,

Raphaël.

Message 2 of 3
(8,613 Views)

Why can't you use the VI name from the call chain exactly ? It uniquely identifies the VI in memory, and is different for each clone for reentrant VIs:

 

 

PS: The fact that multiple refnums to the same VI clone are not considered the same is specific to maps because they use the numeric value of the refnum instead of checking if it actually represents the same object in memory (see this discussion). You don't have this issue if you use an array and the function "Search 1D Array".I


 I didn't know/expect that. Very helpful, thanks.

0 Kudos
Message 3 of 3
(8,593 Views)