01-07-2015 02:44 AM
Can you suggest any function which works as afunction of Build Array instead of using diectly Build Array Function.
01-07-2015 02:46 AM
01-07-2015 04:45 AM
Usually by using Build Array Function,it takes much time for executing when element are more than 100,since it allocates memory dyanamically(i.e one by onebehind each other).SO,We have to avoid using Build Array when we are handling more elements in a Array.
01-07-2015 04:52 AM
If you know the expected (or maximum) size of the array then you can use the initialise array function to allocate the memory for the array in advance and then use the replace array subset function to fill the array. You will need to keep track of the index (so you know the size of the array) and the array in a shift register.
01-07-2015 04:54 AM
Good : Build Array, Insert into Array
Better : Auto-index
Best : Initialize Array + N x Replace Array Subset. (+ Resize Array, if needed)
Hope this helps 🙂
Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.
01-07-2015 06:30 AM
@ZentronLV wrote:
Usually by using Build Array Function,it takes much time for executing when element are more than 100,since it allocates memory dyanamically(i.e one by onebehind each other).SO,We have to avoid using Build Array when we are handling more elements in a Array.
If you are dynamically building your array, it doesn't really matter what you use. You will have the same problem.
But if you know the max size, initialize array and use Replace Array Subset is definately the way to go.
01-14-2015 04:19 PM
Yup as others have said. Preallocate, then use replace. I believe the conditional concatenating terminal out of a for and while loop, first had a normal build array being used behind the scene. Users in 2012 noticed this performance wasn't that great, and could code better conditional indexing functions, by pre-allocating. Since then NI has improved the performance and I suspect it uses the pre-allocate method.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
01-14-2015 05:13 PM
@ZentronLV wrote:
Usually by using Build Array Function,it takes much time for executing when element are more than 100,since it allocates memory dyanamically(i.e one by onebehind each other).SO,We have to avoid using Build Array when we are handling more elements in a Array.
You need to be much more specific what you are trying to do. Maybe show us some code.