NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert Local Data into a Schema

Solved!
Go to solution

Hi,

I am using the TestStand schema and a MySQL database to log my test results.

I have made a copy of UUT_Results & called it UUT_Results_Test and added a number of columns to the new table.

I have a number of variable from my test sequence I want to log to these new columns.

As I can't access the sequence variables in the TestStand schema (without changing the porcess model) I have opted to use a Data Operation in my test seqeunce to log the results to the database.

My problem is when TestStand then goes to log it's reults to the table it creates a new record.

What si the best way to ensure all data is written to the same record.

  1. When does the schema log data to the database? Can I add a seqeunce that will run after this cal and update the current record.
  2. If not and I have added a number of data points to my table, through the data operation, how can I tell the schema to use this record and not creat a new one?Should I use an update base on time stamp?

Maybe there is an easier way that what I am suggesting?

Any advice greatly appreciated.

Regards,

Don1.

0 Kudos
Message 1 of 20
(5,204 Views)

You can look at this discussion forum, it is similar to your issue. In particular, look at the third post, by nikolair.

 

I want to reiterate nikolair's recomendation of these two NI Knowledge Base articles:

Logging a New UUT Property to a Database in TestStand

Logging a New Step Property to a Database in TestStand

 

 

 

 


Mark E.
National Instruments

Message 2 of 20
(5,179 Views)

Hi EadieU,

Thanks for the information. I had a read through both documents & I am trying log the Reported Text of a specific test in my sequence  to a column of the new UUT_Results_Test table.

Should I be able to do this?

I was trying use the following syntax, Logging.StepResult.extractname.ReportedText

Thanks & Regards,

Don1.

0 Kudos
Message 3 of 20
(5,167 Views)

Where are you trying to do the logging?  In the sequence file or the schema?  If in the sequence file, are you using Database step types or are you calling a code module that does the logging?

 

To further answer your original questions, you can change where the logging is done by selecting or de-selecting the On-the-Fly Reporting option in the Report Options (Configure»Report Options).  If On-The-Fly Reporting is selected, the logging is done in the SequenceFilePostResultListEntry engine callback and the logging to the database will occur after every step.  If On-The-Fly Reporting is not selected, the logging is done in the Log to Database callback in the process model and the logging to the database will occur at the end of the sequence.


Mark E.
National Instruments

0 Kudos
Message 4 of 20
(5,144 Views)

Hi,

At the moment I am trying to do the logging in the Schema. (I actually got it working by using StationGlobals which are accessible through the Schema, but now I just figured out that these are StationGlobals for all sequences, which I don't want)

I did try using the database steps types (I am not too familiar SQL), but my results ended up on different rows in the database &  I had to remove constraints around foreign keys and ID field, which I would not like to have to do if possible.

Row 1: Results from Database step types

Row 2: Schema Results.

 

Is there anyway I can call the database step types to update the current record, after the Schema updates the tables?

 

Thanks for all your help.

PS: I am fairly new to TestStand so my apologies if I am asking stupid questions.

 

Regards,

Don1.

 

 

0 Kudos
Message 5 of 20
(5,134 Views)

I'm looking into this for you.  Can you tell me which version of TestStand are you using?

Message Edited by EadieU on 03-20-2009 06:28 PM

Mark E.
National Instruments

0 Kudos
Message 6 of 20
(5,031 Views)

Don1 -

Based on what I here you asking is that you want to log multiple values that are related to a sequence that runs. It is unclear if you want to do this for subsequences as well, but I will assume yes. Since the UUT_Result table is designed to have a single row per UUT, this does not seem to be the right place to place this type of data. What you typically want to do is log additional results in a separate table and have its foreign key reference the UUT table primary key. If you want to maintain strict constraints, you basically have to log the UUT result before you log the variables, so using Database steps in your sequence occurs before the UUT record is logged, so that will not work. In TestStand 4.1, NI added a feature called Additional Results that allows any step to add additional result information to the result for a step, and the report generation and database logging features were enhanced to support including this information in reports and in a database. Without these features your task is more difficult to do in TS 4.0 or earlier because you would basically be attempting to duplicate this feature without the additional support that we added to TestStand in 4.1.

Scott Richardson
https://testeract.com
0 Kudos
Message 7 of 20
(5,009 Views)

Hi Scott & EadieU,

Thanks for the replies.

I am using TestStand 4.1.1.

Since posting this original post I have tried another way to log the data. I would appreciate it if you could review my latest post and comment?

http://forums.ni.com/ni/board/message?board.id=330&thread.id=23505

 

Any feedback greatly appreciated.

Regards,

Don1.

0 Kudos
Message 8 of 20
(4,990 Views)

Don1 -

Since you are using 4.1.1, what are the reasons that you are not using Additional Results steps at the beginning of sequences to log the local variables that you want, and then use the default schema or a variation on it to log the values to a separate table that points to the UUT-RESULT table? The whole purpose of the Additional Results feature was to do things like this and to use the default reports and database logging features to assist you to capture this information.

Scott Richardson
https://testeract.com
0 Kudos
Message 9 of 20
(4,977 Views)

Hi Scot,

To be honest I am fairly new to TestStand not to familar with how to access "additional results" in the Schema.

Can you point me to any good tutorials on using this function?

Thanks & Regards,

Don1.

0 Kudos
Message 10 of 20
(4,975 Views)