LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending 8-bit unsigned integer in LabVIEW

Solved!
Go to solution

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:

 

Untitled.png

 

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 ?:

 

Untitled.png

 

The VI is uploadet. 

 

 

Best regards

Oesen
0 Kudos
Message 1 of 3
(3,723 Views)
Solution
Accepted by topic author Oesen

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:

 

11-01-2014 17-39-54 dot.png

 

Andrey.

 

Message 2 of 3
(3,711 Views)

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.).

U8 Image to String.png

Message 3 of 3
(3,686 Views)