public bool OnInit()
        {
            _log.NormalLog(string.Format("ModbusTCPClientHanderTask:Init=>Initing "));
            try
            {
                //获取配置
                _config = ReaderXMLUtil.ReadXMLConfig <ModbusTCPClientConfig>("../../../../conf/Configuration.xml", ModbusTCPClientConfig.ReadConfig, "setup", "ModbusTCPClientHandlerTask")[0];
                if (_config.IpAddress == "" || _config.SignalListFilePath == "")
                {
                    _log.ErrorLog(string.Format("ModbusTCPClientHanderTask Init fail:{0}", "IP address or Signal file path is null!"));
                    return(false);
                }
                _setup   = new EthernetSetUp(_config.IpAddress, _config.Port);
                _timeout = new TimeOut("ModbusTCPClientHanderTask", _config.TimeOut, _log);

                _timeRead = new Timer.Timer(_config.PollingTime);

                _client = new ModbusTCPClient(_setup, _timeout, _log);

                //获取点数据
                _workbook = XmlSerialiaztion.XmlDeserial <XMLWorkbook>(_config.SignalListFilePath, _log);
                _points   = PointsCollcetCreate.Create(_workbook, _log);
                //点数据注册
                PointsRegister.Register(ref _points, _log);
                _log.NormalLog(string.Format("ModbusTCPClientHanderTask:Initing=>Inited "));
                return(true);
            }
            catch (Exception e)
            {
                _log.ErrorLog(string.Format("ModbusTCPClientHanderTask Init fail:{0}", e.Message));
                return(false);
            }
        }
        public static void ReadConfig(ModbusTCPClientConfig clientConfig, XmlReader reader)
        {
            int temp;

            clientConfig.IpAddress = reader["address"];
            if (int.TryParse(reader["port"], out temp))
            {
                clientConfig.Port = temp;
            }
            if (int.TryParse(reader["timeout"], out temp))
            {
                clientConfig.TimeOut = temp;
            }
            if (int.TryParse(reader["timer"], out temp))
            {
                clientConfig.PollingTime = temp;
            }
            clientConfig.SignalListFilePath = reader["signallist"];
        }