LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

List Directory function not listing files correctly

I am using LV 7.1 on Windows XP pro, and lately I have been having problems with "List Directory" function. Some files are not listed, when I know for sure they physically sit in the specified (searched) folder. There is no error reported by the function itself. It seems to me that the problem started occurring at about the same time with Windows SP3 update.

 

Has anyone experienced the same problem? Any help or information on how to fix this would be highly appreciated.

0 Kudos
Message 1 of 9
(5,818 Views)

I have not seen this problem, but are you doing anything unusual like supplying filter pattern? What kind of files are not showing up in the list? Does there seem to be any correlation between how old a file is and whether or not it shows up in the list? Is the directory that you are searching on your hard disk, or is it a network drive? How is it that you are sure the files are there? Does a missing file stay missing or does it later appear if you rerun the listing?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 9
(5,810 Views)

Dirk,

 

Any chance you could post your vi or an image of it?  If you don't know how to do it, ask Hiram Yaeger 🙂 [Inside joke]

 

-Matt

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 3 of 9
(5,800 Views)

Hello Mike,

 

Thanks for your response.

Here are the answers to your questions:

 

The only filter applied to the LD function is the Datalog Type (cluster of U32 and U16 numerical values). These files are updated from a data acquisition application (runs continuously) and they are always "fresh", although they may have a long history (eg. several months) of data. These files are static on a local HD, never moved or deleted, .. so simple look into the folder using Win Explorer tells me they ARE physically there. The problem is sporadic, meaning sometimes files appear, sometimes not.

 

The only thing that comes to my mind is that at the time the LD function is executed, some files may be taken (opened) by the data acquisition for writing data, but in that case you would expect an error from the function, and there is none whatsoever. 

 

Also, this is not an isolated problem. We have about 40 systems distributed to our customers and there are quite a few of them experiencing this problem lately.

0 Kudos
Message 4 of 9
(5,790 Views)

I think you may be onto something with the file being busy idea. However, I'm not surprised that there is no error being generated. The list directory function is a group operation, so I wouldn't expect problem reading a particular file to generate an error. In any case, this is something you can test. Try doing a directory listing while opening a file and continuously writing to it.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 5 of 9
(5,782 Views)

Hi Matt,

Here is a screen capture with LD function in question. I have also added some code (cased in) to log any discrepancy in between actual and listed files. This VI executes only in the middle of night, so I won't be able  to post any results before tomorrow. Stay tuned.

 

@ Mike: Although it may be a remote possibility, it still doesn't explain why it is happening only since lately. We've been running this for years. And, yes I've done the test with two VI's running in parallel, one opening and closing the file, the other listing directory, both of them looping at the speed of light. No issues there. 

 

0 Kudos
Message 6 of 9
(5,776 Views)

This is just a shot in the dark...

 

Under proprties >>> General for the drive being serached 

 

Try changing the setting of "Allow Indexing Service to index...."

 

I usually keep this shut off to keep Windows from robbing CPU cycles to wander about the disk but it may help you.

 

Done shotting in the dark,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 9
(5,750 Views)

OK, ... using the code I previously posted, here is the problem captured (see attached):

 

There are 10 files in the searched folder, and "Scale 008" is for some reson omitted by the LD function, with no error reported. If a collision between opening a file elsewhere and listing is the culprit, shouldn't there be an error reported, like Open File function does?

 

@ Ben: Thanks for your help, but I've already tried this, with no results.

0 Kudos
Message 8 of 9
(5,733 Views)

I have read about files not showing up soon after they are crated but not showing up hours afterwards..... Smiley Mad

 

That just does not make sense.

 

I have an IT buddy that is always grumbling "SP3 grrr... SP3...) but I never took him too seriously.

 

Is backing out of SP3 on just one machine to test your suspicions?

 

I can't think of anything else that could help and if you try backing down and you still see the issue then at least we will not be distracted by the Q "I wonder if it is due to SP3?"

 

Please share the answer if you find it!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 9 of 9
(5,726 Views)