I am developing OpenTAP plugins for a few months i realized that there is no variable screen that operator can create variables. It is actually the same feature as the one in the NI TestStand.
I didn’t spend too much time for testing instruments so i want to know if there is a way of achieving that in Keysight’s PathWave Test Editor. Basically what the feature will do is creating a variables screen in which the user can create variables and assign test step output values to them or providing these variables as inputs to test steps. I know that there are Input&Output classes and how to assing them but but they are not very useful in every case since we can’t select the type or format of the variable. For example, an open relay test step gets the relay number as an input and i want to use a repeat step to open all the relays. Repeat iteration is in the format “x of y” which is a string and i cant use it as an input to relay number.
If there is a feature like that can you give an example for that? Or if there isn’t a feature like that i would want to develop that feature.
There is a concept called ‘parameters’ which I think solves you problem in a bit different way. A parameter is a setting that is promoted to a parent step or the test plan and can be shared among multiple test steps.
This is described in the Developer Guide.
I was using parameters for inputs but when i want to change a parameter’s value while test plan is running inside a test step, it is not being updated.
I parametrized a setting of the test step, lets say it is named as MyOutput, and i wanted to use this MyOutput in another test step. So, i parametrized that test step’s input to MyOutput. However, value of the parameter is only updated where it is parametrized, second test step can’t take that updated value as an input.
Do you have any idea how i can solve this problem?
Ah OK, I think I understand. Parameters are a one-way binding and are not intended to be used as input/outputs.
If you mark a property with
[Output] in your C# code, you can make a binding between that and another property.
Did you try this already?
I did try [Output] attribute, it works but i want something with more functionality. It is really cumbersome this way when there are 100+ test steps. What i want is actually similar to the topic mentioned in here: How to use scripts.
I think it would be really nice to have a functionality like a Variables window like the one in the NI TestStand. User will add variables here and to use them in the test step settings, user will just print the variables name.
NI TestStand’s variable window:
Why do you find it cumbersome? You should be able to multi select the steps and assign them all at once. Unless of course you need 100 outputs assigned to 100 different inputs.
Note, you dont need to use the Input<> class, any e.g double-type output can be assigned to a double-type input.
Well actually, it is not that i have seen much test automation. but what i want to achieve is preventing the test operators to change the plugin code. They might need an input&output relation in the test plan but they are not experienced c# programmers. So, it is impractical for them to just go inside the code and change what they need.
I will prepare plugins for our test operators and they will be just using them in the editor without going inside the code. If there would be a feature like that, i think it would be nice for anyone who wants to just create test plans without developing plugins.
No programming required. Here I made a short GIF trying to explain what you can do with outputs. Note, the trick is that an output can be assigned to any input of the same type:
This is a nice feature it will be useful and it solves our problem for now. But here is a small issue, only same type of variables can be used as input&output. I may want a little bit more generic input&output connection. Is there a way i can achieve that? In your gif, calculation is performed using same variables right? So should i implement different plugins for each numeric type? (“Double Calc”, “Int Calc”, each are different test steps)
That is a limitation of the current system. Doing any conversion of numbers would require a way to specify how to do that conversion. e.g for float to int, do you want to floor, ceil or round. same goes for anything to string.
So currently that requires adding a step that does the conversion, but something better would be good. We just don’t know how yet.
I see, thank you very much. I will be alerting you if i can think of a way to achieve that.