NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically specify TestStand pass/fail string

I am performing tests utilizing multiple instruments. Each instrumemt may independently be in 'live' or 'simulated' mode. If any one instrument is in 'sim' mode, the test is considered in 'sim' mode. When in 'sim' mode the tests pass.

My goal is to be able to look at the test report and determine if a specific test ran in 'sim' mode or live mode. My solution is to append the suffix '-sim' to the test status produced by TestStand. Thus the 'passed', 'failed' strings would become 'passed-sim', 'failed-sim' in 'sim' mode. These strings would have to be given to TestStand at the same time as the measurement value but before the test exited.

Any thoughts or ideas on how I might accomplish the dynamic setting of the pass/fail string? I don't want this to be a permanent change, I want TestStand to revert back to the original pass/fail strings for the next sequential step.

Hurst C.
0 Kudos
Message 1 of 13
(5,425 Views)
Hi,

The default Status Expression of say the Pass/Fail step type is

Step.DataSource != "Step.Result.PassFail" ? Step.Result.PassFail = Evaluate(Step.DataSource) : False, Step.Result.PassFail ? "Passed" : "Failed"

but you can not change this on the default step type.

What you could do is create your own Custom Pass/Fail step type and modify the Status Expression to maybe something like this:-

Step.DataSource != "Step.Result.PassFail" ? Step.Result.PassFail = Evaluate(Step.DataSource) : False,
((Step.SimulateMode) ? (Step.Result.PassFail ? "Passed_Sim" : "Failed_Sim") : (Step.Result.PassFail ? "Passed" : "Failed"))


Where Step.SimulateMode is a new boolean property of your custom step type.

regards
Ray Farmer

Message Edited by Ray Farmer on 04-29-2005 09:03 PM

Regards
Ray Farmer
0 Kudos
Message 2 of 13
(5,421 Views)
While not as elegant as Ray's solution, you could override 'ModifyReportEntry'
which allows you to customize the test report for each step.

Your first step would be an expression to collect the results you need:
Parameters.ReportEntry = Parameters.Result.TS.StepName + " " + str(Parameters.Result.Numeric)

For the next step expression you could do a search and replace on the result text
looking for "Passed" and replacing it with "Pass_SIM" etc.
i.e.
SearchAndReplace(Parameters.ReportEntry,"Passed", "PASS_SIM"),
SearchAndReplace(Parameters.ReportEntry,"Failed", "FAIL_SIM")
TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 3 of 13
(5,403 Views)
Ok, here's what I did in my implementation.

I'm already using custom step types, so I just added the variable 'SimFlag' to each step type.

In the steps where this situation may occur, I pass a reference to 'SimFlag' to the C code, which appropriately sets 'SimFlag'.

Since I have other steps that depend on 'Passed' and 'Failed', I opted to NOT change the status text returned by TestStand.

The final phase is handled in the report generator. Here, I detect 'SimFlag' being set and append "-sim" to the status text that goes into the report. This works quite well and does exactly what I want.

But this brings up the next question:

This test is about 1400 steps long and I want to know at the time I generate the report header if any steps were simulated. Is there a way I can accumulate this information for each step as the test proceeds (e.g. SimStatus += SimFlag)?

The only way that I can think of is to generate the report header after the report body. Any other thoughts?
0 Kudos
Message 4 of 13
(5,395 Views)
I also needed to do this. In the end I used an expression to add a string to the report text immediately after the test finished:

RunState.PreviousStep.Result.ReportText+=" FLAG."

Then by overriding ModifyReportEntry it is possible to see if that string is present and modify the report accordingly (if needed).
TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 5 of 13
(5,390 Views)
Hi,

If you look in the TestReport sequence in the process model sequencefile you will notice that the Report Body is done before the Report Header because information is already required from the body to add to the header, such as the failure link information.

So there shouldn't be any problems adding your addition information.

Oh by the way nice solution.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 6 of 13
(5,386 Views)
Hi Believer,

Glad you have sorted out a working solution to your problem.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 7 of 13
(5,382 Views)
Thanks Ray, I am a new TestStand user and so am learning much from this site
from people like yourself.
TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 8 of 13
(5,274 Views)
Actually I tried my expression: RunState.PreviousStep.Result.ReportText+=" FLAG."
and it didn't work!

I had to access the ReportText variable through RunState.Sequence... instead:
RunState.Sequence.Main["Clock test (4.0V)"].Result.ReportText="FLAG"

Ray - do you know why I can't set ReportText through PreviousStep?

Thanks.
TestStand 4.2.1, LabVIEW 2009, LabWindows/CVI 2009
0 Kudos
Message 9 of 13
(5,268 Views)
Hi Believer,

What you seem to be trying to do is modify the results or a property of the results from the previous step. But unfortunately modify this property will only be affective if you were to re-run that step again eg step back one step. What you need to be modifying is the property that is in the Locals.ResultList. i.e Locals.ResultList[0].ReportText for the first step to be recorded in the sequence, Locals.ResultList[nth].ReportText for the nth step in the sequence to be recorded.

By modifying 'RunState.Sequence.Main["Clock test (4.0V)"].Result.ReportText="FLAG"' you are actually modifying the runtime version of the step before its executed. Therefore, providing you do not over write the contents of ReportText within you step, this initial value will be seen in the result.

You can check this by stepping into you step and checking the value of ReportText within the step.

Hope this clarifies things
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 10 of 13
(5,250 Views)