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: 

null refnum

Solved!
Go to solution

Hello everyone,

 

I have a really easy question, I need an expression to detect a null refnum.

 

I am sending the StationGlobals.TS.CurrentUser.LoginName from TestStand to the User Interface via the FrontEndCallback.seq using the UIMessage. There are times when the StationGlobals.TS.CurrentUser does not exist (i.e. when the user click on the 'Cancel' button of the Login Dialog). I want to detect this situation by checking if the StationGlobals.TS.CurrentUser is a null refnum. I tried the following expression such as

 

StationGlobals.TS.CurrentUser == Null

or

StationGlobals.TS.CurrentUser == null

 

but they all do not work.

 

Can anyone please tell me the expression to detect a null refnum?

 

Thanks for reading

hlim

0 Kudos
Message 1 of 5
(3,513 Views)

You might want to try Nothing instead of Null Smiley Happy

0 Kudos
Message 2 of 5
(3,500 Views)

I have tried Nothing, but it still does not work. I am thinking of using the StationGlobals.TS.hasAttribute API.

0 Kudos
Message 3 of 5
(3,498 Views)
Solution
Accepted by topic author hlim

Sorry, didn't read your post properly....

 

StationGlobals.TS.CurrentUser is of type container. For checking if it has been created, you can use the PropertyExists API function

Message 4 of 5
(3,495 Views)

Hello Oli Wachno,

 

thanks for your big help. PropertyExists method works for me! I added the PropertyExists("StationGlobals.TS.CurrentUser") in the precondition of the step. This works very well.

 

Sincerely,

Huck

 

 

 

0 Kudos
Message 5 of 5
(3,482 Views)