LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compare binary file

Solved!
Go to solution

Hi,

 

I am using LV 8.5.1. Would like to know, is there any method can compare 2 binary files? Same function as command prompt below:

 

fc /b "file 1 path" "file 2 path"

 

First do not consider use the system exec.vi.

 

Appreciate your feedback.

 

Thanks.

0 Kudos
Message 1 of 4
(3,787 Views)
Solution
Accepted by topic author TanTan

What's wrong with using the fc function? The alternative is to read each file into LabVIEW and do an Equal comparison.

0 Kudos
Message 2 of 4
(3,782 Views)

Nothing wrong in fc function. But I think use the LV read file and comparison method will be better. 

0 Kudos
Message 3 of 4
(3,757 Views)

Doing it in LabVIEW is fraught with all sorts of issues that the fc command has probably already addressed.  But if you want to do it, I would recommend the following:

 

  1. Read your file in 65,000 byte chunks to optimize disk I/O.
  2. Compare each chunk.  Your compare operation is up to you.  Note that depending on how you want to compare, you may want to do this byte by byte or chunk by chunk to find the locations of differences, but also find locations which equal, even if they have different offsets (e.g. a difference is a single byte inserted into the file).
  3. Output your results.  The output is also up to you.  It could be a file, a front panel indicator, the operating system error buffer, etc.
All in all, this is a lot of work vs. just using the fc command.

 

0 Kudos
Message 4 of 4
(3,726 Views)