LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save a bit sequence to file?

Solved!
Go to solution
Highlighted

Hello Reader.

 

The demodulation's output is a bit sequence and I'd like to save it to file. When I connect the demodulation's output to the data port of "write to binary file" block, a bit is converted to a byte automatically and write to file (so file's size too large.)

 

Could you help me to write the bit sequence to binary file, please?

 

Thanks so much.

 

TanPhong.

0 Kudos
Message 1 of 7
(954 Views)
Highlighted

What is the datatype of your "bit sequence"? A boolean array maybe?

 

If this is the case, typecast it to a string using the 4.x mode of typecast before writing the string to a file. Reverse the operations for reading. (you might also need to account for padding)


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 2 of 7
(953 Views)
Highlighted

Thanks for your attention.

 

I've followed your advice but the data in file is similar with the old data (one bit to one byte)

0 Kudos
Message 3 of 7
(949 Views)
Highlighted

Did you right-click the typecast primitive and select 4.x mode (it will show big red lettering)?

 

There should be one bit per boolean element. If it does not, show us your code.


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 4 of 7
(942 Views)
Highlighted

I used Modulation example and add some functions to save outbit data after demodulation to file.

0 Kudos
Message 5 of 7
(935 Views)
Highlighted
Solution
Accepted by topic author phonglt03

OK, your data is a I8 array, where 4.x mode has no special meaning. What kind of data is in the I8 array? Is it just numbers 0 and 1? In this case, insert a "not equal 0" to convert it into a boolean array before type casting.

 

(Sorry, I don't have any of your toolkits)


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 6 of 7
(930 Views)
Highlighted

Thank you very much.

0 Kudos
Message 7 of 7
(922 Views)