07-10-2009 03:40 AM
Hi,
Can anyone tell me the fastest way to convert a boolean array to an array of numbers repressenting 8bit words?
Examples:
1D Boolean array: 11001001 11111111 10110010
1D U8 Output: 201 255 178
As you can see the MSB is read first. I will be doing this several thousand times. What is the most efficient way of doing this? My implementation is not fast enough.
Any help or links would be greatly appreciated.
John
Solved! Go to Solution.
07-10-2009 04:26 AM
Please find attached a suggestion.
Are your chunks of bits always the same size?
07-10-2009 05:15 AM
"Are your chunks of bits always the same size?"
The array is actually taken from a .bin file created by dumping data from the NI6541 HSDIO card in U8 format so it'll always be a multiple of 8 I can set.
Thanks for the suggestion but could you save it in a lower version for me, preferably the lowest you can? I apologise for not stating it but I am working with Labview 7.1 at the moment. However I can access 8.5 and 8.0 to convert back if needs be, but not 8.6.
Thanks again.
07-10-2009 06:35 AM
07-10-2009 09:33 AM
I'm a little confused as to how you can say it works because it does not give the same output as your VI. If you plug in the constant that you have on your block diagram in Jorn's code you will see that the output of Jorn's VI is incorrect. The reason is that the Reshape Array is not being done correctly. See attached picture for correction.