02-16-2022 12:57 PM
I'm looking for unique ID for each time when TestUUT is executed.
I could find ID for
But I'm looking for still top-level ID, i.e., ID of each run/execution of the sequence. Is there any such?
Thanks
Ajay.
02-16-2022 03:57 PM
How about Execution.Id or Thread.Id?
02-16-2022 04:09 PM
I used RunState.Execution.UniqueID and it always gives the same ID how many ever times I run the sequence again. It changes only after I restart the Teststand.
I believe thread ID would also be less helpful, I expect there could be numerous threads that could invoke under a single run. I will give it a try, do you know where I can find it? Is it in RunState.xxx.xxx like?
02-16-2022 05:04 PM
You can get it in many ways. See diagram: https://zone.ni.com/reference/en-XX/help/370052AA-01/tsapiref/infotopics/teststand_api/
But normally you will get it from Execution (here you also have many options): https://zone.ni.com/reference/en-XX/help/370052AA-01/tsapiref/reftopics/execution/
02-16-2022 05:10 PM - edited 02-16-2022 05:14 PM
@Ajay_MV wrote:
I used RunState.Execution.UniqueID and it always gives the same ID how many ever times I run the sequence again. It changes only after I restart the Teststand.
I think you meant Execution.Id. Yes, this behavior is expected. But if you want some different ID each time you start execution, combine Execution.SecondsAtStart with Execution.Id: Str(RunState.Execution.Id) + Str(RunState.Execution.SecondsAtStart*10000000)
02-17-2022 01:09 AM
I think you meant Execution.Id. Yes, this behavior is expected. But if you want some different ID each time you start execution, combine Execution.SecondsAtStart with Execution.Id:
Str(RunState.Execution.Id) + Str(RunState.Execution.SecondsAtStart*10000000)
@bienieck Thanks for feedback Both Execution.Id and SecondsAtStart are not unique between the test sockets as in the screenshots below. I'm looking for an ID which never changes between test sockets but is unique for each TestUUTs entry point execution.
02-17-2022 01:48 AM
Can't you use socket execution id? It should be unique. Combine it with timestamp and it's done.
02-17-2022 01:52 AM - edited 02-17-2022 01:54 AM
Or maybe generate GUID using .NET when new socket execution starts and save it as execution runtime variable.
https://docs.microsoft.com/pl-pl/dotnet/api/system.guid.newguid