LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP: Converting a LabView String Array to a C string

I created a LabView dll (8.0.1) and i am trying to use it in C.  However i am finding it very difficult to convert a Labview array of strings to C.  All the information i have found so far is very unclear.
 
Could someone please explain how this might be done
 
Thanks
0 Kudos
Message 1 of 3
(2,807 Views)
When you build a dll from your VI, and define a string control as an input or output for a function of the dll, you can choose if you want to pass the string in labview format (String handle Pointer) or in C format (C String Pointer) in the "Pass by" Drop-Down field.
0 Kudos
Message 2 of 3
(2,793 Views)


@Andre_Saller wrote:
When you build a dll from your VI, and define a string control as an input or output for a function of the dll, you can choose if you want to pass the string in labview format (String handle Pointer) or in C format (C String Pointer) in the "Pass by" Drop-Down field.

Nice idea but this fails for arrays of strings ;-). There isn't a simple way to do that both from a C point of view and of course from within LabVIEW since arrays of arrays in C are at least tricky and easily done wrong. Basically you do not want to pass complex datatypes (arrays and clusters) containing arrays (this includes strings) as DLL parameter in order to make that DLL compatible with other environments than standard C. Such DLLs definitely will get you into big trouble if you want to use the more Visual oriented development environments like LabVIEW, Visual Basic, Delphi and similar ones.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(2,774 Views)