05-01-2014 10:25 AM
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!
05-01-2014 12:05 PM
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?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-02-2014 10:05 AM
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.
05-02-2014 10:07 AM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-21-2015 10:02 AM
@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