LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to continue recording on a new excel sheet?

Solved!
Go to solution

Perhaps the out of memory error can be traced back to that array you're building with 65500 Double precision numbers.  This array would require a contiguous 262MB of RAM.  It could be possible that after a while, this amount of contiguous RAM is no longer available.  It might be worth trying to pre-allocate this 65500-element array, and then inserting numbers into the correct indices.  This way you would not have to allocate this space every time you need this data.  Other advice for alleviating this error can be found in this article.  Hopefully one of these steps allows you to run smoothly.

0 Kudos
Message 21 of 28
(810 Views)

How can I pre-allocate the array? I've been trying to understand how to do that, but the examples and information that I've read so far haven't helped me much. I recently just added the Request Deallocation function to see if it helps, but I'm not sure that this is what I need to get a better result. 

 

Jose

0 Kudos
Message 22 of 28
(808 Views)

Initialize your array to a preset number of elements before use.  This one inits 5 elements to 0 using the Init Array function.

 

Init array.png

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 23 of 28
(802 Views)

Hello, 

 

I've managed to complete a VI that records data to excel and displays the measurements at the same time. Now that I completed that code, I was asked to merge it to an old VI. Since this old VI has a record to excel command, I just needed to add the new variables. However, the way that this code was designed is very different from what I did. I know that by stretching the input arrays I'm able to get the new variables into that VI. My questions are more on how do I add them to the excel spreadsheet that the old VI is creating. 

 

I've attached the old VI to see if anyone can help me understand how to add the new variables. I know that I have to change what is established in String 1 and String 2 (see attachment), but I don't know how it works. Before, I copied and pased some lines in String 1 and String 2 and added one of the new variables. I did see the title and subtitle for that new variable, but I could not see the value of the new variable only a black space.

 

Thank you all for all the help, I hope I can complete the program once and for all. 

 

 

Jose

0 Kudos
Message 24 of 28
(778 Views)

Depending on your data, much the same way the author does here using the Format Into String array function.  Don't forget to specify the format identifer.  That said, I would hope you are doing things differently than what you've posted.  What a rat's nest!  This code could have been done much more efficiently and cleaner with the use of a For loop.  But, if this crappy design is working, don't fix it, unless you just want something to do.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 25 of 28
(774 Views)

Your previous code used the report generation toolkit, where this "old code" utilizes Write to Binary File.  To fit your code into the old code, you could probably hook your variables up to that long "format to string" function, adding the correct format strings.  You would also need to add the correct header names into that long list as well.

0 Kudos
Message 26 of 28
(763 Views)

Easy fix: Buy Excel 2007 which has more thant 1000000 rowsSmiley Wink

 

Is that the best way? Probably not.. 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 27 of 28
(757 Views)

Got it!!

I added the new variables to the old code. The problem was that I had a Typo in the Format String, but I fixed it and it's working now.

 

THANK YOU ALL!!

 

Jose

0 Kudos
Message 28 of 28
(752 Views)