09-30-2008 05:58 AM
Hello, I have a litle problem: I have to create a decimal number from byte array. For exemple:
Array
01
12
24
34
34
32
Number -> 011224343432
Thanks
09-30-2008 06:06 AM
Hi maumontesi,
There is a convert from byte array to number function located in the Programming>>Numeric>>Conversion pallette. The function is called "Boolean Array to Number".
I hope this helps,
Thanks,
09-30-2008 06:24 AM - edited 09-30-2008 06:24 AM
If you have the "byte array" as strings you can just wire the array to concatenate strings and then use decimal string to number.
See screenshot.
09-30-2008 06:46 AM
Hi Andrew
Would you please put a picture(as done by dan) of the method suggested by you.
09-30-2008 07:35 AM
The question is a bit vague as we don't know what the data types involved are. In the example presented, if the "decimal number" is in an integer type it would have to be a 64 bit value as the example presented is beyond the range of a 32 bit value.
So the attached MIGHT be what the OP is looking for. I've set the properties (Format and precision) of the indicator and control to allow leading zeroes and the appropriate field length. But of course this example will only work if the array entries are numerically less than 100.
Or maybe the array elements are actually strings, and you want one long string. That's just the concatenate part of Dan's post.
Or are these the hex representation of 8-bit bytes, and the answer is also shown in hex?
Rod.
09-30-2008 07:57 AM - edited 09-30-2008 08:02 AM
Hi All,
Attached are the two solutions that I came up with. The first is simply converting a Boolean Array to a Numeric number as shown in example 1. The second example (example 2) takes boolean words and then converts them into numbers stored in an array.
Thanks,
03-04-2010 08:12 AM - edited 03-04-2010 08:14 AM
>>There is a convert from byte array to number function located in the Programming>>Numeric>>Conversion pallette. The function is called "Boolean Array to Number".
Hi,
Where exactly is that? And is it available on version 8.6? Because the only thing I can find is "Byte array to string" function on that pallette.
03-04-2010 08:18 AM
They re-aranged the furniture since this thread was live.
Look on the Boolean palette.
Ben
03-04-2010 08:22 AM
03-04-2010 08:24 AM
See your other thread.
Ben