private void SendReadmsg()
 {
     udpPackage package = new udpPackage();
     package.addr = 1;
     package.cmd = (byte)RfidCmdEnum.CMD_READ;
     package.frameType = 0x01;
     package.len = 0x03;
     try
     {
         byte[] byteStream = package.UnPack();
         //_sockRfid.SendTo(byteStream, _epRfid);
         _udpClient.Send(byteStream, byteStream.Length);
     }
     catch (System.Exception e)
     {
         Console.WriteLine("SendReadmsg()"+e.Message);
     }
 }
        /// <summary>
        /// 发送查询命令
        /// </summary>
        private void SendQuerymsg()
        {
            udpPackage package1 = new udpPackage();
            package1.addr = (byte)MachineNo;
            package1.cmd = (byte)PlcCmdEnum.CMD_QUERY;
            package1.frameType = 0x01;
            package1.len = 0x03;
            byte[] byteStream = package1.UnPack();
            //_sockPlc.SendTo(byteStream, _epPlc);
            try
            {

                _udpClient.Send(byteStream, byteStream.Length);
            }
            catch (System.Exception e)
            {
                Console.WriteLine("SendQuerymsg failed:" + e.Message);
            }
        }
 /// <summary>
 /// 清除线上产品
 /// </summary>
 public void SendMsgClearObj()
 {
     udpPackage package = new udpPackage();
     package.addr = 1;
     package.cmd = (byte)RfidCmdEnum.CMD_OBJCLEAR;
     package.frameType = 0x01;
     package.len = 0x03;
     try
     {
         byte[] byteStream = package.UnPack();
         //_sockRfid.SendTo(byteStream, _epRfid);
         _udpClient.Send(byteStream, byteStream.Length);
     }
     catch (System.Exception e)
     {
         Console.WriteLine("SendClearObjMsg" + e.Message);
     }
 }
 /// <summary>
 /// 执行指令
 /// </summary>
 /// <param name="cmd"></param>
 /// <returns></returns>
 public bool ExecuteCmd(HouseInOutCmd cmd)
 {
     if (cmd == null)
         return false;
     CurrentCmd = cmd;
     udpPackage package = new udpPackage();
     package.frameType = 0x01;
     package.len = 0x07;
     package.cmd = (byte)cmd.Cmdcode;
     package.addr = (byte)MachineNo;
     package.data = new byte[4];
     package.data[0] = (byte)cmd.CellTarget.L;
     package.data[1] = (byte)cmd.CellTarget.R;
     package.data[2] = (byte)(cmd.CellTarget.C&0xff);
     package.data[3] = (byte)((cmd.CellTarget.C>>8)&0xff);
     byte[] byteStream = package.UnPack();
     try
     {
         _udpClient.Send(byteStream, byteStream.Length);
     }
     catch (System.Exception e)
     {
         Console.WriteLine("Send ExecuteCmd failed:" + e.Message);
     }
        // _sockPlc.SendTo(byteStream, _epPlc);
     return true;
 }