NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Force a terminate on a .NET call when we Abort

How can I receive the UIMessageEvent_Terminate or Abort in my .Net Step? I don't want to run a loop in the TerminationMonitor.

I have passed the SequenceContext to my step an registred my eventhandler but no event is rised.

 

public static int Startup(SequenceContext seqCtx)

{

   seqCtx.Engine.UIMessageEvent +=new _TEEngineEvents_UIMessageEventEventHandler(Engine_UIMessageEvent);

}

 

 

static void Engine_UIMessageEvent(UIMessage msg)   //  <--- never called
        {
            System.Diagnostics.Debug.WriteLine("UIMessage: " + msg.Event.ToString()); 

            switch (msg.Event)
            {
                case UIMessageCodes.UIMsg_AbortingExecution:
                case UIMessageCodes.UIMsg_TerminatingExecution:
                    dl.Abort = true;
                    break;
                case UIMessageCodes.UIMsg_BreakOnUserRequest:
                    break;
            }
            msg.Acknowledge();
        }

 

what is wrong???

0 Kudos
Message 1 of 2
(1,950 Views)

See here some informations:

 

http://forums.ni.com/ni/board/message?board.id=232&message.id=7258&requireLogin=False

 

Regards

Ken

0 Kudos
Message 2 of 2
(1,937 Views)