NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

logging step parameters to database

I need to port some code from our in-house testexecutive to TestStand. The old testexecutive gives the parameters as Array of doubles to the measurement module witten in C. To port that code, I will create a custom teststep with a additonal container named Parameters as step property for each measurement module. Each parameter will be a number subproperty in that container and will be loaded with the property loader with values for a single teststep.
That works fine so far.

Since the parameters may change from time to time, we want to log them also in the result database (Access).
SoI want to create a additional table named STEP_PARAMETER in the result database schema with the following members :
CREATE TABLE STEP_PARAMETER
(
ID
COUNTER CONSTRAINT STEP_PARAMETER_CONSTRAINT PRIMARY KEY,
STEP_RESULT INTEGER NOT NULL,
PARAMETER_NAME TEXT,
PARAMETER_VALUE DOUBLE,
CONSTRAINT STEP_PARAMETER_FK FOREIGN KEY (STEP_RESULT) REFERENCES STEP_RESULT (ID)
)
and add a substep to the steptype which loops over all subproperties of the Parameters Container to save name and value of that subproperty.
However I've found some problems with that design:
To write a generic substep I have to loop over all subproperties of the container without knowing number and names before. How to realize that in TestStand.

And how do I realize a database access in detail. Do I have to open the result database myself. Or are there some ready to use database handles for the result database available in TestStand. And how do I get the get the reference key ( The ID of the step result record for that test step) ?
0 Kudos
Message 1 of 3
(3,391 Views)
Hi Markus,

I know exactly what you are talking about. I found myself in a similar situation. I have several devices associated with a test, the number of devices is different from time to time and I needed to store that in the database. One idea was to write my own step that would write this device list to the database but I couldn't get the id from access.

I finally figured out a way to do this. Follow this link to read the entry:

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000AF560000&UCATEGORY_0=_8_&UCATEGORY_S=0

There is a difference between what I'm doing and what you will need to do. My array was per UUT, you array is per step is I understand correctly and this my complicate things.

Hopefull
y this can help you get started and give you some ideas. If I think on something else, I will let you know. Anyone out there has another idea?

Marcela.
0 Kudos
Message 2 of 3
(3,391 Views)
Hi Marcela;
I've checked that discussion thread. Your idea works fine if the database statements will change once per UUT because Database.seq is called once per UUT (correct me if I'am wrong). However I need to change the database statements per step, because i.e. Step 1 of my sequence ( of steptype A) will need to log 4 parameters, step 2-5 (of steptype B) may need to log 6 parameters and so on.
Marc's solution is fine for a single steptype, But I hoped to find a generic solution for a class of steptypes.
0 Kudos
Message 3 of 3
(3,391 Views)