LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Array Pointers with In Place Elements

Just trying to brainstorm a more clever way of handling a common task that we find on our code.  We use a lot of custom DLL's to implement some optimized functions.  There are several times where we have a large array of data but only need to pass into the function a subset of the array at a certain offset into the array.  This is currently handled using an array subset function and passing that data as an array data pointer into the function.

 

I was just thinking about the In Place Element and wondering if it would make this task much more efficient.  My thought is that with the In Place element I could index the array element that represents my offset.  Then pass the address of this element into my DLL function.  This would only work if the address of the element matches its address in the array.  Hopefully the attached image describes what I'm trying to explain.

 

My guess from reading the help is that the In Place Element only ensures that the entire array is not copied but does not mean that the element indexed is not a temporary allocation.  Anyone know if this is true?

 

My other option is to re-write my DLL functions to accept an offset but this affects all the other programs that call these functions and are not written in LabVIEW.

 

Thanks,

Andy

Systems Engineering - National Instruments
Message 1 of 3
(3,006 Views)
Yes a nice way.Thanx for sharing it andy
0 Kudos
Message 2 of 3
(2,983 Views)
If you have LabVIEW Full Development System or higher, you can select Tools»Profile»Show Buffer Allocations to identify specific areas on the block diagram where LabVIEW allocates memory.  This might help you along.  I'm not sure if the DLL has access to LabVIEW's code space, or if the offset is an address within the array when used with In Place Element, but there's no harm in trying.
0 Kudos
Message 3 of 3
(2,950 Views)