LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how keep data safe?

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.

 

 

0 Kudos
Message 1 of 9
(2,782 Views)

Hi behzad,

 

you can command Excel to not open it's window. It's a parameter of the "Open Excel" ActiveX call…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(2,752 Views)

Hi GerdW,

thank you

Is it restricted to Active x way? can I command Excel to not open it's window in RGT too?

 

0 Kudos
Message 3 of 9
(2,743 Views)

Hi Behzad,

 

I don't use RGT so I cannot comment on this.

I use plain ActiveX calls to remotely control Excel:

 

check.png

 

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 9
(2,741 Views)

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 😉

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 5 of 9
(2,735 Views)

@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

Message 6 of 9
(2,694 Views)

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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 9
(2,675 Views)

@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.

0 Kudos
Message 8 of 9
(2,670 Views)

@GerdW wrote:

Hi Behzad,

 

I don't use RGT so I cannot comment on this.

I use plain ActiveX calls to remotely control Excel:

 

check.png

 

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. 

0 Kudos
Message 9 of 9
(2,655 Views)