LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to spreadsheet

Hi...

 

1) In my program i used the write to spreadsheet.vi in order to save data every 5 sec in a .cvs file. My question is, can .csv file become overflow?how many data that can be stored in the file?I have to let my program, running for a long period. So can I use this .csv file? What will happen if I keep on save the data in .csv file ?Is there any better method that can be use?

 

2)How to start SQL 2005 xpress in Labview?

 

Thanks 

0 Kudos
Message 1 of 8
(5,033 Views)

There is a limit to the file size that Windows can support.  32 bits can only access up to 4Gb.

 

As for a .cvs file, it is no different than any other file type.  All files are really binary. 

 

If you notice performance issues, it may be the way the code deals with writing to the file.  If you simply append new data to an existing file, then doing so every 5 sec should not be an issue.

 

R

Message 2 of 8
(4,996 Views)

I write a line of data to a text file every second. To avoid the files getting too large I keep track of how many lines I've written and when it reaches a given size (1000 lines in my case) I close the file and open another one. The files have the same name with a numerical increment at the end, ie

 

SaveData1.txt

SaveData2.txt

SaveData3...

 

This way I can be sure that the file size is not an issue.

 

Dave

0 Kudos
Message 3 of 8
(4,989 Views)

Hi Gdah,

 

I believe the method suggested by JoeLabView and DavidU is the correct method. However, please be reminded that write to spreadsheet.vi is a high level File I/O, which performs Open-Write-Close operation sequencially, do not use this subVI inside any Loops or else you will experience slow processing time and the data you are writing might overwritten each iteration.

 

Regarding your 2nd question, if you want to connect between LabVIEW and SQL database, you would need NI LabVIEW Database Connectivity toolkits (https://www.ni.com/en/shop/labview/select-edition.html). 

 

Let me know if you have further enquiries.

Sincerely,

Krisna Wisnu

Applications Engineer

NI ASEAN

SR:66756

Certified LabVIEW Developer (CLD)
Certified TestStand Developer (CTD)
Using LabVIEW 8.5.1 (2008) to LabVIEW 2024
0 Kudos
Message 4 of 8
(4,966 Views)
I must disagree with my esteemed colleague.  Windows files are not always limited to 4GBytes.  There are two limits, one imposed by the file system, one by LabVIEW.  If the file system type is FAT32, files are limited to 4GBytes.  If the file system type is NTFS, you will only run into a limit if you are managing a Google disk farm or processing weather data.  Earlier versions of LabVIEW (7.1 and earlier) had signed 32 bit access to files, limiting random access to 2GBytes.  However, if you simply append to the same file without closing it, the normal file system limits apply.  LabVIEW 8.0 and above has signed 64 bit access to files, taking away any limits from the LabVIEW side.
Message 5 of 8
(4,945 Views)

Hi All,

 

I think I have mistaken understood the first question. DFGray is right. I am sorry for the confusion made. Thanks DFGray! I will take note on that

 

Sincerely,



Krisna Wisnu
 

Certified LabVIEW Developer (CLD)
Certified TestStand Developer (CTD)
Using LabVIEW 8.5.1 (2008) to LabVIEW 2024
0 Kudos
Message 6 of 8
(4,922 Views)

Hi All,

 

I am trying to write data that I am sampling with a 4-channel DAQ, and I want to write the data from all the channels during each sample to the excel file, continuously appending.  I'm trying to do this, however, the values are being over-written and all I get in the excel file is the values from the last sample.  I am using the Write-To-Spreadsheet function outside of the while loop, I am sure this is a simple thing but I am just not getting it.  Can you offer some feedback as to what I'm doing wrong and point  me to the right direction for doing this?  Thank you very much.

0 Kudos
Message 7 of 8
(4,761 Views)

You probably should have started a new message thread for this.

 

The reason you get data from only the last sample is that you have a normal tunnel for the 2-D array that exits the loop.  That means only the last iteration's data exits the loop.  You probably want to use an autoindexing tunnel.  However that would turn the 2-D array into a 3-D array which you don't want.  The problem starts with using the express VI's which hide the real data behind the mysterious structure of the dynamic data type.  The express vi's convert that to 1-D arrays even though your are sampling only 1 sample at a time.  You may want to index out the only element present in that 1-D array to get the single data point for each channel.  Then build an array into a 1-D array of your 4 channels, then auto-index the tunnel to get a 2-D array.

0 Kudos
Message 8 of 8
(4,755 Views)