DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

FileNameGet error

Hi,

 

I am having a folder with about 300.000 rather small TDM-files in it. I am doing a series evaluation on them. For evaluating all files I use the DirListGet command, which works fine, but when I just want to include a selection of files, I switched to the FileNameGet command. This one works well for a small selection, but unfortunately the command seems to have problems with a larger selection than just a few hundred files. The error I receive is the following:

 

Cannot find "C:\PROGRAM FILES (X86)\NATIONAL INSTRUMENTS\DIADEM 2012\..."

 

So, obviously, if the selection exceeds a certain limit, Diadem tries to search for the files in its root directory. Does anyone have an explanation on that behaviour?

 

rgds,

Phex

0 Kudos
Message 1 of 8
(4,959 Views)

Hi Phex,

 


what about adding your specific folder to DataFinder's search areas and narrow down your files of interest by applying search conditions, like date/time information, sensor ids or other information available in your TDM files?

You can also add search areas programmatically:

 

Dim oMySettings
Set oMySettings = Navigator.ConnectDataFinder("My DataFinder").GetSettings()
Call oMySettings.SearchAreas.Add("NewSearchArea", "MyData", "D:\MyData")
0 Kudos
Message 2 of 8
(4,941 Views)

Thanks for the reply, Stefan. A search area is not really an option, as the search conditions vary too much.


I really would like to know why it is not working. For instance I found out that after a certain number of files, the filenames are not parsed into the file name area of the selection dialogue anymore. Has this file name field a restricted character limit?

 

Is the FileNameGet command creating a file list somewhere, comparable to the DirListGet command?

 

Phex

0 Kudos
Message 3 of 8
(4,937 Views)

Hi Phex,

 

we did some testing and can confirm the FileNameGet dialog does not work well selecting a few hundred files. It seems that the file dialog in general is not suited for this use case - you can observe a comparable behavior in other applications.

Nonetheless would a combination of PathDlgShow to select a specific folder in combination with DirListGet an alternative solution for you?

And in case it has to be interactive maybe by adding the file names into a SUD table...

MyFileSelection.png

0 Kudos
Message 4 of 8
(4,900 Views)

Hi Stefan,

 

thanks for your input. The idea of filling a list box with the files sounds great, but unfortunately for all 300.000 files it takes too long to fill up and scrolling in the box causes huge problems. To split up the files into smaller groups is also not possible, it would cause me much more hassle to manage the files afterwards while they need to be constantly updated.

Basically I am trying to find a procedure, that is able to write a file selection to a LST-file, that I can use for accessing my selected files. While Windows explorer can handle such a selection, I thought there would be some similar functionality in DIAdem.

 

Could you think of some alternative?

0 Kudos
Message 5 of 8
(4,894 Views)

maybe sth. like:

 

set fso = CreateObject("Scripting.FileSystemObject")

set myFolder = fso.GetFolder("path\to\folder")

 

for each tdm in myFolder.Files

  if tdm.Type = "Xy" then ...

'or

  if tdm.Name = "Xy" then ...

'or

 if .....

next

 

0 Kudos
Message 6 of 8
(4,890 Views)

It is not DIAdem cannot,, but Explorer can; the file selection box cannot (it will take forever to fill the file name edit field).

The fso approach is more or less similar to DirListGet, but may give you the advantage to use only those files, you are really interested in.

 

The question which would be of interest is: How do you select the relevant files out of the 300.000? Or are should your code work on all files in that directory?

0 Kudos
Message 7 of 8
(4,881 Views)

Right now, I either select the files by the date they have been modified or by their name, while the names start with a number in an increasing order. So I guess I probably go best with the FileSystemObject bamboocopter proposed and try to set up modifiable selection intervals.

 

When I run the script on all files, I already successfully applied the DirListGet command.

 

Thanks for the advice so far.

0 Kudos
Message 8 of 8
(4,873 Views)