NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

using previous step result

Solved!
Go to solution

Hi All,

In a step (.NET code module), I want to use the result produced by a previous step.

I don't want to use TS variable in the sequence.

 

Do I have to get all results list ? If yes, how can I get recusively resultlist.

Or do you have to use "Result" property of the previous step?

 

Thanks in advance for your help

 

0 Kudos
Message 1 of 4
(3,233 Views)

Hello Maxont,


ResultList is an option, but its behavior may be impacted by result recording options (at Station, Sequence or Step level). And parsing it could be tricky.


You can also use ThisContext.PreviousStep, and get informations from the Result container. But it only adress immediate previous step. What will happen if the step is skipped ? If an other step is inserted between this two steps? It could be a bug source, that's why I don't really like the use of PreviousStep (my opinion).


And if you need to use a result as an input for more than one other Step ?

 

From my point of view, you are looking for a complicated way of doing things, and that goes against TestStand good practices. Simple is better, so why not using TestStand variables ?


Best regards,

0 Kudos
Message 2 of 4
(3,191 Views)
Solution
Accepted by topic author maxmont

Thanks for your help.

 

I don't want to use TS variable because variable value can be produced in another sequence call totaly far from the step.

And personn who build sequence doesn't have software dev skillset.

So It should be very easy to use.

 

I decided using ResultList because I know that results are stored.

 

Regards

0 Kudos
Message 3 of 4
(3,179 Views)

@maxmont wrote:

Thanks for your help.

 

I don't want to use TS variable because variable value can be produced in another sequence call totaly far from the step.

And personn who build sequence doesn't have software dev skillset.

So It should be very easy to use.

 

I decided using ResultList because I know that results are stored.

 

Regards


So the value may be produced far away from where it will be used. If it is in the same sequence file you can use a file global.

And i also do not understand your statement that the developer does not have software dev skillset. I would imagine it is harder for a unskilled developer to find the value in the Resultlist than using a variable.

It may be a little harder if the steps are in different files, but even then you can access a local variable located in the main "Mainsequence" by using Runstate.Main.Locals.VariableName (Where "VariableName" is the name of the variable).
It is a little harder to get a reference to it since it is not possible to locate it when developing, but the same problems exist when looking for it in the Resultlist.

0 Kudos
Message 4 of 4
(3,148 Views)