Example Code

Ex- Detect File Change Example

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This code detects whether or a file has been modified since the last execution of this code using the MD5 Checksum File.vi. 


Description
This piece of code requires only an input file path. When used as a sub vi it has a default 50 milliseconds wait function, and provides error in and out terminals, as well as a boolean output indicating whether or the file being checked has been changed. It also provides and output terminal for the file path to be the next piece of code in the upper-level application in which it is being implemented. The code maintains its functionality regardless of whether the file being checked is open or closed, requiring only that the file be saved to indicate that it has been changed.

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. choose the File path
  2. set the Milliseconds to wait
  3. Run VI

Additional Information or References
VI Block Diagram

 Block Diagram.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Best Regards,

Thomas B.
National Instruments
Applications Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.