Quantcast
Channel: NI TestStand topics
Viewing all articles
Browse latest Browse all 6732

C# - Async wait for Execution.WaitForEndEx

$
0
0

I want to run a TestStand sequence via .NET API in C#. I'm currently doing as follows:

 

Engine tsEngine = new Engine();
SequenceFile testSequenceFile = tsEngine.GetSequenceFileEx(pathToMySequence);
SequenceFile processModelSequenceFile = tsEngine.GetSequenceFileEx("MyProcessModel", GetSeqFileOptions.GetSeqFile_FindFile, TypeConflictHandlerTypes.ConflictHandler_Error);
Execution tsExecution = tsEngine .NewExecution(testSequenceFile, "MainSequence", processModelSequenceFile, false, 0);

var result = tsExecution.WaitForEndEx(1000);

 

Everything works fine, and WaitForEndEx returns true.

 

How can I wait for execution end in an async way? If I run WaitForEndEx in a separate Task it always time outs (example next line).

 

Task.Run(() => tsExecution.WaitForEndEx(1000));

 

Thanks.


Viewing all articles
Browse latest Browse all 6732

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>