LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Management for Large Arrays

The loop on the left is just to create a big array to write to file.

 

The main purpose is not to count time, but the file write operation without error / memory problems.

 

Do you see any reason why the "OT row-wise" option gives an error?

Vaibhav
0 Kudos
Message 31 of 41
(1,549 Views)

Vaibhav wrote:

Do you see any reason why the "OT row-wise" option gives an error?


You did not attach the newest file IO subVI (the one with the variant connector). I don't know what you mean by OT-row-wise.

0 Kudos
Message 32 of 41
(1,538 Views)

Oops, sorry about that.

 

 

Vaibhav
0 Kudos
Message 33 of 41
(1,532 Views)

@Vaibhav wrote:

Do you see any reason why the "OT row-wise" option gives an error?


What kind of error are you gettting? Why is the format strng blank?

 

(Of course I assume that you know whatever you are calling excel here has nothing to with excel, right? An .xls extension does not define a file format)

0 Kudos
Message 34 of 41
(1,510 Views)

@altenbach wrote:

What kind of error are you gettting? Why is the format strng blank?


The Format String input is in the "OT (Excel)" case, where it's left untouched because the default is %s and that's what I need.

The problamatic case "OT row-wise (Excel)" doesn't have any format string input.

Are you looking at that case? It's the case that incorporates suggestion by Yamaeda.  But somehow it doesn't work with this large array.

The error message is as below -

Screen Shot 10-02-14 at 01.27 PM.PNG

 

Again, I am coming back to that "GLV_StreamToDisk.vi" file. I mentioned already several times in this thread. I think that could be a useful way to write large array on disk.

 


altenbach wrote:

(Of course I assume that you know whatever you are calling excel here has nothing to with excel, right? An .xls extension does not define a file format)


Yes of course. I mention the word Excel just so that I know it will be written in a tabular form that can be viewed as a spreadsheet.

@BowenM wrote:

There is some additional reading here:   http://www.ni.com/white-paper/3625/en/

 

I don't really like that "GigaLabVIEW" llb, but it does have a few useful tools.


Have you used these tools for your purpose? I am particularly interested in how the technique used in "GLV_StreamToDisk.vi" can be used in my case (the program in the attachement).

Vaibhav
Download All
0 Kudos
Message 35 of 41
(1,480 Views)

Add an Open-constant in "Observation Table (Excel)" so you Open or Replace, if you want to overwrite old files.

(Blank format string = %s, lazy me) 😉

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 36 of 41
(1,469 Views)

@Yamaeda wrote:

Add an Open-constant in "Observation Table (Excel)" so you Open or Replace, if you want to overwrite old files.

(Blank format string = %s, lazy me) 😉

/Y


Again, I had ignored that input, assuming that the default was "create if not found" as in many cases. Ok, now selected "create or replace" and it works fine.

However, it takes a bit more than merging the two arrays column-wise and writing to spreadsheet file - case: "OT (Excel)".

Please check my latest version below.

 

Thanks!

 

(Edit: unlike the write spreadsheet file, this option doesn't ask for format string, so I don't have to mention it either, I am not sure what were you referring to).

Vaibhav
0 Kudos
Message 37 of 41
(1,456 Views)

Yamaeda wrote:

(Blank format string = %s, lazy me) 😉


Actually, this is not true. A blank format string could mean many things, for example if the input is a numeric array, it would default to a numeric format string (e.g. %d, or %f), not %s.

 

I have argued very long ago that the format input should NOT be a required input if leaving it a malformed input (empty string, for example ;)) does not cause it to malfunction in any way and in any conceivable scenario. If it is a required input, it should also requre a meaningful string. If the string does not matter, it should not break the VI if left unwired.

 

I still strongly believe it should not be a required input, but I was overruled back then.... 😞

Message 38 of 41
(1,440 Views)

@altenbach wrote:

I have argued very long ago that the format input should NOT be a required input if leaving it a malformed input (empty string, for example ;)) does not cause it to malfunction in any way and in any conceivable scenario. If it is a required input, it should also requre a meaningful string. If the string does not matter, it should not break the VI if left unwired.

 

I still strongly believe it should not be a required input, but I was overruled back then.... 😞


Since it "converts" the input to %s (in case of string data) if left untouched, it's already some format. So it's not blank anyways.

 

Although not related to my original question (but to my quest to adopt better programming practice nevertheless), Dr. Christian, if you have checked the last uploaded version of my program, I have removed the unnecessary code. Do you see anything to be done differently there?

I am not going to use this VI directly for my application, I will just pickup the changes made in SubVI. But I am always eager to learn better programming style as well as techniques.

 

Thanks.

 

 

Vaibhav
0 Kudos
Message 39 of 41
(1,429 Views)

@altenbach wrote:

Yamaeda wrote:

(Blank format string = %s, lazy me) 😉


Actually, this is not true. A blank format string could mean many things, for example if the input is a numeric array, it would default to a numeric format string (e.g. %d, or %f), not %s.

 


That might be, but blank, %s or %f gives the same output on a double array until you add specific format specifiers as %.2f. %d do as expected and writes the values as integers. So Blank is as close to empty/default as you get. 🙂

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 40 of 41
(1,402 Views)