LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory allocation/deallocation and external libraries...

I am using a Cypress CY7C68013A USB chip to develop some hardware that will connect to a PC. I want to use LabView to send and receive data via this interface. The driver provided by Cypress for this IC is accessed via a statically compiled MS Visual C++ library called CyAPI.lib. I do not have access to the source code. I do have documentation on the API. Therefore, I suspect that I will have to write a C wrapper for each object field/method...
 
However, I have been told by some colleges that LabView has trouble with memory allocated by external libraries.  Can anyone comment on this and/or offer some tips when writing a C wrapper dll to access a static C++ library.  Are there other options for getting LabView to access the CyAPI.lib?
0 Kudos
Message 1 of 3
(2,844 Views)
I can't offer much in the way of details, but you might want to investigate USBTMC (USB Test and Measurement Class). With a driver written to this spec, you use VISA commands to the USB instrument in exactly the same manner as a GPIB device (i.e. VISA Write "*IDN?", VISA Read "response"). Drivers that implement this are much easier to use than exposing USB Raw. This will take more work on your end but will end up with greater customer satisfaction. This is the route we're taking with some instruments developed for internal use. They may never be commercially released but the current customer (me), is very happy. The developer started by googling USBTMC and went on from there.
0 Kudos
Message 2 of 3
(2,838 Views)

If you expect a return in the form of string or array, you have to allocate memory in the wrap dll, or LabVIEW will crash.

 

George Zou

http://gtoolbox.yeah.net

George Zou
0 Kudos
Message 3 of 3
(2,828 Views)