From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging DataSource Expressions

Solved!
Go to solution

Hello,

 

We are using NI TestStand 2012 here in our company, and I have a simple question.

 

In any pass/fail test (numeric, string, regular pass/fail), is there a way to have TestStand include the DataSource expression in the report by default?

I can add it manually in the "Additional Results" pane, but I have to do that for every step.

 

I see that conditional expressions on While and For flow steps are included in the report, but not the my pass/fail expressions, which are located in the DataSource tab.

 

It seems obvious to me that the DataSource should be in there, otherwise I just have in the report the name of the step and the result and no information of what was actually tested.

 

Thank you in advance!

Leandro

0 Kudos
Message 1 of 6
(4,391 Views)

Hi,

You could use a sequence file callback - sequencefilepoststep to add the datasource.

Example code attached.

Hope this helps!

Regards,

Shane.

0 Kudos
Message 2 of 6
(4,382 Views)

You might consider using numeric limit or string limit or multinumeric limit tests instead if what you are putting in the data source is really a limit test. The pass/fail test is primarily for the use case in which a code module returns a boolean pass/fail state determined internally.

 

That said, if you still prefer using pass/fail steps, you could create a step template which is already configured to log the data source (simply drag and drop a step already configured the way you like into the templates view - i.e. with the additional result settings set) and have developers use the template rather than the step type directly.

 

Hope this helps,

-Doug

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

Thanks for all the answers. I will take a look into this.

 

I would think that logging the data source would be something that everybody would want by default and I was just missing something, but apparently not.

Even using numeric limit tests, the log just show by the default the actual measurement and the high/low limits. It does not show WHAT is being tested. For exampe: by default the report shows for a numeric limit test shows:

 

- actual measurement: 10

- high limit: 15

- low limit: 9

 

It does not show what the "10" value stands for: speed, voltage, current, RPMs, etc. unless we actually name the step that way. This helps for numeric or string tests but it doesn't help when our pass/fail criteria are results of boolean equations. In this last case, I would like to see the actual equation (which I'm putting in the datasource) on the report.

 

Thanks again.

0 Kudos
Message 4 of 6
(4,344 Views)
Solution
Accepted by topic author leandroaveiro

It does not show what the "10" value stands for: speed, voltage, current, RPMs, etc. unless we actually name the step that way.

 

Thanks again.


There is a "units" setting on numeric limit steps that addresses this issue. You can even specify custom units if you'd like, though there are many built in ones you can choose from as well. Also the step name should usually give some indication of what exactly is being tested.

 

For logging boolean expressions, probably the simplest thing is to use a step template which is preconfigured to log the datasource, or you could create a custom step type based on the pass/fail test which logs the datasource by default, or you could write a tool which goes through sequence files and modifies all of the pass/fail tests to log their datasource.

 

-Doug

0 Kudos
Message 5 of 6
(4,340 Views)

OK. We'll look into customizing our pass/fail step to include the data source. Seems to be the easiest way.

 

Thanks again!

 

0 Kudos
Message 6 of 6
(4,325 Views)