Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
8 rating:
 1.5 out of 5   

Archived: Why Does TestStand Incorrectly Log Some Numeric Values to My Database That Uses the New Default Database Schema Introduced in TestStand 4.1?

This document has been archived and is no longer updated by National Instruments



Primary Software:
Primary Software Version: 4.1
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I am using Teststand 4.1 or newer and logging results to my database using one of the new TestStand 4.1 default database schemas.  When I log numeric values larger than 9.999999999999E+254, smaller than -9.999999999999E+253, and between -0.1E-12 and 0.1E-12, incorrect values are stored in my database.  Why are values being logged incorrectly and how do I resolve this issue?

Solution:
Note: This issue is fixed in TestStand 2010.

The TestStand 4.0 and prior default schemas do not exhibit this behavior.  This problem occurs when using the new TestStand 4.1 default database schemas.  Read below for patches or a workaround to this problem and for more information regarding the behavior of the TestStand 4.1 default database schemas. 

With the introduction of Additional Results in TestStand 4.1, the database logging feature added support for logging additional results and miscellaneous step result properties to a database using redesigned database schemas.  With the new schemas, values for additional results and miscellaneous step result properties are logged to the database and stored in a single string field, allowing the user to simplify the SQL statements required to mine data for generating reports and performing general analysis.

The numeric value ranges mentioned above are incorrectly logged because the database logging DLL incorrectly uses the %f conversion specifier  to convert these numeric values to strings, causing the numeric value to be converted to a string in non-exponential format regardless of its size.  Instead, the DLL should use the %g conversion specifier.

Depending on the maximum size of the string field for a string column in the database schema, trailing zeros can truncate, resulting in logging incorrect values.  For example, the maximum string field size is 255 characters for the DATA column in the PROP_RESULT statement in the new default schemas, so values greater than 9.999999999999E+254 and values less than -9.999999999999E+253 are incorrectly logged.

For values between -0.1E-12 and 0.1E-12, the resulting value logged to the database is 0 because the database logging DLL specifies that values formatted with %f have a maximum of 13 digits to the right of the decimal point.

Please contact National Instruments Support if you have any questions or need assistance regarding the below mentioned patches or workaround for this issue.

The above mentioned issue is resolved in the following patches:

Workaround
To workaround this behavior without installing the patches above, implement the following modification to the TestStand 4.1 database schema that you are using:

  1. Select Configure»Database Options...
  2. Navigate to the Statements tab of the Database Options dialog and select the PROP_RESULT statement.
  3. Then navigate to the Columns/Parameters tab of the Database Options dialog and select the DATA column.
  4. In the Expression field, replace Logging.PropertyResult with the following expression:
    (Logging.PropertyResultDetails.Type.ValueType == 3)?Str(Logging.PropertyResult, "%$.16g"):Logging.PropertyResult
  5. Click OK to apply your changes
Deploying Updated Schema to Other Machines
You can follow the standard procedure to deploy your new database options settings to other machines by including the TestStandDatabaseOptions.ini file from the <TestStand>\Cfg directory in your deployment workspace.  Please see the Knowledgebase article How do I Include My Station Globals, Search Directories, Tools Menu, etc. in My Deployment When Using the TestStand Deployment Utility? for further information about including files in the <TestStand>\Cfg directory in your deployment.

If you do not want to re-create a deployment and only need to apply this update on a specific set of machines, you can export your updated database schema from the Schemas tab of the Database Options dialog using the Save button to create an INI file with your schema configuration.



You can then copy this INI file to the appropriate machines and import the updated database schema from the Schemas tab of the Database Options dialog using the Load button.



Related Links:
Knowledgebase 3WLI47YV:  How do I Include My Station Globals, Search Directories, Tools Menu, etc. in My Deployment When Using the TestStand Deployment Utility?
Knowledgebase 37O9H144:  How Do I Copy My Custom Database Schemas from One Station to Another?


Attachments:





Report Date: 05/14/2010
Last Updated: 07/08/2014
Document ID: 59DDENPI

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit