NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using PropertyExists() on runtime properties

In the PostResultlistEntry callback you can see the Resultlist of a sequence as Runstate.Caller.Locals.Resultlist.
I want to access the Numeric field of a Result in that list . Since that field only exists in Teststeps with numeric results,
I added a precondition PropertyExists("Runstate.Caller.Locals.Resultlist[Index].Numeric") to that statement.  Index is a Number between 0 and GetNumElements(Runstate.Caller.Locals.Resultlist) -2. But then that statement was allways skipped, even if I see that the property exists.
What's going wrong here ( Teststand 3.1) ? .
0 Kudos
Message 1 of 4
(3,384 Views)

Hi Markus,

How are you coding the index in your statement 'PropertyExists("Runstate.Caller.Locals.Resultlist[Index].Numeric")'.

If index is a number eg PropertyExists("Runstate.Caller.Locals.Resultlist[0].Numeric") there should be no problem.

if you are using a variable then you need to something like:

PropertyExists("Runstate.Caller.Locals.Resultlist[" + Str(Locals.Index) +"].Numeric")  

Hope this helps.

Regards

Ray Farmer

Regards
Ray Farmer
Message 2 of 4
(3,380 Views)

I have a similar issue when I try to check the existence of the serial number property in RunState.  Please notice in the attached screenshot that PropertyExists() function returns False though the property actually exists and have the serial number value "1234".  How can I check if the property exists in RunState?

 

image.png

 

--
Ajay MV


0 Kudos
Message 3 of 4
(1,616 Views)

Just in case anyone has such issue, the missing quotes inside PropertyExists function arguments are the cause of this issue.  Since serial number is itself a string, the function operates on the value in variale UUT.SerialNumber which will obviously be False.  

--
Ajay MV


Message 4 of 4
(1,586 Views)