LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use classes (C++) in CINs?

Hello,
I want to program some CINs but with code written in C++. In this code I've got some classes and i would like to know if this is possible (and how) or if i should change my C++ code into C.

Thank you,
Silvia.
0 Kudos
Message 1 of 4
(3,027 Views)
Don't know about with a CIN but it's certainly possible with a DLL. Imho, a DLL is easier to create than a CIN and it's certainly more portable.
0 Kudos
Message 2 of 4
(3,027 Views)
I am not sure this is correct. Page 2-15 of the "Using External Code in LabVIEW" has the following:

"Some APIs have structure and, in the case of C++, class data types. LabVIEW cannot use these data types. If you need to use a function that has a structure or class as an argument, you should write a CIN or shared library wrapper function that takes as inputs the data types that LabVIEW supports and that appropriately packages them before LabVIEW calls the desired function."

I don't know if this has changed with LabVIEW 7. I am using LabVIEW 6.1 and I am trying to do the same thing with CINs but I keep getting linking errors.
0 Kudos
Message 3 of 4
(3,027 Views)
DanX wrote:

> I am not sure this is correct. Page 2-15 of the "Using External Code
> in LabVIEW" has the following:
>
> "Some APIs have structure and, in the case of C++, class data types.
> LabVIEW cannot use these data types. If you need to use a function
> that has a structure or class as an argument, you should write a CIN
> or shared library wrapper function that takes as inputs the data types
> that LabVIEW supports and that appropriately packages them before
> LabVIEW calls the desired function."
>
> I don't know if this has changed with LabVIEW 7. I am using LabVIEW
> 6.1 and I am trying to do the same thing with CINs but I keep getting
> linking errors.

You will have to explicitedly add the C++ link libraries to your
makefile or Visual
C project file. The default setup does only include
basic WinAPI import libraries and the msvcrt library in one of its
incarnations.

Rolf K
0 Kudos
Message 4 of 4
(3,027 Views)