public CompositeInputRegisterVariable(ModbusControllerConnection connection, InputRegisterAddress address, ushort sizeInWords)
 {
     _connection  = connection;
     _address     = address;
     _sizeInWords = sizeInWords;
 }
Exemplo n.º 2
0
        public static Message CreateReadInputRegistersCommand(SlaveAddress slaveAddress, InputRegisterAddress firstRegister, ushort numberOfRegisters)
        {
            var data = new List <byte>();

            WriteSlaveAddress(data, slaveAddress);
            WriteFunctionCode(data, FunctionCode.ReadInputRegisters);
            WriteInputRegisterAddress(data, firstRegister);
            WriteBigEndianUInt16(data, numberOfRegisters);

            return(CreateFromRaw(data));
        }
 internal ushort[] ReadInputRegisters(InputRegisterAddress firstRegister, ushort numberOfRegisters)
 {
     return(_master.ReadInputRegisters(_slaveRaw, firstRegister.WireValue, numberOfRegisters));
 }
Exemplo n.º 4
0
 private static void WriteInputRegisterAddress(List <byte> buffer, InputRegisterAddress address)
 {
     WriteBigEndianUInt16(buffer, address.WireValue);
 }
Exemplo n.º 5
0
 public InputRegisterVariable(ModbusControllerConnection connection, InputRegisterAddress address)
 {
     _connection = connection;
     _address    = address;
 }