LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

E2V Camera SDK DLL, cluster configuration with the Moveblock function.

I'm working with an E2V camera SDK that provides a dll written in C.  I have nearly all functions working with the exception of one, the most important one that retrieves the image data.  The function provides a pointer to a structure which I can get and send to the Moveblock function.  I'm able to retrieve some of the data but I'm obviously doing something wrong.   

 

I have a pointer to a structure called tImageInfos. How would I use the LabVIEW Moveblock function to extract the data from this structure? I'm using 64-bit LabVIEW and I understand that size_t variables
are unsigned 64-bit integers. I'm not sure about the datatype to use for hBuffer Handle and pDatas pointer. I'm really trying to get the array data from the pDatas pointer but so far, most of the data I'm extracting doesn't make sense, although some data points do. It seems the data doesn't seem to be ordered the way its defined below.  Any help would be appreciated. The struct is defined below:

 

typedef struct
{
/*! Buffer handle which contains new data. */
BUFF_HANDLE hBuffer;

/* Pointer to the beginning of the image datas (including contextual datas if they are enabled) */
void * pDatas;

size_t iBufferSize;

size_t iImageSize;

size_t iOffsetX;

size_t iImageWidth;

size_t iImageHeight;

tImagePixelType eImagePixelType;

size_t iLinePitch;

unsigned short iHorizontalFlip;

unsigned long long iNbMissedTriggers;

unsigned long long iNbLineLost;

unsigned long long iNbImageAcquired;

} tImageInfos;

 

Thank you.  

0 Kudos
Message 1 of 2
(2,056 Views)

I can't tell you what to use for hBuffer since you do not show the declaration of BUFF_HANDLE and any intermediate datatypes it may use. HANDLE under Windows is a pointer sized variable, but BUFF_HANDLE is obviously a user defined datatype from the SDK itself, and while it is prudent for a programmer to use similar conventions than what the platform uses, there is no coding police that enforces that. And I have seen enough code to know that assuming such things is never a good idea.

 

For pDatas you obviously need to use a pointer sized (unsigned) integer (which for use in a cluster needs to be represented as 32-bit integer in LabVIEW 32-bit and 64-bit integer in LabVIEW 64-bit). And if BUFF_HANDLE doesn't resolve to a pointer sized variable, you should add padding to make the pDatas align to 64-bit. Also note that size_t under Windows is indeed 64-bit for 64-bit LabVIEW but 32-bit for 32-bit LabVIEW.

So if you should want to make this work for both 32-bit and 64-bit LabVIEW you would need to use the Conditional Compile Structure to create two different cluster prototypes and pass them to two seperately configured Call Library Nodes.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(2,031 Views)