03-23-2017 07:44 AM
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
Solved! Go to Solution.
03-23-2017 07:59 AM
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.
03-23-2017 09:06 AM
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
03-23-2017 09:26 AM
RunState.Root.Locals.StartTime
RunState.Root.Locals.StartDate
is what you are looking for.
03-23-2017 10:04 AM
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
03-23-2017 10:08 AM
These are dynamic (aka runstate) properties. They exist only during an execution using a process model.
03-24-2017 12:42 AM
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?
03-24-2017 02:50 AM
@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
03-24-2017 04:33 AM
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
03-24-2017 04:41 AM
"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").