NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch database schema programatically

Hello,

I have two sequences (Test1 and Test2 ) which have to use diffrent database schemas (Schema1 and Schema2) . I have  added LogToDatabase callback to each sequence and configured them as following

In Test1.seq -> Parameters.DatabaseOptions.DatabaseSchema.Name="Schema1"

In Test2.seq -> Parameters.DatabaseOptions.DatabaseSchema.Name="Schema2" 

but unfortunately, both of sequences keep using a schema which is marked in the Result Processing.

Have you idea how to resolve the problem?

Thanks

0 Kudos
Message 1 of 5
(2,783 Views)

According to the help documentation for the Database Options Dialog Box, you may have to include the databases in the ini file or it will default to the default schema. Have you already tried this?

 

"Database Options Dialog Box": https://www.ni.com/docs/en-US/bundle/teststand-api-reference/page/tsref/database-options-dialog-box....

Applications Engineering
National Instruments
0 Kudos
Message 2 of 5
(2,766 Views)

Thank you for the answer, Daniel.

Yes, I have seen TestStandDatabaseSchemas.ini but find there nothing that allows me to switch the default schema. Maybe you can point me what exactly I should change?

0 Kudos
Message 3 of 5
(2,749 Views)

I dug into some old service requests and found an old forum post that actually state we do not provide the API functions to programmatically change this configuration file. Modifying the schema in the database options by importing/exporting a schema will automatically change the .ini file for you which is the most modification you can do. I'll run this by my colleagues here just to double-check that nothing has changed in the API functionality in the last few years to support this but I believe it's not currently possible. You can post this to our Idea Exchange though. It's a good spot to post ideas that R&D looks at frequently to determine what features to include in future releases of TestStand. Below is a link to the old forum post that I believe is pretty relevant.

 

https://forums.ni.com/t5/NI-TestStand/Programmatically-load-Database-Schema/td-p/783678

Applications Engineering
National Instruments
0 Kudos
Message 4 of 5
(2,731 Views)

Hey airspan,

 

Also take a look at this example - https://forums.ni.com/t5/Example-Programs/Changing-the-TestStand-Database-During-a-Single-TestStand/...

 

This lets you switch between to database connections during an execution. 

 

Hope this helps! 

Roxy

0 Kudos
Message 5 of 5
(2,714 Views)