Jump to content

Folder Monitoring for File Changes


Recommended Posts

I searched around the forums/online and I can't seem to find anyone who's used LabVIEW to monitor folders for changes in files/folders. I'm collecting data on a network drive in my building and then hoping to have my data post processor monitor that folder for generated data, when data is generated I then want the post processor to automatically process the data but not touch any old data.

Any thoughts?

Link to comment

I searched around the forums/online and I can't seem to find anyone who's used LabVIEW to monitor folders for changes in files/folders. I'm collecting data on a network drive in my building and then hoping to have my data post processor monitor that folder for generated data, when data is generated I then want the post processor to automatically process the data but not touch any old data.

Sounds like a very good application for LabVIEW.

Here's a simple example of implementing this.

post-3370-125449930275_thumb.png

Link to comment

I should have make it more clear but the XControl I linked to uses the windows messages for this.

Well. Yes and no. It uses .NET so its a bit like saying a vi creates Word documents when, in fact, it is an automation interface to Microsoft Word and Word creates the document. No word, no document. No .NET, no messages.

Link to comment
  • 4 years later...
Be even better if we could catch windows messages in the event structure!

 

I know that someone posted an xcontrol with this functionality.

ton

 

The disadvantage of using the .NET solution is that it can't be implemented on a real-time target.  If I want my RT controller to FTP a log file to me whenever a new one is created then I'll have to use something like Christian_L's example above (which looks pretty good to me).

Link to comment
Sounds like a very good application for LabVIEW.

Here's a simple example of implementing this.

attachicon.giffoldermonitor.PNG

 

BTW - the problem with doing the array checking for this operation is that it can become a pretty big performance hit to poll the folder and list all files and search for all changes, especially if the number of files grows large.  Plus, you may need other features (like file removed or file updated) and you end up with more and more trouble when you try to recreate that functionality.  I think the .NET solution is the best long run solution for this problem (as long as you're on a Windows platform).

Link to comment
BTW - the problem with doing the array checking for this operation is that it can become a pretty big performance hit to poll the folder and list all files and search for all changes

If you are on a non windows OS, you could use the "get file/directory info" VI and just monitor the last mod timestamp. Then only call the directory listing once at startup to get the initial list, and any time the last mod timestamp changes. This reduces the number of times it needs to do the list/compare.

Edited by GregFreeman
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.