Class: ModBus::RTUSlave

Inherits:
Slave
  • Object
show all
Includes:
RTU
Defined in:
lib/rmodbus/rtu_slave.rb

Overview

RTU slave implementation

Examples:

RTUClient.connect(port, baud, opts) do |cl|
  cl.with_slave(uid) do |slave|
    slave.holding_registers[0..100]
  end
end

See Also:

Constant Summary

Constant Summary

Constants included from RTU

ModBus::RTU::CHUNK_SIZE, ModBus::RTU::CrcHiTable, ModBus::RTU::CrcLoTable

Constants inherited from Slave

Slave::Exceptions

Instance Attribute Summary

Attributes inherited from Slave

#uid

Attributes included from Options

#raise_exception_on_mismatch, #read_retries, #read_retry_timeout

Attributes included from Debug

#debug, #raise_exception_on_mismatch, #read_retries, #read_retry_timeout

Instance Method Summary collapse

Methods included from RTU

#clean_input_buff, #crc16, #read_rtu_pdu, #read_rtu_request, #read_rtu_response, #send_rtu_pdu, #serv_rtu_requests

Methods inherited from Slave

#check_response_mismatch, #coils, #discrete_inputs, #holding_registers, #initialize, #input_registers, #mask_write_register, #query, #read_coils, #read_discrete_inputs, #read_holding_registers, #read_input_registers, #write_multiple_coils, #write_multiple_registers, #write_single_coil, #write_single_register

Methods included from Debug

#log, #logging_bytes

Constructor Details

This class inherits a constructor from ModBus::Slave

Instance Method Details

#read_pduObject (private)

overide method for RTU implamentaion

See Also:



38
39
40
# File 'lib/rmodbus/rtu_slave.rb', line 38

def read_pdu
  read_rtu_pdu
end

#send_pdu(pdu) ⇒ Object (private)

overide method for RTU implamentaion

See Also:



32
33
34
# File 'lib/rmodbus/rtu_slave.rb', line 32

def send_pdu(pdu)
  send_rtu_pdu(pdu)
end