NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Access UUT Report Data

Solved!
Go to solution

Hi,

I am wondering how I can access the following UUT data ( I want to add these details to my test database)

  1. Station ID
  2. Serial Number
  3. Date
  4. Time
  5. Operator
  6. Execution Time
  7. Number of Results
  8. UUT Result

Thanks & Regards,

Don1.

0 Kudos
Message 1 of 8
(4,676 Views)

Look under RunState.Caller.Locals, it has StationInfo and all other required information.

 

 

0 Kudos
Message 2 of 8
(4,671 Views)
All of that information is written to the database if you are using one of the standard schemas and if you creating your own, you can add these when you use the Database Options dialog.
0 Kudos
Message 3 of 8
(4,669 Views)

Hi Guys,

Thanks for the advise..

I was using my own SQL statements to update my MYSQL datatbase, but I have change to use the schema to do this.

1 problem I do have is adding local vairable in my test sequence to the database?

Is this possible?

All suggestions welcome...

Thanks,

Don1

0 Kudos
Message 4 of 8
(4,639 Views)

Hi Don1,

 

If you want to avoid changing the schema, and you are using TestStand 4.1 or later,  you can add an Additional Result to any step to ensure that a local variable is being logged.  For example, if you had a step in your sequence, you can look at the Properties of the step and select Additional Results to see the list of additional results being logged.  You can then add a custom result and enter any expression that you want to be logged (like your local variable).  This will get logged to your database as part of the step results.

 

You can also edit your schema and add a statement and column that will log your variable to whatever table you want.  Just set the expression in the Columns/Parameters tab to be that local variable and set your statement accordingly.

Eric B.
National Instruments
0 Kudos
Message 5 of 8
(4,613 Views)

Hi Eric,

I am fairly new to TestStand but I would like to edit the schema and add the local variables, as you suggested was one of my options.

"You can also edit your schema and add a statement and column that will log your variable to whatever table you want.  Just set the expression in the Columns/Parameters tab to be that local variable and set your statement accordingly"

 

I have added the required colums to my database table and updated the schema with the new columns, but I don't know the correct syntax to locate my variable in the Columns/Parameters tab?

Can you please advise?

Thanks & Regards,

Don1.

0 Kudos
Message 6 of 8
(4,600 Views)
Solution
Accepted by topic author ShaneDonn

Hi Don1,

 

I'm afraid I may have led you down the wrong path.  I have been trying to change the schema to log a local variable unsuccessfully, so I think it would be better to just use the database steps to log that value directly to your database.

 

To do that, you have to use all five database step types.  You need to open a reference to the database (using Open Database), create a SELECT statement that selects the column you want to insert to (something like "SELECT localvar FROM testtable") using the Open SQL Statement step, then use the Data Operation step to perform a Set and Put operation to insert the value into the table.  Then close the SQL Statement by using the Close SQL Statement step and close the reference to the database using the Close Database step.  This makes a lot more sense looking at the database example that ships with TestStand.  You can find the example in <TestStand Public>\Examples\Database\WritingAndReadingTableData.seq .  This example uses all five database step types.

 

I hope this is helpful.  If you need any clarification on anything, let me know.

Eric B.
National Instruments
0 Kudos
Message 7 of 8
(4,572 Views)

HI Eric,

No problem,

I appreciate the help,

Regards,

Don1.

0 Kudos
Message 8 of 8
(4,555 Views)