03-13-2014 03:42 PM
Hi,
I have a BMP text string I have obtained from a Yokogawa oscilloscope. I can write this file directly to a .BMP but the binary write appends 4 bytes to the beginning of the BMP string that makes it an invalid BMP format. Removing those 4 bytes with a text editor, saving, and reopening the file will make it valid which can be opened by any image viewer.
I have also tried the regular write text to file function but it makes the image jarbled, however, does not append the extra 4 bytes as binary write does.
And I have tried the recommendation from this post but the BMP file is also jarbled.
http://forums.ni.com/t5/LabVIEW/problems-creating-a-BMP-file/m-p/757714/highlight/true#M347071
Here is my VI:
Writing file with binary write, extra 4 bytes...
I don't see the 4 bytes here in the data string!
Solved! Go to Solution.
03-13-2014 03:45 PM - edited 03-13-2014 03:49 PM
What happens if you wire a FALSE to the "prepend array or string size" when writing the binary file? (defaults is TRUE!)
(If you use "write to text file" make sure that "convert EOL" is disabled (It is enabled by default).)
03-13-2014 04:09 PM
Thanks for the quick reply! That's what I get for not reading the help files. Here is my final block diagram:
03-14-2014 06:49 AM
@altenbach wrote:
What happens if you wire a FALSE to the "prepend array or string size" when writing the binary file? (defaults is TRUE!)
Can't tell you how many times I have been bit by that one.
03-14-2014 09:11 AM - edited 03-14-2014 09:12 AM
@crossrulz wrote:
@altenbach wrote:
What happens if you wire a FALSE to the "prepend array or string size" when writing the binary file? (defaults is TRUE!)
Can't tell you how many times I have been bit by that one.
You should think that banging your head against a wall once should be enough to learn!
The default is a quite useful feature if you write more complicated binary data files, which the write to binary data was meant to be used for originally.
10-27-2016 10:23 AM
please to attach VI file