LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write Binary File and carriage returns

I anm using the Write Binary File VI to write some data. However, when I connect a string control to the data, nothing appears in the file until a carriage return is written, and then only the carriage return and everything after it is in the file.

For example if I send "Hello[CR]World" ([CR] is carriage return) to Write Binary File, only "[CR]World" shows up in the file.

What is going on here?


--

Brian Rose
0 Kudos
Message 1 of 6
(3,491 Views)
Can you provide the code? I can't replicate the behavior. Also, please indicate which LabVIEW version.
0 Kudos
Message 2 of 6
(3,485 Views)
Simple VI. Also attached is the output.
--

Brian Rose
0 Kudos
Message 3 of 6
(3,479 Views)
The VI in your zip file creates the following file:

\00\00\00\0BHello\0AWorld.  The output file you included in the zip has the Hello in it and matches the file the VI created.  How did you determine the file was not being built correctly?  If you open the file in your zip with notepad, you'll see that Hello is in there.
0 Kudos
Message 4 of 6
(3,467 Views)
Actually, it appears my text editor has the bug. I see the data in notepad.
--

Brian Rose
0 Kudos
Message 5 of 6
(3,462 Views)
Try wiring a False to the "prepend array or string size" input. Those extra few bytes at the beginning of the file, which are the array/string size, may be messing up your editor.
0 Kudos
Message 6 of 6
(3,456 Views)