LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting data from array pointer

I am passing an array pointer to a void dll function that sets the values of the array, and the data is to be retrieved be referencing the pointer. How do I accomplish this in LabVIEW? Thanks.
0 Kudos
Message 1 of 3
(2,733 Views)
Maybe I wasn't clear enough. I am using a Call library function node to connect to the dll. My function prototype looks like this: 'void SetOutput(long image, double *data);'. The function sets the array values at *data. Once it does this, I need to then get the data from that address in LabVIEW.
0 Kudos
Message 2 of 3
(2,723 Views)
A few important points in doing this:
1. You'll need to configure the Call Library Function (CLF) to pass the array using "Array Data Pointer" format.
2. I'm assuming that the DLL expects that the memory at data has been allocated by the caller. If that's the case, you should create a constant array of doubles on the LV block diagram, whose size is sufficient that the DLL will not write past the end of the array, and pass that array into the left hand side of the CLF. Otherwise you'll crash.

Steven H.
0 Kudos
Message 3 of 3
(2,712 Views)