Jump to content

Accessing elements in a large array without manipulating all the array


tomasl

Recommended Posts

Hi,

I have a large 2D array of strings (let's say 2x1000000). When i need to access only a few elements of the array it takes quite a lot of time. Is there anything to access those elements directly without manipulating all the array? (something like pointers in C++).

Thank You very much.

T.

Link to comment

Try the In Place Element Structure to modify a single element of an array efficient. Array Subset and Replace Array Subset can also be efficient when used correctly.

An array of strings in LabVIEW is basically an array of pointers to strings; since strings are not fixed-size they cannot be stored in the array itself and so the array stores pointers to strings instead. String manipulation is often slow because the string may need to be reallocated as it grows.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By noplo
      Hello all,
      I have the following problem. I'm using an external DLL in LabVIEW and one of the functions require a structure as an input parameter.
      Here's the structure:
      struct Pippo {
      DWORD ipAddress;
      DWORD centerFrequency;
      Pluto* array
      };
      struct Pluto {
      DWORD size
      DWORD address
      }
      The function prototype is the following:
      myfunction( Pippo input )
      I've used the Import Library Wizard from LabVIEW and it extract every field from the structures. So what I get as the function inputs is:
      ipAddress,centerFrequency,size,address.
      So basically the array is not treated and I get the 1097 error:
      LabVIEW: An exception occurred within the external code called by a Call Library Function Node. The exception might have corrupted the LabVIEW memory. Save any work to a new location and restart LabVIEW.
      I've read other threads from this forum and I tried to create the Pluto array of clusters but still the same error.
      How can I run the function correctly with these parameters?
      Thanks,
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.