04-10-2023 12:38 PM
I'm reading from analog pin on my device. I can see data being displayed on the waveform graph and I'm okay with that. The only thing that I don't like my data on excel does not look as the data being exported from waveform to excel.
Below is how my data looks like:
When I right click on the waveform and do export to excel, data looks very good as you can see below.
How do I write to excel so that it looks like the exported data?
Can someone please help?
Solved! Go to Solution.
04-10-2023 01:30 PM - edited 04-10-2023 01:39 PM
You take your Y data and build a waveform without specifying x0 and dx, so LabVIEW assumes x0=0 and dx=1.
Don't extract the Y data if you need the waveform timing information for the graph.
Please don't wire waveforms to the file save!
The waveform only contains the currently displayed data. It can never show all the history data as in the appended text file.
04-10-2023 01:32 PM
You just need to wire a second Truth constant to input TRANSPOSE.
The frequency column I'm assuming is actually the time right ? SInce you are sampling at 1 KHz, you don't need the timing just the sampling rate to plot the data.
04-10-2023 01:36 PM
@LVNinja wrote:
You just need to wire a second Truth constant to input TRANSPOSE.
The problem is exporting to excel. With each iteration, they are only appending one row to the text file, so that part is fine.
04-10-2023 02:19 PM - edited 04-10-2023 02:20 PM
@LVNinja wrote:
You just need to wire a second Truth constant to input TRANSPOSE.
The frequency column I'm assuming is actually the time right ? SInce you are sampling at 1 KHz, you don't need the timing just the sampling rate to plot the data.
The more proper way it to just use the Export Waveforms To Spreadsheet File VI. It can be found in the Waveform->Waveform File I/O palette.
However, if it were me I would create/open the file before the loop, format the data myself and write to the file inside of the loop, and then close the file after the loop. This is A LOT more efficient.
04-10-2023 02:57 PM
@crossrulz wrote:
However, if it were me I would create/open the file before the loop, format the data myself and write to the file inside of the loop, and then close the file after the loop. This is A LOT more efficient.
Yes, good advice, but irrelevant for the question, which was (IMHO) exclusively about "right-click on graph, export to excel". Apparently, they were already happy with the csv save.
04-10-2023 03:46 PM
I made this change below and still missing data from the x-axis (0 to 999)
04-10-2023 03:48 PM
Hi crossrulz,
Thanks for the suggestion. My goal is to replicate what the export waveforms to spreadsheet can do.
04-10-2023 03:51 PM
I tried but I'm only getting one column of the data. I'm not missing tank pressure column if only I can get the tank pressure, my problem will be solved. I don't even care much about the headers.
04-10-2023 04:22 PM
I would recommend you use the built-in TDMS logging feature of the DAQmx driver. You can refer to the shipping example of Voltage Input - Finite and enable the logging.
You can then open the TDMS file using Excel Importer, and even export the data to excel. Export TDMS File with Large Dataset to Excel File