LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call librairy function node

There was a limitation in LabVIEW 6.1 and earlier version. When calling a .DLL library (Dynamic linked library) LabVIEW was waiting for the function to return. .DLL were, to LabVIEW, behaving like an atomic function. Even the panel was freezed during the call. Is it still the case with LabVIEW 7.0 Express

Is it now possible to register call back function from LabVIEW. So we could be called instead of polling for an asynchronous process.

Nitrof
0 Kudos
Message 1 of 2
(2,528 Views)
> There was a limitation in LabVIEW 6.1 and earlier version. When
> calling a .DLL library (Dynamic linked library) LabVIEW was waiting
> for the function to return. .DLL were, to LabVIEW, behaving like an
> atomic function. Even the panel was freezed during the call. Is it
> still the case with LabVIEW 7.0 Express
>
> Is it now possible to register call back function from LabVIEW. So we
> could be called instead of polling for an asynchronous process.

All DLLs functions in all languages work as you describe. Control is
passed to the DLL function until it chooses to return. If you call the
DLL using the LV UI thread, then LV is pretty locked, especially the UI
until it returns. If you mark the DLL call as reentrant, LV can call it
in a parallel thr
ead, and the UI will still be alive. Note that the
diagram will still have to wait for the node to finish before it can
pass data down the wires out of the DLL node.

The callback mechanism you are looking for has been possible for a long
time, but not in the way you are looking for it. If you have a DLL that
creates its own thread and runs in parallel with LV, then you call the
DLL to give it an occurrence. The function then returns to the diagram,
and your diagram can Wait for the occurrence to be set by the DLL
thread. This puts that part of LV to sleep but allows for everything
else to proceed like normal. When the DLL calls Occur, it will wake up
the diagram and it can call back into the DLL to retrieve or drop off
data. LV 7 also extends ActiveX events if that is convenient and you'd
rather go that route.

Greg McKaskle
0 Kudos
Message 2 of 2
(2,528 Views)