LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file read write affect my execution speed..

Hi friends,

             

              I am facing one problem regarding excel tab file.thats i have one instrument its generates the 100 data in one minute which data is needed to log in Excel tab file. 

 

In this case i need to display the serial no of each data,so the i am reading the file each time and increament it and store as next serila no.its not given the problem when file size is less.but afterward when file size is increased ,its take much time to read the file.so my execution time is mostly impacted or spoiled..i developed as a queue based produce costumer architecture even i get it ,

 

and onething i dont have obtion to use any other file type except excel tab type.

 

pls if u have the solution Telll me

 

Raj
0 Kudos
Message 1 of 10
(2,435 Views)

Can you post your code?

 

It sounds like you may be doing your file writes in an inefficient manner.

Are you really using Excel or are you using delimited spreadsheet files?  Delimited spreadsheet files will be much more efficient.

 

I believe Write to Spreadsheet allows you to append data to the end of a file so file size shouldn't affect the execution time.  How big of a file are we talking about?

 

If I'm wrong about the Write to Spreadsheet.vi, another brute force method would be to open the file and set the write position manually.

0 Kudos
Message 2 of 10
(2,430 Views)

Pandiyan wrote:

[...]

and onething i dont have obtion to use any other file type except excel tab type.



In that case, I would use the VI mentioned above (Write to Spreadsheet File) and set the delimeter to Comma, and save the filename as a *.csv. These can be opened up directly in Excel. Why limit yourself to tab delimeter?

 

However, your problem is strange. You should post your code if you are dead set on writing/reading directly from Excel - see if someone can help.

Richard






0 Kudos
Message 3 of 10
(2,426 Views)

thanks for reply 

 

if i do append in excel .i cannot realize what s.no is  given before...so that pupose only i need to read the data to get the last S.no.

 

your answer is correct only if i enable the  append option.its work fastly.....but this situation i cant make append the data..i need to know already stored data  like "S.NO"

Raj
0 Kudos
Message 4 of 10
(2,422 Views)

I don't understand what you are doing with the serial number. You said you need to display the serial number of each data. What does this mean? Display it where, and in what way? I see you passing the file reference to another subVI. What is this subVI doing? Is it also reading the file? What is that other VI that has the icon that says "Database Handler" doing? You appear to be passing in the value of a global variable which imples the name of a file. Is this also writing to a file?

 

Also, please note that you are NOT dealing with Excel files here. You are dealing with text files, so please stop saying Excel, since that's a completely different question.

0 Kudos
Message 5 of 10
(2,412 Views)

@smercurio_fc wrote:

 

Also, please note that you are NOT dealing with Excel files here. You are dealing with text files, so please stop saying Excel, since that's a completely different question.


Baybe not at first. After seeing the OP's code, I just assumed he changed his Excel calls to the VI's mentioned in the first reply (by Taki1999).

Richard






0 Kudos
Message 6 of 10
(2,402 Views)

While it's possible I doubt it - it's pretty common for people to say they're using Excel files when they're actually using that VI. I rue the day that NI decided on that name for that VI.

0 Kudos
Message 7 of 10
(2,396 Views)

smercurio_fc wrote:

I rue the day that NI decided on that name for that VI.

For real !  It's my decision whether it's going to be a Spreadsheet File or not. It's simply an Easily Appended Delimited File with Housekeeping

Richard






0 Kudos
Message 8 of 10
(2,390 Views)

@Pandiyan wrote:

thanks for reply 

 

if i do append in excel .i cannot realize what s.no is  given before...so that pupose only i need to read the data to get the last S.no.

 

your answer is correct only if i enable the  append option.its work fastly.....but this situation i cant make append the data..i need to know already stored data  like "S.NO"


Save "last serial number written" in an Action engine- Load from file on init only.  Otherwise read the value from the AE and just append new data to your file and update the last serial number wrirten in the AE.  No reason to read what was written from the same program- remember what you wrote.


"Should be" isn't "Is" -Jay
Message 9 of 10
(2,382 Views)

ok thank s for your all replay...bye

Raj
0 Kudos
Message 10 of 10
(2,358 Views)