LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting Data to Excel

Hi guys! I'm pretty stuck atm so any help would be most gratefully received! I am now at a point where my program is controlling everything properly and reading the data from the logger correctly.
 
I am using 8.5, using the DAQ assistant sampling at 10Khz reading the samples of the buffer at 1khz, across 8 channels and plotting this to a waveform chart. So far so good..
 
My problem lies in exporting this to Excel, I started using the write to spreadsheet vi but this never properly worked and straight to excel would make life a whole lot easier!
 
1) I'm expecting roughly 50,000 data points (5 seconds at 10kHz) off each channel, but is this more than Excel can handle? Anyway round this or do I need to take every 10th value or similar?
 
2) I am only getting roughly 50 data points for each channel! What is going on here? I have tried converting the DDT to an array, autoindexing and then reading this outside the while loop. I have tried convert DDT to array, then using buil array function inside the while loop then exporting this. All to no avail!
 
3) My values are roughly of the order or 0.00001 or lower, I can only get Excel to write values to 0.0001 decimal places, can i change this at all??
 
I am trying to use the Excel Vi's supplied under the report generation pallett. So my problem is I'm expecting thousands of data points, I'm getting maybe a few hundred 0.0000 with the occasional 0.0001 thrown in for fun!
 
Thanks
Jon
0 Kudos
Message 1 of 17
(5,145 Views)
Hi Jon,

can you show us what you have coded so far?

But I would advise to use "Write to spreadsheet" using "%.7g" as format code - this will produce a csv-formatted file containing all your values with needed accuracy...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 17
(5,139 Views)
Right well I have tried you advice to go back to the write to spreadsheet file...
Using "%.7g" has sorted out my significant figures problem. However I'm still stuck with the biggy...
 
When plotting for five seconds the program writes 51 rows for 8 columns
When plotting for six seconds the program writes 60 rows for 8 columns.
 
I guess then it is taking readings every 0.1s? I need much higher resolution than this! I'm just struggling to see how to change this. The set up is fairly simple for this part.
DAQassistant>Convert from DDT>auto index on the while loop>write to spread sheet.
 
So where am i going wrong? The program must just be ignoring a lot of data yet the Chart is updating at the correct rate. So somewhere from the DDT conversion onwards I lose a lot of data?
 
Please help? It's driving me mad!
 
Cheers
Jon
0 Kudos
Message 3 of 17
(5,110 Views)
Hi Jon,

"So where am i going wrong?"

Attach your vi and we will tell you Smiley Wink
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 17
(5,106 Views)
Well here is the main section. Hopefully its fairly self explanatory....
 
Thanks
 
0 Kudos
Message 5 of 17
(5,102 Views)
Hi Jon,

the picture inside a rtf is quite, ehhm, colorful.
Why not attach: the picture itself or - even better! - the vi?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 17
(5,097 Views)

Hi, sorry blame it on a mixture of a long day and a ridiculous IT policy but I thought I had!

 

Anyways here it is, its still a work in progress... So any major flaws you see I'd be greatfull for your feedback!

 

Thanks

Jon

0 Kudos
Message 7 of 17
(5,090 Views)
Hi Jon,

in this vi I cannot find any writing routines... Maybe they are hidden in one of those missing subvis...

Cleaned up the attachment nevertheless Smiley Wink
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 17
(5,081 Views)
Hi thanks for that! The sub-Vi's only really control power supplies, nothing very exciting. The write to spreadsheet vi is just to the right of the central while loop if thats what you can't find? You should be able to find it easily from the DAQ assistant?
 
I'll have to have a look at it tomorrow now as I'm just off home! Do you have any ideas on where the data loss is coming from? I can't get my head around the fact its taking data from the buffer 1000 times a second, taking 10 sample at a time... Am I not putting this into an array right? Unless its for some reason taking one buffer read every tenth of a second and auto-indexing this? Does something need to be sped up?
 
Sorry for all the questions!
Jon
 
0 Kudos
Message 9 of 17
(5,076 Views)


jh5638 wrote:
Hi thanks for that! The sub-Vi's only really control power supplies, nothing very exciting. The write to spreadsheet vi is just to the right of the central while loop if thats what you can't find? You should be able to find it easily from the DAQ assistant?



It's just not there in your VI.  Your VI doesn't match the picture that is in that bloated .rtf file.
0 Kudos
Message 10 of 17
(5,038 Views)