LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to overcome for loop memory limitations?

I have some csv files, they have a range of around 50k-100k rows and 15 columns. I needed to filter data specific to one of the columns and only show them results, however in my for loop I just get not enough memory notifications.. I had to resort back to filtering in excel and then saving the results into a separate file.... this is not ideal for my application.

Is there another way to do this in labview without a for loop?

I need something like this, if column 15 = 1 then show only the rows with that information into an array... I can then use that array for other means later on.

0 Kudos
Message 1 of 7
(332 Views)

Hi nolan,

 


@n1olan wrote:

Is there another way to do this in labview without a for loop?


Why get rid of the FOR loop? It's the best you can get!!!

 

Instead of reading the whole file at once you should read lines/rows in a FOR loop.

Use a conditional output tunnel to only output the lines/rows of interest!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(326 Views)

First of all, if you are cross-posting from reddit, you absolutely must include a link to the original discussion to avoid duplication of efforts.

 

A FOR loop is one of the most efficient tools in LabVIEW and it is not clear why you try to blame it for your error message.

 

If you can read the CSV file without memory problem it is hard to imagine that your FOR loop code that does the filtering will run out of memory unless you are doing it wrong. So keep the FOR loop, but improve your filtering code. Once you show us how you are doing it, we can offer improvements.

 

What is the datatype of the 2D array? is it DBL? String? I32?

What kind of filtering?

Message 3 of 7
(292 Views)

Since the name is different and the Reddit user have several posts there i assume this is a bot.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 7
(262 Views)

Hi,

 

before I answered I googled for the message text, but didn't found anything (especially no Reddit entry).

 

Usually I mark such messages/threads as crosspost and notify moderators because of "possible SPAM"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(230 Views)

Sometimes it will take a while until new reddit posts show up in searches, and this was only a few hours old. Still there was some obvious "post smell" here from the beginning... 😄

0 Kudos
Message 6 of 7
(222 Views)

@GerdW wrote:

Hi,

 

before I answered I googled for the message text, but didn't found anything (especially no Reddit entry).

 

Usually I mark such messages/threads as crosspost and notify moderators because of "possible SPAM"…


I usually just check the front page for that very reason.

Yamaeda_0-1758710189960.png

 

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

Qestit Systems
Certified-LabVIEW-Developer
Message 7 of 7
(169 Views)