02-28-2011 08:40 AM
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
Solved! Go to Solution.
03-09-2011 02:40 PM
Hi Kewal,
I also don't know what Logging.PropertyResultDetails.Order is, and very insterested to know how to get benefints from it. 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.
03-09-2011 05:03 PM
How about something like:
Logging.PropertyResult.Parent.GetArrayOffset("", PropOption_NoOptions, "[\"" + Nameof(Logging.PropertyResult) + "\"]")
03-09-2011 05:54 PM
James, you'are right. Your way is better.
I was too focusing upon PropertyResult itself. Instead we can use GetArrayOffset to get index
03-10-2011 07:33 AM
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
03-10-2011 09:50 AM - edited 03-10-2011 09:53 AM
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).
03-10-2011 10:38 AM
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.
03-10-2011 11:47 AM
Thanks this actually work just as well, even with measurement names being the same!