LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My First Nugget - Directory Changed Event

That's correct, .NET is not currently supported on LV Real-Time and the best way to do it would be to write a LV VI that looks for changes in folder contents. This forum post has some pretty good info on how to do that:

 

 

 

http://lavag.org/topic/11154-folder-monitoring-for-file-changes/

 

Hope this helps!

Rob B
FlexRIO Product Manager
0 Kudos
Message 21 of 25
(853 Views)

I've seen similar code to this posted before, but one thing I was thinking about that would be useful, is if the user event being generated would return which file I/O type caused the callback to run.  By that I mean was there a file created?  Or was one deleted?  I would do this by creating a seperate callback VI for each I/O type with a constant as part of the User Parameter for each type.  Is there an easier way to know which I/O type occured in the event structure when the user event is generated?

0 Kudos
Message 22 of 25
(834 Views)

You could always use the "size" data from the "File/Directory Info" vi and determine if it increases in size or decreases, but I don't know of a built-in way to determine that information by file type.

Rob B
FlexRIO Product Manager
0 Kudos
Message 23 of 25
(804 Views)

@BauerPower wrote:

You could always use the "size" data from the "File/Directory Info" vi and determine if it increases in size or decreases, but I don't know of a built-in way to determine that information by file type.


I don't think this is the right way of doing things because if the file watcher is setup to be recursive you have a longer time scanning directories to get the file/directory list size.

0 Kudos
Message 24 of 25
(800 Views)

@Hooovahh wrote:

I've seen similar code to this posted before, but one thing I was thinking about that would be useful, is if the user event being generated would return which file I/O type caused the callback to run.  By that I mean was there a file created?  Or was one deleted?  I would do this by creating a seperate callback VI for each I/O type with a constant as part of the User Parameter for each type.  Is there an easier way to know which I/O type occured in the event structure when the user event is generated?


Today a found a community example to this question: Event based File and Folder Watcher

This solution extracts the information out of 'Event data' of the callback VI.

 

UliB

Message 25 of 25
(721 Views)