取消
显示结果 
搜索替代 
您的意思是: 

Compare binary file

已解决!
转到解答

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 项奖励
1 条消息(共 4 条)
4,306 次查看
解答
已被主题作者 TanTan 接受

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

0 项奖励
2 条消息(共 4 条)
4,301 次查看

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

0 项奖励
3 条消息(共 4 条)
4,276 次查看

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 项奖励
4 条消息(共 4 条)
4,245 次查看