From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Use local variables and foreign keys in a database command text

I am currently using TestStand 2013. I have not managed to find any help or documentation regarding this and was wondering if it is possible to use:

 

1) TestStand Variables / Properties (eg. Logging.StepResult.TS.Index)

2) Foreign Key

 

within the Command Text for doing a 'Get Value from Recordset' type query in the Database options

 

If so how would I achieve this, any help on this would be greatly appreciated

 

Thanks

 

Kewal

0 Kudos
Message 1 of 3
(4,211 Views)

Hi Kewal,

 

Could you please let me know why you want to use Foreign Key for doing a ''Get Value from Recordset'' type query because this is uausl and as far as I know, there is not a straightforward answer to your question.

 

Thank you.

 

Lanxi

 

0 Kudos
Message 2 of 3
(4,146 Views)

Hi,

 

Thanks for the reply

 

I have the following tables which I am trying to write to.

Step-Results Relationship.png

 

Since the sequence I am running is going to be static, so no steps or subsequences are going to be called dynamically. To avoid duplication of the same step data multiple times, I would like to prepopulate the Steps table before actually running the sequence, which I believe I can do using the TestStand API and Labview. In the figure above you can see Steps linking with Steps_1, these are both the same table it is just how MS Access is showing the Parent-Child relationship, so we can have a step which may be a subsequence which could contain further steps.

 

What I want to do is during runtime when TestStand is storing test results to the database for it to link to the Steps table using the Step_ID.

 

Which is why I asked to use TestStand Variables / Properties (eg. Logging.StepResult.TS.Index) to query the Steps table with to get a value for this field. Since I have a Parent-Child relationship for steps, instead of using the Parent Results Result_ID as a ‘foreign key’  I would like to use it in a query to obtain its Step_ID which I can link to Parent_Step_ID in getting the Step_ID for the new result, which is why I had asked about how to query using Foreign Key.

 

Hope that helps understand what I am trying to do

 

Thanks

 

Kewal

0 Kudos
Message 3 of 3
(4,108 Views)