I assume from your question that you already have a DLL that can return numbers in Labview. To return a string from a DLL, I created a DLL with the following C ++ function
void returnString(char myString[]) { const char *aString = "test string"; memcpy(myString, aString, 12); }
In Labview, I then use the Node Call Library function and configure it as follows
Library Name or Path: c: \ path \ to \ my \ custom.dll
Function Name: returnString
Calling Convention: C
Parameters:
Parameter: return type
type: void
Parameter: arg1
type: String
string format: C String Pointer
Function prototype:
void returnString (CStr arg1);
After connecting the output arg1 on the block diagram to the line and start indicator. The line "test line" should appear on the front panel.
I tried to use a returnString function of type CStr, as in
CStr returnString() { ... }
but I got build errors when compiling a dll project.
Refresh
Thanks to the comment @ bk1e do not forget to pre-allocate space in Labview for the line.
source share