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 to read 212 binary format


Hi,

I would like to get some ideas on how I can read a binary file which has 2 voltage signals in 212 format. Each sample is represented by a 12-bit two's complement amplitude. The first sample is obtained from the 12 least significant bits of the first byte pair (stored least significant byte first). The second sample is formed from the 4 remaining bits of the first byte pair (which are the 4 high bits of the 12-bit sample) and the next byte (which contains the remaining 8 bits of the second sample). The process is repeated for each successive pair of samples.

I am attaching my vi which shows some preliminary work. The .dat file has 212 format data to be read. The 2nd and 3rd columns of the text file show what the data should look like after read is completed.

Any help will be greatly appreciated.

Thanks,

Rahul

0 Kudos
Message 1 of 2
(4,593 Views)