LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem that Calling DLL with 2D array input in LabVIEW

Hello,
 
I have to call a DLL which a 2D character array as an input, the DLL can't be changed any more because some odd reason. How can I call this kind of DLL in LabView?
 
Any help shall be appreciated.
Thanks, Steven
 
 
0 Kudos
Message 1 of 4
(2,945 Views)

Hi Steven,

      Can you post the DLL function's prototype, or even some of the code? 

Cheers.

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 4
(2,922 Views)

Hello, Thanks for your reply.

 

The definition of one function(get the QTY of the loading box currently using and its ID)

Int  binResLists (char *ids[ID_LENGTH + 1], int maxNum)

output:         char *ids[ID_LENGTH + 1]          // a array used for store the ID read back.

Input:           int maxNum                                  //  specify the maxmum loading box.

how many loading box using will be returned after calling this function

Explaination about this function in the DLL spec as below:

" char ids[256] [ID_LENGTH + 1]  or  char ids[256] [9]       // Declaration.
  int resNum = binResLists ( ids, 256);                         // Allowed maxmum loading box is 256,resNum is the number of loading box."

I don't know how to allocate the memory for the 2d array in LabVEIW. the DLL in attachment but no any code cos i have not get started till now.

Thank you again.

Steven

 

.

 

0 Kudos
Message 3 of 4
(2,916 Views)

Hi Steven,

      The attached VI shows how to pre-allocate the table-memory in LabVIEW.  Unless you know the "Calling convention" you'll have to experiment.  Also, maxLoadingBox (int) INPUT might be 16bits instead of 32bits.

Don't feel bad if you crash a few times before solving the details. Smiley Wink

Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 4 of 4
(2,893 Views)