NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

what TestStand GetNumElements return?

I am trying to understand TestStand.
When I call TestStand Get Property Value (Object) with Sequence context, and lookupString=RunState.Sequence.Main
At the output, I have a PropertyObject with a Method:GetNumElements,
What does this method return?
0 Kudos
Message 1 of 15
(5,338 Views)
The property RunState.Sequence.Main is an array of containers where each element is a step. I believe the method GetNumElements will return the number of steps in the main group of the sequence.
You can look at the contents of the RunState.Sequence.Main property if you select Browse Sequence Context from the View menu in TestStand and browse to that property.
Message 2 of 15
(5,338 Views)
Thank you for your answer, it is very helpful for myself. For the Main Sequence, To access a multiple numeric limit test data, I use TestStand Get property Value(number).vi with lookup string=locals.resultlist[step=0or n].Measurement[0 or n].Data. This works.
How do I access the same for a sub-sequence?
0 Kudos
Message 3 of 15
(5,338 Views)
You can use the following property path

Locals.ResultList[x].TS.SequenceCall.ResultList[y].Measurement[z].Data

x is the step in your main sequence that calls the sub-sequence
y is the multiple numeric limit test index in your sub-sequence
z is the measurement you are trying to get

-----------
I'm curious to find out a bigger picture of what you are trying to accomplish. You might be taking a more complicated route.
0 Kudos
Message 4 of 15
(5,338 Views)
Hello Marcela,
I will try your suggestion.
The big picture:
I am testing a pneumatic manifold with a lot of pneumatic valves. I have both vacuum (-) and positive pressure. The test to verify any leak rate and pressure. For each valve, I collect two numbers: pressure and leak rate, therefore I use multiple numeric array.
My step is run the compressor, Open a valve, measure pressure and verify leak rate for 30 sec. Very simple.
there is one step in the middle of these steps, I have to do extra because there is a regulator. I plan to use a sub-sequence to adjust the regulator to get a desired pressure (not too hi/lo); and then measure pressure and leak rate. this is where I need to collect the data, limit hi.lo at the end of the test to
record/write to a file for statistical report.
0 Kudos
Message 5 of 15
(5,339 Views)
Hi! I had to so something similar when I built an application where I needed to customize the TestStand standar report. TestStand generates report automatically in HTML or TXT. It can also save results of every step to a database and you don't have to program anything.

But it sounds like you are creating your own report. In this case you do have to access the result list. The problem with the way you are doing it is that your test might not be so easy to modify. If you add a new step you have to go and modify ypur code that generates the report. You can build code that will give you more flexibility, but that would take more time. It would be ideal if the TestStand report would work for you.
Good luck in any case!
0 Kudos
Message 6 of 15
(5,340 Views)
Hello Marcela,
You wrote:"It can also save results of every step to a database" How do I specify the database?
What do I need to change to make the report save results to a database?
Right now, I count how many steps do I have and separate each test data by a semi-colon and save as text file.
To get the UUT Result: PASS/FAIL, status, I use the TestStand-Get Property Value(Boolean).VI with lookup string: "RunState.ThisContext.Result.Status". The boolean seems to be like False=Passed.Do I use the right lookup string?
Another question: How do I get the number of results:x,
This number of results was seen in the standard report under time tested....
example: only the first two steps passed, the 3rd step failed. the rest of
steps = skipped.
In cleanup sequence, I turn off all valves and write result to text file. no result recorded.
I stop now, even I may confuse myself.
0 Kudos
Message 7 of 15
(5,340 Views)
Database:
You can specify the database by configuring the Database Option in the Configure Menu. You have to specify the database, and the schema you are using. The scehma is what defines the tables and field of you database. You can use on of the NI predefined schemas and you can create an empty database that follows that schema by clicking View Data from the Data Link tab in the database options after you build (by clicking build) the connection screen that defines your database. Press CTR-E in the Database Viewer, click the open icon, and open the file that corresponds to the schema you selected from C:\TestStand\Components\User\Models\TestStandModels\Database. Finally click GO, this will create allt h
e tables and columns you need. Chapter 18 of the TestStand user manual describes this in more detail.

UUT Result:
The UUT Result is not a boolean is a string and the possible values are Passed, Failed, Error, and Terminated. You should use the GetValString instead of the GetValBoolean

Number of Results:
I'm not sure what you mean here, but I don't think the number of results can be read from a property. I think it is being calculated by finding out how many elements are in the result list for the main sequence and subsequences.
0 Kudos
Message 8 of 15
(5,340 Views)
Hi,

In the User Manual Under the Database chapter there is a guide on how to setup the database logging. Hope it helps

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 9 of 15
(5,179 Views)
Hi Marcela,
Yes, I let the TestStand does the database for me. I hope tomorrow I will get good results.
What is the correct lookup string for UUT Result?
I attach here a file that I place at the cleanUp sequence, it writes a text file, it causes the array out of bound when the step in main sequence fails. It's right,it is my bad. However, I would like to know the size of the array locals.resullist at the end of my test (my test may passed/failed). If I know this then I can limit my forLoop.
0 Kudos
Message 10 of 15
(5,340 Views)