07-21-2011 04:22 PM
@SteveChandler wrote:
In that case it is very simple. There is a vi called list folder in the advanced file functions. It returns an array of filenames. Just run that periodically.
And I meant this example, but for LV 2009. Thanks!
07-21-2011 04:25 PM
Okay. It wasn't clear which example you were talking about. That is correct. Since it is a 2010 snippet, it won't load in 2009 directly as far as I know.
Fortunately, that example is so simple, it would be quicker for you to draw it from scratch than it would be to ask for it.
07-21-2011 04:38 PM
I tried - but I have difficulties finding the "filenames" array. What is the exact function name for it?
07-21-2011 04:51 PM
@Ravens Fan wrote:
Okay. It wasn't clear which example you were talking about. That is correct. Since it is a 2010 snippet, it won't load in 2009 directly as far as I know.
Fortunately, that example is so simple, it would be quicker for you to draw it from scratch than it would be to ask for it.
Actually I re-created it in LV2009, however it does not seem to work. I attached it below.
07-21-2011 04:54 PM
It is called List Folder. You can find it under FileIO/Advanced File Fuctions. i am not sure why it is considered an advanced function.
07-21-2011 04:56 PM
@wprice wrote:
Actually I re-created it in LV2009, however it does not seem to work. I attached it below.
Your VI works okay for me.
07-21-2011 04:57 PM
Are you having trouble selecting the directory you want to list? Right click on the path control and select browse options and change the selection mode to folders.
07-21-2011 05:02 PM
@SteveChandler wrote:
Are you having trouble selecting the directory you want to list? Right click on the path control and select browse options and change the selection mode to folders.
That would be it. It also explains why it worked for me. I just typed in c:\ into the path control and it worked. I didn't browse to anything.
07-22-2011 09:19 AM
@SteveChandler wrote:
Are you having trouble selecting the directory you want to list? Right click on the path control and select browse options and change the selection mode to folders.
Yes - got it now, thanks!
07-22-2011 11:20 AM
That's good if you have your solution, but I wanted to give another method for monitoring file activity. I used the File/Directory Info function to get the last modified date. The other two VIs are simple FGVs that read and write the date modified. It's a simple comparison from there. The VI will detect if new data has been written to the file. You can do something similar for the entire folder (awaiting a new file) by using the List Folder function to acquire the files and then monitor for the newest in a similar fashion as the attached.