03-17-2022 09:21 AM
Anyone have examples of using NI_CustomResult?
Also, any links to docs would be appreciated. Could not find anything that explains in detail on all related properties and how to setup.
Thanks
Solved! Go to Solution.
03-17-2022 10:23 AM
What are you specifically trying to do with it?
NI_CustomResult is a datatype used by any step type to log additional results. Because it is part of the TS property (or rather an array of them are part of the TS property) it will get automatically injected into the resultlist and passed to each of the plugins. The plugins will then process them and put them on the report.
If you go to Configure>>Station Options and on the Preferences tab check the show hidden properties box then click OK you'll be able to see the TS property for each step.
Throw down a step in TS and go to the additional results category. Add a result and set it up how you want. Then on the Property Browser category you can look inside the TS property at the CustomResults array. Expand it and you'll se how NI_CustomResult is being used.
Hope this helps,
03-17-2022 10:35 AM
03-27-2022 09:10 AM - edited 03-27-2022 09:33 AM
Hi @jiggawax.
So I mentioned I may come back with more questions 🙂
I need to add complex types to the CustomResults where they have a mixture of basic types (number, string, etc.), array of types (strings, containers, etc.), and other custom data types.
One problem I'm having now is when trying to add elements within the arrays (whether it is basic or complex types). It appears to throw errors when trying to add elements manually even when changing the type to NI_CustomResultElement.
For example and to make it simple, let's say I have a data type that includes one Array of Strings property.
When I add to the step, it doesn't add the 3 string properties under the MyString array.
I can add the data in the Value to Log (like below), but not sure how to add for complex data types in arrays that could vary in elements.
I guess I might could create Local variables and those in the Value to Log, but I'm more wanting the ability to manage/view within the tree UI of results as I'm setting up data to be displayed for selected steps in sequence and data varies between them.
So my current question is how do I add the elements under the array to be displayed. Eventually, these will be more complex, but trying to keep simple with just strings to understand how TestStand works in UI and APIs.
Thanks again for the help.
04-08-2022 03:09 PM
So when you make a datatype like you've done in the first image you need to create instances of it before you can put it in the result list.
If you don't want the instances to reside in Locals or FileGlobals then you can actually add an attribute to each step and define it there.
Create your type
Add an instance by adding an attribute to the step:
Then you can add that instance to the additional results:
Hope this helps,
04-08-2022 09:12 PM
@jigg.
"you can actually add an attribute to each step and define it there"
That's exactly what I ended up doing. Works great! Thanks again.