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,727 Views)

You might want to try Nothing instead of Null Smiley Happy

0 Kudos
Message 2 of 5
(3,714 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,712 Views)
Solution
Accepted by 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,709 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,696 Views)