LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

curve fit

Solved!
Go to solution

Hi altenbach!

Thanks in advance. I adapted your code into my real VI and it works very well. I'm also able to write the polynomial equation that relates to curve fit into the text file :). I' m very happy and thank you again and again. I want to make a data bank in the E folder of PC. So I want to copy text files into E:\. Could you please help me for this?

 

In E.\ folder, Firstly I want to open a new folder and name it as, i.e., "Reta=680; Reos=52" and then I want to save the corresponding text files into this related folder. How can I do this?

 

Also, I said previously that I wanted to copy the figure of "Best curve fit" into the same corresponding text file. Is it possible?

 

Thank you very much again and I'm looking forward to hearing from you.  

 

 

0 Kudos
Message 31 of 50
(1,453 Views)

Well, it's past midnight. Maybe I have time tomorrow to cook something up.

 

All the tools you need are in the (advanced) file IO palette. You can create a folder, define paths, etc. See how far you get. 🙂

0 Kudos
Message 32 of 50
(1,447 Views)

ok! I will try today. If I have a problem, I will write. Have a nice night! Thank you again!

0 Kudos
Message 33 of 50
(1,442 Views)

Hi altenbach!

I have tried to creat a new folder for each run in E:\  part of the PC and succeeded a bit. However, when I define the path as E:\, the program give an error. I want to save the text file named as "Reos=...; um,os=....txt"  in the folder named as "Reos=...; um,os=..."  in E part of PC. The name of the text file and folder will be the same. You can say that saving only one text file into a folder is nonsense. But, in my original VI, I will save more than one file into this folder. So, I want to classify and collect the text files in their corresponding folder. 

I did something, however, it gives error. How can I achieve this?  thanks..

0 Kudos
Message 34 of 50
(1,432 Views)

What is the exact type of error? Can you show us your code?

 

Firstly, make sure you only create the folder if it does not already exist.

Make sure you don't use any special characters in the name that are not allowed on your OS.

Don't operate on paths as strings. Use path datatypes. Only names (folder name, file name) should be strings.

0 Kudos
Message 35 of 50
(1,425 Views)

Hi altenbach,

The error says that the special characters in the name are used, that are not allowed on OS, i.e. @, etc. But I do not use the character @.

I used the "create folder.vi" and wired a constant "E:\" to the path and wired a string "Reos=%d; um,os=%.02f" to the prompt and used "format into string" as you did for text file.

Then, I wired the "create folder.vi" to the path of "Strip Path" deleting the "Current VI's Path". However it does not work and give error.

Could you please show your code on the sample vi? It will be quite easier for you but, it is confusing for new user like me.thanks..

0 Kudos
Message 36 of 50
(1,420 Views)

 


mechen wrote:

The error .. special characters ...But I do not use...I  used ...and wired a string "... and used .. does not work ... give error.


A VI is worth a thousand words. Attach the VI! 😄

 

0 Kudos
Message 37 of 50
(1,416 Views)

Hi altenbach,

I attached the VI and subvi.rar. I hope you can open the vi. As before I said, I could not create a folder. How can I achieve this? I also attached the blockdiagram.jpeg which shows where I wired the "create folder.vi". My aim is to collect and save all text files into one folder named as a result of Reos=...;um,os=.... values like the text file names. However, in the attached vi, I have wired two "create folder.vi" to test. However, it failed.

The folder name should be given with resulted numeric constants of, i.e., "Reos=100; Reta=680", similar to the procedure of name of text files (string of "Reos=%d; um,os=%.02f.txt")

Download All
0 Kudos
Message 38 of 50
(1,402 Views)

I also attached the subvi.zip.

0 Kudos
Message 39 of 50
(1,399 Views)

 


@mechen wrote:

Hi altenbach,

I attached the VI and subvi.rar. I hope you can open the vi. As before I said, I could not create a folder. How can I achieve this? I also attached the blockdiagram.jpeg which shows where I wired the "create folder.vi". My aim is to collect and save all text files into one folder named as a result of Reos=...;um,os=.... values like the text file names. However, in the attached vi, I have wired two "create folder.vi" to test. However, it failed.

The folder name should be given with resulted numeric constants of, i.e., "Reos=100; Reta=680", similar to the procedure of name of text files (string of "Reos=%d; um,os=%.02f.txt")


You need to read the help for "create folder". You are trying to create folder "E:\\" which of course already exists, the upper input is not a folder name, but the dialog prompt. Since you wire a path, that's not even used. And why are you doing everything in duplicate. Do you understand the formatting code in the parts I wrote?

 

0 Kudos
Message 40 of 50
(1,386 Views)