LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW blocking QT signals?

I have a LabVIEW 8.6 program that is using a DLL written in QT; the DLL listens to a TCP port for incoming messages and updates some internal data.  My LabVIEW program calls into the DLL occasionally to read the internal data.  The DLL works perfectly (i.e., receives data from the TCP port) with another QT program.  However, it does not work at all with my LabVIEW program.

 

I've attached a debugger to the DLL and can see calls from LabVIEW going into it -- my function for getting the internal data is being called and I can step through it.  The code that gets the data from the TCP is never called though; it looks like the signal for incoming data on the TCP port is never triggered. 

 

I know this sounds like a QT issue but the DLL works perfectly with another QT program.  Unfortunately, it fails miserably with LabVIEW.  

 

One theory:

 

   - The event loop is not running when LabVIEW calls the DLL

      - In the QT DLL's run() function, I call socket->waitForDisconnected(). Perhaps the DLL is not processing incoming events because the event loop is not running?  If I call exec() to start the event loop, LabVIEW crashes (LabVIEW 8.6 Development System has encountered a problem and needs to close."):

 

   AppName: labview.exe     AppVer: 8.6.0.4001     ModName: qtcored4.dll
   ModVer: 4.5.1.0     Offset: 001af21a

 

      -  Perhaps when I call the DLL from another QT program, that program's event loop is allowing for the TCP signal to be seen by the DLL.  Unfortunately, kicking off the event loop in the DLL takes down LabVIEW.

 

 

Any thoughts on how to keep signals running in the DLL when LabVIEW is the calling program?

 

(Cross-posted on  http://stackoverflow.com/questions/1267804/labview-blocking-qt-signals)

0 Kudos
Message 1 of 3
(4,153 Views)

Hi,

calling a dll in LabVIEW can be tricky. Qt is based on C++ and LabVIEW do not like C++. A dll written in C++ needs to be redefined in how calling conventions must be. There is some App. notes you should read. Please search for them here or at lavag.org.

 

Regards.

0 Kudos
Message 2 of 3
(3,739 Views)
0 Kudos
Message 3 of 3
(3,731 Views)