NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

What file format is TestStandDatabaseSchemas.ini ?

Solved!
Go to solution

Hi folks,

 

I'm trying to figure out how to directly access the property objects within TestStandDatabaseSchemas.ini.

Does anyone know which API method to use to accomplish this?

I've been trying methods like GetEngineConfigFile and ReadPropertyObjectFile, and I haven't had any luck yet.

I guess as a last resort I could make a parser, but I'm hoping to find the official way to do this.

 

Context:

Years later I am still trying to figure out how to programmatically load a database schema so that the user never has to worry about this being configured correctly. This has historically been a headache and I'm trying to automate it.

Since the TSDBOptions methods are mostly undocumented, my thought process is loading the schemas into a property object and then using the contents to directly set up a schema at runtime from within the plugin.

 

Thanks in advance for anyone's input.

 

Mr. Jim

0 Kudos
Message 1 of 3
(1,172 Views)
Solution
Accepted by topic author Mr._Jim

Mr._Jim, 

 

The code uses PropertyObject.ReadEx and PropertyObject.Write to create and update the file. The object names are "DatabaseOptions" and "DatabaseSchemas";

 

Note: This can change in a future version of TS but there are no immediate plans to change it. 

 

Hope this helps, 

Regards, 

Anand Jain

NI

 

PropertyObject.ReadEx - NI

PropertyObject.Write - NI

 

Message 2 of 3
(1,129 Views)

Anand, this is great! It was the mystical secret I was missing.

 

Thanks!

 

For anyone attempting to do this...

Locals.DatabaseSchemas.ReadEx( Parameters.TestStandDatabaseSchemaFilePath,0,ConflictHandler_Error)

 

In this case, Locals.DatabaseSchemas must be an array of NI_DatabaseOptionsSchema

At first I made the mistake of trying to use that type, but not as an array.

 

Mr. Jim

0 Kudos
Message 3 of 3
(1,098 Views)