LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Entering the sampling frequency at the top of the file

I have a labview file through which i am getting some data from the ADC.

 

I have to give some sampling frequency. Now what i want is i want the sampling frequency should be at the first row of the CSV file as i need to use it for some processing in the Matlab. Do any one knows how to do it.

0 Kudos
Message 1 of 13
(2,847 Views)

I forget to attached the VI file.

 

Like in this VI file i am writing the values in the file tw.csv

 

I want to write the sampling frequency at the A1 so that i can fetch this value and use in matlab.

 

 

0 Kudos
Message 2 of 13
(2,845 Views)

Why are you overwritting your file constantly?  That's hard on the hard drive.  Since it appears that you only care about the last set of data, write the file only after the loop.

 

Instead of using the Write to Spreadsheet File VI, use the lower lever file functions.  Open/Create the file, write your sample frequency, format your data (use the Array to Spreadsheet String function), write your data, and close the file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 13
(2,840 Views)

 

sorry i did not get what you saying ............

 

can you please the file as you said in the post and attached it

 

and still the problem of adding the sampling frequency is still there

0 Kudos
Message 4 of 13
(2,838 Views)

Pretty basic stuff. You can write the header before you enter the while loop. Use another Write to Spreadsheet File if you want or just a simple Write to Text File.

 

If you don't want to save the results of every iteration, your current Write to Spreadsheet should not be inside the loop. Simply drag it outside and connect your data. If you do want to save every result, then your append to file should be set to True. Though with continuous samples, you may get an error

0 Kudos
Message 5 of 13
(2,831 Views)
0 Kudos
Message 6 of 13
(2,830 Views)

That saves just the last iteration - the same as what you had before without all of the disk thrashing. Now you just need another write to add the header. Since you moved it outside, you can write the header after the loop finishes as well.

0 Kudos
Message 7 of 13
(2,828 Views)

 

could you please show the admenments you are saying on the VI file and then upload that VI file

0 Kudos
Message 8 of 13
(2,825 Views)
0 Kudos
Message 9 of 13
(2,818 Views)

sorry boss

 

 

i still could not get it ......

 

may be if you can amend to the file that i am attaching .......

0 Kudos
Message 10 of 13
(2,783 Views)