LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a dll in LabVIEW with a 2D array

I'm attempting to create a dll in LabVIEW with the following parameters from Test DLL.vi:

 

Inputs:

IN1 - Word

Buffer - 2D array of Unsigned Byte

 

Output:

OUT1 - Unsigned Byte

 

The prototype is constructed as follows in the Build Specifications of the Project:

uint8_t TestDLL(int16_t IN1, TD1Hdl *Buffer)

 

The dll builds successfully but when I attempt to use it in another VI (using the Call Library Function block) the prototype appears but it does not look like what was defined from the Build Specifications.  Instead it looks like the following:

void TestDll(void );

 

 

I attached some screen shots of all the settings as described above.

 

0 Kudos
Message 1 of 6
(3,944 Views)

jfalcon:

 

That is strange. Is there a chance you could attach the VI for us to take a look at?

Caleb Harris

National Instruments | Mechanical Engineer | http://www.ni.com/support
0 Kudos
Message 2 of 6
(3,920 Views)

The Test DLL.vi is what I used to create dll prototype with in the Build Specifications in the project.

 

Note:  There is no logic implemented yet.

0 Kudos
Message 3 of 6
(3,894 Views)

jfalcon:

 

It looks like you haven't defined the parameters of the function on the "Parameters" tab. The function prototype down below reflects what we've entered in there. Since we haven't entered any parameters, it just lists "void" in the display. Once set up the inputs, outputs, and their respective datatypes, it should look a little closer to what you're expecting.

Caleb Harris

National Instruments | Mechanical Engineer | http://www.ni.com/support
0 Kudos
Message 4 of 6
(3,852 Views)

Should the parameters already be defined in the build specification for the actual dll?  By defining the parameters again this would overwrite what was created.

0 Kudos
Message 5 of 6
(3,834 Views)

 


@jfalcon wrote:

Should the parameters already be defined in the build specification for the actual dll?  By defining the parameters again this would overwrite what was created.


This is completely normal.  There's no way for LabVIEW to read the expected parameters from the DLL, so it defaults to an empty parameter list.  You need to define them to match your DLL, or use the DLL import tool which can read the header file to create a VI containing a call library node with the correct parameter list.

 

0 Kudos
Message 6 of 6
(3,819 Views)