From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-15-2014 08:12 PM
That's actually not a bad idea, although I don't know if you can subtract 2 time stamps. What I need right now, is a way to go through the files again after it has finished reading the files the first time.
05-15-2014 08:19 PM
@Nando88 wrote:
That's actually not a bad idea, although I don't know if you can subtract 2 time stamps. What I need right now, is a way to go through the files again after it has finished reading the files the first time.
You get a double representing fractional seconds. 🙂
05-15-2014 08:34 PM
How can I make the read files in a directory loop for the files again after it has finished reading all the files in the directory?
How can I make the 2 time stamps match, so that the condition is met?
Thanks in advance!
05-15-2014 08:42 PM
If you get an array of the last mod timestamps, you can use Sort 1D array to find the newest file. Save that timestamp in a shift register. If the newest timestamp from the current array is greater than the save timestamp, then you have a new file. I think this might meet your needs better than trying to compare to the current time. It could also be easily modified to identify multiple files which have been created since the previous check. The equality with current time cannot do that.
Lynn
08-28-2015 02:27 PM
I'm trying to do something similar, but am using LV 2011, and I can't open these VIs. Unless there's a tool incompatible with 2011, could someone send me the equivalent VI in 2011?
08-28-2015 03:53 PM - edited 08-28-2015 03:55 PM
Personally, I would not loop though the entire file directory again once it's completed.
Have a look at the FileSystemWater Class in .NET. It will let the program know a file was added or removed in a specific directory. I've never used it before, but it should eliminate unecesarry iterations. The only reason I knew about this was I was browsing through the forms and seen a request to know when something in a directiory changed.
https://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher(v=vs.110).aspx