LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW call function library 1D array of string

Solved!
Go to solution

Help~!! 

 

Hello LabVIEW developers and experts~~~

 

I want to do below.

1. there is a vi including 1D String of array control and indicator.

LV_DLL_01.png  LV_DLL_02.png

2. made this vi to dll with Build Specification-Shared Library(DLL).

 LV_DLL_03.png

 function definition in header file is below.

   --> void __cdecl Dbl1d_array(LStrHandleArray *inStr1d, LStrHandleArray *outStr1d);

 

and definition of LStrHandleArray is

 

typedef struct { int32_t dimSize; 

                        LStrHandle String[1];
} LStrHandleArrayBase;
typedef LStrHandleArrayBase **LStrHandleArray;

 

3. want to use this dll in new vi.

  • call library function - configure.. -select dll file created above and function name parameter :

 LV_DLL_04.png     LV_DLL_07_01.png

--> parameter tab

LV_DLL_05_01.png  LV_DLL_06_01.png

 

??? What type and format should I select for LStrHandleArray *inStr1d in the header file of dll???

 

Help~!!

 

Thanks.

 

 

 

0 Kudos
Message 1 of 4
(3,562 Views)

Try "Adapt to Type" with the Format set to "Array Data Pointer." One way to find out if the types match is to set up the Call Library Function Node (CLFN), wire all the inputs, then right-click the CLFN and choose "Create C File." Look at that C file and see if the parameter types match the prototype of the function you want to call, in the header file.

0 Kudos
Message 2 of 4
(3,537 Views)
Solution
Accepted by topic author nara

The parameters are Arrays of LabVIEW strings. So you simply create such an element on the diagram, wire it to the according parameter configured as Adapt to Type. But don't use Array data 

pointer but rather Pointer to Array Handle. 

Rolf Kalbermatter
My Blog
Message 3 of 4
(3,527 Views)

Dear Rolf Kalbermatter,

Thank you for your exact answer.

Adapt to Type and Pointers to Handles.

It was very helpful to solve my worries your answer.

0 Kudos
Message 4 of 4
(3,484 Views)