NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging a custom StepType Property

I followed the "Logging a New Step Property to a Database in TestStand" description but I get this answer back: An exception occurred calling 'LogResults' in 'ITSDBLog' of 'DBLog 1.0 Type Library'
An error occurred while setting a column value.
Schema: Copy of Generic Recordset.
Statement: STEP_RESULT.
Column: String.
Unknown variable or property name 'String'.
Source: TSDBLog

How do I log these custom types?
0 Kudos
Message 1 of 5
(3,601 Views)
Hi Clausen,

*Note: The following information only applies to TestStand 2.0.x and later.

This error is being caused by the setup of your database schema not having a valid property name to be logged for the "String" column of the "STEP_RESULT" statement. If you look in your database schema under the STEP_RESULT statement and select the String column under the Columns/Parameters tab the "Expression" box probably contains a lookup string equal to -> String. This is the exact "unknown variable or property name" that is causing the problem. You need to have a property name that begins with "Logging.StepResult.*" in order to specify a valid lookup string for the logging process/schema. For instance if this String property of yours has a lookup string of "Step.String" the lookup string to use in the database schema would be "Logging.StepResult.String". If the property is inside another step property that is a container, like "Step.MyData.String", then you would use "Logging.StepResult.MyData.String". The one exception to this container rule is that if the property is in the "Step.Result" container, as "Step.Result.String", then you would use the lookup string "Logging.StepResult.String" (this is caused by the fact that the Logging property is pulled directly from your sequence execution's "Locals.ResultList" array and properties under Step.Result are extracted from the Result container and placed in ResultList as top level properties. For example, Step.Result.String gets copied into Locals.ResultList[n].String, where "n" represents the array index of the step result you want to modify.

The main thing to also realize, is that this step property has to be copied to your sequence's Locals.ResultList array during execution as well, because only properties within the ResultList will be passed to the logging process. There are basically 3 different ways to do this.

1) Use the Execution.AddExtraResult method (Check the TestStand Programmer's Help for further information. You can see an example of its use within the Sequential ProcessModel's Test UUTs execution entry point as well).

2) Put the property you wish to record into the ResultList in your step's "Step.Result" container, as every property within Step.Result is automatically copied into the ResultList at run-time by the engine. You can place your property in the Result container as the default location for the property within the definition of the custom steptype, or you can use any one of the PropertyObject.SetVal* API methods to programmatically insert a new property into the step's result container at run-time by using the method's "InsertIfMissing" option (note that if you do this it needs to occur before the step executes, or else it won't be copied into the ResultList).

3) You can also use the PropertyObject.SetVal* methods to insert a new property directly into the ResultList using the InsertIfMissing option AFTER the desired step has executed. For instance, you could specify the lookup string "Locals.ResultList[n].String" when using these methods.

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
Message 2 of 5
(3,602 Views)
Great write up. I tried this and tried what this article mentioned (it's similar):
http://digital.ni.com/public.nsf/allkb/d30ec9bba0d740c286256c760049dabd

So, my custom step variable is at Step.Result.Voltage and if I probe "Locals.ResultList[n].Voltage" after the step, I can see my data but I still get the:
"Unknown variable or property name 'Logging.StepResult.Voltage'.
Source: TSDBLog"
Error

Any ideas?
TIA (TS 3.5)

Message Edited by InfiniteNothing on 12-01-2006 08:52 PM

Message Edited by InfiniteNothing on 12-01-2006 08:54 PM

CLED (2016)
Message 3 of 5
(3,428 Views)
InfiniteNothing,

Have you tried what this KB recommends?

Test Engineer - CTA
0 Kudos
Message 4 of 5
(3,398 Views)
Yeah, that'll get it into the test report but I don't think it gets it into the database. I called tech support and had my issue resolved. I needed to add my new step variable to Globals.StepResult in the "Expected Properties" field under the "Columns/Parameters" tab in "Database Options"
0 Kudos
Message 5 of 5
(3,395 Views)