### Install Documentation Tools Source: https://github.com/pymodbus-dev/pymodbus/blob/dev/README.rst Install the necessary tools for building project documentation. ```bash pip install ".[documentation]" ``` -------------------------------- ### Install Documentation Tools Source: https://github.com/pymodbus-dev/pymodbus/blob/dev/doc/index.md Installs the necessary tools for building the project documentation. This is a prerequisite for generating the documentation. ```bash pip install "'.[documentation]'" ``` -------------------------------- ### Device Setup Configuration - Alternative Source: https://github.com/pymodbus-dev/pymodbus/blob/dev/doc/source/library/simulator/config.md Alternative device setup configuration with different default actions for data types. Note the null values for actions. ```json { "device_list": { "device_try": { "setup": { "co size": 63000, "di size": 63000, "hr size": 63000, "ir size": 63000, "shared blocks": true, "type exception": true, "defaults": { "value": { "bits": 0, "uint16": 0, "uint32": 0, "float32": 0.0, "string": " " }, "action": { "bits": null, "uint16": null, "uint32": null, "float32": null, "string": null } } } } } } ``` -------------------------------- ### Start Pymodbus Simulator Source: https://github.com/pymodbus-dev/pymodbus/blob/dev/README.rst Use this command to start the Pymodbus simulator. Ensure you specify the correct modbus device. ```bash pymodbus.simulator --modbus_device device_try ``` -------------------------------- ### Install Development Tools Source: https://github.com/pymodbus-dev/pymodbus/blob/dev/README.rst Install required development tools in editable mode. Use the '.[development]' option for development tools or '.[all]' for all extras including documentation. ```bash pip install -e ".[development]" ``` ```bash pip install -e ".[all]" ``` -------------------------------- ### Device Setup Configuration Source: https://github.com/pymodbus-dev/pymodbus/blob/dev/doc/source/library/simulator/config.md Configure device setup parameters including data sizes for different register types and default values for various data types. ```json { "device_list": { "device": { "setup": { "co size": 63000, "di size": 63000, "hr size": 63000, "ir size": 63000, "shared blocks": true, "type exception": true, "defaults": { "value": { "bits": 0, "uint16": 0, "uint32": 0, "float32": 0.0, "string": " " }, "action": { "bits": null, "uint16": "increment", "uint32": "increment", "float32": "increment", "string": null } } } } } } ``` -------------------------------- ### Install Pymodbus with Pip Source: https://github.com/pymodbus-dev/pymodbus/blob/dev/README.rst Install the pymodbus library using pip. For serial communication, install with the 'serial' extra. ```bash pip install pymodbus ``` ```bash pip install pymodbus[serial] ``` -------------------------------- ### Install pymodbus with pip Source: https://github.com/pymodbus-dev/pymodbus/blob/dev/doc/index.md Install the core pymodbus library using pip. This is the standard method for applications that use the library. ```bash pip install pymodbus ``` -------------------------------- ### Basic Modbus TCP Client Example Source: https://github.com/pymodbus-dev/pymodbus/blob/dev/README.rst A simple example demonstrating how to connect to a Modbus TCP device, write a coil, read coils, and close the connection. ```python from pymodbus.client import ModbusTcpClient client = ModbusTcpClient('MyDevice.lan') client.connect() client.write_coil(1, True) result = client.read_coils(1,1) print(result.bits[0]) client.close() ``` -------------------------------- ### Install Pymodbus with Pip Options Source: https://github.com/pymodbus-dev/pymodbus/blob/dev/README.rst Install pymodbus with specific options or all options using pip. The 'all' option includes extras for documentation and development. ```bash pip install pymodbus[