cheap_modbus_rtu
Lightweight control of cheap Modbus RTU components using Python
|
Control via RS-485 Modbus RTU: More...
Public Member Functions | |
def | __init__ (self, int slave_id=255, str serial_device_name=None, int baudrate=9600, **kwargs) |
def | set_output (self, int output_no, bool active=True) |
Set specified output. More... | |
def | clear_output (self, int output_no) |
Disable specified output. More... | |
bool | get_input (self, int input_no) |
Return the state of the specified digital input. More... | |
tuple[bool,...] | get_inputs (self) |
Returns the state of the digital inputs. More... | |
def | set_slave_id (self, int slave_id_new) |
Set the slave ID. More... | |
def | set_baudrate (self, int baudrate=9600) |
Set RS485 serial baud rate. More... | |
def | do_factory_reset (self) |
Factory reset not implemented for the relay modules. | |
int | get_slave_id (self) |
Sends a broadcast query to all devices on the bus. More... | |
Public Attributes | |
slave_id | |
master | |
Control via RS-485 Modbus RTU:
1x Serial RS-485 Modbus RTU relay PCB
==> This is for the four-channel variant.
This variant has:
|
inherited |
Disable specified output.
output_no | Output number, starts counting at 1 |
|
inherited |
Return the state of the specified digital input.
input_no | Input number, starts counting at 1 |
|
inherited |
Returns the state of the digital inputs.
|
inherited |
Sends a broadcast query to all devices on the bus.
This only works when only one device is attached to the bus
|
inherited |
Set RS485 serial baud rate.
FIXME | 1200 and 2400 are undocumented. Really possible? |
baudrate | Can be 1200, 2400, 4800, 9600 (default) or 19200 |
Reimplemented from cheap_modbus_rtu.cheap_modbus_io.ModbusModuleABC.
|
inherited |
Set specified output.
output_no | Output number, starts counting at 1 |
active | Enable output if active == True (default) Disable output if active == False |
|
inherited |
Set the slave ID.
slave_id_new | New Modbus slave ID |
Reimplemented from cheap_modbus_rtu.cheap_modbus_io.ModbusModuleABC.