Write raw Modbus values
write_registersWrites raw values into a Modbus table starting at an address, including read-only tables to simulate sensor inputs and test SCADA systems without hardware.
Instructions
Write raw values into one Modbus table of a device, starting at an address: 0-65535 for holding and input registers, 0 or 1 for coils and discrete inputs. Unlike a Modbus client this can also write the read-only tables (discrete, input), which is how you fake sensor inputs at an address no point covers. Use set_point when the address belongs to a named point and you want scaling applied; a signal running on a point at that address will overwrite the value on its next update. Returns how many values were written.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"device_id": "<device_id>",
"table": "<table>",
"address": "<address>",
"values": "<values>"
},
"name": "write_registers"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Modbus table: coil and discrete hold bits, holding and input hold 16-bit registers. | |
| values | Yes | Values for consecutive addresses, first value at 'address'. | |
| address | Yes | Zero-based address of the first value. | |
| device_id | Yes | Id of a running device, as returned by create_device, clone_device or list_devices. |