コード例 #1
0
        private void ProcessWriteTag(UHFReader.PR9200Msg msgTran)
        {
            string strCmd       = "写标签";
            string strErrorCode = string.Empty;

            if (msgTran.AryData.Length == 1)
            {
                strErrorCode = CCommondMethod.FormatErrorCode(msgTran.AryData[0]);
                string strLog = strCmd + "失败,失败原因: " + strErrorCode;

                WriteLog(lrtxtLog, strLog, 1);

                //tbx_SerialWrite.Enabled = true;
            }
            else
            {
                int nLen    = msgTran.AryData.Length;
                int nEpcLen = Convert.ToInt32(msgTran.AryData[2]) - 4;

                if (msgTran.AryData[nLen - 3] != 0x10)
                {
                    strErrorCode = CCommondMethod.FormatErrorCode(msgTran.AryData[nLen - 3]);
                    string strLog = strCmd + "失败,失败原因: " + strErrorCode;

                    WriteLog(lrtxtLog, strLog, 1);

                    EnableControl(1);
                    //tbx_SerialWrite.Enabled = true;
                    return;
                }

                string strPC   = CCommondMethod.ByteArrayToString(msgTran.AryData, 3, 2);
                string strEPC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 5, nEpcLen);
                string strCRC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 5 + nEpcLen, 2);
                string strData = string.Empty;

                byte   byTemp   = msgTran.AryData[nLen - 2];
                byte   byAntId  = (byte)((byTemp & 0x03) + 1);
                string strAntId = byAntId.ToString();

                string strReadCount = msgTran.AryData[nLen - 1].ToString();



                WriteLog(lrtxtLog, strCmd, 0);

                //tbx_SerialWrite.Enabled = true;
                EnableControl(1);

                paintBackgroundColor(statusType.PASS);
            }
        }
