01-20-2016 01:45 PM
Hi,
I have an array (u8). Let's the array is as below. Array size is always even
214
115
234
117
111
123
I would like to combine every even index value with the next odd index value and make 16bit array . odds are high bits and evens are low bits. Could you please let me how can I do it in LabVIEW?
115-214 or binary 0111001111010110
117-234
123-111
01-20-2016 01:50 PM - edited 01-20-2016 01:53 PM
01-20-2016 01:52 PM - edited 01-20-2016 01:53 PM
Decimate 1D Array followed by Join Numbers
You can also just use Type Cast to a U16. At least on my system, you will have to use Swap Bytes after it to get the order you want.
04-24-2024 05:50 AM
Hi Team,
I have recently faced issue related to typecasting from U8 to U16 and it works fine for even numbers but for the odd numbers the typecast function ignores the last U8 byte, Is it a bug?
I have used other ways to achieve the solution but typecast should consider the last odd byte as well.
04-25-2024 04:13 AM - edited 04-25-2024 04:13 AM
@PalanivelThiruvenkadam wrote:
Hi Team,
I have recently faced issue related to typecasting from U8 to U16 and it works fine for even numbers but for the odd numbers the typecast function ignores the last U8 byte, Is it a bug?
I have used other ways to achieve the solution but typecast should consider the last odd byte as well.
Type cast works for me, but Decimate requires an even number.
04-25-2024 04:42 AM - edited 04-25-2024 04:45 AM
Hi Yamaeda,
@Yamaeda wrote:Type cast works for me, but Decimate requires an even number.
Only when you typecast into a scalar U16: what happens when typecasting to an array of U16?
Like this:
04-25-2024 05:52 AM
The problem is when you wanted to typecast to array of U16 from array of U8 it ignores the last odd byte which means it executes as same as decimate array function
04-25-2024 06:11 AM