NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Quick Database Connection Test

I am working on a TestStand & LabVIEW developed test system upgrade. One new feature is sending real-time test data to a network SQL database. One contingency feature is to detect a loss of the network and write test data to a local datatbase until the connection is restored. The problem I have is that the TestStand Open Database function takes 20 seconds to time out and I have a 30 second window for the full test cycle. The LabVIEW function takes about 15 Seconds to time out. Does someone know of a quick response (<5 seconds) TestStand or LabVIEW "ping" like function to check for network and/or database connection status.
0 Kudos
Message 1 of 4
(4,865 Views)
Hi NeptuneTest,

The connection timeout for a TestStand "Open Database" step doesn't always have a default setting like you are assuming. You can actually specify in the connection string for the OLE DB provider a connection timeout parameter. If when in the "Edit Open Database" dialog, you click the "Build" button you can see that there is a "Connection Timeout (in seconds)" option under the "Advanced" tab of the window. Not all OLE DB providers allow this to be set, but some do so check it out for yours.

Now, the real issue we should look at here is the special circumstance your situation has of needing to decide whether to log remotely or locally in less than 30 seconds. So you really should implement some type of fault detection procedure just like yo
u mentioned in conjunction with a proper timeout setting. In order to perform a ping you can actually do this from both LV or TestStand by executing a system command. In LabVIEW you can use the System Exec.vi to run a batch file that calls ping. In TestStand you can use the Call Executable step to perform the same operation. For more information on doing this check out the KnowledgeBase document on the following page:

http://digital.ni.com/public.nsf/websearch/833D2F227971E4BF862564DB00579D1B?OpenDocument

Jason F.
Applications Engineer
National Instruments
www.ni.com/ask
0 Kudos
Message 2 of 4
(4,865 Views)
Thanks Jason,

I could not set the timeout in the Open Database step, but I do have the ping command approach working. I only takes two steps and just over 1.5 seconds to determine the connection status.
0 Kudos
Message 3 of 4
(4,865 Views)
Because I had a problem with the database toolkit open connection timeout not working, I created this VI to check for connectivity before opening a connection.
Message Edited by LabBEAN on 02-19-2010 06:16 PM

Certified LabVIEW Architect
TestScript: Free Python/LabVIEW Connector

One global to rule them all,
One double-click to find them,
One interface to bring them all
and in the panel bind them.
Message 4 of 4
(4,174 Views)