NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the start date and time of a socket when using batch model

Solved!
Go to solution

Hello,

 

Until now, i was using SequencialModel and #NoValidation(RunState.Main.RunState.Caller.Locals.StartDate.ShortText) to get the string date and time, for report and so on.

Now, i need to use BatchModel, and it looks like Locals.StartDate is no longer there.

 

Doesn anybody know another variable that contain this information?

 

Thank you in advance!

0 Kudos
Message 1 of 5
(223 Views)

I found in the model, the place where the date and time are saved, but i don´t understand how to access these variables from the outside

Marian_G_0-1741366876801.png

 

I need this time, because it is used in some subsequences to always find the path to save data on disk and so on. 

This is my structure 

Marian_G_1-1741367317337.png

 

I would like to avoid to get time stamps in the Main sequence, because there are many main sequences which i would need to change.

 

Thanks!

0 Kudos
Message 2 of 5
(210 Views)
Solution
Accepted by topic author Marian_G

When using Batch, this data is stored in RunState.Root.Parameters.TestSocket.StartDate.ShortText.

 

Please note it is better to use RunState.Root to access the Process Model that is running the test.

 

In Sequential it is: RunState.Root.Locals.StartDate.ShortText

 

No matter how big your call stack is, Root will be the process model entry point SequenceContext that contains the StartDate.

Message 3 of 5
(180 Views)

Thanks a lot for the solution and for your fast response!

It worked, with a small change: RunState.Root.Parameters.TestSocket.StartDate.Text instead of RunState.Root.Parameters.TestSocket.StartDate.ShortText.

 

Best regards,

Marian

 

 

0 Kudos
Message 4 of 5
(165 Views)

Just a correction to my previous post:

RunState.Root.Parameters.TestSocket.StartDate.ShortText works. 

0 Kudos
Message 5 of 5
(161 Views)