NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I report #INF as a number

My test reports get sent to a database which refuses to accept non-numeric values (in this case #INF) where it expects to see a numeric value.  Is there a way to report INF as a numeric value such as 999?

 

 

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

jd -

In general I do not recommend trying to replace INF with a valid value. What database are you using? Does your databases support NAN or IND because these might also come up?

 

If there are specific steps that are reporting this, you could update the sequence to change the specific values before they are added to results. For example, a post expression might be able to do this.

 

If you want to change the database logging schema, you will have to review the schema to find all the places where a INF numeric value could be logged and you could update the expression for the column to check for INF. I suspect you already know of one because you are getting an error. For example, if the numeric column expression is:

Logging.StepResult.Numeric

You could change it to something as shown below by using a conditional, but you need to decide if 999 is the correct replacement value:

(Logging.StepResult.Numeric == INF) ? 999 : Logging.StepResult.Numeric

Scott Richardson
https://testeract.com
Message 2 of 4
(3,739 Views)

Thanks Scott,

 

 

I am unable to change the database logging schema.  It does not support NAN or IND either where it expects to see a number.

 

Let me give you more information, maybe you can help me in writing a post expression.  I am new to TestStand and don't have a lot of programming background, but...

 

Pre Expression in the case is:

FileGlobals.ResultCounter = FileGlobals.ResultCounter + 1,

Step.Result.Numeric =

FileGlobals.MultiResults[FileGlobals.ResultCounter]

 

Post Expression is empty:

 

Status Expression is:

Step.DataSource != "Step.Result.Numeric" ?

Step.Result.Numeric = Evaluate(Step.DataSource) : False,

(Step.Result.Numeric >= Step.Limits.Low && Step.Result.Numeric

<= Step.Limits.High) ? "Passed" : "Failed"

 

Thanks in advance for any input.

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

jd -

It appears that you are using a step type that is custom and not based on the Numeric Limit Test step type because the status expression does not look familiar. Since the location of the value to evaluate is not determined until your status expression is evaluated, you need to update the status expression with something like the following in bold:

Step.DataSource != "Step.Result.Numeric" ? Step.Result.Numeric = Evaluate(Step.DataSource) : False,

Step.Result.Numeric = (Step.Result.Numeric == IND || Step.Result.Numeric == NAN) ? 999 : Step.Result.Numeric,

(Step.Result.Numeric >= Step.Limits.Low && Step.Result.Numeric <= Step.Limits.High) ? "Passed" : "Failed"

Hope this helps...

 
Scott Richardson
https://testeract.com
0 Kudos
Message 4 of 4
(3,678 Views)