public Int32 PC_Set_callbackOn_udPacket(UpDnEngine.L6_OnDataRxCallback_DEL fn)
 {
     udEngine.set_rxCallback(fn);
     return (0);
 }
        /// <summary>
        /// Collection of method calls to start and setup MasterEmulator.
        /// The calls are placed in a background task for not blocking the gui thread.
        /// </summary>
        public void Controller_Initialize()
        {
            Task.Factory.StartNew(() =>
            {
                try
                {
                    InitializeMasterEmulator();
                    RegisterEventHandlers();

                    String device = FindUsbDevice();

                    OpenMasterEmulatorDevice(device);

                    //----- PipeSetup -----
                    udEngine = new UpDnEngine();
                    udEngine.UpDnEngine_Setup(masterEmulator);
                    udEngine.PerformPipeSetup();

                    set_default_local_udPacketHandler();

                    ctrlEngine = new CtrlEngine();
                    ctrlEngine.CtrlEngine_Setup(masterEmulator);
                    ctrlEngine.PerformPipeSetup();

                    //----- Start the MasterEmulator -----
                    Run();

                    //----- Send Out Initialized Event -----
                    appEv_Initialized(this, EventArgs.Empty);

                }
                catch (Exception ex)
                {
                    LogErrorMessage(string.Format("Exception in StartMasterEmulator: {0}", ex.Message),
                    ex.StackTrace);
                }
            });
        }