NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging TestStand names of LV variables being passed

Solved!
Go to solution

The grand problem I have is one of communication. I want a report to tell me WHY it passed or failed. Right now I can log variables and the data source, but the two are disconnected.

 

I have a passfail teststand step that calls some labview code. The labview code handles serial communications to a DUT, which hands back three booleans, a, b, and c, the last of which is passed to step.result.passfail.

 

I want the step to pass when the boolean is False, so I negate it on the data source tab, "!Step.Result.Passfail".

 

So here is the core of the problem. I can log the variable, and I can add the data source criterion to the report with a callback that includes:
Parameters.Step.Result.ReportText=Parameters.Step.Result.ReportText+"Datasource: "+Parameters.Step.DataSource.

 

I ultimately get a step that lists three booleans,

a = false

b = true

c = false

and my criterion is displayed on the report, "!step.result.passfail"

 

Can I log that variable c was passed to step.result.passfail, so the report ultimately tells me, unequivocally, "This step passed because c is false."?

 

0 Kudos
Message 1 of 6
(3,301 Views)

You could use the Additional Results to log your parameters.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(3,284 Views)

image.png

What would I add for the report to indicate "x^y was passed to Locals.PowerResult"?

 

It seems like this should be done in the sequence callback, not in additional results, as it should be programmatically evaluated for the step, and not be essentially hard-coded for each step.

 

Pseudocode might look like a "for each" loop:

For each element i in parameters.step.parameters {

if i type is "out" && value != "" {

parameters.step.result.reporttext = parameters.step.result.reporttext + "Labview variable "+i+" handed to "+value+"."

}

}

 

0 Kudos
Message 3 of 6
(3,252 Views)

I think I'm getting somewhere.
In the SequenceFilePostStep callback, I've added an empty array of containers named Parms, and added the line Locals.Parms = Parameters.Step.Module.VICall.Parms, and placed a stop, and can now see an array of containers from 0...n with the following contents.

 

image.png

 

Now to figure out how to iterate over that container and append Label - ArgVal to the step's ReportText...

0 Kudos
Message 4 of 6
(3,257 Views)

It appears the forum lost my last response to this.

I don't see how to do what I'm trying to do in the Additional Results tab without hard-coding stuff into every step, which is undesirable for a host of reasons.

The problem formulation can be simplified

image.png

 

How do I reflect on the report that "Labview variable "x^y" was stored in Locals.PowerResult."?

0 Kudos
Message 5 of 6
(3,255 Views)
Solution
Accepted by topic author Archon

More headway.

 

Using the TestStand flow control For Each over the array of containers "Parms" using an object reference variable CurEl to point to the current element, I can add elements to the report. Only problem is that it experiences a runtime error when checking for parameters.step.module.VICall if the step type isn't a LV module call.

 

image.png

 

Edit: I suppose it's just a matter of ignoring runtime errors on that statement.

0 Kudos
Message 6 of 6
(3,246 Views)