NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Enter a Testnumber value in the results

Solved!
Go to solution

Where and how would be the best way to enter a testnumber for each test I run so that the test would have a test number column in the database associated with it.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 1 of 11
(320 Views)

I'm not an expert

 

maybe this give you an idea. See our test result -html and Test Sequence.

 

Marinuss_0-1727943299902.png

Marinuss_2-1727943375404.png

Marinus

 

 

0 Kudos
Message 2 of 11
(289 Views)

You mean like assigning a (human readable) unique identifier to each test?

0 Kudos
Message 3 of 11
(265 Views)

Hi

 

I was thinking you can change the test names to 1, 2, 3 etc.

 

Marinus

0 Kudos
Message 4 of 11
(258 Views)

Thanks but I’d really rather not do it this way. I would rather have a number tied directly to the test itself that way I can create a master test table in the database that corresponds to the test numbers. Makes it easier to generate a test report from the database. 




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 11
(249 Views)

Yes exactly. This would make it a little easier when creating a report from the database itself. Ultimately the goal is to have a master table in the database that has names associated with test numbers. I just need a way to put the testnumber in the test results or to be able to add it in the database somewhere that correlates to the actual test performed. 




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 6 of 11
(238 Views)

I'll start with some background before sketching a possible solution...

 

TestStands result collection basically works by harvesting the result containers from the steps in a sequence.

The data from the result containers are than written into the report or database by the result processing.

 

Consequently, the data you want to have in the report / database should go into the result container of the step. 

 

To do so, there are several ways, each with some pros and cons (guess you'll find them out yourself)

 

1.) Use "Additional Results" Properties of step

Oli_Wachno_1-1728363789932.png

2.) Create your own StepType based on the NI StepTypes, modify the result structure and provide some code to enable better UX. (https://www.ni.com/de/support/documentation/supplemental/08/teststand-custom-step-type-development-b... )

 

These are the most straight-forward options I am aware of.

 

We have opted for the second way, since there is a lot of additional functionality in our steps.

 

 

 

 

0 Kudos
Message 7 of 11
(225 Views)

Thank you. This is what I was looking for. I was leaning towards a custom type before posting this but I wanted to make sure that there was not something easier. I will look more into custom types. 




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 8 of 11
(218 Views)
Solution
Accepted by Joe_H

@Joe_H wrote:

Where and how would be the best way to enter a testnumber for each test I run so that the test would have a test number column in the database associated with it.


  1. Go to Configure > Result Processing
  2. Insert a Database report by clicking the add button
  3. eejallen_0-1728408584749.png

     

  4. Click Options 
  5. eejallen_1-1728408633268.png

     

  6. Go to Schemas tab
  7. Copy the Generic Recordset
  8. eejallen_2-1728408921045.png

     

  9. Checkbox the new copy Recordset.  Expand the Generic Recordset, then expand STEP_RESULT.  Right-click any child and add a New child
  10. eejallen_3-1728409123955.png

     

  11. I named it UID and set it to a 32 byte string
  12. eejallen_4-1728409195123.png

     

  13. Set the Value to Log option to: PropertyExists("Logging.StepResult.UID") ? Logging.StepResult.UID : ""
  14. Click OK on Database Options to save and close Options
  15. Click OK on Result Processing dialog to save and close
  16. Click on any test step in your sequence, where you want a Unique ID.
  17. In the step's Pre-Expression add this: Step.AsPropertyObject().SetValString("Result.UID", PropOption_InsertElement, "12345")
  18. This adds a UID of 12345 to the Step.Result
  19. Run the test sequence
  20. After the sequence is complete, go back to Database Options in Result Processing and click View Data
  21. eejallen_5-1728409655919.png

     

  22. Use this sql query to see the Step Name, UID and UUT Status

SELECT UUT_RESULT.UUT_SERIAL_NUMBER, UUT_RESULT.START_DATE_TIME, STEP_RESULT.ORDER_NUMBER AS STEP_ORDER, STEP_RESULT.STEP_NAME, STEP_RESULT.UID, STEP_RESULT.STATUS
FROM UUT_RESULT LEFT JOIN STEP_RESULT ON UUT_RESULT.ID = STEP_RESULT.UUT_RESULT
ORDER BY UUT_RESULT.UUT_SERIAL_NUMBER, UUT_RESULT.START_DATE_TIME, STEP_RESULT.ORDER_NUMBER

 

A table will be created which includes the UID column

eejallen_6-1728409901485.png

 

0 Kudos
Message 9 of 11
(206 Views)

This seems like a very viable option. I will try it out and let you know. 




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 10 of 11
(196 Views)