Passing String Parameter Without Length from LabVIEW DLL to TestStand

Updated May 6, 2023

Environment

Software

  • LabVIEW
  • TestStand

I want to pass a LabVIEW DLL to TestStand with a string parameter.
When creating the DLL with string parameter, a length parameter is added automatically for the String Out.
 

Can I remove the length parameter and how would I configure the data types in TestStand?

Please follow the steps below for both LabVIEW and TestStand parts:
 

LabVIEW

  1. Create the VI you want to use as a source file for your DLL. You can refer to the link below for more details: Generate a DLL from a LabVIEW Project
  2. Choose String Handle Pointer in the Pass By Parameter for String In and String Out

 
3. Build the DLL
 

TestStand

1. Create a new Sequence File
2. Create a new String as a Custom Data Type for your Sequence File
 

3. Edit the Properties of the custom string:
  • Rename the string, LV_String for example
  • In the C Struct Passing tab, check the box Allow Objects of this Type to be Passed as Structs
  • Choose LabVIEW String for the Type

4. Return back to the Sequence File and create two local variables with the LV_String type, one for the String In and the second for the String Out
5. Create an Action Step
6. Add the DLL in the Module, choose the Function and choose None for the Code Template
7. Add manually two parameters, one for the string In and the second for the String Out
8. Set the properties for both strings as below:
  • Category: C Struct
  • Type: the name you chose for the custom data type
  • Pass: By Pointer (*)

Additional Information

In my example, I chose to work with one String as an Input and another one as an Output. But you can do the exact same operations if you have more than two strings in your DLL.