Writing to Binary Files

Complete the following steps to write a double-precision, floating-point number to a binary file.

  1. Add the Write to Binary File function to the block diagram.

     Add  Find

  2. Wire the data you want to write to the binary file.
    1. Add a numeric constant to the block diagram.

       Add  Find
    2. Wire the numeric constant to the data input of the Write to Binary File function.
    3. Enter 1.23 into the numeric constant. LabVIEW changes the representation of the numeric constant to a double-precision, floating-point number.
    You also can wire an array to the binary file.
  3. Run the VI.
  4. In the dialog box that appears, create a name for the file, such as number.bin. LabVIEW creates the file in the directory specified by the file input and stores the double-precision, floating-point number in the file.

After you write to a binary file, you can read the binary file.

Refer to the Simple Binary File project in the labview\examples\File IO\Binary\Simple Binary directory for an example of how the Write to Binary File function writes an array of double-precision, floating-point values to a binary file.

 Open example  Find related examples