LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write excel file

Solved!
Go to solution

Please show your code

0 Kudos
Message 11 of 18
(2,079 Views)

Hello there,

I have a .vi that aquires 6 AI and 3 DI

I am sending those data to a 'Write to Excel File' every 5 seconds.

The problem is that when I STOP the .vi after 4-6 hours  the file is3 Mb and is taking loooong time (10-15 minutes) to finally save the data and let me work on the PC

There is a better way to write a file without building such a heavy file?

The .vi is supposed to work for 12 hours or more..............

thanks for all your effort

Andrea

0 Kudos
Message 12 of 18
(2,057 Views)
Hi Andrea,

Write to the file in the loop, not just after...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 18
(2,054 Views)

Thanks GerdW,

I did that and after 4 hours of running............... only one line got aadded to the file......

What the trick to resolve this issue?

Thanks for your help

Andrea

 

0 Kudos
Message 14 of 18
(2,019 Views)

ok, got it..... I moved the fil and location out of the Loop and added a TRUE to the Append File.

Thanks a lot. now I will test it with a lot of data................

have  a good day

Andrea

0 Kudos
Message 15 of 18
(2,016 Views)

Hello !    jess1006  and other LabVIEW experts.. 

 

I am trying to write excel file but the data is not being recorded in separate columns, I am using the 'format into file' to push the title of each column.. not sure if this is the best way to do it... I have attached the screen shot of 'format into file' function with parameters and generated excel file..

 

Can someone share the best way to save the data in excel file (dot csv)?

 

 

 

 

 

 

Download All
0 Kudos
Message 16 of 18
(1,391 Views)

Hi Singh,

 

save the data in excel file (dot csv)?

Please don't call them "Excel files" when they are just (formatted) text files!

 

When you want to create a CSV file (Comma Separated Values) then you should use a comma as separator (and not some spaces or tabs).

Sounds quite simple, isn't it?

 

Btw. Excel is able to open your file as intended AFTER you rename it to *.TXT! But that is an Excel problem and not a LabVIEW problem…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 17 of 18
(1,388 Views)

First, I strongly recommend that you open your own .csv example file with Notepad or any other text editor.  You will see that it consists of lines of text broken up into columns of string (first line) or numeric (all other lines) data.  This is a file type that LabVIEW calls a "Delimited Spreadsheet File", and (if you use their Delimited Spreadsheet" functions) saves with a default extension of .csv.  Do you know what a .csv file means?  CSV stands for "Comma-separated Values", where the separator is a comma (","), not a tab, but I'm just being "picky".

 

Excel is, indeed, able to open and "import" text files having a Comma or a Tab separating "columns", but it is not correct to say that such files are "Excel" files (even though Microsoft associates the .csv extension with what looks like an Excel icon).

 

However, the LabVIEW Delimited Spreadsheet File functions will do a very nice job for you, particularly when you combine them with a little intelligence code to create the data for a single row (i.e. iterate over the columns) and for multiple rows (iterate over the rows).  Of course, you only want to do the Header Row once ...

 

Study those LabVIEW Functions, try to figure out (for yourself) how to use them, write some simple code, post it, and we'll critique it for you.

 

Bob Schor

0 Kudos
Message 18 of 18
(1,376 Views)