コード例 #2
0
 private void SendData(byte[] btArySendData)
 {
     try
     {
         if (m_bDisplayLog)
         {
             string strLog = CCommondMethod.ByteArrayToString(btArySendData, 0, btArySendData.Length);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #3
0
        public bool ReadTagID()
        {
            //only can inventery 1 tag, because the reader is a shit
            UInt16 byteLen = 0;

            byte[] ary_data = new byte[9];    //the first byte is DSFID, and the other 8 byte containers the UID data
            try
            {
                int  loop     = 0;
                bool stopLoop = false;
                st = 0;

                /*
                 * loop 30 second to find tag
                 */
                while (loop < 300 && !stopLoop)
                {
                    st = ISO15693Commands.rf_inventory(ReaderInfo.icdev, 0x36, 0x00, 0x00, out byteLen, ary_data);

                    stopLoop = st == 0 ? true : false;

                    loop++;

                    System.Threading.Thread.Sleep(100);
                }

                if (st != 0)
                {
                    //MessageBox.Show("未发现单个标签");
                    return(false);
                }
                else
                {
                    Array.Copy(ary_data, 1, rConfig.m_btTagUID, 0, 8);

                    byte[] msbFstUID = new byte[8];
                    Array.Copy(rConfig.m_btTagUID, msbFstUID, 8);
                    Array.Reverse(msbFstUID);

                    rConfig.m_sTagUIDstring = CCommondMethod.ByteArrayToString(msbFstUID, 0, 8);

                    return(true);
                }
            }
            catch (Exception)
            {
                return(false);
            }
        }
コード例 #4
0
        private void PacketReceived_WriteTag(PR9200Msg msgTran)
        {
            /*
             * after write tag, should check if the tag is the same tag as read before
             */
            string strErrorCode = string.Empty;

            if (msgTran.AryData.Length == 1)
            {
                strErrorCode = CCommondMethod.FormatErrorCode(msgTran.AryData[0]);
                string strLog = "读标签失败,失败原因: " + strErrorCode;

                SetErrorCode(strLog);
                dlgt_TagIdentifyFail(ActionResault.ReadTIDBankWhenWriteFail);
            }
            else
            {
                /*  response packet byte map
                 *
                 *  TagCount        DataLen     Data        ErrorCode       AndID       WriteCount
                 *     2 byte       1byte       Nbyte       1byte           1byte       1byte
                 *
                 */

                int nLen     = msgTran.AryData.Length;
                int nDataLen = Convert.ToInt32(msgTran.AryData[2]);//lenght of useful data of a tag(PC+EPC+CRC)
                int nEpcLen  = nDataLen - 4;

                string strPC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 3, 2);
                string strEPC = CCommondMethod.ByteArrayToString(msgTran.AryData, 5, nEpcLen);
                string strCRC = CCommondMethod.ByteArrayToString(msgTran.AryData, 5 + nEpcLen, 2);

                strErrorCode = CCommondMethod.FormatErrorCode(msgTran.AryData[nLen - 3]);
                byte   byTemp     = msgTran.AryData[nLen - 2];
                byte   byAntId    = (byte)((byTemp & 0x03) + 1);
                string strAntId   = byAntId.ToString();
                string writeCount = msgTran.AryData[nLen - 1].ToString();//the last byte contains write count, according to application note

                /*
                 * check these things:
                 *      1: writecount should be 1;
                 *      2: error code should be success
                 *      3: epc should equals the one read before
                 *
                 * after all check passed, retun ok
                 */
            }
        }
コード例 #5
0
        private void ProcessInventoryReal(Reader.MessageTran msgTran)
        {
            string strCmd = "";

            strCmd = "Real-time inventory";
            string strErrorCode = string.Empty;

            if (msgTran.AryData.Length == 1) //You receive an error message packet
            {
                strErrorCode = CCommondMethod.FormatErrorCode(msgTran.AryData[0]);
                string strLog = strCmd + "Failure, failure reasons: " + strErrorCode;
                m_curSetting.btRealInventoryFlag = 100; //The reader return inventory error
                //WriteLog(RecordLogBox, strLog, 1);
            }
            else if (msgTran.AryData.Length == 7) //End packet received command
            {
                m_curInventoryBuffer.nReadRate   = Convert.ToInt32(msgTran.AryData[1]) * 256 + Convert.ToInt32(msgTran.AryData[2]);
                m_curInventoryBuffer.nDataCount  = Convert.ToInt32(msgTran.AryData[3]) * 256 * 256 * 256 + Convert.ToInt32(msgTran.AryData[4]) * 256 * 256 + Convert.ToInt32(msgTran.AryData[5]) * 256 + Convert.ToInt32(msgTran.AryData[6]);
                m_curSetting.btRealInventoryFlag = 1; //Inventory command ends successfully received packet
                //WriteLog(RecordLogBox, strCmd, 0);
            }
            else //Receive real-time tag data
            {
                m_nTotal++;
                int             nLength    = msgTran.AryData.Length;
                int             nEpcLength = nLength - 4;
                RealTimeTagData tagData    = new RealTimeTagData();

                string strEPC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 3, nEpcLength);
                string strPC   = CCommondMethod.ByteArrayToString(msgTran.AryData, 1, 2);
                string strRSSI = (msgTran.AryData[nLength - 1] - 129).ToString() + " dBm";
                byte   btTemp  = msgTran.AryData[0];
                byte   btAntId = (byte)((btTemp & 0x03) + 1);
                byte   btFreq  = (byte)(btTemp >> 2);
                // string strFreq = GetFreqString(btFreq) + " MHz";

                tagData.strEpc  = strEPC;
                tagData.strPc   = strPC;
                tagData.strRssi = strRSSI;
                //tagData.strCarrierFrequency = strFreq;
                tagData.btAntId = btAntId;

                RealTimeTagDataList.Add(tagData);
            }
        }
コード例 #6
0
        private void ProcessReadTag(Reader.MessageTran msgTran)
        {
            string strCmd       = "Reading the label";
            string strErrorCode = string.Empty;

            if (msgTran.AryData.Length == 1)
            {
                strErrorCode = CCommondMethod.FormatErrorCode(msgTran.AryData[0]);
                string strLog = strCmd + "Failure, failure reasons:" + strErrorCode;
                m_curSetting.btRealInventoryFlag = 100; //The reader returns the error message
            }
            else
            {
                RealTimeTagData tagData  = new RealTimeTagData();
                int             nLen     = msgTran.AryData.Length;
                int             nDataLen = Convert.ToInt32(msgTran.AryData[nLen - 3]);
                int             nEpcLen  = Convert.ToInt32(msgTran.AryData[2]) - nDataLen - 4;

                string strPC   = CCommondMethod.ByteArrayToString(msgTran.AryData, 3, 2);
                string strEPC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 5, nEpcLen);
                string strCRC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 5 + nEpcLen, 2);
                string strData = CCommondMethod.ByteArrayToString(msgTran.AryData, 7 + nEpcLen, nDataLen);

                byte byTemp  = msgTran.AryData[nLen - 2];
                byte byAntId = (byte)((byTemp & 0x03) + 1);

                tagData.strEpc  = strEPC;
                tagData.strPc   = strPC;
                tagData.strTid  = strData;
                tagData.btAntId = byAntId;

                RealTimeTagDataList.Add(tagData);

                int nReaddataCount = msgTran.AryData[0] * 255 + msgTran.AryData[1]; //The total number of data
                if (RealTimeTagDataList.Count == nReaddataCount)                    //All data received
                {
                    m_curSetting.btRealInventoryFlag = 1;                           //The reader returns the error message
                }
            }
        }
