From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-26-2012 12:49 AM
i am developing a vi in which i have to create a folder in any drive(e.g D:\dataacquisition) than in data acquisition folder, i have to create date folder and name folder and then we need to create some files e.g patient's information, and like this different files in the name folder, i have shown this in attached vi, now the problem is this that when i run the vi for the first time when no folder has been made it runs ok with no error, but when i again run the vi with different patient name it shows Error code 10 at create folder, i know this error is because the same folder is already present, but the problem is this that when an error comes the new patient's folder is not created, i have tried several things but not able to avoid or remove this error, is there any way to remove this error or if there is any other option of creating folder in LabVIEW.
I am attaching the vi.
Solved! Go to Solution.
08-26-2012 09:23 AM
There is two ways you can do.
You can create the folder along with a time stamp including seconds so that your folders will be new always otherwise before creating the folder check whether it is already created or not. If already created skip the create folder function else create it.
08-26-2012 09:25 AM
I'm not really sure what you're asking, since the code is working exactly as it should. That very first Create Folder function will return an error if the folder already exists. This is by design. You clearly need to check to see if that folder exists before you try to create it. You could use the File Dialog function, but that will present a dialog asking you to choose a starting folder.
08-26-2012 10:48 PM
Hi
Attached is a fix for your issue. you will have to use the 'check folder or file exists' before you create the folders.
08-27-2012 12:01 AM
Read some documents and KB or search this on NI website. Above link is related with Open/Create/Replace File Function and read operations(2.Create) functions.
08-27-2012 06:10 AM
Thanks to every one, your suggestions helped me in solving my problem, although my problem is solved but i am having some more question
To P Anand
There is two ways you can do.
You can create the folder along with a time stamp including seconds so that your folders will be new always otherwise before creating the folder check whether it is already created or not. If already created skip the create folder function else create it.
FreeLance V
Thanks your vi works well, but now i am having 1 more question
I have also found 1 more other than check if folder exists by which error 10 is avoided but in that case name should be different, now what i want is when suppose i enter the same name in the suppose i want folder with name 'a' to be created and that folder is already present than what i am trying is that labview should ask weather you want to replace existing folder,or you want to delete,or you want to keep both files, delete and replace is easy to implement but although i am trying but if anyone knows the way that how we can keep both the files than that would be great help.
i am attaching the vi which is not complete yet, i am trying to implement some more extra points like keeping both the same files or if i want to replace.
08-27-2012 06:42 AM
Hi
I had simplified your code a bit.
let us know if need further help
08-28-2012 11:15 PM
Hi
any update? did you solve your issue?
08-29-2012 01:33 AM
To FreelanceLV
Thankyou for your help
yes the error 10 issue is solved now, and your code has helped a lot in reducing the length and efficiency of my code,your code is working correctly, but it is creating new file in case of replace, i want to create new folder and this is not difficult, i am doing it but i am not getting what your code is doing in case of either replace or keep both, in keep both case what i want it is it should make a new folder with name a1(if already made folder is 'a'),i don't think so it's difficult, your code has already done all the things,i just have to add some extra code in that i am doing this and will soon post the code, and will seek your further suggestion.
i also need your suggestion on my original project code(this is one part of the code i am working upon), i am making some changes in that and will then post the code, can i post my code here on this post only or do i need to create new post for that.
08-29-2012 02:52 AM
Good to know that your issue is sovled for now.
You can mark the post which helped you as the solution.
If you have further queires, you can always post on the forums. We are here to help in learning LabVIEW and developing successful applications.
If you have a new query, I would suggest you open a new post. That will help you track your queries.
If you got a solution to this particular question on the error code 10, close this and mark the solution.