LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding an element to a LabVIEW Queue from a C Dll

Using LabVIEW 7.0, is it possible to add an element to a LabVIEW queue from with a dll written in C?

I'm using the queue as a synchronisation mechanism - it's a bit complicated, but I call a dll function which produces data. When it gets a new set of data, it sets an occurrence which my LabVIEW VI is waiting for (using WaitForOccurrence). Essentially, I need to add an element to the queue to indicate that the occurrence was set from within the DLL and not by LabVIEW (since I need to set the occurrence when I want to quit, otherwise it will wait for the occurrence forever!) I've tried lots of different ways to handle this, and this is the only scheme that works - at least, it works within LabVIEW, with one VI produc
ing data (simulating the dll). The trick is to now get it working with the real dll.
0 Kudos
Message 1 of 3
(2,968 Views)
There are other ways to do this, but if you are running Windows you can message into LabVIEW's ActiveX server and call a VI that enqueues data into your queue.

Good luck,

-Jim
0 Kudos
Message 2 of 3
(2,968 Views)
> Using LabVIEW 7.0, is it possible to add an element to a LabVIEW queue
> from with a dll written in C?
>

I'd recommend going another way. Once the C code signals it has data
using the occurrence, the easiest way is to have the diagram call back
into the DLL -- likely to another function -- and that function will
return the data. After you retrieve the data from the DLL, you can do
whatever you like, including enqueuing it.

Greg McKaskle
0 Kudos
Message 3 of 3
(2,968 Views)