08-28-2013 08:00 AM
Hello,
I'm trying to call a variables arguments function coded in C from teststand and I have no idea how to do that.
The function can be called in C as follow:
SetParameters(ID,Data,null);
SetParameters(ID1,Data1,ID2,Data2,ID3,Data3,null);
...
Thank you for your response
08-28-2013 08:06 AM
The term for the function you describe is "overloaded".
You can call overloaded functions from TestStand, but you have to populate the parameters from the calling step manually (yellow mark):
Configure each parameter appropiatly
.
Norbert
08-29-2013 03:06 AM
Hello Norbert,
Thank you for your response
My function is not overloaded.
This is the same function which can be call with a various number of argument. It is few as the main function in a C programs you can have various argument.
i have just one function prototypes
int SetParameters(Data, ...)
{
}
And the call can be as follow
SetParameters(Data1)
SetParameters(Data1,Data1)
SetParameters(Data1,Data2,Data3)
SetParameters(Data1,Data2,Data3,Data4)
SetParameters(Data1,Data2,Data3,Data4,Data5)
SetParameters(Data1,Data2,Data3,Data4,Data5,Data6)
....
08-29-2013 03:16 AM
Ah, so you refer to variadic functions.
I never worked with those as exportet functions from a DLL. But if the compiler is capable of exporting such a function in your custom DLL, it should be possible to call the function exactly as i already stated.
Have you tried it?
Norbert
08-29-2013 05:43 AM
Hi,
Just to be sure what your DLL is really exporting
there is tool called "Dependency Walker"
You can download it at http://dependencywalker.com/ .
With it you can look "inside" your dll
If you will see your functions there, you will see them (in my case !!always!!) in TestStand, too.
Regards
Juergen
08-29-2013 06:39 AM
Good point, Juergen. I assumed that the TestStand step provides the function in the drop down of selectables functions.
If that is not the case, my remarks are of course of not much use...
If it appears, i would expect it not to populate any parameters (telling something like "This function does not have parameter information in the DLL or uses types not recognized by TestStand").
Norbert