From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can i find the 8th bit of a 13-bit-hex digit

Solved!
Go to solution

basically i have a 13-bit-hex digit, now i want to find the 8th bit of the digit and output. how can i achieve it. I have definitley tried but none of them worked. 

 

thank you very much

0 Kudos
Message 1 of 12
(2,926 Views)

I am not sure what you mean by a "13-bit-hex digit" but the boolean functions work on integers.  Create a constant with only the 8th bit equal to 1 and all others 0. Then AND it with your data word.  The result will be zero if the 8th bit is zero and >0 otherwise.

 

Lynn

0 Kudos
Message 2 of 12
(2,922 Views)

thank you very much indeed. I use RFID reader to detect the tag. the ID of the tag is a 13-bit-hexdecimal digit. say, 29A030AC1DA1A, how can i take out the 8th bit of this data? i can understand your AND logic. but that only give me 0 or non-0. i need an exact number which is C in this case.

 

thank u again.

0 Kudos
Message 3 of 12
(2,919 Views)
Solution
Accepted by topic author zhoudeng

It appears that you want the 8th digit, not the 8th bit.  Make your mask 0000000F00000.  That should select the digit you want. You may need to do some additional manipulation to get just C and not 0000000C00000.

 

Lynn

0 Kudos
Message 4 of 12
(2,914 Views)
Thanks Lynn
0 Kudos
Message 5 of 12
(2,910 Views)

Hello,

The attached VI might help you to resolve your proble.

A simple number to array conversion is used.

Just Check it

 

Prabhakant

Regards
Prabhakant Patil
0 Kudos
Message 6 of 12
(2,897 Views)

@Prabhakant Patil wrote:

Hello,

The attached VI might help you to resolve your proble.

A simple number to array conversion is used.

Just Check it

 

Prabhakant


As already stated, the user is looking for the 8th digit, and not the 8th bit.

 

Also, using a Number to Boolean Array and then an Index Array is unnecessary. Why create an array when you don't need to? The most straightforward way of doing this is as Lynn indicated: use a single AND function, followed optionally by an Equal to Zero if you need a Boolean output.

Message 7 of 12
(2,878 Views)

I think using the words "Character" or "Hexit" would have avoided some of the confusion.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 12
(2,872 Views)

thank you very much for the VI.

 

the data i am dealing with is a  13-bit long data. this program can only deal with 4-bit long hexadecimal maximum. thank you anyway.

0 Kudos
Message 9 of 12
(2,833 Views)

yes. right. thanks. me coming from China. not good at manipulating English yet..

 

thank you very much indeed for the correction.

0 Kudos
Message 10 of 12
(2,832 Views)