LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 13 occurred at List Folder in temp.vi.

Solved!
Go to solution

The attachment contains a program to copy a file from 1 folder and paste it into another folder. But when I try to run the code it shows an error. 

Error 13 occurred at List Folder in temp.vi. 

Possible reason(s):

LabVIEW: File is not a resource file.

C:\Users\MadhavaG\Desktop\Govind\An automated Test Set-up for the dynamic Characterization of IGBT.pdf

Can someone help me as to why the error is occuring and how to overcome the error. Thanking You. 

0 Kudos
Message 1 of 13
(5,658 Views)

When you ran the VI, what did you do when the two File Dialogs opened?  Did you click on a File?  Did you click on a Folder?

 

Did you look at the Help for List Folder?  It says " path identifies the folder whose contents you want to determine. If this is not an existing folder, this function sets filenames and folder names to empty arrays and returns an error".   In particular, it returns Error 13.

 

So my "guess" is that you clicked on a File, not a Folder, and got the "expected and documented behavior".  I also notice that the Error terminals in your VI are completely unwired, meaning that you are completely "unprotected" from errors in your code.

 

Bob Schor 

Message 2 of 13
(5,647 Views)

Thank You Mr Schor. Yes I did click on a file and not a folder. So what should I do to select a file. Thank You.

 

Govind Sankar

0 Kudos
Message 3 of 13
(5,639 Views)

Hi Govind Sankar,

 

what did you select for the selection of file and / or folders in the configuration?

 

Best regards,

Melanie

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 4 of 13
(5,601 Views)

@vindsan wrote:

Thank You Mr Schor. Yes I did click on a file and not a folder. So what should I do to select a file. Thank You.

 

Govind Sankar


It depends what you want to do.  The function "List Folder" returns the files and folders of the folder whose path you specify, so you must specify a folder in the Path that you wire in.  The Path control you wired as an input, by default, can accept either Files or Folders, so if you click on a File, it will return a File, causing an Error.  

 

When you click the Browse button and see the list of files, do you see the Current Folder button at the bottom?  That will choose the Folder containing those files.  That's one way.

 

Another way is to change the Browse behavior so that it shows only folders.  To do this, right-click the Browse button, choose Browse Options, and select Folders.  I would also suggest (in this case) checking "Existing".

 

The third way is to change the Path that includes the File Name so that it only has the Folder Name.  The function Strip Path, found on the File Palette, will do this.

 

Any of these changes should make your code work without an Error 13.

 

I take it that you know almost no LabVIEW, correct?  Otherwise you would not put a Move function inside a While loop, where it will do its very best to move whatever is wired into the inputs over and over as fast as it can.

 

Please, before you do too much more and potentially start deleting all the files on your PC, spend a few hours and take the LabVIEW Tutorials that are listed in the upper right section of the Forum.  You can also search this Forum, or the Web, for more suggestions.

 

Bob Schor

 

 

0 Kudos
Message 5 of 13
(5,585 Views)

Bob already touched  the most important points;

 

Let me iterate:

  • The outer loop should only run exactly once for each combination of input paths, not over and over as fast as the computer allows. Delete that while loop or implement a proper state machine! (You also have "overwrite" set to false (default), so the program will fail on the second iteration of the while loop even if everything else is programmed correctly.)
  • Yes, the path inputs need to be folders, so change the browse option. You cannot "list folder" with a file.
  • You can wire the output of the search function directly to the case structure. Make one case -1 and one "default".
  • You also need to build the full destination path, including the file name. You cannot copy a file path to a folder path or vice versa. 
  • What are the full inputs for the source 2 and target 2 controls in your case?
0 Kudos
Message 6 of 13
(5,575 Views)

Hi

 

 

 

0 Kudos
Message 7 of 13
(5,542 Views)

There is a 'move file' VI in the Advanced File I/O palette. The strip path and build path VIs are also really useful for manipulating files/folders and helping you get to the right place.

 

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 8 of 13
(5,528 Views)

Thank You. But I am trying to move just 1 single file from the folder. Move function uses a path and moves all the files. I am trying to move just 1 file. Thank You

0 Kudos
Message 9 of 13
(5,514 Views)

Did you try reading the help for the Move Function?

 

"Moves the file or directory that you specify in source path to the location that you specify in target path."

 

If you give it a path to a file, it moves a file. If you give it a directory, it moves the directory and all files inside it.

 

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 10 of 13
(5,508 Views)