NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using CVI obtained handle for a device in Labview via TestStand

Hi,
 
I am running a TestStand sequence.
 
I open a device using a CVI adaptor step to call a function in a CVI generated DLL. This in turn calls a base DLL.
 
I store the returned handle in a TestStand local variable.
 
I talk to the device in a number of CVI adaptor steps. This works fine.
 
I then call a LabVIEW vi, passing the handle. This vi uses the Library Function Node to call a function in the original CVI DLL.
 
This returns an invalid handle error from the base DLL.
 
I think that LabVIEW may be loading another version of the base DLL.
 
If this is the case then how can I stop it.
 
Thanks,
 
John
0 Kudos
Message 1 of 3
(2,916 Views)
If the LV VI is executing in a separate process, it will load the dll again in that process, which would explain what you are seeing.
 
To verify this, select Specify Module on your LabVIEW step and checkmark the Advanced Settings...>>Alway Run VI in LabVIEW Run-Time Engine option and see if that fixes the problem.
 
The runtime engine will run the VI in the TestStand process, so it should use the same dll instance. It is also a little faster to call the VI, but you can't debug the LV VI when this option is set.
 
If it still doesn't work, your CVI code might also be running in a separate process. To see if that is the problem, either call your CVI dll with the DLL adapter instead of the CVI adapter, or set the Configure>>Adapters>>LabWindows/CVI>>Configure>>Execute Steps In-Process option.
Message 2 of 3
(2,912 Views)

Hi James,

Switching to the "Alway Run VI in LabVIEW Run-Time Engine" option has fixed the issue.

My DLL does not run in a seperate process, but I don't know if the base driver does.

Thanks for the help,

John

 

0 Kudos
Message 3 of 3
(2,905 Views)