LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extracting a particular bit from bytes

Hi
 
Is there any inbulit VI that extracts a particular bit from  bytes ???
 i have acquired data using pattern generation method in which the port is read as a whole(i.e. 8 bits data at a time) , but i need data  from a particular bit only and then i want that data to be again converted into byte format...
can anyone help....
 
thanx and regards
 
vivek modgil  
0 Kudos
Message 1 of 5
(4,408 Views)
This could be one of many ways to index specific bit from a byte data
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
Message 2 of 5
(4,399 Views)

You could convert your byte to an array of boolean, extract the desired bit using logical AND and convert the array of boolean back to a number.

Regards

Jörn

 

0 Kudos
Message 3 of 5
(4,403 Views)
Why convert to boolean array ? You can do an and operation directly on the U8.
 
Message 4 of 5
(4,384 Views)
I'm with Sture on this one.

a simple "AND" will do nicely.  Just add a ">0" after the AND and you have your Boolean.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 5 of 5
(4,377 Views)