07-24-2008 03:49 PM
The tutorial, Using Existing C Code or a DLL in LabVIEW, does an excellent job of explaining how to include C functions into a VI via a DLL. I would like to use the same DLL, but with C++ Classes as well. Does anyone know how to do this?
Rob Steele
07-28-2008 10:57 AM
You will be able to call C++ dlls in LabVIEW, provided that they only use primitive data types. I would recommend you to look at the following resources for detailed information on calling external code in LabVIEW:
1. How Do I Call a Dynamic Link Library (DLL) from LabVIEW?
2. Using External Code in LabVIEW
I hope this helps!
Mehak Dinesh
Applications Engineer
National Instruments
07-28-2008 03:53 PM
My desire was to be able to access a C++ class and it's methods directly. From my reading of the documentation it appears that I can do this by buidling a C wrapper which calls the method I am interested in. Is this correct?
07-30-2008 05:09 PM
Yep. You will need to build wrappers
08-02-2008 11:59 AM
The good news is that I can use my working C and C++ code and call call it from labView. The bad news, is that the C++ code must be wrapped within C functions.
08-30-2008 12:11 PM
My goal was to do my vision code and signal processing code through labview and have it give the data to some localization code I wrote in C++. Does this mean I cant use the full capabilities of C++ such as classes and methods?
09-01-2008 11:33 AM
You can still use all of your functionality, but how you access is , in my opinion, a little contrived. What I did to use my C++ code was to instantiate the C++ objects in the dllmain. From there I built C wrappers which called my functions. When I had to pass in data structures I had to build C wrappers to handle bundling and unbundling the primitive data types. For me, I was using the functions in the standard template library for sorting that I wanted to continue to use. After i made the committment to use the wrapper functions things went very easy.
One thing I did do was to build vi's that would wrap one or two of the C++ methods. This way I only replicated what looked like standard vi's through my application and I did not have the "Call Library Function Node" directly visible on my 'high level' vi's.
Rob Steele
05-10-2011 06:51 AM
nice information
05-11-2011 09:49 PM
Hey,
I've been taking a programing class (Just BASIC and C++) this past semester. Where is a good place to start looking for how to code the robot using C++ ?
Thanks,
Davis Catherman
10-21-2016 06:27 AM
Thanks