NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Add UUT.AdditionalData to database from process model

I am following the instructions provided here for reporting the UUT.AdditionalData to the test database. I have this working, but it only works when the step (that holds the copy of UUT.AdditionalData) is located within the sequence file. 

 

Is there a way to add this data/perform this step from the process model itself? I tried adding the step to the PostUUT callback (the most obvious place to put it) but it doesn't get picked up by the result processing.

 

To put it into context - my process model records a number of fields of additional data about the test, and the test sequence might do this as well. I am storing/adding this data to UUT.AdditionalData and I want to record that to a 'test metadata' table in my database. I have that working from the link above, but it requires the statement step to be located in the test sequence - I want it to be in the process model instead so it happens automatically.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 1 of 6
(3,769 Views)

If you're using the default model in TS 2012 or later, PostUUT runs after (or in parallel to) the Model Plugins - UUT Done sequence, so you're modifying a property that has already been logged.

 

Try adding AdditionalData in the PostMainSequence callback. Any changes to the UUT container here should make its way into the database logger. Also since it's a callback, the client file can override this and customize it further if needed.

 

Hope this helps!

Trent

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 2 of 6
(3,731 Views)

It's worth mentioning that PostMainSequence wasn't added until 2016, so you may need to add this callback yourself if you're on an earlier version:
Callbacks.PNG

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 3 of 6
(3,723 Views)

I tried this but it didn't work.

 

I'm not actually adding fields to the UUT.AdditionalData here - most of them get added during the PreUUT callback or some might get added during the test (e.g. to store particular test configurations/information).

 

What I'm currently having to do is copy the UUT.AdditionalData to a step in the test sequence and then using a custom database statement to log those to the database. I was hoping to do this from the process model since I want it to happen automatically for every sequence but I guess steps in the process model don't/can't get logged.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 6
(3,696 Views)

Can you elaborate a bit on what you tried and how it didn't work? The reason we added the PostMainSequence Callback is to modify the UUT container before the report plugins are called.

 

The attached zip file contains an example:

1. Unzip and configure your database plugin to point to the included mdb, using the included schema.

2. run the dbtest sequence using singe pass

3. Look at the UUT_Results table for the extra string.

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 5 of 6
(3,691 Views)

If you look at the link I posted in my OP (https://forums.ni.com/t5/NI-TestStand/Logging-UUT-AdditionalData-to-the-database/m-p/2979731#M46562), that is what I am trying to do. I want to add a bunch of dynamic 'metadata' fields about the test during its operation and I do this by adding it to the UUT.AdditionalData as needed. I want this data to populate a 'Test_Metadata' table in the database - the only way I've found to do this is by using an expression step to 'copy' the UUT.AdditionalData at the end of the test to a step in the test sequence and then use a custom database statement which only logs sub-properties named 'UUT.AdditionalData' (the property previously copied). 

 

What I want is to avoid having to add a step to every sequence to copy the UUT.AdditionalData and have this performed as part of the process model.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 6
(3,677 Views)