The UUT_RESULT table contains two types of informations :
1) Informations known at the beginning of the execution
2) Informations known at the end of the execution
Could it be possible to fill in the database the informations of category 1) at the beginning of the execution and udpate the UUT_RESULT record at the end of the execution with the informations of category 2) ?
├ CTA - Certified TestStand Architect (2008 & 2010 & 2014)
├ CTD - Certified TestStand Developer (2004 & 2007)
└ CLD - Certified LabVIEW Developer (2003 & 2005)
I had a similar need to have UUT Results updated prior to the end of the testing so that I could query the results. I have a long test, so I chose to use On-The-Fly logging so that I could review step results prior to the completion of the test as a whole. Similar to this thread I ran into the problem of not being able to query the UUT results because several of the important fields are not populated until the entire test is complete. So I thought I would document my solution with some example code.
To get my example code to work you will have to do the following.
The one part of my solution that I am not 100% in favor of is the use of a Station Global but I was not able to figure out an alternative in the time allotment that I wanted to spend on this. If anyone has another method other then the Station Global I would love to hear it.
Did you found a solution for filling the UUT_RESULT table? In my opinion you're absolutely right that it's not logic not to fill the uut_result-table with the information already known at the start. The only design considerations I can think of is that it's possible to change the variables in a sequence programmatically (for example UUT_SERIAL_NUMBER ) during the execution causing an inconsistent state (DB versus result-collection) However this could be resolved by adding an extra update state on the end of the execution (the same statements like in the current implementation)
The solution you provided looks good. Unfortunately I can't use it because I'm using MySQL (MariaDB to be exactly) which doesn't have the datatype UNIQUEIDENTIFIER for the ID-columns. Also I'm wondering what happens when I use this solution with multiple sockets. Is it possible that the StationGlobals.UUTGUID can contain invalid values? The GetGUID-sequence will be executed in parallel and there is no guarantee that the order in which the database-engine will execute the statements will be same order as in the sequence. (it's not an atomic action)
Best solution in my opinion would be to implement the update of the uut_result-table in the DBlog.dll. The "model plugin-UUT Start"-sequence in the NI_Databaselogger.seq calls the method "NewUUT" of the TSDBLog-object class. The UUT-container (with for example UUT_SERIAL_NUMBER) and StartDate/Time are part of the parameters-list of the "model plugin-UUT Start"-sequence and are passed as object-references into the method "NewUUT". So the data is available in the DLL.
I was wondering if it's difficult to implement this into the provide source-code and build a new DBLog.dll. (I'm a Newbie in C++)
The source-files are available in /Program Files (x86)/National Instruments/TestStand 2013/Components/Models/TestStandModels/Database/DBLog
I found the NewUUT method in the TSDBLog.cpp but I still haven't found the exact place were the resulting DB INSERT statement is executed ...
Somebody an idea how to do this?