LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RT executable causes functional global variable VIs to become non-reentrant

 

Hi,

 

I am having a small issue with functional global variables (Repositories). The attached VI is a sample functional global variable I created that stores double precision numeric values. The VI properties are set to normal execution. I use this VI to pass data between loops running in real time on a PXI platform. When running my application from the project explorer (not creating executable) the VI functions as it should and passes data between my loops with no issues. But when I create a real time executable of my application and run it on the PXI, it does not share data between instances of the VI. My work around this issue is to change the VI properties execution priority to Subroutine but it forces me to modify my VI slightly for this to work (I have to remove the property node). I am not sure why this is happing. I have seen some applications with this VI that appear to function normally in development and in executable with the VI properties execution priority set to Normal. Any comments or suggestions are welcomed.

I am running LabVIEW 2009, PXI-8186, and Windows XP

Thanks

0 Kudos
Message 1 of 2
(5,311 Views)

Many properties require the front panel to be loaded in memory; the property you're using, NumItems, appears to be one of them (look at the help, you'll see that it says "Loads the front panel into memory.")  However, VIs running in an executable on RT do not have front panels, so those property nodes will not work.  If you were to log the error out terminal from the property node in your executable, you should see that an error occurs.  As a result, you're getting a 0 value out of the property node, causing your VI to output unexpected results.

 

My recommendation is that you replace the property node with the function GetNumericInfo found in vi.lib\utility\VariantDataType.  It has an output called EnumNames.  Take the size of the EnumNames array and use that in place of the output from the property node.  This will work on RT.

 

Note that this has nothing to do with re-entrancy, and the key hint is that the VI works when you remove the property node.

Message 2 of 2
(5,306 Views)