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: 

Read START_DATE_TIME during test.

Solved!
Go to solution

I would like to read the time the test started when the test sequence is still executing.

 

The time is stored in the column “START_DATE_TIME” in the NI standard data base table UUT_RESULT. It is also used to name the standard xml test report generated by TestStand.

 

I store some data to a custom data base table. By saving “START_DATE_TIME” along with the data I will be able to match data in the NI standard data base tables with the data in the custom data base table.

 

How do I get the time so I can send it with the data when I store the data to the data base?

 

Best regards

Erik

0 Kudos
Message 1 of 10
(3,485 Views)

Erik,

 

TestStand uses "schemas" to distribute data in the different database tables. Or in other words: A schema describes the (minimum) setup of a database to enable database logging.

You can review the schema and check what "value to log" is used for the START_DATE_TIME.

Create a custom schema by duplicating the original schema and modify it by adding this column configuration to other tables as well.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 10
(3,481 Views)

Thank you Norbert for an interesting idea, but I hesitate to change the "schema". I have a labview VI that saves the data to the custom data base table and I just what to add the time.

 

What I understand the parameters I what to use is :

Logging.StartDate.Month

Logging.StartDate.MonthDay

Logging.StartDate.Year

Logging.StartTime.Hours

Logging.StartTime.Minutes

Logging.StartTime.Seconds

 

How do I get the value of the parameters when “MainSequence” is executing?

 

Thanks

/E

 

0 Kudos
Message 3 of 10
(3,462 Views)

RunState.Root.Locals.StartTime

RunState.Root.Locals.StartDate

 

is what you are looking for.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 10
(3,454 Views)

The parameters I see in

RunState.Root.Locals is

ResultList

UUT

UUTTeminated and

ModelThreadType

 

StartTime and StartDate is not pressent. What do I do wrong?

/E

0 Kudos
Message 5 of 10
(3,451 Views)

These are dynamic (aka runstate) properties. They exist only during an execution using a process model.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 10
(3,448 Views)

I run the test sequence with BatchModel.seq as process model.

I put a break point in “MainSequence” and by adding a “Watch Expression” l check what parameters are available.

The RunState.Root.Locals.StartTime and RunState.Root.Locals.StartDate parameters are not available to me.

 

In the “MainSequence” I put a step with a message popup and in the “Message Expression” I put “Str(RunState.Root.Locals.StartDate)” just to access the variable if its hidden, but the program only returns:

 

An error occurred evaluating the Message Expression:

Error in argument 1, 'RunState.Root.Locals.StartDate', in call to the expression function 'Str'.

Unknown variable or property name 'RunState.Root.Locals.StartDate'.

 

What am I missing?

 

0 Kudos
Message 7 of 10
(3,437 Views)
Solution
Accepted by topic author ErikKlingenstierna

@ErikKlingenstierna wrote:
[...]

What am I missing?

 


You should have stated that you are working with the batch model.

As i said, these variables are created by the model during execution. Because the batch model handles each socket in a separate execution, the lookup string i previously posted is not correct. It applies to the sequential model.

In the batch model, the lookup string is:

RunState.Root.Parameters.TestSocket.StartTime

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 8 of 10
(3,431 Views)

Thank you for your excellent help!!

 

To summarize.

When using a BatchModel the parameters are located in

RunState.Root.Parameters.TestSocket.StartTime

 

Thanks again

Erik

 

0 Kudos
Message 9 of 10
(3,429 Views)

"Give a man a fish you feed him for a day. Teach him to fish you feed him for a life time".

 

To follow that quote, you should use the search tool (Ctrl+F) to find variables. When sitting in a break point, open search and type what you are looking for. In this case that would be starttime (non-case sensitive!).

Browse the results and look for the most promising. You can copy the value or the lookup string (only "copy").

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 10 of 10
(3,425 Views)