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) ?