LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

curve fit

Solved!
Go to solution

Hi, I did not duplicate anything. I have to use something twice, one of the for um,ta and Reta, and other is for um,os and Reos. I understood the formatting code in the parts you wrote and looked at help for "create folder". But I do not succceed. Please help. Could you please show me how I can create a folder in E:\ and save the text file in the created folder and name this folder with "Reos=...; um,os=..." as you did for text file name. Please help..

0 Kudos
Message 41 of 50
(1,654 Views)

 


@mechen wrote:

Hi, I did not duplicate anything. 


 

Yes you did. For example you are trying to create the same folder twice. Once is enough!

(You also need to check if it already exists and only create if it does not.)

 

Your code was way to messy to edit, so I reduced it to the problem of filename generation. Please insert your file data back and splice it all into your original program. You can test the way it is now.

 

 

Message 42 of 50
(1,646 Views)

Hi altenbach,

I have adapted your code into my VI. And, now it works and save 3 files into the folder in E part of PC. Thanks a lot..

 

I also save the simultaneous data into 2 files named as "Text File" and "Pressures" in the loop. I also want to save these text files into the same folder in E. I did the same things that I applied to other 3 text files. However, It does not work, maybe, because of tunnels of loops. How can I save these 2 files in case structure and loop to the same folder in E:\?

 

Also, as I previously said, I want to save the "best curve fit" graph pictures into the related text file as I showed in attachment of "block3.jpeg". How can I do this? Could you please help me? Thanks again.

Download All
0 Kudos
Message 43 of 50
(1,626 Views)

the last attachment of "block3.jpeg".

0 Kudos
Message 44 of 50
(1,625 Views)

Hi altenbach,

Addition to two previous mail, I have a simple problem that I can not solve. As can be seen from the jpeg attachment I want to specify the data in the text. However, for every iteration, the headings are written between the data. But, I want these headings only at the first row, at the top. I have also attached the text file. Could you please look at it?

Download All
0 Kudos
Message 45 of 50
(1,615 Views)

 

  • When the file does not exist, create it and write the header once.
  • If the file exist, only append a row of data.
try it!

 

0 Kudos
Message 46 of 50
(1,594 Views)

 


mechen wrote:

I also save the simultaneous data into 2 files named as "Text File" and "Pressures" in the loop. I also want to save these text files into the same folder in E. I did the same things that I applied to other 3 text files. However, It does not work, maybe, because of tunnels of loops. How can I save these 2 files in case structure and loop to the same folder in E:\?


 

What is a "tunnel of loops"? I am not familiar with that terminology. Does the error terminal tell you anything? Put an error probe or error indicator to see what is happening.

If you say "it does not work", I have no idea what that means. You need to provide details. (no file created, wrong location, wrong name, no content in file, computer crashes, computer bursts into flames, etc.)

 

To troubleshoot something like that, make a small VI such as the one I made earlier and do some isolated testing. It cannot be much different to what I already showed you. I think you have all the tools, you just need to debug a little. 😉

0 Kudos
Message 47 of 50
(1,584 Views)

Hi altenbach!

 

I was able to append the row of the text. Now, I have another big problem.

 

As can be seen from the figure, I want to obtain sinüsoidal waveform. I can obtain whatever amplitude and offset I want, however, until frequency=0,05 Hz. If freq.<0,05 Hz, an error is obtained, which is like in the attachment. There is aa error code and points an error in the subvi of "Daq3000 Predefined Waveform Output Config.vi". I went into this vi, but everything seem ok. I also change the buffer size, count, total scan to acquire and scan rate which are seen in the attachment. However, for freq.<0,05 Hz, it fails and gives the same error. What is your opinion? Could you please help me?

0 Kudos
Message 48 of 50
(1,563 Views)

Hi altenbach!

 

I have shortened my vi and attached the subvis. Could you please help me?

 

I was able to append the row of the text. Now, I have another big problem.

 

As can be seen from the figure, I want to obtain sinüsoidal waveform. I can obtain whatever amplitude and offset I want, however, until frequency=0,05 Hz. If freq.<0,05 Hz, an error is obtained, which is like in the attachment. There is an error code and the error is pointed out in the subvi of "Daq3000 Predefined Waveform Output Config.vi". I went into this vi, but everything seem ok. I also change the buffer size, count, total scan to acquire and scan rate which are seen in the attachment. However, for freq.<0,05 Hz, it fails and gives the same error. What is your opinion?

Could you please also make a discussion on buffer size, scan rate, total scan to acquire and loop count? In your opinion, Do I make a mistake? What must these values be???? Could you please help me?

0 Kudos
Message 49 of 50
(1,541 Views)

 


mechen wrote:

Could you please also make a discussion on buffer size, scan rate, total scan to acquire and loop count? In your opinion, Do I make a mistake? What must these values be???? Could you please help me?


 

You have a third party DAQ driver here which is not even written by NI. You should contact whoever sold you the hardware and driver. I cannot help you there!

 

Just looking at your code, there are some mind-boggling constructs that don't make sense:

 

 

  • Why are the inputs and outputs to "kings law" and "pressure transducer calibration" all 1D arrays?? All you do is element-wise operations with array constants that only have one element, so no matter what, all you basically do is a scalar operation on the first element, throwing out everything else. All these need to change to scalars! This is way off from any reasonable code. 😉
  • Why do you use "insert into array" in the loop? The right tool is built array (concatenate mode). Since all inputs should actually be scalars (see above), a simple built array would be sufficient.

 

0 Kudos
Message 50 of 50
(1,535 Views)