LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dll for outputting data

 
I am in need to evaluate problems my program is having regarding speed and real time in another language.
The drivers of some of my devices is only accessible through NI, ie, no active x.
I dont want to mailback the devices, im not sure the other language will even fix the problem.
 
So Ive made a dll and am already accessing the data in matlab.
The main VI through which the dll is made from follows the convention
initialize device -> get data -> close device
to call this from a dll, i have to do each of the three steps  (itialize, close, and get data) each time its called.
This is problematic, it is not efficient to initalize and close the device each time.
 
Is there a way to break this into say 3 dlls.
One to initialize the device.
The a 2nd dll that gets repeatly called in matlab to bring in the data.
Then a third dll to close the device
This would somehow involve passing instrument handles from the other language, right?
 
Basically, the way the program flows in labview without the dll allows the initailzie and close events to happen once.
Then the while loop scans the data is in a while loop pulls in the data each iteration.
I would think there is a way to do this with the labview dll?
 
does this question even make sense?
 
 
0 Kudos
Message 1 of 2
(2,390 Views)

Hello,

First off, there is no reason to create 3 separate DLLs.  If I understand you correctly, you have a LabVIEW VI that you want to make into a DLL.  And you need it to be able to perform 3 functions - initialize, read data, and close.  This could all be implemented in one VI that is designed as an "action engine" - basically, you have one input that defines whether to perform the initialize function, read data function, or close (perhaps an enumeration with those 3 values).  Based on that input, you perform the appropriate code and any data that needs to be stored between calls can be maintained in shift registers.  Once that is compiled into a DLL, you can call from whatever other language you are using.  Just call initialize function of the DLL once, then sit in a loop processing each peice of data, then at the end call the close function.

Good luck.

Rob

0 Kudos
Message 2 of 2
(2,362 Views)