NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL adapter doesn't support other return values but int and boolean

Hello,

I'd like to use an existing software function in Teststand code module. The prototype looks like
this:

char* doSomething(int blah)

Teststand doesn't seem to support return types else but "void" or "int" or "int*".
Is there a way to return a string to TS?
I mean another way than wrapping the function in another one.

I there a chance that TS will support more ANSI-C types (also with pointers) in the future?
0 Kudos
Message 1 of 2
(3,030 Views)
Thomas -
You are correct that the CVI and DLL adapters only support numeric return values. The primary reason is that most functions that have string return values typically return allocated memory. TestStand has no way to know how or when to release that allocated memory. If we did support this return type ignoring this issue, every time that a step calls the function the step will leak memory. The only option around this limitation is to create a DLL with functions that wrap the function that returns a string and return them in a buffer parameter. Does your function return allocated memory that the caller is expected to release?
Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 2
(3,018 Views)