11-23-2015 08:46 AM
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.
Solved! Go to Solution.
11-23-2015 09:15 AM
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
11-23-2015 09:19 AM
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
11-24-2015 09:48 AM
Hi Govind Sankar,
what did you select for the selection of file and / or folders in the configuration?
Best regards,
Melanie
11-24-2015 01:33 PM
@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
11-24-2015 02:24 PM
Bob already touched the most important points;
Let me iterate:
11-25-2015 02:28 AM
Hi altenbach,
Thank you for your reply. Regarding your question. The input of source 2 is some file and ouptut in target 2 is the same file. Mainly what I am trying to do is cut and paste a file from one folder to another. Hence cut a file from source 2 and pase in target 2. That is what I am trying to do. If you have some points to help me it will be extremely helpful. Thanking You.
11-25-2015 03:56 AM
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.
11-25-2015 04:41 AM
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
11-25-2015 04:57 AM
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.