From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview-Global is automatically set to 0 when executed in Model ->SeqeunceFileUnload

Hello,

in my Teststandmodel i am using SeqFileload and SeqFileUnload

SeqFileload -> external SequenceCall INIT.seq

SeqFileUNload -> external SequenceCall CLOSE.seq

 

In the INIT.seq is a labview-vi that opens a session to an instrument an retruns a session-id which is saved in a labview global variable.

 

In the CLOSE.seq is a labview-vi that uses this labview global variable as input to close the session to the instrument.

 

What now happens is that when executing is that the labview global is somehow set to 0 which is an invalid session.

BUT when moving the labview-vi from the external sequence direct into the SeqeunFileUload-seqeunce of the model then it is working.

 

Question is: Why is the global set to 0? Is there somewhere an option to "unload/clear all labview variables" when unloading teststand?

 

Thanks for help

0 Kudos
Message 1 of 4
(980 Views)

Why aren't you trying to use FGVs in LV rather than Global Variable?

0 Kudos
Message 2 of 4
(830 Views)

When you unload a sequence, you are removing all of its called code from memory, including the global variable.  Now when your external sequence is ran, it will reload the global variable.  When this happens, the global will have the default value.  A simple solution might be to simply store the value in TestStand and pass it to the external sequence when it is called.

 


@Gevor wrote:

Why aren't you trying to use FGVs in LV rather than Global Variable?


Global Variables work just fine.  FGVs are not a cure-all replacement unless you are protecting critical sections of code.  That does not apply to this situation.

A Look At Race Conditions


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 4
(824 Views)

zur Info - das ist die Antwort vom NI-Support:

 

#######

nach meiner Meinung fällt das von Ihnen beobachtete Verhalten unter unerwartetes Verhalten von Teststand

- Wird das Modell im laufenden Userinterface geschlossen, dann funktioniert der SequenceFileUnload Callback wie erwartet.

- Wir das Modell durch schließen der UI geschlossen, dann werden nur die default Werte zurückgeliefert.

Ich habe dies an unsere Entwickler weitergegeben. Als Workaround würde ich weiterhin die Daten über Teststand Globals weitergeben.

Der ich an dieser Stelle nichts weiteres für Sie tun kann werde ich das Ticket im Anschluss an diese Email schließen.

#########

0 Kudos
Message 4 of 4
(818 Views)