コード例 #7
0
        //private void TagIdentify(PR9200Msg msgTran)
        //{
        //    string strErrorCode = string.Empty;

        //    if (msgTran.AryData.Length == 1)
        //    {
        //        strErrorCode = CCommondMethod.FormatErrorCode(msgTran.AryData[0]);
        //        string strLog = "读标签失败,失败原因: " + strErrorCode;

        //        SetErrorCode(strLog);
        //        readTIDBankWhenWriteFailDelegate(ActionResault.ReadTIDBankWhenWriteFail);
        //    }
        //    else
        //    {
        //        int nLen = msgTran.AryData.Length;
        //        int nDataLen = Convert.ToInt32(msgTran.AryData[nLen - 3]);//lenght of the data we specified
        //        int nEpcLen = Convert.ToInt32(msgTran.AryData[2]) - nDataLen - 4;//totally data length minus specified data length minus PC&CRC(4 bytes)

        //        string strPC = CCommondMethod.ByteArrayToString(msgTran.AryData, 3, 2);
        //        string strEPC = CCommondMethod.ByteArrayToString(msgTran.AryData, 5, nEpcLen);
        //        string strCRC = CCommondMethod.ByteArrayToString(msgTran.AryData, 5 + nEpcLen, 2);
        //        string strData = CCommondMethod.ByteArrayToString(msgTran.AryData, 7 + nEpcLen, nDataLen);//the specified data

        //        byte byTemp = msgTran.AryData[nLen - 2];
        //        byte byAntId = (byte)((byTemp & 0x03) + 1);
        //        string strAntId = byAntId.ToString();

        //        string strReadCount = msgTran.AryData[nLen - 1].ToString();

        //        string sUniqueTID = "";
        //        bool b_tagValid = true;

        //        m_sTIDType = strData.Substring(0, 11);
        //        sUniqueTID = strData.Substring(12);

        //        if (m_sTIDType.Equals(UHFTIDTypes.Alien_Higgs3))
        //        {
        //            //WriteLog(lrtxtLog, "this is alien higgs 3 chip", 1);
        //        }
        //        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4D))
        //        {
        //            //WriteLog(lrtxtLog, "this is monza 4d chip", 1);
        //        }
        //        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4E))
        //        {
        //            //WriteLog(lrtxtLog, "this is monza 4e chip", 1);
        //        }
        //        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4i))
        //        {
        //            //WriteLog(lrtxtLog, "this is monza 4i chip", 1);
        //        }
        //        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4QT))
        //        {
        //            //WriteLog(lrtxtLog, "this is monza 4qtchip", 1);
        //        }
        //        else
        //        {
        //            string err = "标签类型未知";
        //            SetErrorCode(err);
        //            readTIDBankWhenWriteFailDelegate(ActionResault.ReadTIDBankWhenWriteFail);

        //            //WriteLog(lrtxtLog, "this tag is not valid", 1);
        //            b_tagValid = false;
        //        }

        //        if (b_tagValid)
        //        {
        //            tagUid = sUniqueTID;

        //            byte btMemBank = MemoryBank.USERBank;
        //            byte btWordAdd = 0x00;
        //            byte btWordCnt = 0x00;

        //            byte[] btAryPwd = new byte[] { 0x00, 0x00, 0x00, 0x00 };
        //            //byte[] btAryData = Encoding.ASCII.GetBytes(data);

        //            Int16 dataLen = Convert.ToInt16(btWriteDataBuffer);
        //            byte[] btLen = BitConverter.GetBytes(dataLen);

        //            byte[] btAryDataAndLen = new byte[btWriteDataBuffer.Length + 2];
        //            btLen.CopyTo(btAryDataAndLen, 0);                                   //the first 2 bytes contains data length
        //            btWriteDataBuffer.CopyTo(btAryDataAndLen, 2);

        //            btWordCnt = Convert.ToByte(btAryDataAndLen.Length / 2 + btAryDataAndLen.Length % 2);//1 word equals 2 bytes

        //            /*
        //             * finnaly, we got the data to be write
        //             */
        //            actionType = ActionType.WriteTag;
        //            WriteTag(PR9200Setting.btReadId, btAryPwd, btMemBank, btWordAdd, btWordCnt, btAryDataAndLen);
        //        }
        //    }
        //}


        private void PacketReceived_TagIdentify(PR9200Msg msgTran)
        {
            string strErrorCode = string.Empty;

            if (msgTran.AryData.Length == 1)
            {
                strErrorCode = CCommondMethod.FormatErrorCode(msgTran.AryData[0]);
                string strLog = "读标签失败,失败原因: " + strErrorCode;

                SetErrorCode(strLog);
                dlgt_TagIdentifyFail(ActionResault.ReadTIDBankWhenWriteFail);
            }
            else
            {
                int nLen     = msgTran.AryData.Length;
                int nDataLen = Convert.ToInt32(msgTran.AryData[nLen - 3]);         //lenght of the data we specified, stored in the third byte from last, according to application note
                int nEpcLen  = Convert.ToInt32(msgTran.AryData[2]) - nDataLen - 4; //totally data length minus specified data length minus PC&CRC(4 bytes)

                string strPC   = CCommondMethod.ByteArrayToString(msgTran.AryData, 3, 2);
                string strEPC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 5, nEpcLen);
                string strCRC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 5 + nEpcLen, 2);
                string strData = CCommondMethod.ByteArrayToString(msgTran.AryData, 7 + nEpcLen, nDataLen);//the specified data

                byte   byTemp   = msgTran.AryData[nLen - 2];
                byte   byAntId  = (byte)((byTemp & 0x03) + 1);
                string strAntId = byAntId.ToString();

                string strReadCount = msgTran.AryData[nLen - 1].ToString();

                string sUniqueTID = "";
                bool   b_tagValid = true;

                m_sTIDType = strData.Substring(0, 11);
                sUniqueTID = strData.Substring(12);

                if (m_sTIDType.Equals(UHFTIDTypes.Alien_Higgs3))
                {
                    //WriteLog(lrtxtLog, "this is alien higgs 3 chip", 1);
                }
                else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4D))
                {
                    //WriteLog(lrtxtLog, "this is monza 4d chip", 1);
                }
                else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4E))
                {
                    //WriteLog(lrtxtLog, "this is monza 4e chip", 1);
                }
                else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4i))
                {
                    //WriteLog(lrtxtLog, "this is monza 4i chip", 1);
                }
                else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4QT))
                {
                    //WriteLog(lrtxtLog, "this is monza 4qtchip", 1);
                }
                else
                {
                    string err = "标签类型未知";
                    SetErrorCode(err);
                    dlgt_TagIdentifyFail(ActionResault.ReadTIDBankWhenWriteFail);

                    //WriteLog(lrtxtLog, "this tag is not valid", 1);
                    b_tagValid = false;
                }

                if (b_tagValid)
                {
                    tagUid = sUniqueTID;

                    byte btMemBank = MemoryBank.USERBank;
                    byte btWordAdd = 0x00;
                    byte btWordCnt = 0x00;

                    byte[] btAryPwd = new byte[] { 0x00, 0x00, 0x00, 0x00 };
                    //byte[] btAryData = Encoding.ASCII.GetBytes(data);

                    Int16  dataLen = Convert.ToInt16(btWriteDataBuffer);
                    byte[] btLen   = BitConverter.GetBytes(dataLen);

                    byte[] btAryDataAndLen = new byte[btWriteDataBuffer.Length + 2];
                    btLen.CopyTo(btAryDataAndLen, 0);                                   //the first 2 bytes contains data length
                    btWriteDataBuffer.CopyTo(btAryDataAndLen, 2);

                    btWordCnt = Convert.ToByte(btAryDataAndLen.Length / 2 + btAryDataAndLen.Length % 2);//1 word equals 2 bytes

                    /*
                     * finnaly, we got the data to be write, go to step 2: writing data to tag
                     */
                    actionType = ActionType.WriteTag;
                    WriteTag(PR9200Setting.btReadId, btAryPwd, btMemBank, btWordAdd, btWordCnt, btAryDataAndLen);
                }
            }
        }
