Module ModbusSlave
The class that creates a modbus slave communication protocol.
Info:
- Copyright: Debaru Kft. 2017
- Release:
- License: GNU
- Author: Debaru Kft
| 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. |
| 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. |
| assign (tag) |
Assign an existing tag to a modbus slave point. |
| tag () |
Create a new tag for a modbus slave point |
-
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:
-
slave_id
-
Represents the identification of the slave device
-
tcp_port
-
Represents the port number of the connection
-
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
-
data_bits
-
Represents the number of data bits of the connection
-
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
-
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
-
receive_timeout
-
Represents the receive timeout settings of the connection. Resolution is in ms.
-
type
-
Tells the system how much time should it wait between two query. Resolution is in ms.
-
assign (tag)
-
Assign an existing tag to a modbus slave point.
Parameters:
-
tag ()
-
Create a new tag for a modbus slave point
Returns:
Tag