05-05-2017 04:45 AM - edited 05-05-2017 05:10 AM
Hello,
i have a custom c# function that i execute as teststep.
Here i already added the TestStand-API as reference to my C# project which appears as "TS".
Now I want to write data from the executing c# function into the teststep properties.
As it is a custom teststep i added a property called MyString.
How can i write data into this property?
I know how to do this with a normal function output parameter but i want to do it with ActiveX.
I am already passing the SequenceContext into the C#-function.
I tried things like:
seqContext.Step.MyString ="test";
but the syntax is not correct...
Thanks for help
05-05-2017 05:51 AM
It is highly recommended to pass data between TS and code modules by using parameters.
What are the reasons why that does not work for you?
Also note that you would not use ActiveX in .NET to pass data to TS (dataspace). You would simply use the .NET API from TS to get/set values inside the TS dataspace.
Please post the code with what you have done so far.
05-05-2017 06:12 AM
I am using a Supstep in the teststep of Type "Edit" which is a appearing popup where i can set a string.
The popup can be shown when right-cklicking the teststep and selecting "modify".
This stringhas to be stored in a property after closing the popup.
The real teststep function is then using this property as input parameter.
So far i am only passing the SequenceContext in the function.
Now the question is how to get access to the property of the step?
thx
05-05-2017 06:39 AM
You should use parameters for every type of code module, including substep modules.
The important feature of EDIT substeps is to implement "cancel" functionality keeping step variables as-is. Therefore, you will always pass all necessary step variables TO the module and BACK again. In case of "OK" you pass the modified values, in case of "CANCEL" you pass the originally passed values while discarding potential changes inside the edit dialog code.
05-05-2017 06:49 AM
You are right.
Otherwise i have to save the original values in a temp variable that restores the values when canceling.
How would i use the API?
05-05-2017 07:15 AM
Your problem about the SequenceContext as parameter is that the Edit substep is NOT running during execution. That means that SequenceContext makes no real sense here.
If you refer only to step variables (recommended) you should pass the step reference. Handle it as PropertyObject and use standard set/get methods with the appropriate lookup strings.....
05-05-2017 07:32 AM
Yes, the Edit substep is only used for a comfortable way to modify the parameters. The testplan is not running while a Edit popup is opened.
Can you give me some help how to pass a Step reference?
Thanks
05-05-2017 08:00 AM
Configure the parameter as type step (reference) and pass Step as value.....
05-05-2017 08:14 AM
Sorry i dont get it what you mean.
What is type "step"?
05-05-2017 08:20 AM
You configure a substep module inside the step. You have the Step directly available.