NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute a sequence without using an User Interface

Hi,

 

I have programatically generated a TestStand Sequence File. I used C# and the TestStand API. I opened the .seq file in the default TestStand User Interface and the Sequence File runs perfectly.

 

However, when I created a NewExecution using the Engine object created in the porgram, it seems that the sequence never starts execution. Please look at the following code snippet:

 

// TSStep and TSSequence was created before 

 

TSSequence.InsertStep(TSStep, 0, StepGroups.StepGroup_Main);

SequenceFile TSSequenceFile = TSEngine.NewSequenceFile();

TSSequenceFile.InsertSequenceEx(0, TSSequence);

TSSequenceFile.Save("SeqGen.seq"); 

Execution TSExecution = TSEngine.NewExecution(TSSequenceFile, "Seq_0", null, false, ExecutionTypeMask.ExecTypeMask_Normal, System.Type.Missing, System.Type.Missing, System.Type.Missing);

while (TSSequenceFile.IsExecuting == true) ; // this flag never changes to false

 

TSEngine.ReleaseSequenceFileEx(TSSequenceFile, 0);

 

I know the sequence is not being executed because a COM Server (written as a Local Server in a .EXE) should start when the step within the sequence be executed.

 

Any ideas why the sequence is not executing properly ?

 

PacSoft

0 Kudos
Message 1 of 5
(3,325 Views)

Hi Pacsoft,

 

As far as I can tell, you are making all of the right API calls.  Can you verify that you are correctly passing the parameters to the NewExecution method?  You could also try passing 0 to the executionTypeMaskParam parameter to get the default behavior.  The main things to look out for is that you are passing the Sequence File object, as well as the correct name for the entry point sequence ( referring to "Seq_0" ).

Message Edited by RT4CY on 12-04-2008 02:14 PM
Rod T.
0 Kudos
Message 2 of 5
(3,305 Views)

Hi, RT4CY,

 

I finally made it so the COM Server is launched when I call the NewExecution method. However, no steps are being executed. I already tried with different values for the executionTypeMaskParam, but the behavior is the same.

 

Should not the NewExecution method start executing steps when called ?

 

PacSoft

0 Kudos
Message 3 of 5
(3,280 Views)

Hi Pacsoft,

 

Check out this example,

I posted it in a former thread.

 

Note: Also downloaded the .seq from the former thread! NEVER acept savings to Ni. -INI files !!!

 

Greetings

 

juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 4 of 5
(3,261 Views)

Hi,

 

I actually found a post in this Discussion Forum where the solution to allow execution is to dequeue UI messages right after the Engine.NewExecution() call. I enable UI Message Polling, dequeue events in a wuile() loop and now the sequence is running gracefuly.

 

Regards

0 Kudos
Message 5 of 5
(3,246 Views)