11-12-2019 01:14 PM
Currently, when I have an action/test calling a .NET function that would use a class variable, I have to add an action step before that "gets" that variable and saves it to a TestStand variable then use that TestStand variable in the subsequent function call.
Is there a way to directly use a .NET class variable as a parameter to a function call without modifying the .NET library so that I could avoid this 2-step process?
Solved! Go to Solution.
11-13-2019 08:14 AM
Do you mean that you want to make a call into another .NET class and use the return result of that call as a parameter to a different call all in one step?
If so, the answer is no, you will need to store the result of the first call in an Object Reference variable at least and pass that into the second call.
If you meant is there a way to avoid converting the .NET type from the first call into a TestStand type and then back into a .NET type when passing it as an argument, then the answer is yes. You can store any .NET output or return value from a .NET call into a TestStand Object Reference variable. If you do that it's just stored there without any conversion to a TestStand type and you can then pass that object reference as an input to a subsequent call.
11-13-2019 08:21 AM
Kind of like that except the call into a .NET class is just getting a public variable not a function call. Although I think that ends up being the same as what you described as getting that public variable is seen as a "get()" function call in TestStand.
Thanks for the response.
11-14-2019 07:55 AM
That's correct. The TestStand expression language does not currently support accessing .NET properties on .NET objects directly.
11-14-2019 08:32 AM
Ok thanks for the response. Looks like I'll have to use a custom step type to simplify things.