05-04-2007 06:40 PM
05-04-2007 06:48 PM - edited 05-04-2007 06:48 PM
Sounds very similar to a recent post. Here is one solution:

Message Edited by tbob on 05-04-2007 05:49 PM
05-04-2007 06:53 PM
05-04-2007 07:35 PM
@triniboy wrote:
I initially created binary strings from numerical numbers using the
"%03b" command on the 'Format into String' block. I then concatenated
the various strings into one string that is now composed of 16bits.
In general, you are out of luck, because the number of characters for each value when formatted to binary with "%03b", will be variable. Any number greater than 7 will use more than 3 digits. (since you use "03" instead of 3", smaller numbers will have three digits with possible leading zeroes for padding).
After you concatenated all the formatted strings, you loose all boundary information unless ALL numbers are less than 8, but in this case they result would be a multiple of 3 and would not add up to 16 bits, right?
My best suggestion would be to NOT create a binary formatted string in this way, because it is a one-way operation and cannot be undone because you loose information in the process.
Back to square one! 😮
Maybe we can backup a few steps and you can explain to us what you really want to do with your original numbers. Why would you even consider formatting them this way? Do you need to save them to a file for later retrieval, for example?