From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview locks event processing in external library (DLL) :-(

Hi all!

 

I have to test some Bluetooth functionality for devices on production line.

I use Bluesoleil Bluetooth C++ SDK to make small DLL to support several simple Bluetoth operations.

This DLL registrates several event callbacks on BT HW, call function for Bluetooth device descovery and waits an result.

This operation driver executes asinchronously and to wait end the process DLL creates Windows event and activates it when appropriate drivers's callback is called.

DLL uses Windows API function WaitForSingleObject with timeout to catch end the process.

After this process is finished I check gathered information about devices in environment.

It normally works when I call these DLL functions from C code.

 

Then I repeat the test functionality in Labview's VI where I use DLL wrapper to call DLL functions..

And the most functions works correctly inside of Labview too..

But I can see: event's callbacks in DLL under LABVIEW are processed in wrong time slot:

a) When I use C-code caller then DLL's callbacks gather information about devices in background

And when this process is finished counter of devices is not zero an I have a list of devics.

 

b) When I use Labview DLL caller then the discovery process is ended by timeout. I latch zero BT device counter.

And only after return from DLL call I can viewin logs result of callback processing - incremented counter and gathered BT device.properties.

But this information is already missed for me.

 

Is it posibly Labview organizes own event queue and processes it?

And is it possible event hooks in DLL are processed after return from DLL function call?

There are some way to configure this behaviour in LABVIEW?

 

Thanks in advance for any ideas.

Anatoly

0 Kudos
Message 1 of 2
(3,638 Views)

Hello Anatoly,

you ended up posting this question to ther LabWindows/CVI forum board but since it refers to LabVIEW you should post it to the appropriate board



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,633 Views)