Module ModbusSlave

The class that creates a modbus slave communication protocol.

Info:

  • Copyright: Debaru Kft. 2017
  • Release:
  • License: GNU
  • Author: Debaru Kft

Functions

ModbusSlave () Creates a slave modbus communication platform
start () Begins to serve the master queries.
register (address) Reads the specified range of modbus registers.
coil (address) Reads the specified range of modbus coils.
is_connected () Returns a ModbusSlavePointLocator instance that the user can then test for connection.
is_error () Returns a ModbusSlavePointLocator instance that the user can then test for error.
debug_as (name) Logs the input and output data of the serial port, with name.

Fields

slave_id Represents the identification of the slave device
tcp_port Represents the port number of the connection
serial_device Represents the port mode.
baud Represents the baud number of the connection
data_bits Represents the number of data bits of the connection
parity Represents the parity settings of the connection
stop_bits Represents the number of stopbits of the connection
flow_control Represents the flow control settings of the connection
frame_timeout Represents the frame timeout settings of the connection.
receive_timeout Represents the receive timeout settings of the connection.
type Tells the system how much time should it wait between two query.

ModbusSlavePointLocator

assign (tag) Assign an existing tag to a modbus slave point.
tag () Create a new tag for a modbus slave point


Functions

ModbusSlave ()
Creates a slave modbus communication platform
start ()
Begins to serve the master queries. Must be called only once at initialization after setup.

Returns:

    bool
register (address)
Reads the specified range of modbus registers.

Parameters:

Returns:

    ModbusSlavePointLocator
coil (address)
Reads the specified range of modbus coils.

Parameters:

Returns:

    ModbusSlavePointLocator
is_connected ()
Returns a ModbusSlavePointLocator instance that the user can then test for connection.

Returns:

    ModbusSlavePointLocator
is_error ()
Returns a ModbusSlavePointLocator instance that the user can then test for error.

Returns:

    ModbusSlavePointLocator
debug_as (name)
Logs the input and output data of the serial port, with name.

Parameters:

Fields

slave_id
Represents the identification of the slave device
  • type int (default: 1)
tcp_port
Represents the port number of the connection
  • type int (default: 502)
serial_device
Represents the port mode.
  • 0 tcp_port and host is used
  • 1 RS232 (port1)
  • 2 RS485
  • 3 RS232 (port2)
  • type int (default: 0)
baud
Represents the baud number of the connection
  • type int (default: 9600)
data_bits
Represents the number of data bits of the connection
  • type int (default: 8)
parity
Represents the parity settings of the connection
  • Options NONE, EVEN, ODD
  • type string (default: NONE)
stop_bits
Represents the number of stopbits of the connection
  • type int (default: 1)
flow_control
Represents the flow control settings of the connection
  • Options NONE, RTSCTS, XONXOFF
  • type string (default: NONE)
frame_timeout
Represents the frame timeout settings of the connection. Resolution is in ms. Only available when serialport mode is selected
  • type int (default: 5)
receive_timeout
Represents the receive timeout settings of the connection. Resolution is in ms.
  • type int (default: 500)
type
Tells the system how much time should it wait between two query. Resolution is in ms.
  • type int (default: 10)

ModbusSlavePointLocator

assign (tag)
Assign an existing tag to a modbus slave point.

Parameters:

tag ()
Create a new tag for a modbus slave point

Returns:

    Tag
generated by LDoc 1.4.6 Last updated 2023-09-25 09:31:08