LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reverse an order of an 8 bit value

Solved!
Go to solution

Hi Altenbech,

Can u explain how to create the LUT..

0 Kudos
Message 11 of 14
(1,426 Views)

What you can do is create a For Loop that runs N=256 times.  Use the "i" terminal through the code that JB posted.  Create an array indicator out of an autoindexing tunnel.  Now you have an array of reversed bits from i=0 to 255.

 

Now change that indicator to a constant and copy and paste it into your real code.

0 Kudos
Message 12 of 14
(1,415 Views)

Just make a simple FOR loop as follows (or use Yamaeda's code ;)), run the VI so the indicator contains data, and right-click the indicator to create a constant of it.

 

Use constant where needed. 😄

 

 

 

(Note that in newer LabVIEW versions you can use the output configuration of "boolean array to number" as U8, eliminating the "to U8" at the end.) 

Message Edited by altenbach on 03-24-2010 08:55 PM
Message 13 of 14
(1,413 Views)

Thanks for the LUT tip.

 

For those looking to reverse all bits (regardless of byte size):

ReverseBitsVim.png

Reverse Bits.vim (attached) accepts any numeric type:

ReverseBitsExample.png

 

0 Kudos
Message 14 of 14
(387 Views)