Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Writing to Binary Files

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

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

  1. Place the Write to Binary File function on the block diagram.



  2. Wire the data you want to write to the binary file.
    1. Place a numeric constant on 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 (use dialog) 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 Write Binary File VI in the labview\examples\file\smplfile.llb for an example of how the Write Binary function writes an array of double-precision, floating-point values to a binary file.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit