LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does the "Flatten to string" function actually work?

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

0 Kudos
Message 41 of 45
(760 Views)

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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 42 of 45
(749 Views)

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.

Message 43 of 45
(734 Views)

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 ?

Message 44 of 45
(691 Views)

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

 

0 Kudos
Message 45 of 45
(667 Views)