Reading from Binary Files
- Updated2026-05-01
- 2 minute(s) read
Read numeric data from a binary file in LabVIEW by using the Read from Binary File function and specifying the matching data type of the binary data to read.
To read numeric data from a binary file, complete the following steps.
- Write to a binary file to create the .bin file you need to complete the following steps.
- Add the Read from Binary File function to the block diagram.
-
Wire the data type of the logged data to the Read from Binary File
function.
- Add a numeric constant to the block diagram.
- Wire the numeric constant to the data type input of the Read from Binary File function.
- To tell LabVIEW the data type that you want to read, enter a value into the numeric constant.
The value you input determines which data type LabVIEW interprets. For example:
- By default, LabVIEW interprets 0.0 as a double-precision, floating-point number.
- By default, LabVIEW interprets 0 as a long signed integer.
You can also right-click the constant and select a Representation option to define the data type.
You can also wire an array to the Read from Binary File function.
- Right-click the data output of the Read from Binary File function and select .
- Run the VI.
-
In the dialog box that appears, select a binary file with a value that corresponds to
the data type you specified.
Presenting a dialog box to choose a file is the default behavior of Read from Binary File if the file input is unwired.
Reading Binary Files Examples
For information about reading binary data and placing it into a pre-allocated array without incurring a copy, refer to the Preallocated Read from Binary File function.
For an example of how to open and read an existing file stored as a double-precision array in binary form, refer to the Simple Binary File project in the labview\examples\File IO\Binary\Simple Binary folder.