From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C ++ DLL

Hello,

 

Can someone help me to convert the attached C++ .cpp file to a DLL that i can use with Labview?

 

Thanks in advance

\phlip

0 Kudos
Message 1 of 5
(2,277 Views)

Umm... what?

 

Are you asking how to write a C++ DLL?  This is a really bizarre request to make on a LabVIEW forum.

 

Be aware that LabVIEW handles only C DLLs, not C++ DLLs.

0 Kudos
Message 2 of 5
(2,264 Views)

Well, you need to wrap the C++ object into standard C functions and create a wrapper DLL from that code, in order to access this DLL. LabVIEW can NOT create std:: datatypes to pass to the DLL so what you need to do is create a the wrapper in C++, that exports standard C functions for the constructor and every object method. If you need support for the callback it gets even more complicated as you will have to convert the callback in your C wrapper into a LabVIEW user event.

 

This is anything but trivial work even for me and I guess I would work a day or three on this, before having everything so far, partly because I have no idea at all about std:: types so far. If there is a change to get the TCP/IP protocol specification of the device, I would certainly think that creating a VI library based on the TCP function nodes would be probably easier to implement than trying to wrap this DLL so it can be called with the Call Library Node. Another approach would be to turn this into an ActiveX object, as C++ to ActiveX should be fairly straigth forward, but I don't have any idea about how to go about this in detail.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 5
(2,262 Views)

Rolf,

 

I suspect that, given the nature of the question, everything you said probably went right over his head. Woooosh. Smiley Happy

0 Kudos
Message 4 of 5
(2,259 Views)

Tnx for the replies , i understand that it is not easy to convert.

 

0 Kudos
Message 5 of 5
(2,257 Views)