11-05-2014 12:39 AM
Hello,
I build an application with LabView that use MS. Excel to save my sensors data. but i dont know how to do it optimally. i use Excel Get work sheet and Excel Get Data in report generator toolkit for reading data from MS Excel and Excel easy table and Excel wirte to file for transfering data to MS Excel. but I have lots of problem ecpecially in wiriting data to MS. Excel. the problem is as follow:
I produce 10 catagory of data each 5 minutes in my program. I want save them in excel. but each time i want to save data in MS Excel the program open the Excel Sheet in front of running LabView application and again colse it after inserting data to it. and it is repeated for each individual data. it really makes the LabView application slow and making the CPU busy. if I want to collect data in My Labview program for one day and at the end of the day, transfer them to MS. Excel the risk of pc shut down and data loss is critical. is there any solution or a better way for data exchange between Labview and MS. Excel?
Best Regard.
11-05-2014 02:52 AM
11-05-2014 03:31 AM
Hi GerdW,
thank you
Is it restricted to Active x way? can I command Excel to not open it's window in RGT too?
11-05-2014 03:34 AM - edited 11-05-2014 03:36 AM
Hi Behzad,
I don't use RGT so I cannot comment on this.
I use plain ActiveX calls to remotely control Excel:
if I want to collect data in My Labview program for one day and at the end of the day, transfer them to MS. Excel the risk of pc shut down and data loss is critical. is there any solution or a better way for data exchange between Labview and MS. Excel?
Store your data in a plain spreadsheet file (aka CSV file) while your measurements runs. At the end of the measurement you load that file and create an Excel worksheet at once from it using RGT.
No need to call Excel each 5min…
11-05-2014 03:42 AM - edited 11-05-2014 03:44 AM
Speaking frankly, I wouldn't use Excel to save my data.
Make a independend loop and use a queue to pipe the data into that loop. This loop saves the data ( I would use a ASCII .txt file) and if MSexcel is really needed keep a copy of the data (it's not that much) and once an hour or after request transfer all data at once to excel.
Sounds like a room condition (temp & hum) logging, BTDT , I saved the data with one file a day , and created a weekly report with diagrams (for Q), one year folder,
Every 5 min, save it to the backuped network drive , with local drive as a fall back in case of network failure (Nowadays you can use SYNC programs that do the job if you want). if you open & close the file for each data set, other applications can read the data too, and you can always read ascii files 😉
11-05-2014 12:28 PM
@Henrik_Volkers wrote:
Speaking frankly, I wouldn't use Excel to save my data.
Make a independend loop and use a queue to pipe the data into that loop. This loop saves the data ( I would use a ASCII .txt file) and if MSexcel is really needed keep a copy of the data (it's not that much) and once an hour or after request transfer all data at once to excel.
Or similarly log to a TDMS file, then convert it to Excel afterwards.
https://decibel.ni.com/content/docs/DOC-36555
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-05-2014 01:33 PM
I've almost completly switched over to TDMS for data logging. Its just too powerful to ignore as an option. My clients love it when I introduce them to the ability to Launch the TDMS Viewer without stopping the test and see the channels update in situ and they get better chanel information as well.
11-05-2014 01:39 PM
@JÞB wrote:
My clients love it when I introduce them to the ability to Launch the TDMS Viewer without stopping the test and see the channels update in situ and they get better chanel information as well.
You are probably already aware of this, but for others out there check out Scout TDMS viewer. The built in TDMS viewer is decent and helps visualize the file structure, but after using it on any real data you'll find yourself asking for basic graph or analysis features, and Scout does that.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-05-2014 02:26 PM
@GerdW wrote:
Hi Behzad,
I don't use RGT so I cannot comment on this.
I use plain ActiveX calls to remotely control Excel:
if I want to collect data in My Labview program for one day and at the end of the day, transfer them to MS. Excel the risk of pc shut down and data loss is critical. is there any solution or a better way for data exchange between Labview and MS. Excel?
Store your data in a plain spreadsheet file (aka CSV file) while your measurements runs. At the end of the measurement you load that file and create an Excel worksheet at once from it using RGT.
No need to call Excel each 5min…
Some additional info to Gerd's comment. If you open Excel with 'Visible'=FALSE, it is probably better to set also the "DisplayAlerts"=FALSE.
Otherwise, when Excel is not visible, and tries to display a warning, i.e. file override, etc..., you will get an error message. You can handle this errors in your code, but if you don't care about them, just set DisplayAlerts to false.