06-07-2010 11:16 AM
Hi
I am creating a VI that initialises an array in a for loop. The array is used by a DLL and I am finding that the address of the array is different outside the loop. The attached example illustrates this. The GetAddress function simply displays the address of the array passed to it in a message box.
Does anyone know how I can ensure that the address is not changed?
Thanks
Robin
06-07-2010 11:21 AM
06-07-2010 12:48 PM
RobinM2 wrote:Does anyone know how I can ensure that the address is not changed?
![]()
06-08-2010 08:17 AM
Hi
Thanks for the replies.
I should have realised that it is the branch causing the data copy.
I have a DLL that assigns a set of data buffers using one function and populates them using another function. The assign buffer function is called once for each buffer and the populate function is called once only.
If I assign all of my buffers in a for loop, I get a 2D array by using an auto-indexed tunnel. However, when I call my populate function, the arrays remain unchanged. This appears to be because the location of the arrays has changed since the call to assign the buffer.
Does the auto-indexing tunnel move the locations of arrays so that they are contiguous? Is there a way to preserve the address that was allocated by the initialise array block and still combine them into a 2D array?
Thanks
Robin
06-08-2010 09:22 AM
RobinM2 wrote:I have a DLL that assigns a set of data buffers using one function and populates them using another function. The assign buffer function is called once for each buffer and the populate function is called once only.
If I assign all of my buffers in a for loop, I get a 2D array by using an auto-indexed tunnel. However, when I call my populate function, the arrays remain unchanged. This appears to be because the location of the arrays has changed since the call to assign the buffer.
Does the auto-indexing tunnel move the locations of arrays so that they are contiguous? Is there a way to preserve the address that was allocated by the initialise array block and still combine them into a 2D array?
06-08-2010 09:27 AM
altenbach wrote:
RobinM2 wrote:I have a DLL that assigns a set of data buffers using one function and populates them using another function. The assign buffer function is called once for each buffer and the populate function is called once only.
If I assign all of my buffers in a for loop, I get a 2D array by using an auto-indexed tunnel. However, when I call my populate function, the arrays remain unchanged. This appears to be because the location of the arrays has changed since the call to assign the buffer.
Does the auto-indexing tunnel move the locations of arrays so that they are contiguous? Is there a way to preserve the address that was allocated by the initialise array block and still combine them into a 2D array?
In LabVIEW, all arrays are contiguous in memory.I am sure your problem can be solved. Could you provide a bit more details or example code?
Wrapping the dll call in an Action Engine wrapper, I believe will met your req's.
The Shift Register will "hold" the data when the dll is not being called.
Ben