07-10-2014 01:35 AM
Hello,
I'm making many tests with TestStand to run the same sequence using the TestStand Editor and calling the Engine with a .NET application.
For the same custom step, it takes approximatively 1.5 secondes to run the step starting the sequence calling the engine using a .NET application and only 0.75 secondes running the same step using the TestStand Editor.
Here the code calling the sequence using .NET API.
Engine.NewExecution(seqFile, "Single Pass", seqFileModel, false, 0, null, null, null);
I don't understand why. What is the difference between the 2 ways ?
Best Regards,
CFOE
07-28-2014 09:36 AM
Is the main thread of your .NET program (the one that originally created the engine) processing Window messages (i.e. in a run loop of some sort)? When an execution gets created, UIMessages are sent to the main thread of the program using Window messages, so if the main thread is not regularly processing such messages, it could delay the execution of the sequence.
Hope this helps,
-Doug
08-26-2014 04:32 AM
Hello,
Of course the main thread is processing UIMessages messages :
I do it in two ways, the first using the UIMessageEvent and the second polling the UIMessageQueue.
// Constructor public TestStandController() { _engine = new Engine(); _engine.LoadTypePaletteFilesEx(); _engine.UIMessageEvent += new _TEEngineEvents_UIMessageEventEventHandler(_engine_UIMessageEvent); InitUIMessagePolling(); } void _engine_UIMessageEvent(UIMessage msg) { if (msg.Execution != null) { Trace.WriteLine("Execution id: " + msg.Execution.Id + " - " + msg.Event); } switch (msg.Event) { case UIMessageCodes.UIMsg_Trace: Step curStep = CurrentStep(msg); if (curStep != null) { Debug.WriteLine("trace : " + curStep.Name); } break; case UIMessageCodes.UIMsg_UserMessageBase: // Reception d'un message utilisateur UserMessageBase(msg); break; case UIMessageCodes.UIMsg_EndExecution: // Fin d'exécution d'une séquence EndExecution(msg); break; case UIMessageCodes.UIMsg_ShutDownComplete: // Lorsque le moteur d'exécution est arrêté ... on ferme l'application // Todo : A voir quoi faire en fin de shutdown du moteur testStand break; } } private void InitUIMessagePolling() { _engine.UIMessagePollingEnabled = true; _checkStateTimer = new DispatcherTimer(); _checkStateTimer.Tick += new EventHandler(_checkStateTimer_Tick); _checkStateTimer.Interval = new TimeSpan(0, 0, 0, 0, 100); _checkStateTimer.Start(); } private void _checkStateTimer_Tick(object sender, EventArgs e) { while (!_engine.IsUIMessageQueueEmpty) { UIMessage msg = _engine.GetUIMessage(); // messages from a execution if (msg.Execution != null) { FireTsExecutionMessage(msg.Execution.Id, msg.Event); } msg.Acknowledge(); } }
I don't know if it's the right way to do it.
Best regards,
CFOE
05-12-2015 03:24 AM
Boujour tous le monde,
ma question au cours d'execution de teststand
myExecution = myEngine.NewExecution(mySqFile, "Test UUTs", mySqFile.GetModelSequenceFile(out sDummyString), false, 0, null, null, null);
je veut veut recuperer a chaque instent la sequence qui est entraint d'exucter de l'afficher dans un listview en c#
est ce que quelqu'un peut m'aider recuperer la sequence en cours d'execution?
merci