Search code examples
c#wpfteststand

TestStand APIs with C#


I am working in a Project where I have to use the TestStand APIs in a C# (WPF). I have not worked in this area before and I am not able to find any references or materials regarding it.

I want to get 2 inputs from user say x and y using a C# UI. Now I have to send these x and y values to TestStand where I have a Function member of the same class which will get these inputs and add both. My need is that as soon as I enter the x and y value in the UI and press some button ("Save Changes") the values should be populated in the parameters of the function that is called. The whole thing is a custom step.

Any idea is appreciated. I feel very thankful if you suggest some materials for my reference. Thanks in advance.


Solution

  • It is not completely clear that your C# UI is launched from an Edit Substep. However, assuming that you are writing a C# UI to be launched from an Edit Substep in your Custom Step Type, you can pass the SequenceContext (ThisContext) to your C# UI as a reference that will provide the correct context to the Parameters PropertyObject in a given Sequence. Once the button on your UI is pressed, you would be able to use the TestStand PropertyObject API to SetVal(Type) (where 'Type' is the Data Type of the Parameter you are setting i.e. Number, String, etc.) of a given lookupstring variable in the Parameters of your Sequence.

    If you provide more detail as to where the x and y values will be placed upon button click, I can give you a more detailed approach.

    For online documentation of TestStand API Concepts, here is the TestStand API Reference Help

    For a diagram of the entire TestStand API, I suggest you have a look at the TestStand API Reference Poster