04-24-2023 06:23 AM
ok, in that case, let me reword my question to make it labview relevant
how should a integer number value be transformed/ sent from external application so the lab view server accepts /reads the value after the tcp connection is established
THanks
04-24-2023 07:22 AM
As Big Endian formatted Integer. Only other thing I could imagine to go wrong is if you use anywhere string functions in the C code path. Those like to treat embedded NULL bytes as termination character, not processing any further bytes in the string. A good way to check what your application really puts on the wire compared to what you think it should do is to use WireShark.
04-24-2023 08:05 AM
Your C++ program does not work like WriteClient, because it never sends meta data. On the other hand, WriteClient.vi sends meta data before every actual data message. Since the meta data message has a different format than the data message, the server cannot decode it.
That protocol would be better if the meta data message were implemented with a reserved meta ID.
04-25-2023 04:58 AM
So should i send the data as explained below ?
1 - endianize the data and convert to String
2 - Endianize the 'Data Type' constant and convert to String
3 - Get the total size of the packet (size of 'Data Type' + size of 'Data')
4 - Endianize the Packet Size and convert to String
5 - Concatenate all Strings together to form a stream of the form <Data Size><Data Type><Data>
and before I send the data paket , should i send the Meta data packet ?
04-26-2023 08:25 AM
We were able to send 16 bit integer data from client to server
just sent the number in Hex and it was read by server
But same code does not work if we send a number greater than 65535 ( 16 bit)
or for -ve integer of any value
Any change is required on server side ?
THe client VI also does not work for value > 65535 or for-ve values