I want to use LabVIEW’s Call Library Function Node to access a DLL function, and have this function return a string to displayed on my VI. How would I go about doing this? I am quite happy returning numbers from my DLL, but am really struggling to find any examples of how to return a string.
Share
I assume from your question that you already have a DLL that can return numbers to Labview. To return a string from the DLL, I have created a DLL with the following C++ function
In Labview I then use the Call Library Function Node and configure it as follows
After connect the arg1 output in the block diagram to a string indicator and run. The string ‘test string’ should appear in the front panel.
I tried to have the returnString function be of type CStr as in
but I got build errors when compiling the DLL project.
Update
Thanks to @bk1e comment don’t forget to pre-allocate space in Labview for the string.