コード例 #1
0
ファイル: FactoryExtensions.cs プロジェクト: l5624/NModbus-1
        /// <summary>
        /// Creates an ASCII slave network.
        /// </summary>
        /// <param name="factory"></param>
        /// <param name="streamResource"></param>
        /// <returns></returns>
        public static IModbusSlaveNetwork CreateAsciiSlaveNetwork(this IModbusFactory factory,
                                                                  IStreamResource streamResource)
        {
            IModbusAsciiTransport transport = factory.CreateAsciiTransport(streamResource);

            return(factory.CreateSlaveNetwork(transport));
        }
コード例 #2
0
 public IModbusSlaveNetwork CreateSlaveNetwork(IModbusAsciiTransport transport)
 {
     return(new ModbusSerialSlaveNetwork(transport, this, Logger));
 }
コード例 #3
0
ファイル: FactoryExtensions.cs プロジェクト: l5624/NModbus-1
        /// <summary>
        /// Creates an ASCII master.
        /// </summary>
        /// <param name="factory"></param>
        /// <param name="streamResource"></param>
        /// <returns></returns>
        public static IModbusSerialMaster CreateAsciiMaster(this IModbusFactory factory, IStreamResource streamResource)
        {
            IModbusAsciiTransport transport = factory.CreateAsciiTransport(streamResource);

            return(new ModbusSerialMaster(transport));
        }