LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Splitting a 32 bit integer into two unsigned 8 bit integers

This is my first project and post so please be gentle.
 
I have a Build Array that currently has seven unsigned 8 bit integer inputs. 
 
A lot code currently is input to Array Size as a 1D Array String and comes out as a 32 bit integer.  I would like to split this somehow into two separate 8 bit integers to feed into the Build Array, which will consist of the first and second part of the data.  The Build Array will then have eight unsigned 8 bit integer inputs instead of seven due to the output of the Array Size being split into two parts.
 
Any ideas?  Thanks.
0 Kudos
Message 1 of 3
(6,064 Views)
First you will have to coerce the I32 into an I16 because an I32 would consist of 4 bytes.  This will effectively limit your range from -2147483648 to +2147483647, to -32768 to +32767.  But that probably won't be a problem.  Look on Numeric palette, Conversion for that function.
 
Then look on Numeric palette, Data Manipulation for the split number function to take the I16 into 2 I8's.  then you can coerce to 2 U8's.
 
You can probably do this more simply as coerce I32 to U16, then split to 2 U8's.  But I'll leave that for you to experiment with.
0 Kudos
Message 2 of 3
(6,053 Views)
Worked perfectly!
 
Thanks
0 Kudos
Message 3 of 3
(6,015 Views)