LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel save error

Hello,

 

I use it to save the data given in a project onto an Excel file. Get data -> Save to file -> Close Excel. I did not experience any problems when the number of data in this stream was low. However, when the number of data increases, Excel does not save the data and does not close it. I've added the code snippet below. Please I would like to hear a logical explanation.

 

Kind regards,

 

Dispose report.PNG

create report.PNG

  

0 Kudos
Message 1 of 7
(622 Views)

I wonder if the system is running out of memory. 

 

Would  a for loop help simplify your code ? You are repeatedly executing the same function over and over , try build an array of data and use a for loop. I'm not sure if it will fix your issue, but it will make it more efficient. 

0 Kudos
Message 2 of 7
(617 Views)

A blurry truncated set of  pictures is not a snippet!

 

Can you define you definition of "low" and "increase": These words can have very different meaning to different people.

Excel has certain limits (number of rows/column, etc.). Are you exceeding those?

0 Kudos
Message 3 of 7
(616 Views)

Are you trying to write data into Excel while you are running your tests?

 

If so, neither Excel nor the Report Generation Toolkit is designed to be fast.  You should be storing all your data in a proper data structure (e.g.: Type-Def Clusters) during your data collection phase.  After the testing is complete, you can then analyze, review and generate reports without worrying about slowing down the whole process.

 

If not, we would need to see the actual code to determine what the bottleneck is...

 

NOTE:  You don't have an error indicator after Close Report, so you may not be seeing an informative error message.  Make sure you have auto error handling ON or add some indicators so you know where the problem occurs.  You can add probes on the error wires too.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 4 of 7
(598 Views)

Hi,

What you say is true. It is a .csv file that I use in my system. The data in this file is retrieved one by one using a for loop within the get data event structure. 

In Excel, not when the row size is around 100, but when it reaches around 2000, the Excel file does not save to the draft.xslx file in the photo, but remains open. If you enter from Excel's own page and click save file, the program continues. But I need to save this file in Labview, not Excel.
By the way, I did not receive any error messages in the error connections. This makes it difficult to find a solution.

Are there any other solutions that come to your mind in this section?

 

Also, with the command in the first photo, it gives .xslx output, but then there is an edit in the 2nd photo, it does not work under this condition, .xslx does not print. Do you have any comments for this?

print.PNG

sneep.PNG

 

0 Kudos
Message 5 of 7
(539 Views)

@Id94 wrote:

Do you have any comments for this?


You keep posting truncated blurry pictures full of disorganized spaghetti code, talk about xlsx and csv without telling us how they relate to your problem, even talk about a "get data event structure" without defining what  is.

 

Here's all you need to do (all attachments in one zip file, Vis saved for previous, 2020 or below):

 

  1. Attach your xlsx file
  2. Attach your csv file
  3. Attach a simplified version of your VI
  4. Explain how you interact with the running program, what errors you get, and what you expect to happen instead.

 

We cannot help based on the current sparse, ambiguous, and confusing information

0 Kudos
Message 6 of 7
(522 Views)

If you are using a .csv file, then using the Report Generation Toolkit is the slowest, most complicated way to save data to a Comma-Separated-Variable (.csv) file.  For many years now, LabVIEW has provided a "Write Delimited Spreadsheet" function that takes a 2D (or 1D) array of data and writes it in "modified CSV format", using the default extension of .csv (which Microsoft sneakily displays with an "Excel-resembling" icon), and separating the columns (by NI's default) with a horizontal tab (which Excel will also recognize, and which you can change to a comma, if you like).

 

The data types applicable to these functions are Strings, Dbls, and Integers, all of which are converted to and from Strings using a Format statement you provide.  If you don't need the Bells and Whistles of Excel and can tolerate its size and bulk, you might consider writing .csv files using the first two functions on the File I/O Palette.

 

Bob Schor

Message 7 of 7
(511 Views)