08-25-2011 05:04 PM
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.
08-25-2011 05:13 PM
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
08-25-2011 08:48 PM
Initialize your array to a preset number of elements before use. This one inits 5 elements to 0 using the Init Array function.
10-12-2011 04:09 PM
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
10-12-2011 04:46 PM
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.
10-13-2011 06:57 PM
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.
10-14-2011 12:52 AM
Easy fix: Buy Excel 2007 which has more thant 1000000 rows
Is that the best way? Probably not..
10-14-2011 08:02 AM
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