LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

binary file read with bit offset..not byte offset.

hi,

 

           i want to read a binary file with some offset ..not in bytes...  offset in bits..my data is a single bit data stream size of 1GB ,after skipping particular bit offset i want to read the data in byte order..

------------------------------------------------------------------------------------------------------------------
Indrajit

| indrajitbarve@gmail.com | indar_indar2005@yahoo.co.in .
0 Kudos
Message 1 of 5
(3,931 Views)

Hi Indrajit,

 

file are read byte-wise! You simply have to calculate the needed offset (#bits/8) and skip the first bytes (and upto 7 bits)...

Best regards,
GerdW


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

hi , Gerd W 

 

 

 

                   i am not able to follow your answer.... here with i attached a file to describe my query more clearly.   Actually two channels of  1 bit data stream stored in two different files ,and the file size will be more than 10 GB. 

 

 i want to delay the channel B by 3 bits and i want to perform bitwise operation between channel A and shifted version of channel B..till the end of the data..

 

now i am doing this without applying any delay by choosing a small block by block which corresponds to 1 sec of data .

------------------------------------------------------------------------------------------------------------------
Indrajit

| indrajitbarve@gmail.com | indar_indar2005@yahoo.co.in .
Download All
0 Kudos
Message 3 of 5
(3,914 Views)

sorry 

 

here is the file..

------------------------------------------------------------------------------------------------------------------
Indrajit

| indrajitbarve@gmail.com | indar_indar2005@yahoo.co.in .
0 Kudos
Message 4 of 5
(3,909 Views)

Hi Indrajit,

 

right now you deal with bytes instead of bits... Don't know what you're doing with those typecasts, but probably you want to use a simple "string to U8 array" conversion there. Also your Sum algorithm may be ill because of not correct datatype, depending on block size and data content...

 

To work with bits you have to

- convert those file contents to real bit arrays

or

-(when trying to stick with byte arrays) use some shift operations to delay by 3 bits...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(3,907 Views)