// Function to get rfid event
        private void rfidDev_NotifyRFIDEvent(object sender, SDK_SC_RfidReader.rfidReaderArgs args)
        {
            switch (args.RN_Value)
            {
            // Event when failed to connect
            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_FailedToConnect:
                updatelabel("Info : Failed to Connect");
                break;

            // Event when release the object
            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_Disconnected:
                updatelabel("Info : Device Disconnected");
                break;

            //Event when device is connected
            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_Connected:
                updatelabel("Info : Device Connected");
                break;

            // Event when scan started
            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_ScanStarted:
                updatelabel("Info : Scan Started");
                break;

            //event when fail to start scan
            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_ReaderFailToStartScan:
                updatelabel("Info : Failed to start scan");
                break;

            //event when a new tag is identify
            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_TagAdded:

                break;

            // Event when scan completed
            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_ScanCompleted:

                if (device.currentInventory.nbTagAll == 0)
                {
                    updatelabel("Info : No Tag Found");
                    // feed the printer

                    PrinterClass printer = new PrinterClass();
                    PrinterClass.MAPI_FEED_RETURN_TYPE ret = printer.FeedPrinter(printInfo.PrinterIP, 9100);
                    if (ret == PrinterClass.MAPI_FEED_RETURN_TYPE.MAPI_FEED_RETURN_SUCCEED)
                    {
                        updatelabel("Feed Succeed");
                        System.Threading.Thread.Sleep(1000);
                    }
                }
                else if (device.currentInventory.nbTagAll > 1)
                {
                    updatelabel("Info : More than one tag scanned - Please check the printer");
                }
                else
                {
                    updatelabel("Info : Scan Completed - Tag Scanned : " + device.currentInventory.listTagAll[0].ToString());
                    TagUidPrinted = device.currentInventory.listTagAll[0].ToString();
                    print(TagUidPrinted);
                }

                break;

            //error when error during scan
            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_ReaderScanTimeout:
            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_ErrorDuringScan:
                updatelabel("Info : Scan has error");
                break;

            case SDK_SC_RfidReader.rfidReaderArgs.ReaderNotify.RN_ScanCancelByHost:
                updatelabel("Info : Scan cancel by host");
                break;
            }
            Application.DoEvents();
        }