/// <summary> /// Reads a single Modbus/TCP register /// </summary> /// <param name="command">Modbus/TCP register index for holding register</param> /// <returns>Register content</returns> public int ReadInteger(object command) { int _value = 0; ModbusCommand _command = (ModbusCommand)command; ushort[] _data = ReadModbusRegisters(); _value = _command.ToValue(_data); return(_value); }
/// <summary> /// Reads a single Modbus/TCP register /// </summary> /// <param name="command">Modbus/TCP register index for holding register</param> /// <returns>Register content</returns> public string Read(object command) { int _value = 0; ModbusCommand _command = (ModbusCommand)command; ushort[] _data = ReadModbusRegisters(); _value = _command.ToValue(_data); return(_value.ToString()); }
/// <inheritdoc /> public async Task <string> ReadAsync(object command) { int _value = 0; ModbusCommand _command = (ModbusCommand)command; ushort[] _data = await ReadModbusRegistersAsync(); _value = _command.ToValue(_data); this.UpdateData?.Invoke(this, new EventArgs()); return(_value.ToString()); }
/// <inheritdoc /> public int ReadIntegerFromBuffer(object command) { ModbusCommand modbuscommand = (ModbusCommand)command; return(modbuscommand.ToValue(AllData)); }
public string ReadFromBuffer(object command) { ModbusCommand modBusCommand = (ModbusCommand)command; return((modBusCommand.ToValue(AllData)).ToString()); }