10-13-2015 11:24 AM
Hi,
I understand this question gets asked a lot but I am very new to labview and have not been able to apply any of the previous solutions to my problem. I am generating voltage data with a USB-6008. I have attached my VI file. I can view the data in a chart and as a value but I can't export it to excel. I connected the data out to the export to excel VI which returned an error, I also tried this with a csv. I was wondering if you could possibly help me identify why I am getting this error.
Ideally I want to have a spreadsheet with voltage in one column and time in another.
Thanks
10-13-2015 11:29 AM - edited 10-13-2015 11:31 AM
It should be noted that it is not an Export to Excel Vi, but actually Write to Spreadsheet. This is important because not everything you do with that VI will be readable in excel. Usually, the best practice is to generate a CSV file with the Write to Spreadsheet File VI (using comma delimination).
You don't have a path wired in to the spreadsheet VI, so you will be prompted for the file path at which you want to save. Every iteration, it will be prompting you for a new file.
You say you return an error. Please share what error you get...
You're writing the data as a 2D array, that's fine. You'll end up with a table of data in the file. If you want to add timestamps in there, you'll have to do your own string conversions and build a 2Darray of strings to write to the spreadsheet.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
10-13-2015 11:41 AM
Hi,
I appreciate your quick response. I have attached an image of the error I get. Can you tell me what block I need to add to the write to spreadsheet in order to specify the file? and could you possibly explain how to add in the string conversions / build the 2d array of strings?
I know this is a lot to ask of you and I really appreciate you helping me.
Thanks
10-13-2015 11:58 AM - edited 10-13-2015 11:59 AM
That error is because you're not reading fast enough for your acquisition. Basically, you're pulling data in at 1kHz, but your buffer is only 1000 data points, so you better read faster than every one second. Since you're browsing for the file every time you are writing, that takes longer than a second for you to find the file I'm sure.
Here's a guideline for what to do the simplest way. This is NOT scaleable, so I would suggest you look in to design patterns if you want to grow your application. Writing the data to file with every single loop in the same loop thjat you're acquiring could potentially slow down your loop to the point where you see the above error again.
Watch some LabVIEW tutorials to get more familiar. You say none of the other posts similar to this help you, but they definitely would help you if you dive in and figure out how they work.
"Give me six hours to chop down a tree and I will spend the first four sharpening the axe." - Abraham Lincoln
Here are some free training tools primarily focused on LabVIEW and NI hardware to help you.
-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)
Learn NI Training Resource Videos
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'