From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Memory Allocation

Hey,

 

Is it possible to allocate predefined RAM Memory and accumulate data's into it?

 

Before going in to detail – I am currently looking to write the inspection results in database for statistical analysis. I hope it will always consume some time to write it in database for each component / iteration. So decided to accumulate all the data in memory and write it at one shot.

 

In detail, user has to inputs the memory size via front panel control. Let us assume for writing 1 row of string information occupies “XX” bytes. (Not yet sure how to calculate memory size of 1D string array of 10 elements (max of 20 character in each string)). Dividing the user input memory size with 1 row of memory size will give how many rows we can write at maximum say “N”.
Use the for loop with “N” iteration and accumulates the 1D info to 2D array of information (auto indexing) and write it in Database at one shot.

 

Any help or direction may helps a lot. 

 

Waiting for the reply Smiley Happy

---
Silver_Shaper | CLD
0 Kudos
Message 1 of 6
(2,781 Views)

Hi,

 

Any replies on the previous post..

---
Silver_Shaper | CLD
0 Kudos
Message 2 of 6
(2,733 Views)

 As far I know LabVIEW internally handles the memory allocation and we don't have any option to allocate it. There might be a way by using a windows dll but no direct function atleast.

As you said you are going to use the for loop, in this case LabVIEW pre-allocates the memory depending on the data type and you don't have to worry about that. For details about the memory according to the data type you can check this link.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 6
(2,729 Views)

Are you talking about pre-allocating for an array?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(2,719 Views)

As mentioned, generally you dont have to manage memory in this way, but it sounds like what you really want is a simple Initialize 2D-array with some fixed string.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 6
(2,701 Views)

Let see what you have.

 

Your discrption leaves me curios.


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 6
(2,672 Views)