コード例 #8
0
        private void ProcessInventoryReal(Reader.MessageTran msgTran)
        {
            //Console.WriteLine("ProcessInventoryReal started");

            string strCmd = "";

            if (msgTran.Cmd == 0x89)
            {
                strCmd = "Real time mode inventory ";
            }
            if (msgTran.Cmd == 0x8B)
            {
                strCmd = "Customized Session and Inventoried Flag inventory ";
            }
            string strErrorCode = string.Empty;

            if (msgTran.AryData.Length == 1)
            {
                strErrorCode = CCommondMethod.FormatErrorCode(msgTran.AryData[0]);
                string strLog = strCmd + " failed, due to: " + strErrorCode;

                Console.WriteLine(strLog, 1);
                RefreshInventoryReal(0x00);
                RunLoopInventroy();
            }
            else if (msgTran.AryData.Length == 7)
            {
                m_curInventoryBuffer.nReadRate  = Convert.ToInt32(msgTran.AryData[1]) * 256 + Convert.ToInt32(msgTran.AryData[2]);
                m_curInventoryBuffer.nDataCount = Convert.ToInt32(msgTran.AryData[3]) * 256 * 256 * 256 + Convert.ToInt32(msgTran.AryData[4]) * 256 * 256 + Convert.ToInt32(msgTran.AryData[5]) * 256 + Convert.ToInt32(msgTran.AryData[6]);

                Console.WriteLine(strCmd, 0);
                RefreshInventoryReal(0x01);
                RunLoopInventroy();
            }
            else
            {
                // m_nTotal++;
                int nLength    = msgTran.AryData.Length;
                int nEpcLength = nLength - 4;

                //增加盘存明细表
                //if (msgTran.AryData[3] == 0x00)
                //{
                //    MessageBox.Show("");
                //}
                string strEPC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 3, nEpcLength);
                string strPC   = CCommondMethod.ByteArrayToString(msgTran.AryData, 1, 2);
                string strRSSI = msgTran.AryData[nLength - 1].ToString();
                //SetMaxMinRSSI(Convert.ToInt32(msgTran.AryData[nLength - 1]));

                m_curInventoryBuffer.nMaxRSSI = -79;
                m_curInventoryBuffer.nMinRSSI = -18;

                byte btTemp  = msgTran.AryData[0];
                byte btAntId = (byte)((btTemp & 0x03) + 1);
                m_curInventoryBuffer.nCurrentAnt = btAntId;
                string strAntId = btAntId.ToString();

                byte   btFreq  = (byte)(btTemp >> 2);
                string strFreq = GetFreqString(btFreq);

                //DataRow row = m_curInventoryBuffer.dtTagDetailTable.NewRow();
                //row[0] = strEPC;
                //row[1] = strRSSI;
                //row[2] = strAntId;
                //row[3] = strFreq;

                //m_curInventoryBuffer.dtTagDetailTable.Rows.Add(row);
                //m_curInventoryBuffer.dtTagDetailTable.AcceptChanges();

                ////增加标签表
                //DataRow[] drsDetail = m_curInventoryBuffer.dtTagDetailTable.Select(string.Format("COLEPC = '{0}'", strEPC));
                //int nDetailCount = drsDetail.Length;

                DataRow[] drs = m_curInventoryBuffer.dtTagTable.Select(string.Format("COLEPC = '{0}'", strEPC));
                if (drs.Length == 0)
                {
                    DataRow row1 = m_curInventoryBuffer.dtTagTable.NewRow();
                    row1[0] = strPC;
                    row1[2] = strEPC;
                    row1[4] = strRSSI;
                    row1[5] = "1";
                    row1[6] = strFreq;

                    Console.WriteLine($" From A: \nstrPC: {strPC}, strEPC: {strEPC},Count: 1 strRSSI: {strRSSI} strFreq: {strFreq}");

                    m_curInventoryBuffer.dtTagTable.Rows.Add(row1);
                    m_curInventoryBuffer.dtTagTable.AcceptChanges();
                }
                else
                {
                    foreach (DataRow dr in drs)
                    {
                        dr.BeginEdit();

                        dr[4] = strRSSI;
                        dr[5] = (Convert.ToInt32(dr[5]) + 1).ToString();
                        dr[6] = strFreq;
                        Console.WriteLine($" From B: \nstrPC: {strPC}, strEPC: {strEPC}, Count: {(Convert.ToInt32(dr[5]) + 1).ToString()} strRSSI: {strRSSI} strFreq: {strFreq}");
                        dr.EndEdit();
                    }
                    m_curInventoryBuffer.dtTagTable.AcceptChanges();
                }

                m_curInventoryBuffer.dtEndInventory = DateTime.Now;
                RefreshInventoryReal(0x89);
            }
        }
