12-12-2005 08:01 AM
Hi Mah,
Glad to see that there was progress. I will review your questions in order to understand what you are trying to achieve.
"I got it to work, however it only made one new file, with a number 1 at the end." It (should) creates one new file every time the vi is run. Do you intend to create more than 1 file when running the vi (calling it)? You could use the vi as a sub-vi and call it more than once from the main vi. But if you describe how this should function, then I can provide more accurate suggestion(s).
"I keep getting an error dealing with the "Scan from String" function I think." I would have to see this portion of your code. Can you post it or at least that portion as a jpg attachment?
"Also it seems to not work if the file has already been created, it will not create or update the file for me." It should create a new file everytime it is called or run. Can you post this portion of your code (or the entire vi)?
"Also I can only seem to get this to work when using the directory, not selecting individual files." Yes, this is actually what it does. I didn't realize that you wanted the option to select a file at run-time. 😉
"Is it possible to "hard-wire" a path and file name to somewhere in the vi (able to change via the front panel)?" Absolutely. Can you describe the how & why you want to select a particular file? I thought that you wanted to look at a directory and create a new file having the same name but with the next number appended to it. Can you show me an example of actual file names?
"THen that would be the file to update and whatnot when saving?" So you want to select the file after it has been created... is that so? Do you actually want to select the new filename or should it be selected by default? Do you simply want to see the new filename in use? Or do you actually want to browse and select the new file manually?
Sorry to have so many questions, but I am trying to capture a better understanding of what you wish to achieve.
Ray
😄
12-12-2005 09:40 AM
12-12-2005 10:12 AM
12-12-2005 12:18 PM
Hi Mah,
I think I understand what you want to do. So basically hardwire the path instead of browsing for it. Since your co-workers like the feature, a switch can be added to choose from the two. I will try to modify the vi tonight and post it in this thread.
It is possible that the error that you get (error 85) is because you are scanning a path instead of a string. What is the color of the wire? I will do a search on error 85.
Ray
12-12-2005 12:36 PM
Hi Mah,
Here is what I found on Error 85:
To find the meaning of the error code meaning, you can right-click on a front-panel error cluster and select the "explain error" option to see all the known causes of the error. Use an error cluster on the Front Panel, set status to Error and code to 85, right click on it, and select "explain error".
"Error 85 occurred at an unidentified location
Possible reason(s):
LabVIEW: Scan failed."
It appears that you might be trying to use the "Scan From String" function with input data that does not match the format string, maybe feeding in a path, for instance... If that is the case, simply convert the path to string first.
Ray
🙂
12-13-2005 10:44 AM
Hi Ray, thanks again for replying. I had found the same information on the errors I was getting. I'm still not sure why I am getting them. I have not altered your wiring in anyway, I'm just trying to see if the vi you posted would work. I simply created a sample text file wit hthe word "hello" in it. Maybe that is the problem. The name of the file was simply "filename". I'm not really sure what's going on or how to proceed exactly, I mean i think it's close but I'm just not sure getting it to work right, with finding out why I'm getting these errors.
If you could post the modifed vi you had mentioned I'd appreciate it.
Thanks again for your help.
12-15-2005 12:19 PM
Hi Mah,
Attached is an updated version. It has the features you were looking for.
The original error was due to the fact that the filename did not contain a numeric value nor an extention. This one fixes that, so you can actually use "filename" as a name or "filename.txt" or "filename10" or "filename11.txt". It will work for all these conditions.
HOWEVER... You must fill in a leading filename in control panel and set the switch to select a hard-coded or run-time folder location. If it is hardcoded, then a folder name MUST be entered.
I think the rest is straight forward... 😉
Hope this one helps. Try running it as is then placing it within your vi.
Ray
12-18-2005 11:22 PM
Hii,Joe,
Thanks for the solution, but i am still confused, will it acept .xls file?
HOWEVER... You must fill in a leading filename in control panel, i cant understand this line,can u explain pls.... whenever switch is at the Hardcoded folder side, it always generate anerror of type,New File in new filename.vi in the error out dialog box, so can you explain me about this things!!!!!
Thanks,
Nishant
12-19-2005 09:54 AM
Thanks for the solution, but i am still confused, will it acept .xls file?
HOWEVER... You must fill in a leading filename in control panel, i cant understand this line,can u explain pls....
whenever switch is at the Hardcoded folder side, it always generate anerror of type,New File in new filename.vi in the error out dialog box, so can you explain me about this things!!!!!
12-21-2005 01:12 AM
Hiii, Ray
Thanks for the explaination, and it is working quite well, the problem is only that, it is not generating the file with the extension type, mean suppose i am giving the .xls in the extension box, it is not generating the xls file, (Data1.xls), it only creates the file data1, which doesnt have any specific type, can you please check this out?? and suppose i am writing the file with ext in the file name box(data.xls) it will generate the data1.xls1, which also doesnt have the specifib type. so please resolve this, if you can!!!!!!!!!
Thanks,
Nishant