11-12-2021 06:41 AM
Hello NI community,
Firstly, I would like to say thank you all for your support. I am working on a Gaussmeter to get the magnetic field density data. Successfully, I am getting data from the Gaussmeter in a waveform chart. Now, I would like to save the measured data into CSV file. I knew direct export process but for user interface, Just they have to select the path for CSV file, run the program, all the data needs to be saved in CSV file. I want the data to be saved in a csv file same as how the data is getting plotted in wave form chart.
I have one more doubt is it possible to create a CSV file from the wave form chart.
When I implemented the spreadsheet file into the program, it’s not working (I was not able to run the program). Could you please suggest me how to write data to CSV file and Could you please recommend any examples.
Thanks & Regards
Vijay
Solved! Go to Solution.
11-13-2021 05:49 AM
Sorry, no LabVIEW 2021 here, but looking at the picture shows a few unusual things that should be corrected.
A better and much more efficient option would be to use lowlevel file IO. Open the file before the loop, write the headers, then keep appending rows (form the array with three elements then use "array to spreadsheet string" using comma as delimiter). Close the file after the loop has completed.
11-15-2021 08:27 AM
Hello Altenbach,
Thank you so much for your kind reply. I have changed the program according to your suggestions. I was able to get the excel file. when I tried to check the data saved in excel, just magnetic flux density alone is saved not Time. I would like to get Time along with Magnetic flux density. Could you please check the code once and let me know your suggestions for Time as well. Do I need to change the program for getting Time data and magnetic flux density data. Looking forward to hearing from you soon.
Thanks
Vijay
11-15-2021 12:20 PM - edited 11-15-2021 12:21 PM
Hi vijay,
@vijay0507 wrote:
when I tried to check the data saved in excel, just magnetic flux density alone is saved not Time.
Because "magnetic flux" is the only value that you save to your file!
When you also want some timestamps in the file then you need to save them too!
I don't see anything related to timestamps in your VI/blockdiagram…
11-16-2021 05:34 AM
Hello,
Thank you for the reply. But I am not getting how to save the data of X axis (Time) as well. I want to save the data of both X (Time) and Y (Magnetic flux density) values in .csv file. Since X is time, it can be in arbitrary unit.
Could you please check previous message attached program file. I was trying but just Magnetic flux density data alone getting into csv file. I want to Flux density along with time when I run the program. Could you please suggested any ideas or reference program.
Thanks & Regards
Vijay
11-16-2021 08:06 AM
Hello
I was trying to add array to the spreadsheet but not getting the Time values from the waveform chart. In waveform chart I was getting Time in sec on X-axis and Magnetic flux density mT on Y-axis. when I try to save waveform data into a .csv file. Just Y-axis data is getting saved but not X-axis data (Time).
Since I am new to LabVIEW, I don't have much knowledge of how to save time data along with Magnetic flux density of Y-axis. Could you please provide me your valuable suggestions.
Thanks
Vijay
11-16-2021 08:07 AM
Hello
I was trying to add array to the spreadsheet but not getting the Time values from the waveform chart. In waveform chart I was getting Time in sec on X-axis and Magnetic flux density mT on Y-axis. when I try to save waveform data into a .csv file. Just Y-axis data is getting saved but not X-axis data (Time).
Since I am new to LabVIEW, I don't have much knowledge of how to save time data along with Magnetic flux density of Y-axis. Could you please provide me your valuable suggestions.
Thanks
Vijay
11-16-2021 11:21 AM - edited 11-16-2021 11:21 AM
I think you should take a step back and tell us what you are trying to do, not how you are trying to do it. Can you show us how the csv file should look like, exactly?
11-16-2021 12:09 PM
Hello Altenbach,
Thank you so much for your reply. Actually, I am working on a Gaussmeter to get Magnetic flux density data along with time. Successfully, I am getting data from the Gaussmeter in waveform chart, as you can see in attached picture. Now I want to save data X-axis (Time [s]) and Y-axis Magnetic flux density (mT) into .csv file. I knew direct export data to excel file process but I want to create and write data into a .csv file to my program when I run and also it includes Time X-axis along with flux density data Y-axis, so I would like to write a measured data directly into .csv file.
For your reference I am attaching the Graph and want the excels file in the attached formate. Looking forward to hear from you soon.
Thanks
Vijay
11-16-2021 12:12 PM
Hello Altenbach,
Thank you so much for your reply. Actually, I am working on a Gaussmeter to get Magnetic flux density data along with time. Successfully, I am getting data from the Gaussmeter in waveform chart, as you can see in attached picture. Now I want to save data X-axis (Time [s]) and Y-axis Magnetic flux density (mT) into .csv file. I knew direct export data to excel file process but I want to create and write data into a .csv file to my program when I run and also it includes Time X-axis along with flux density data Y-axis, so I would like to write a measured data directly into .csv file.
For your reference, I am attaching the Graph and want the .csv file in the attached format (exported from graph). Looking forward to hear from you soon.
Thanks
Vijay