LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

R-entrant LabVIEW DLL Sharing Memory

Hi all-
I have a LabVIEW generated DLL that has a Re-Entrant function.  This function is marked as re-entrant in LabVIEW.  Inside this function is a LV2 style global.  The local memory seems to be shared between instances of the DLL.  I have a test app that has two instances of the DLL, both loaded as re-entrant.  I had thought that the re-entrancy will give me separate memory spaces.  I have taken out all debugging info as well.
Attached is a small app that illustrates the problem. 
Thanks!
0 Kudos
Message 1 of 3
(2,780 Views)


@erikg wrote:
Hi all-
I have a LabVIEW generated DLL that has a Re-Entrant function.  This function is marked as re-entrant in LabVIEW.  Inside this function is a LV2 style global.  The local memory seems to be shared between instances of the DLL.  I have a test app that has two instances of the DLL, both loaded as re-entrant.  I had thought that the re-entrancy will give me separate memory spaces.  I have taken out all debugging info as well.
Attached is a small app that illustrates the problem. 
Thanks!


No! Reentrancy for VIs will have no effect for global variables. What you probably want to do is replacing the global with a shift register inside that reentrant VI. Shift registers are local to a VI and shared between non-reentrant instances of the same VI (the good ol LV2 style global before those nasty globals got available) but will be separate memory locations per instance for reentrant VIs.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 3
(2,767 Views)
Rolf-
Thanks for your reply!
So any VI inside of a re-entrant VI is does not have separate memory space from the next call to the reentrant VI?
This is different than what I had thought.
Thanks!
-erik
0 Kudos
Message 3 of 3
(2,760 Views)