Writing to Binary Files

LabVIEW 2018 Help


Edition Date: March 2018
Part Number: 371361R-01
View Product Info

DOWNLOAD (Windows Only)


LabVIEW 2016 Help
LabVIEW 2017 Help
LabVIEW 2018 Help
LabVIEW 2019 Help
LabVIEW 2020 Help

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.

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


    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.

WAS THIS ARTICLE HELPFUL?

Not Helpful