06-24-2012 02:02 PM
Hello everybody,
I'm beginner in LabVIEW. I need to get bits from the file, but I don't know how I can do it. I use the example "Read Binary File VI" from LabVIEW Help, but it returns DBL array. And for a long time I can't find a solution to convert this array to array of bits. Can somebody help me? Thanks in advance.
Solved! Go to Solution.
06-24-2012 04:03 PM - edited 06-24-2012 04:04 PM
This is a very vague question. A file is nothing more than a long string of bits, so you could simply read it as a string and parse out the bits the way you want them. I don't know how you want them 🙂
One possibility would be to cast to an array of U8, then use "number to boolean array" in an autoindexing FOR loop, followed by reshaping to a 1D boolean array. You could also format the U8 as %08b and concatenate the strings. There is no "official" way to represent "bits" to the human observer. 😉
06-24-2012 04:51 PM
@tranonim wrote:
Hello everybody,
I'm beginner in LabVIEW. I need to get bits from the file, but I don't know how I can do it. I use the example "Read Binary File VI" from LabVIEW Help, but it returns DBL array. And for a long time I can't find a solution to convert this array to array of bits. Can somebody help me? Thanks in advance.
You can pass in the type into the Read Binary File VI to get the data in whatever form you want. Just remember that a boolean is really 8 bits.
06-30-2012 07:27 AM
Thanks guys! Special for altenbach. I've done what I wanted using your instructions!