I have the labview TCP/IP client/server working fine, but now I need to do this were labview is the TCP/IP server and the c++ program is the client. Does anybody have a simple C++ TCP/IP client that works with labview TCP/IP server ????
I haven't done it with c++ but I once wrote a LabWindows/CVI client program that connected to either a LabVIEW or Visual Basic server and the CVI program didn't care which server was running. I just specified the port and host name. I would imagine that the c++ method is similar and if your development system has any TCP client examples, it should work with any TCP server.
Because TCP/IP is a protocol it doesn't matter if you write the client in C++ or the server in LabVIEW (or vice verse) because they speak "the same language". What you need in c++ is to create a TCP socket (a socket is the IP-adress and port together e.g. IP-address 192.168.0.1 port 34 is a TCP socket 192.168.0.1.34) and there a many examples of this available.
However you could run into problem when trying to intepret the transmitted data. For example, if you try to pass a U32 to the server, the U32 is transformed into four bytes. You have to beware of the endian use. I've runned into problems where the C++ uses a big endian and LabVIEW uses little endian (or was it vice verse? Don't remember!). In LabVIEW "flatten into string", "unflat ten from string" and "reverse string" VIs is very useful together with the usual TCP VIs. All you really have to do is to reverse the byte order for each numeric type before transmitting to the server.