01-11-2014 10:25 AM
Hi
I'm sending a bytestream of pixel values in from LabVIEW to a C-program through TCP connection. I just wondered whether this code really sends uint8 data or not, because when I'm reading the data with a console application in C, 3/4 values are zero, as shown in the picture below:
and then, when I switch the boolean expression to send a 32-bit unsigned integer values, only 1/4 values are zero values instead. Does this block really send uint8 values ?:
The VI is uploadet.
Solved! Go to Solution.
01-11-2014 10:42 AM
Actually you sending always 32 bit, because your 8 bit data casted to this type (see red dots).
You should perform conversion to string inside of case structure, something like this:
Andrey.
01-11-2014 01:52 PM
Are you trying to transform a 2D U8 array to a character string so that you can transmit it using TCP/IP? I wrote a little test routine (see Snippet) that makes a 5 by 5 U8 array, flattens it to a string, then displays both the string and the U8 representation of the string (using String to U8). Note that I told the Flatten to String routine to not prepend the array size -- if I do add the size, I get 0, 0, 0, 5, 0, 0, 0, 5 (that is, the array size, 5 by 5, saved as a U32). I also have not set the "Endian" input, leaving it at the default value, which gives me the data string in the "expected" order (0, 1, 2, 3, 4, 5, etc.).