LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

receving type 16 bit complex over udp from C++

I'm trying to interface with my C++ program which uses an array of std complex found here. I've setup my system to receive the data over UDP port.

 

The C++ software sends over an array of type complex looking like thi:

 

std::complex<int16_t> *host_items

 

Would it be easier to write a C++ dll to convert type complex to 16 ints? So far this has been my only solution. Does Labview have any other functionalities that makes my life easier?

 

Thanks.

 

0 Kudos
Message 1 of 4
(2,982 Views)
What data type do you want in LabVIEW? Also, the type complex<int16_t> is used to represent what exactly? How are these 16 bits interpreted? If you simply want to get an array of 16 bit integers then that is fairly easy to do in LabVIEW. A simple type cast will will convert the string returned from the UDP read to an array of 16 bit integers assuming that your data is binary data and not an ASCII representation.
Message Edited by Mark Yedinak on 04-13-2010 03:42 PM


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 4
(2,975 Views)

I want it in type single in LV.

 

complex<int16_t> contains and I and Q of type in 16 (2 numbers). I'm not too sure how it's held in binary format though.

 

I've already tried to do a direct typecast using LV, but I get some N/A in the array (which I'm assuming is an invalid number from a invalid typecast).

0 Kudos
Message 3 of 4
(2,965 Views)
std::complex<int16_t> refers, I believe, to a class template. As far as I know, there's no direct way to get this in LabVIEW. You have to remember that LabVIEW does not handle C++ - it only handles C. Thus, in many cases you have to write a wrapper DLL in order to interface to C++ DLLs. My guess is that you will need to do the same thing here.
0 Kudos
Message 4 of 4
(2,956 Views)