VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding database in definition file using Veristand System Definition in Labview

Hello,

I'm trying to create a program which will have to automatically create a veristand system defintion file using the API in Labview. I've achieved to create my program, but the file created won't compile. It seems that the database creation is a problem. I'd like to obtain some help if that is possible..

 

Si the database I want to add is an existing database :

 

pb.PNG

(picture is from Database manager)

 

I enter the corresponding parameters in my excel sheet :

pb 2.PNG

 

I have this VI which extract the number of database, their name and add them to the file :

 

 

 

 

But then, when I try compiling, this happen :

 

pb5.PNG

The error tell : "The specified databse could not be opened. Solution : Check the alias and/or if the file exist, and if it is a valid database". And at "Database Alias" it should show "databse_test" but it show nothing. Like if it isn't written in the file.. except system explorer show it...

But, if I delete the database frome the definition file via veristand (via the system explorer) and add it again, well it works. I don't understand. I badly need to add these database automatically, and I don't see what I'm doing wrong. From my point of view it seems that the API simply don't work, but I doubt that it is it, I suppose someone would have seen it long ago.

 

I'm using Labview 2012 Full Developement System and Veristand 2012 Full Developement System, the API is "NationalInstruments.VeriStand.SystemDefinitionAPI.dll" 2012.0.1.0.

 

So if anyone has any idea, I'll gladly take it.

0 Kudos
Message 1 of 6
(5,721 Views)

It seems that two pictures are missing, and I'm unable to edit my post, so here they are. They correspond to my VI, and to the database in the system explorer.

Download All
0 Kudos
Message 2 of 6
(5,717 Views)

There may be an easier way, but for such things I have always edited a test system definition in the System Explorer and then inspected the System Definition in a text editor.  It's just an Excel file, so usually you can determine what item or item property needs to be added where to get the desired effect.

 

I would add a database to a blank system definition with a unique alias (say "My Super Cool Database") and then search for it in a text editor.

 

Here's the relevant section in a sys def I had lying around (sorry not databases in this one):

 

				<Section Name="XNET Databases" TypeGUID="def5630b-577f-4ae9-9682-5f8ee445ee21">
					<Description />
					<Properties>
						<Property Name="CD Status">
							<U32>2</U32>
						</Property>
					</Properties>
					<Errors />
				</Section>

 

Chris
Certified LabVIEW Architect
Certified TestStand Architect
Message 3 of 6
(5,687 Views)

Waw. Thank you. Didn't know that. Really thanks you.

0 Kudos
Message 4 of 6
(5,677 Views)

Hi,

 

I just ran into the same problem as Klunst. Unfortunately this thread doesn't propose any solution.

 

The problem seems to be that the MD5 hash is not calculated when creating the system definition using the .NET API and therefore the database is considered invalid during deployment.

I could calculate the MD5 hash for the database myself, but there are two problems:

  • I'm working with a database alias so I don't know where the actual file is stored on disk.
  • The .MD5 property is readonly so you can't assign to it

I hope that one of the NI guys can post a workaround solution (maybe using internal information) because otherwise this would be a dead end and my work on creating system definitons programatically would be for nothing.

Adding the database manually via System Explorer and then extracting the information from the system definition xml file is not a viable option for me. 

 

My VS version is 2012. Was this bug fixed in more recent versions?

 

Regards

Krid

0 Kudos
Message 5 of 6
(5,108 Views)

Ok, as it turns out VeriStand doesn't care about the MD5 property too much.

 

The problem is the missing user.CD.DB alias property. You can manually set the property like this:

 

DB = Database(r'nixnet_example')
DB.BaseNodeType.SetStringProperty('user.CD.DB alias', r'nixnet_example')

 Now the sysdef deploys just fine. Still this is a bug that should be fixed.

 

Regards

Krid

0 Kudos
Message 6 of 6
(5,099 Views)