Beispiel #1
0
        /// <summary>
        /// 现在可以从任意的线程来调用本方法了,性能非常的高
        /// </summary>
        /// <param name="address">地址</param>
        /// <param name="value">值</param>
        /// <returns>结果对象</returns>
        public OperateResult Write(string address, short value)
        {
            ModbusConnector connector = connectPool.GetAvailableConnector( );
            OperateResult   write     = connector.ModbusTcp.Write(address, value);

            connectPool.ReturnConnector(connector);
            return(write);
        }
Beispiel #2
0
        /// <summary>
        /// 现在可以从任意的线程来调用本方法了,性能非常的高
        /// </summary>
        /// <param name="address">地址</param>
        /// <returns>结果对象</returns>
        public OperateResult <short> ReadInt16(string address)
        {
            ModbusConnector       connector = connectPool.GetAvailableConnector( );
            OperateResult <short> read      = connector.ModbusTcp.ReadInt16(address);

            connectPool.ReturnConnector(connector);
            return(read);
        }