LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

passing a pointer to an array causes my VI to crash

Hi guys,
I am in phase of learning LV. I am trying to call the following method in a DLL written in C++.

int PimReturnStillFrame(HANDLE hImager, LPVOID pBuffer, float exposureTime);

the second param is a pointer to the array receiving the raw data of the frame from a Camera.

I tried using a constant array, it didn't work for me.
Then I tried uaing the "Initialise Array" method in LV; however my vi crashes each time I run it. I thoght that the size of the array is small comparing to the data, so I tried increasing the size but it didn't work as well

how can I pass an array pointer to this method in which the raw data can be stored?

Any help would be appretiated
Many thanks
(if u want I can post the vi
)
0 Kudos
Message 1 of 4
(2,655 Views)
The memory layout of a LabVIEW array is different than the standard C-style array. Read "Using External Code in LabVIEW" (search in help) and look through some of the examples.
0 Kudos
Message 2 of 4
(2,655 Views)
Hi again,
I've tried reading that bit of the help, but it didn't solve my problem. The thing that I couldn't get is that in the method declaration the pBuffer parameter is of type LPVOID which is a PU8 (pointer to unsigned 8 bit integer). How can I specify this value? I have tried using array and constants (U8 values) it didn't work ....
can you plz help me
Thanks
0 Kudos
Message 3 of 4
(2,655 Views)
If you are pointing to a single unsigned byte (i.e. not an array), pass it by "Pointer To Value" with the Data Type as "Unsigned 8-bit Integer."
0 Kudos
Message 4 of 4
(2,655 Views)