11-23-2015 07:49 AM
Hello everybody,
I have a question regarding changing the database use for the result processing. My environment is Teststand 2014, LabView 2014.
I need to be able to change the database used for storing the result data programmatically. I am using the simple UI example provided by TestStand as a starting point to build the user interface. The way I do this is by creating a station global variable (StationGlobals.DBName) in the TestStand. User can select his database via a combo box on the user interface. When user execute a sequence, Teststand requested from the UI the database name selected by the user (using UIMessage).
It does not work the way I wanted. It is best to described the symptom using the use case below:
1. Start UI
2. Choose a database (DB-A)
3. Run a sequence
4. Check the result data tables in DB-A. It works.
5. Choose another database (DB-B)
6. Run the same sequence
7. Check the result data tables in DB-B. They are not DB-B.
8. Check the result data tables in DB-A. They are in DB-A.
It seems that the station global variable can only be passed to the database configuration before I started to run any sequence. By the next sequence test, it does not take effect anymore.
I wonder if I need to modify a callback to make it work properly.
Any idea why it is behaving this way? Below is a screen shot of my database configuration:
Thanks in advance for any pointer.
Yours,
hlim
Solved! Go to Solution.
11-23-2015 10:10 AM
from many versions of TS ago...
TS reatains a open handle to that database logging context across executions -- not expecting it to change.
you need to clear out that handle between executions. Insert a line at the end of logging (requires process model modification, or results processor modification, or implementing callbacks for results processor in each sequence file) that sets RunState.Execution.TSDatabaseLoggingDatalinkXXXXX = nothing. XXXXXX needs to be replaced with your schema name. (this is where setting a breakpoint and using the debugger will help get the right variable name)
11-24-2015 03:03 AM
Thanks Warren_Scott for the information. I will try to look into setting the handle. I will report back.
11-28-2015 08:51 AM
Hello Warren_Scott,
apparently in my case, where I am changing the database between executions, I can just disable the 'Share Data Link Between Executions' option in the Result Processing->Database option and it will work. Thanks for your suggestions.
Yours,
hlim