Example Code

Synchronize Directories in LabVIEW

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 example VI demonstrates how to synchronize two folders in LabVIEW. 


Description
In LabVIEW you are able to perform multiple operations on system folders, like checking the size and presence of files inside of a directory. In this example, after you click Search, a subVI checks for files that exist in the Master folder that are missing in the Slave folder and compares file sizes of existing files with matching names. It finally returns a list of all files that need to be synchronized and allow you to choose which ones you want to synchronize on the front panel of the top level VI. After you choose the appropriate files and click Synchronize, another subVI uses the Copy function from the Advanced File Functions palette to copy files from the Master folder to the Slave folder.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached compressed folder to your computer
  2. Open the VI "Synchronize Directories LV2012 NI Verified.vi"
  3. Run the program
  4. Select the path to the folders and which one to synchronize
  5. Press Search and select the files to synchronize, then press Synchronize
  6. Click on the STOP button

 

Additional Information or References

VI Block Diagram

 

Sync Directories LV2012 NI Verified.png

 

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

 

greetings from the Netherlands

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

Comments
BetaCommunityCo
Member
Member
on

thanks for the feedback Albert

A couple of my weaknesses are neatness and documentation. I am working to correct those bad habits but sometimes time contraints make it tough.