LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert I32 to U8

Solved!
Go to solution

Hi,

 

I have a problem during converting my array.

I've a 1D array of long 32-bit integers.

I would like to convert them to a 1d array of unsigned byte 8-bit integers.


I'm trying to use the u8 conversion block but the output I get is a 1D array as i accepted, but all my element values are changed into zero instead of keeping the original.

 

somebody can help me?

0 Kudos
Message 1 of 3
(2,807 Views)
Solution
Accepted by topic author koekie

Hi koekie,

 

1) You will get problems to convert I32 numbers greater than 255 (or smaller than 0) into U8 values, both get coerced into the possible U8 range!

2) You don't say what values you try to convert.

3) Do you actually want to typecast your array instead of converting? What kind of resulting data do you really need?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,805 Views)

Hi,

 

Indeed the numbers are just between 0 and 255..
I forgot it for a moment.

Scaled all the values between 0 and 255 and now it works well..

 

Tanks

0 Kudos
Message 3 of 3
(2,787 Views)