LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

caller name

Hello,

when you use VI property "Callers" it returns array of caller names. The problem that if you call vi dinamically, this property returns empty array.
So, how can i know name of caller vi, when callee vi is dinamic vi?
0 Kudos
Message 1 of 7
(4,972 Views)
Nadav,

the "Callers" property returns the list of all VIs that call the subVI from their diagram. At run-time the "Call Chain" function (Application Control palette) returns the call chain of VIs up to the Top level VI e.g. from which caller the subVI is currently called. That function also works for dynamic calls.


LabVIEW, C'est LabVIEW

Message 2 of 7
(4,972 Views)
Thanks, Jean-Pierre.

But "Call Chain" function returns for dynamic calls only name of sub-vi.
0 Kudos
Message 3 of 7
(4,972 Views)
Nadav,

if by dynamic call you mean using "Call by Reference Node" then yes "Call Chain" DOES return the chain of callers up to the Top Level VI. If you use the Run VI method then no "Call Chain" does not return the name of the VI that invoked the method.

When a VI runs Top Level (Run VI method), there is no way to figure how/by whom the VI was run.


LabVIEW, C'est LabVIEW

0 Kudos
Message 4 of 7
(4,972 Views)
Thanks.
0 Kudos
Message 5 of 7
(4,972 Views)

------------------

JeanPierre wrote:

if by dynamic call you mean using "Call by Reference Node" then yes "Call Chain" DOES return the chain of callers up to the Top Level VI.

------------------

 

OK, so as long as you're operating within the same application instance this is true.  But, if you open a remote application instance and use CBR (Call By Reference), be advised that the called VI immediately becomes top level.  A "Call Chain" function called within that VI will only report one element (itself).

 

When crossing the application instance boundary (e.g. a VI in an LVPROJ or EXE using CBR to run a VI in another EXE) note that:

 

Queue references, etc. are managed by top level VIs.  This means that subVIs that create queues can run and then go idle as long as the top level caller doesn't go idle.  When the subVI becomes the top level caller (because it was called by CBR in another application instance), any references it creates are immediately disposed when the subVI goes idle.  Also, USRs (Uninitialized Shift Registers) reinitialize when the managing VI goes idle.  So, while I haven't checked this, watch out for USRs getting reinitialized with the next CBR call when the CBR crosses an application boundary.

 


Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
Message 6 of 7
(4,456 Views)

@LabBEAN wrote:

------------------

@JeanPierre wrote:

if by dynamic call you mean using "Call by Reference Node" then yes "Call Chain" DOES return the chain of callers up to the Top Level VI.

------------------

 

OK, so as long as you're operating within the same application instance this is true.  But, if you open a remote application instance and use CBR (Call By Reference), be advised that the called VI immediately becomes top level.  A "Call Chain" function called within that VI will only report one element (itself).

 

When crossing the application instance boundary (e.g. a VI in an LVPROJ or EXE using CBR to run a VI in another EXE) note that:

 

Queue references, etc. are managed by top level VIs.  This means that subVIs that create queues can run and then go idle as long as the top level caller doesn't go idle.  When the subVI becomes the top level caller (because it was called by CBR in another application instance), any references it creates are immediately disposed when the subVI goes idle.  Also, USRs (Uninitialized Shift Registers) reinitialize when the managing VI goes idle.  So, while I haven't checked this, watch out for USRs getting reinitialized with the next CBR call when the CBR crosses an application boundary.

 


I can confirm!

 

I have also seen queues created by a served AE invalidated when the network connection to the the AE drops out even though the app running in the machne is still active. it was subtle but it makes sense.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 7
(4,411 Views)