LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Newbie to Application builder, creating a DLL

I've used Labview for about a year, and I'm now evaluating the Application Builder as a way to create DLL's that can be called by external programs.  The goal for my first test is to create a DLL from a VI which takes a file path as an input, and generates six different arrays of doubles for outputs. (It reads a text file and parses out joint values for a robot.)

I'm in the "Define VI Prototype Dialog Box", and I don't understand the options for the output arrays. Here is one default case (this is using the default C Calling Conventions):

Name: XValues
Param Type: Output
VI Output: X Values
Pass By: Array Data Pointer
Length Input: len6
Length Output: (none)

The "Pass By" setting 'Array Data Pointer' requires the last two parameters, Length Input and Length Output. I could understand that when passing an array as output, you may also want to know its length. But I don't understand why there are two parameters for length, one referenced as Input and the other as Output, and why the one which seems to "be used" is the one called Length Input when the Param Type is Output.

If I instead change the setting for the "Pass By" setting to 'Array Handle Pointer', the additional length parameter goes away. The function prototype now contains:

"TD1Hdl *XValues"
instead of
"double XValues[], ... int32_t len6, ..."

But I'm not sure what a type 'TD1HD1' is or where it is described in LabView documentation.

Any insight you can provide will be appreciated.
Thanks,
Dana
0 Kudos
Message 1 of 3
(2,592 Views)
Hi Dana,

Here is a link that contains some information about this. It appears that LabVIEW automatically adds the length parameter for input and output arrays. Output arrays can also pass the length output as a parameter. The parameter is just pointer to the size of the output array. Unless you are uing text based code, this is not required and can be set to none.

TD1HD1* is a pointer to a array structure that contains the array itself and an element holding the size of the array.

Hope this helps!
Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(2,552 Views)
Thanks for the additional information.

- Dana
0 Kudos
Message 3 of 3
(2,532 Views)