NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Call variables arguments function from teststand

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

0 Kudos
Message 1 of 6
(3,993 Views)

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):

AddNewParams.PNG

Configure each parameter appropiatly
.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 6
(3,992 Views)

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)

....

 

 

0 Kudos
Message 3 of 6
(3,979 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(3,975 Views)

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

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 5 of 6
(3,966 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 6 of 6
(3,961 Views)