NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

progammatically display array in report

Solved!
Go to solution

Hi,

 

Is it possible to display the arrays in TestStand report as graph or table programmatically?

I need to log 2 data arrays in the same sequence. One of the array should be displayed as graph and another array should be displayed as table or should not be included in the report at all.

 

I know it is possible to display arrays as graph by using the Report Option. But this would display all the arrays as graph or table. Is it possible to change the Result Option for each step?-

 

Wating for replies 😕

 

Regards

mikan

0 Kudos
Message 1 of 11
(6,462 Views)

Hey mikan,

 

It is not possible to change these report settings on a per-step basis. It is possible that you could modify the report generator to do this, but perhaps an easier and more flexible approach would be to use a code module to generate images for the graphs in your report. This KnowledgeBase article describes a method for adding images to the report, and you could create a code module that takes in your measurement data and generates a graph image based on that.

 

I actually have a VI which does this, so I'll attach it to this post. This one encodes the image into base-64 so that it is actually embedded into the report rather than being linked as the KB describes. 

 

Another approach would be to exclude the non-graph arrays from being displayed at all, since you mentioned that as an option. If we took that route, would you still need that data physically in the report (to be parsed by another utility, for example)? If not, we can probably exclude that data from being included at all, which might be a simpler approach.

0 Kudos
Message 2 of 11
(6,445 Views)

Hi Daniel,

 

Thank you very much for your response.

The information was very helpful.

 

Unfortunately, i was not able to understand your VIs.

It would be great if you can provide me an example sequence. How do I pass my 1D array of U64 to your VIs and convert it to bitmap?

 

Regards,

mikan 

0 Kudos
Message 3 of 11
(6,432 Views)
Solution
Accepted by topic author mikan900

Hey mikan,

 

I'm attaching an example in TestStand/LabVIEW 2013. Let me know if you need another version.

 

Basically, I created a wrapper VI that accepts an array of U64 numbers and plots them on a graph. Then I pass a reference to that graph into the Add Images to Report VI, which generates the code to embed the image into the report. 

 

The advantage to this approach is that you have much more flexibility in how you customize the graph. I can pick any of the graph controls in LabVIEW and control exactly how each axis appears, which colors are used, etc. The downside is that I have to create the wrapper VI and configure the graph. 

 

I hope this works for your application, and let me know if we can do anything else to help out.

Message 4 of 11
(6,424 Views)

You can control whether or not a particular result is included in the report using the "Include in Reports" flag on that result property. If you unset the flag, such results will still be collected and logged  (if configured to do so).

 

-Doug

0 Kudos
Message 5 of 11
(6,422 Views)

Thank you for this!, I have also run into the question on how to embed images. And having them in this way seems more conventient due to the fact that it only generates one file. 

0 Kudos
Message 6 of 11
(6,392 Views)

Thank you very much for the example. This method is very convenient and solves my problem.

0 Kudos
Message 7 of 11
(6,390 Views)

Hi Daniel,

 

I used the method used in the KB to add image to the Report.

I am facing some problem with it. My Report looks like this

 

I want the image to be stored under "myImage" and not under "Report Text"

 

how do I change this small but important thing?

0 Kudos
Message 8 of 11
(6,336 Views)

Mikan,

 

In my example, the output from the VI is being saved in Step.Result.ReportText, which is a string value that is automatically included in the report. You can store that output from the VI in any property or variable in TestStand and log it to the report. For example, if MyImage is a Local variable, you can just save the string output from the VI into Locals.MyImage and then log Locals.MyImage to the report with the Additional Results functionality.

 

I hope that helps, let me know if you run into any more trouble with it.

0 Kudos
Message 9 of 11
(6,325 Views)

Hi Daniel,

 

Thanks for prompt response.

Please find attached my sequence and report file.

I do not have any problem displaying image with ReportText String.

 

I am using aTML 5.00 Standard Report Document. and tr5_horizontal.xsl for Report Processing.

In HTML, there is no problem to display graph image in report. I am not able to undestand, why only the ReportText string is added to report as an image /HTML format string and not other strings as image.

 

Thank you for your help and patience.

 

Regards

mikan

0 Kudos
Message 10 of 11
(6,319 Views)