NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to store numeric format data in a database

In order to properly format a report generated from data stored in a database using a TestStand schema,
I would like to add formating information for numeric values to the database.

My intent was to store the numeric format string data in a separate column in the MEAS_NUMERICLIMIT table in the database.
By using this format string I can then format the numeric values in my report.

I have successfully retrieved the numeric format string by calling the 'NI TestStand API 3.0', using the ActiveX/COM adapter.
In the 'PropertyObject' class there is an action called 'Get Property'.
This action can retrive the 'NumericFormat' property for a given object reference.

The problem is that I don´t know HOW to do this in the dat
abase logging schema.

Can I use this method in the API to retrive and store the numeric format string in the database??

Or is there any other way of achieving this functionality?

All ideas for solutions are appreciated.

Thanks in advance!
0 Kudos
Message 1 of 11
(4,633 Views)
To JesperT -
There is no way to extract the format string from a numeric value in the expression language. For now, the only option that you have is to store the number as a string as a formated value using the Str() expression function. Having access to the property object interface from the expression language may be considered in the future.

Scott Richardson (NI)
Scott Richardson
https://testeract.com
Message 2 of 11
(4,633 Views)

I see that this post is a couple years old. Has this functionality ever been implemetned.

0 Kudos
Message 3 of 11
(4,199 Views)

@Kiebach wrote:

I see that this post is a couple years old. Has this functionality ever been implemetned.


Yes. As of TestStand 4.0, you can now access the entire TestStand API (including the numeric format) inside of an expression. For example: Locals.MyLocalNumber.NumericFormat

 

Hope this helps,

-Doug

 

0 Kudos
Message 4 of 11
(4,179 Views)

But How do I adjust the Schema to include 'formatted data' and/or 'format string' in the database.

0 Kudos
Message 5 of 11
(4,173 Views)

If you are using TestStand 4.1 or later you should be able to look at the PROP_RESULT table in the one of the default NI schemas, which has a column for data and numeric format.

Scott Richardson
https://testeract.com
0 Kudos
Message 6 of 11
(4,157 Views)

I see the numeric format in the PROP_RESULT table, but that only seems to reflect the numeric format for the test result.

 

How do I find the numeric format for the test limits?

 

Is it possible to add other columns to the database table that would contain a string with the numeric value already formatted for the result and the limits.

0 Kudos
Message 7 of 11
(4,130 Views)

Yes you can. I think it would be helpful if you explain in more detail what you are trying to do. Are you using an NI default schema or have you already customized it? If default, what about the schema is insufficient for what you want to do? Is the data and limits that you are trying to log custom properties or or is this for the NI numeric or multi-numeric step type?

Scott Richardson
https://testeract.com
0 Kudos
Message 8 of 11
(4,121 Views)

Yes you can. I think it would be helpful if you explain in more detail what you are trying to do.

>>>> Basically I am trying to reproduce the data sheet created by test stand by using the data in the database.

 

Are you using an NI default schema or have you already customized it?

>>>> I already have a custom schema that I created many years ago, But if I have to start with a 'newer' default schema it wouldn't be to much of a problem to incorporate my changes into it. (I had added Model number and Comment to UUT result table and provided support for custom step types, the custom step types are based on the default NumericLimit step type )

 

If default, what about the schema is insufficient for what you want to do?

>>>> In order to generate a datasheet from the data in the database that replicates the datasheet produced by teststand, I need the Formatted values for the test results and the test limits. So I'm thinking it would be easier for me to query the database for the formatted numbers (as strings) instead of having to query the database for the 'numeric value' and the 'format string' and then creating the string for my datasheet.

 

Is the data and limits that you are trying to log custom properties or or is this for the NI numeric or multi-numeric step type?

>>>> No using custom properties, just dealing with 'NumericLimit' step types

 

I had looked at how the 'SequentialModel.Seq' calls the modelsupport2.dll to  to produce the data sheet entries.

 

     ProcessModelPostResultListEntry >

     Process Step Result >

     Get Step Result Body (Sequence) >

     Add Flagged Values >

     modelsupport2.dll >

     GetFlaggedValuesForReport_Html

 

But, alas, I don't understanding the whole traversing concept.


 

 

0 Kudos
Message 9 of 11
(4,117 Views)

You seem to already know that you already have the numeric result and limit values, and the format, and you could create the formatted value with those. If you wanted to store a formatted value in the DB, you would need to add a new column for each numeric value to the appropriate table, and then alter the database options schema to log the formated value for that new column. The simple expressioin you could use is Str(Logging.StepResult.Limits.High).

Scott Richardson
https://testeract.com
0 Kudos
Message 10 of 11
(4,111 Views)