NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to write data from a DotNet-teststep to TestStand via ActiveX?

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

0 Kudos
Message 1 of 11
(3,830 Views)

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.

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

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

0 Kudos
Message 3 of 11
(3,804 Views)

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.

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

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?

 

0 Kudos
Message 5 of 11
(3,793 Views)

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.....

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

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

0 Kudos
Message 7 of 11
(3,787 Views)

Configure the parameter as type step (reference) and pass Step as value.....

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

Sorry i dont get it what you mean.

What is type "step"?

 

0 Kudos
Message 9 of 11
(3,779 Views)

You configure a substep module inside the step. You have the Step directly available.

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