VI Called From TestStand Produces Unexpected Results

Updated Jul 4, 2022

Reported In

Software

  • TestStand
  • LabVIEW

Issue Details

  • Running the VI in LabVIEW produces different results than running it from TestStand.
  • I am calling a VI from TestStand, but I'm getting unexpected results, although the VI runs fine in LabVIEW.
  • VI called from TestStand produces expected results only for the first run.

Solution

By default, TestStand sequence's code modules are loaded before the sequence executes and are unloaded after the file containing the sequence is closed.
In rare occasions, it can result in
some data structures loaded to the memory while executing the VI to not being unloaded properly after the VI execution ends.
which can result in incorrect data returned from the called VI on the next runs.

Try setting the unload option for the VI call to “Unload after step executes”, to force TestStand to unload the allocated memory.


image.png

Note: Setting Unload option to Unload after step executes can affect the performance of the test sequence, as it will deallocate the memory allocated for the VI each time the step is executed.