NI TestStand

Showing results for 
Search instead for 
Did you mean: 

database connection error



I have a TestStand application running on the production floor and I just noticed an error that I need to find a solution for. Over the weekend our IT department performed some SQL server maintenances and the tester lost connection to the server. Production resumed but after the maintenance the database reporting stopped sending the data to the server due to the lost connection. It did not throw an error just continued testing and now I have lost a day’s production data to the server. I have restarted Windows now and the connection is now valid again and saving data as normal. Is there a simple way to check the connection? Ping and the test connection in the UDL does not work to reestablish the data link if lost since I tried these. Only the reboot would work.


No errors are generated in the sequence file either.


LabView 2015 and TestStand 2014



Bill Lewis
0 Kudos
Message 1 of 8



Probably the station options would have been set to ignore errors.If the option would be for popup then you would have seen it.But this is expected to be ignored as its in the production floor.


You can write a simple program to connect to the SQL ( lots of codes available if you google it) whcih will simply check for connection.


or as a backup option you can use the offline processing tool which generates a .tsr file as you test your product.From this file you can recreate your reports or write to database using the tool.


Hope this helps.



0 Kudos
Message 2 of 8

thanks for the reply!


I do have the ignore errors but in the prodcution enviroment that will have to be set.


When this happened, I went to the UDL configuration and tested the connnection. It passed but the TestStand applicaiton still did not write data to the SQL database until i completely restarted the program. It seems that the connection for results processing remains open and if interputed it will not show the error.


Is there a flag i can monitor in the TestStand engine?


the writing the .tsr file kind of defeats the whole results processing model

Bill Lewis
0 Kudos
Message 3 of 8

Hi Bill,


I was able to find another forum post where users put together VIs that can successfully monitor database connection! You can find them here:


Daniella C.
Systems Engineer
National Instruments
0 Kudos
Message 4 of 8

The issue is not connecting to the database or verification of the connection, it is that the TestStand engine "Database reporting" options do not report an error on the SQL insert statement's if a insert does not commit. In SQL if the insert is not successful you will return an error. In TestStand, there is no error trapping it just goes off with the "hope" of an successful insert. Its is a bug in the TestStand environment in my opinion since I lost days of production data after a connection was interrupted.


@danniwithNI wrote:

Hi Bill,


I was able to find another forum post where users put together VIs that can successfully monitor database connection! You can find them here:



Bill Lewis
0 Kudos
Message 5 of 8



If it appears to be a bug, you can submit it here along with steps to reproduce the error and any relevant files. An Applications Engineer will be assigned to investigating it further to have it addressed in future releases if it is in fact a bug.


0 Kudos
Message 6 of 8

They only all bug entry for beta users. this is a current product

Bill Lewis
0 Kudos
Message 7 of 8

Hey Bill,


I just did a quick trial using the Open Database Step in TestStand. I purposely configured it such that it wouldn't be able to connect to any database. As such, it errored out at this step. I'm guessing you probably have the Open Database Step in your Setup and then you close the database in your cleanup. Something you could try is opening the database at the beginning of the main part of your sequence, and closing at the end of the main part of your sequence. Essentially, you will open and close the database each time you run through. This way, if you cannot make a connection to the database, your sequence will error out. Although, opening and closing every time would decrease the effeciency of your sequence execution, so maybe that's not an option for your application.


Something else you could try is including a script that pings your database. You could include this in a Call Executable step at the beginning of your main to regularly check your connection status.


Hope this helps!



0 Kudos
Message 8 of 8