コード例 #9
0
        private void ProcessReadTag(UHFReader.PR9200Msg msgTran)
        {
            string strCmd       = "读标签";
            string strErrorCode = string.Empty;

            if (msgTran.AryData.Length == 1)
            {
                strErrorCode = CCommondMethod.FormatErrorCode(msgTran.AryData[0]);
                string strLog = strCmd + "失败,失败原因: " + strErrorCode;

                //WriteLog(lrtxtLog, strLog, 1);
            }
            else
            {
                int nLen     = msgTran.AryData.Length;
                int nDataLen = Convert.ToInt32(msgTran.AryData[nLen - 3]);         //lenght of the data we specified
                int nEpcLen  = Convert.ToInt32(msgTran.AryData[2]) - nDataLen - 4; //totally data length minus specified data length minus PC&CRC(4 bytes)

                string strPC   = CCommondMethod.ByteArrayToString(msgTran.AryData, 3, 2);
                string strEPC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 5, nEpcLen);
                string strCRC  = CCommondMethod.ByteArrayToString(msgTran.AryData, 5 + nEpcLen, 2);
                string strData = CCommondMethod.ByteArrayToString(msgTran.AryData, 7 + nEpcLen, nDataLen);//the specified data

                byte   byTemp   = msgTran.AryData[nLen - 2];
                byte   byAntId  = (byte)((byTemp & 0x03) + 1);
                string strAntId = byAntId.ToString();

                string strReadCount = msgTran.AryData[nLen - 1].ToString();

                if (action_Queue.Count > 0)
                {
                    string sUniqueTID = "";
                    bool   b_tagValid = true;

                    switch (action_Queue.Peek())
                    {
                    case ActionType.ReadTIDBankWhenWrite:
                        #region MyRegion
                        m_sTIDType = strData.Substring(0, 11);
                        sUniqueTID = strData.Substring(12);

                        if (m_sTIDType.Equals(UHFTIDTypes.Alien_Higgs3))
                        {
                            WriteLog(lrtxtLog, "this is alien higgs 3 chip", 1);
                        }
                        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4D))
                        {
                            WriteLog(lrtxtLog, "this is monza 4d chip", 1);
                        }
                        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4E))
                        {
                            WriteLog(lrtxtLog, "this is monza 4e chip", 1);
                        }
                        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4i))
                        {
                            WriteLog(lrtxtLog, "this is monza 4i chip", 1);
                        }
                        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4QT))
                        {
                            WriteLog(lrtxtLog, "this is monza 4qtchip", 1);
                        }
                        else
                        {
                            WriteLog(lrtxtLog, "this tag is not valid", 1);
                            b_tagValid = false;
                        }

                        if (b_tagValid)
                        {
                            m_sCurrentUniqueTID = sUniqueTID;

                            GetTIDCallback();
                        }
                        else
                        {
                            //tbx_SerialWrite.Enabled = true; EnableControl(1);
                            EnableControl(1);
                        }
                        #endregion
                        break;

                    case ActionType.ReadEPC:
                        WriteLog(lrtxtLog, strData, 0);
                        break;

                    case ActionType.ReadTIDBankWhenRead:
                        #region MyRegion
                        m_sTIDType = strData.Substring(0, 11);
                        sUniqueTID = strData.Substring(12);

                        if (m_sTIDType.Equals(UHFTIDTypes.Alien_Higgs3))
                        {
                            m_userMemorySizeInWord = UHFUserMemorySizeInWord.A_9662;
                            WriteLog(lrtxtLog, "this is alien higgs 3 chip", 1);
                        }
                        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4D))
                        {
                            m_userMemorySizeInWord = UHFUserMemorySizeInWord.Monza_4D;
                            WriteLog(lrtxtLog, "this is monza 4d chip", 1);
                        }
                        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4E))
                        {
                            m_userMemorySizeInWord = UHFUserMemorySizeInWord.Monza_4E;
                            WriteLog(lrtxtLog, "this is monza 4e chip", 1);
                        }
                        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4i))
                        {
                            m_userMemorySizeInWord = UHFUserMemorySizeInWord.Monza_4i;
                            WriteLog(lrtxtLog, "this is monza 4i chip", 1);
                        }
                        else if (m_sTIDType.Equals(UHFTIDTypes.Monza_4QT))
                        {
                            m_userMemorySizeInWord = UHFUserMemorySizeInWord.Monza_4QT;
                            WriteLog(lrtxtLog, "this is monza 4qtchip", 1);
                        }
                        else
                        {
                            m_userMemorySizeInWord = 0x00;
                            WriteLog(lrtxtLog, "this tag is not valid", 1);
                            b_tagValid = false;
                        }

                        if (b_tagValid)
                        {
                            m_sCurrentUniqueTID = sUniqueTID;

                            ReadUserBank();
                        }
                        else
                        {
                            //tbx_readSerial.Enabled = true;
                            EnableControl(2);
                        }
                        #endregion
                        break;

                    case ActionType.ReadUserBank:
                        byte[] userdata = new byte[nDataLen];
                        msgTran.AryData.CopyTo(userdata, 7 + nEpcLen);
                        UserBankDataInterperater(userdata);
                        break;

                    default:
                        break;
                    }

                    action_Queue.Dequeue();
                }
            }
        }