03-09-2018 05:25 AM
I am working on running Teststand sequence running using "NationalInstruments.TestStand.Interop.API" using in C#.
I am able to run Teststand sequence files using above API if they not give any error.
per example I have sequence file which has error. If such file ran in Teststand tool, we will get run time error box. there user has to decide whether to terminate or ignore or go to clean-up.
But same sequence if I run using above API, my code not able to monitor run time error.
Bellow is my code
using NationalInstruments.TestStand.Interop.API;
{
private readonly Engine engine = new Engine();
private SequenceFile seqFile;
private Execution seqExecution;
private void ExecuteTestCase(TestItem item)
{
seqFile = engine.GetSequenceFileEx(item.SourcePath, GetSeqFileOptions.GetSeqFile_NoOptions,TypeConflictHandlerTypes.ConflictHandler_Prompt);
seqExecution = engine.NewExecution(seqFile, item.Name, null, false, 0);
seqExecution.WaitForEndEx(-1);
engine.ReleaseSequenceFileEx(seqFile,0);
}
}
here
1. item.Name is name of sequence in sequence file.
2. seqFile is object to sequence file.
if in NI Teststand, in configure--station option--On Run time error show dialog box is selected and if error having sequence in sequence file ran, seqExecution.WaitForEndEx(-1) will wait till execution finishes. But in my code, i am not able monitor run time error. so execution never ends(execution will be in infinite loop).
my question is there method which will return true if run time error occurs in sequence which is executing.
if return value is true i can call method "Engine.DisplayRunTimeErrorDialog()" so that user will choose whether to go to clean up or ignore or other option.