Jump to content

[CR] MemBlock


Recommended Posts

I had a situation where I needed something like this, however, I found a good G code solution. I had a dll call that would spawn a new thread, and return immediately. The spawned process would continuously put data into an array that was provided to the dll by LV. The problem was that LV would de-allocate/reallocate the array memory space after the subVI calling the dll completed. This of course causes memory corruption problems. The solution was to use an uninitialized shifter for the array, prefilled to the desired array size. This allows the memory space to remain open, and no corruption errors.

Link to comment
  • 2 weeks later...

I had a situation where I needed something like this, however, I found a good G code solution. I had a dll call that would spawn a new thread, and return immediately. The spawned process would continuously put data into an array that was provided to the dll by LV. The problem was that LV would de-allocate/reallocate the array memory space after the subVI calling the dll completed. This of course causes memory corruption problems. The solution was to use an uninitialized shifter for the array, prefilled to the desired array size. This allows the memory space to remain open, and no corruption errors.

To make things clear - These functions ARE pure G code. Although they use Call External Function Node, as library path they use "LabVIEW" keyword - so they should work regardless of operating system. Of course there is question of "pureness" definition...

Link to comment
  • 4 weeks later...

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

×
×
  • Create New...

Important Information

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