07-26-2019 03:38 AM
I've developed a .NET assembly to be called inside a TestStand sequence by some VIs owned by the same lvlib library.
In the first TS sequence step a VI (init.vi) calls the .NET class constructor (inside a subVI) and then a class method (inside another subVI) with no errors. The .NET reference is then saved in a functional global as a last action before init.vi end.
In the following TS step a VI retrieves the .NET reference from the functional global and calls a .NET method (inside a subVI). The property node that calls the method always returns "Error 1". By putting a probe at the property node reference input I see that the reference number being passed has the same value as the one initially saved in the functional global, but it is also marked as "no longer valid.
Before creating a background running VI to be used as a storage for the .NET reference (in order to avoid garbage collector to dispose the reference at the end of the init.vi execution), I was wondering is there is a more simple alternative to this.
To my knowledge TS keeps all the library's VIs in memory until the end of the sequence execution and this should be enough to keep the reference alive...or not?
Thank you for reading
Best
07-28-2019 02:36 PM
What is the Unload Option set for the sequence file (https://zone.ni.com/reference/en-XX/help/370052W-01/tsref/infotopics/db_seq_file_prop_gen_tab/)?
If the sequence file setting was "Use step unload option", what have you set to for the "init.vi" step (https://zone.ni.com/reference/en-XX/help/370052AA-01/tsref/infotopics/pane_step_settings_run_opt/)?
07-29-2019 12:28 AM