LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convret the bits from LSB

Solved!
Go to solution

Dear Sir,

 

Here I am receiving total 6 words of 32 bits Hex data from Logic Analyzer (from Keysight). Each word consists of different parameters and I have to separate the each parameter from LSB of each word.

 

For example the first word is 00D8 6720 = 00000000110110000110011100100000

From LSB, they are different parameters consists of 18 bits, 4 bits, 5bits, 1 bit, 1bit, 3 bits.

After that each parameter will be shown in Hex format like first 18-bits = 06720 and next 4-bits = 6, 5-bits = 03, 1-bit = 0, 1-bit = 0 and 3-bits 0.

 

I implemented this logic for one word using some of string functions buts it’s looking too lengthy.

 

Kindly let me know if there is any simple implementation to figure out like this.

 

 

Thanks & Regards,

S Nagaraju

0 Kudos
Message 1 of 4
(2,895 Views)
Solution
Accepted by topic author Sonti_11532

Hi S,

 

try this:

check.png

Mind the radix at all constants!

You might use boolean functions like AND and bitshifts too…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,878 Views)

Dear sir,

 

Thank you very much.

 

Can you please explain about array constant.

Because each word having different sizes and give some clarity of array constant values.

 

Regards,

S Nagaraju

0 Kudos
Message 3 of 4
(2,863 Views)
Solution
Accepted by topic author Sonti_11532

Hi S,

 

the array constant defines the parts you want to "strip" (aka get the remainder from the Modulo operation) from your input "word" - it's simple math using hexadecimal numbers.

 

You can also calculate that array from your bit field sizes dynamically or use those bitfield size numbers directly in the loop.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,854 Views)