11-18-2013 05:23 AM
Hello,
i have these problems....
i have to handle some datas and now i use array subset and concatenate strings...
i do this operation many many times...and i receive many memory warnings and errors (also for other reasons ofc - but now i would start emproving this part only)
in which way can i avoid these 2 functions?
PS: i use LV 7.1 - in attachment 1 exaple:)
11-18-2013 05:34 AM
I would guess the problem lies elsewhere. It's easy to create alot of data copies when doing such operations, which might fill up memory.
/Y
11-18-2013 05:57 AM
This example doesn't say too much... Can you upload more complete code or at least describe in detail what you're trying to do?
Do the error messages are about memory only or there's something else?
11-18-2013 06:32 AM
this is my last post...as you can see i have many problems 🙂 but i can't show you the entire code and i'm not a good labview developer....so i would start changing the simplest things 😄
so replace array subset and concatenate strings...if possible 😄
11-18-2013 07:20 AM
I already read that thread. If you are building string arrays there's not much you can do to help, unless all lines are fixed-length.
The keypoint is: what you need to to with these arrays?
Are you sure you cannot read the text file in chunks?
I see in the example you are adding string constants as array elements: are you doing this for every line in the file?
11-18-2013 07:55 AM
all lines are fixed-lenght yeah, but i don't know how many lines are present.
well, i have to read my file, read the hex code in a particular column and examinating these codes i have to write the name of codes, give to user some datas, etc.
and i have to do this control for almost every line (for tx i have to check some value, for rx frames i have to do other things)
my problems are:
1 - i can't use labview as a pro 🙂
2 - my boss told me to use his program changing some subVI only
but he want that it works also for huge files...and his program can't do this 😞
i'd like to solve all problems, also handling his part of code...but in this moment i don't know in what way read-save-manipulate my data in chunks 🙂
i'm reading many documents in internet but it's difficult understand in what way i have to develop my program
11-18-2013 09:08 AM
From the micro piece of code you published I can only suggest to replace Array subset that extract single element arrays with a simpler Index Array.
Furthermore, all that strings constants added to the array (like Seed Data) may probably be added in a later stage, when formatting strings, although I can't suggest how to do it without looking at the code.
11-19-2013 01:48 AM
From the micro piece of code you published I can only suggest to replace Array subset that extract single element arrays with a simpler Index Array.
but if i need a subarray of 4 elements is better array subset or use index array and build a new array with 4 elements?
11-19-2013 02:13 AM
If you need a subarray, stick with Array Subset.
11-19-2013 06:23 AM
As pincpanter said Array Subset is the best choice when you need an array as output. For single element selections use Index Array.
There is a lot of information available on handling large datasets and it should be relevant for your large file problem. Search for a whitepaper on managing large datasets. In some versions of LV much of that information is in the Help but I am not sure about 7.1.
The keys with arrays and strings are to be very careful about any operations which change the size or length. Both datatypes must have all the elements stored in contiguous memory locations, so size changes often lead to memory re-allocations. Growing strings and arrays can leave memory so fragmented that no sufficiently large block of memory is available, creating errors or crashes.
Lynn