NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I convert a Database Handle from TestStand to LabVIEW?

I want to use a Database Handle (already created in TestStand by an Open Database step) in a LabVIEW-VI (called from TestStand) to connect it with the "Connection Reference" input of the "Easy SQL.vi"? If I use a directly connection via the "TestStand - Get Property Value (Number).vi" I get back the error message 4101 in LabVIEW. How can I convert the Database Handle?
Christian

Test Engineering
digades GmbH
www.digades.com
0 Kudos
Message 1 of 2
(2,922 Views)
The TestStand database step types use the CVI SQL Toolkit to talk to databases. The handle that you are referencing is an internal memory location and not a actual handle that you can directly use. Currently as implemented the handle that is stored in a numeric TestStand property for the connection and the SQL statement are the handle values returned from the CVI SQL Toolkit. So for the connection handle, you could call the CVI SQL Toolkit function
DBGetConnectionAttribute (
int Connection_Handle,
tDBConnectionAttr Attribute,
void *Value);
and get the CVI CAObjHandle reference. With this you could then call the CVI ActiveX function
CA_GetInterfaceFromObjHandle(
CAObjHandle Object_Handle,
const IID *Interface_Id,
int Force_AddRef,
void *Inte
rface_Ptr,
int *Did_AddRef);
to get the actual ActiveX interface reference. This would have to be converted into a LabVIEW reference.

You may want to consider just using LabVIEW to open a new parallel reference only using the toolkit.
Scott Richardson
Message 2 of 2
(2,922 Views)