Пример #1
0
        public async Task TestInput()
        {
            var           factory = new ModbusFactory();
            IModbusMaster modbus  = factory.CreateMaster(_client);
            await _client.ConnectAsync(MODBUS_IP, MODBUS_PORT);

            bool[] data = await modbus.ReadInputsAsync(MODBUS_SLAVE, 0, 5);

            Assert.Equal(5, data.Length);
        }
Пример #2
0
 public Task <bool[]> ReadDiscretesAsync(byte slaveAddress, ushort startAddress, ushort number, CancellationToken cancellationToken)
 {
     return(PerformFuncAsync(() => _master.ReadInputsAsync(slaveAddress, startAddress, number), cancellationToken));
 }
Пример #3
0
 public async Task <bool[]> ReadDiscreteInputs(ushort startAddress, ushort pointCount)
 {
     return(await m_modbusConnection.ReadInputsAsync(m_unitID, startAddress, pointCount));
 }