Cannot Copy a Binary File Using LabVIEW File I/O

Updated Apr 3, 2018

Reported In

Software

  • LabVIEW

Other

  • SQL Lite Database

Issue Details

I am copying a database file (.db) using the LabVIEW binary file functions (Read from Binary File.vi and Write to Binary File.vi). I am comparing the files by reading the binary data from both files and comparing them in LabVIEW as well. However, when I try to load my copied file, it doesn't contain any of the tables from my original file. 

Solution

Ensure that you are reading and writing the whole file data. It is possible that you are reading/writing/comparing just one data element from the files. To check this, open the .db files in a text-editor and visually compare to see if all data from your original file is in the copy. To ensure you are copying the entire file, set the Count input of the Read from Binary File.vi to encompass all of your original database file. Use the Get File Size.vi to pass the file size divided by type size (8 for a byte) into this Count input for most accurate results. 
 

This is best displayed in the LabVIEW example Simple Binary File.lvproj from the LabVIEW Example Finder (Help>>Find Examples, search Binary). 

WAS THIS ARTICLE HELPFUL?

Not Helpful