LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pass dimension size of array handle to DLL

Solved!
Go to solution

Hello,

 

what is the correct way of passing Array handle dimensions, I found this document, that only describes the memory situation and some examples that suggest both following possibilities:

 

typedef struct {
        dimSizes[dimensions]
	ArrDatatype data[1];
} Array **ArrayHdl;

 

 or this one:

typedef struct {
	int32 dimSize1;
        .
        .
        .
        .
        int32 dimSizeX;
	ArrDatatype data[1];
} Array **ArrayHdl;

 

 

0 Kudos
Message 1 of 4
(2,646 Views)
Solution
Accepted by topic author Bublina

@Bublina wrote:

Hello,

 

what is the correct way of passing Array handle dimensions, I found this document, that only describes the memory situation and some examples that suggest both following possibilities:

 

typedef struct {
        dimSizes[dimensions]
	ArrDatatype data[1];
} Array **ArrayHdl;

 

 or this one:

typedef struct {
	int32 dimSize1;
        .
        .
        .
        .
        int32 dimSizeX;
	ArrDatatype data[1];
} Array **ArrayHdl;

 

 


They are equivalent, except that the int32 has been forgotten in the first one!

 

And a comma in the type declaration for both!

 

Personally I tend to use the second one, but never did more than 2D arrays. For multi-D arrays, the first may be interesting if you happen to loop through the array dimensions somehow.

 

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

Hi Bublina,

 

as rolfk 

Message 3 of 4
(2,593 Views)

Ok, thanks for reply. I use the second one, it makes the code more readable.

0 Kudos
Message 4 of 4
(2,572 Views)