NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL-Action: How to return text

Hello,
i´m using TS3.1 and inserted a DLL-action. Works good, but how can i return a value from a function?
Not the normal returnvalue but a pointer to a string?
The function is for example result = func(char *parA, char *parB)
and now parB is overwritten in the function, how can i read this in teststand?
I set the value-expression in the "edit dll-call" to a global-string-variable, but nothing comes back.
Thanks for your help

0 Kudos
Message 1 of 4
(3,500 Views)

I would recommend to use the steptype "Test-->String Value Test". Make a right-click on the step,. and select "Specify Module..", enter a Name for a function, then change to the "Source Code" tab, and click "Create Code..." This will create a C-File for you, adn adjust the settings in the TestSTand-Type, sdo that a string-parameter can be passed to the function, and back again. This sample you can take as a starting point to see, how strings can be passed to and from teststand.

 

Hope this helps!

 

André

 

0 Kudos
Message 2 of 4
(3,483 Views)
0 Kudos
Message 3 of 4
(3,469 Views)

Hi,

I am using TestStand 4.0 and created an action. In the action I am calliing a .NET C# code module. I wanted to create a function using create code tab in the specify module dialog box. But, when I have chosen the create code option I got the error which I send in the attachment.

I was able to successfully use the create code option in TestStand 3.5. Is it something related with TestStand 4.0? I will be glad if someone can help me.

Thank you ...

0 Kudos
Message 4 of 4
(3,230 Views)