LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is there a way to convert each byte of input data seperately?

Solved!
Go to solution

I am reading data through a UDP port, each data packet has a 32 byte header. Is there any way to select a bundle of bytes to read, like you can do with a string of data using the 'String Subset' vi? For example, the 5th to the 8th byte contains the Exchange ID, is there any way to discard the rest of the data and only read this information?

0 Kudos
Message 1 of 6
(2,249 Views)

Hi TGL,

 

I would convert the string data to array of U8 values (bytes) using the "string to byte array" function. You can then index out the bytes you are interested in using the index array function.

 

Best regards,

 

Steve

Stephen C
Applications Engineer
0 Kudos
Message 2 of 6
(2,247 Views)

Thanks. Is there any way I can view a bundle of bytes on the same indicator eg can i specify a range of bytes to display rather than just one individual byte?

0 Kudos
Message 3 of 6
(2,244 Views)

Yes,

 

I would extract the sub array that you are interested in, then turn it back to a string for display.

 

There are other methods you could use too.

 

I have enclosed them in this VI

 

Regards,

 

Steve

Stephen C
Applications Engineer
0 Kudos
Message 4 of 6
(2,237 Views)
Solution
Accepted by topic author TGL

bytes.png

Stephen C
Applications Engineer
0 Kudos
Message 5 of 6
(2,236 Views)

Perfect, thanks alot!

0 Kudos
Message 6 of 6
(2,229 Views)