NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you log the index of a numeric limit from a multiple numeric limit test in the database

Solved!
Go to solution

I am trying to store results from our tests to the database.

 

Its simple to log the Step Index of a particular step by using the following expression

Logging.StepResult.TS.Index

 

However our tests have many multiple numeric limit steps, and I need to be able log the index of each numeric limit test of the multiple numeric limit steps to be able to correctly refer back to them. The only expression I can find that gives me such information is

Logging.PropertyResultDetails.Order

 

But the order doesnt quite appear to be consistent like 1, 2, 3..... but instead comes out as 9, 16, 23....for one test and 9, 17, 25, 33, 41, 49..... for another test.

 

Could somebody explain what Logging.PropertyResultDetails.Order really is. And if there is another expression I need to be using to actually get the Index of the Numeric Limit for a Multiple Numeric Limit Test?

 

Also is there some kind of reference manual which shows what kind of properties I have access to in Logging.PropertyResult as I can't seem to find that anywhere! Any help would be greatly appreciated!

 

Cheers

 

Kewal

0 Kudos
Message 1 of 8
(4,598 Views)

Hi Kewal,

 

I also don't know what Logging.PropertyResultDetails.Order is, and very insterested to know how to get benefints from it. Smiley Happy Maybe some NI application engineer can answer this question.

I tried the same thing you did, and it didn't work.So I figured out an alternative solution,  not that elegant, but it works

Suppose you use OnTheFlyLogging option(the other one is similar), we all know ProcessModelPostResultListEntry callback sequence handles test step logging, just add a statement step in loop or sequence before LogResult step to insert index number as an attribute for Measurement element container of NI_MultipleNumericLimitTest step type, which can be as simple as following

Parameters.Result.Measurement[RunState.LoopIndex].Attributes.SetValNumber("Index", 1, RunState.LoopIndex), // Set order number

Then at database schema side, you can log the index using the expression Logging.PropertyResult.Attributes.Index

 

The expression also answers your last question, Logging.PropertyResult really depends upon your property, so it's empty when configuring database schema. For multi numeric limit test, the property is Standard Data Type NI_LimitMeasurement, which includes Data, Status, Units, Comp, etc(under NI_Type.ini), also any attributes/property user adds.

Chenny Zhenyu Wang
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 8
(4,527 Views)
Solution
Accepted by topic author kewsvnet

How about something like:

 

Logging.PropertyResult.Parent.GetArrayOffset("", PropOption_NoOptions, "[\"" + Nameof(Logging.PropertyResult) + "\"]")

Message 3 of 8
(4,522 Views)

James, you'are right. Your way is better.

I was too focusing upon PropertyResult itself. Instead we can use GetArrayOffset to get index

Chenny Zhenyu Wang
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 4 of 8
(4,519 Views)

Thanks for that...that works and does exactly what I want...shame you need to go to such a long expression to do something fairly simple

0 Kudos
Message 5 of 8
(4,505 Views)

I will submitted a request for an IndexOf()/OffsetOf() expression functions and maybe PropertyObject.Index and PropertyObject.Offset properties.

 

Note that the workaround I suggested above will fail if you give your measurements duplicate names (although I don't know why you would).

0 Kudos
Message 6 of 8
(4,494 Views)

One way to get the offset:

 

Locals.Object.Parent.GetArrayOffset("", 0, Locals.Object.GetLocation(Locals.Object.Parent)).  To get the index, you could add that to the index of the first item.

Message 7 of 8
(4,489 Views)

Thanks this actually work just as well, even with measurement names being the same!

0 Kudos
Message 8 of 8
(4,482 Views)