NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling user created Teststand sequence from .NET?

Hello All,
    I created a sequence in sequential process model. Now my question is, Is there a way to call the user created sequence (or) any sequence of a process model from .NET.

Thanks
Arun
0 Kudos
Message 1 of 4
(4,795 Views)

Hi,

Do you call it from UI or from Code module ?

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 2 of 4
(4,787 Views)
Hi Juergen,
    I call it from .NET code module

Thanks
Arun
0 Kudos
Message 3 of 4
(4,783 Views)

HI Arun,

unless i do not understand why you want to perform in a step module a SequnenceCall

I would do it  this way create a new  Exection and wait for end
it looks like this:

StationOptions stationOptions = engine.StationOptions;

stationOptions.AllowOtherModels =

true;

String strAbsolutePath;

Boolean bUserCancelled;

// Get the sequenceFile

if (engine.FindFile(strFileName, out strAbsolutePath, out bUserCancelled, FindFilePromptOptions.FindFile_PromptHonorUserPreference, FindFileSearchListOptions.FindFile_AddDirToSrchList_No, false, null) == true)

{

SequenceFile seqFile = engine.GetSequenceFileEx(strAbsolutePath, GetSeqFileOptions.GetSeqFile_OperatorInterfaceFlags, TypeConflictHandlerTypes.ConflictHandler_Error);

// Get the Model

if (engine.FindFile(strModelName, out strAbsolutePath, out bUserCancelled, FindFilePromptOptions.FindFile_PromptHonorUserPreference, FindFileSearchListOptions.FindFile_AddDirToSrchList_No, false, null) == true)

{

seqFile.ModelPath = strAbsolutePath;

seqFile.ModelOption =

ModelOptions.ModelOption_RequireSpecificModel;

String strModelDescription;

SequenceFile seqFileModel = seqFile.GetModelSequenceFile(out strModelDescription);

// Get the Single Pass EntryPoint

String strEntryPoint = "Single Pass";

Sequence sequence = seqFileModel.GetSequenceByName(strEntryPoint);

if (sequence.Type == SequenceTypes.SeqType_ExeEntryPoint)

{

Execution execution = engine.NewExecution(seqFile, strEntryPoint, seqFileModel, false, 0,null,null,null);

execution.WaitForEndEx(-1,

true, null, null);

}

}

else

{

Console.WriteLine("ModelFile {0} not found", strModelName);

}

}

else

{

Console.WriteLine("Teststand File {0} not found", strFileName);

}

BUT !!!!!

I think the best would be set a TS Locals bolean in your Module and perfom it in next step with precodition and step sequnce call

greetings

juergen 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 4 of 4
(4,771 Views)