Class: ModBus::RTUViaTCPSlave

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

Overview

RTU over TCP slave implementation

Examples:

RTUViaTCP.connect('127.0.0.1', 10002) 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

- (Object) read_pdu (private)

overide method for RTU implamentaion

See Also:



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

def read_pdu
  read_rtu_pdu
end

- (Object) send_pdu(pdu) (private)

overide method for RTU implamentaion

See Also:



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

def send_pdu(pdu)
  send_rtu_pdu(pdu)
end