Inject a communication fault
inject_faultSimulate Modbus device communication faults—delays, timeouts, exception replies, or dropped connections—to test how client software handles failures until cleared.
Instructions
Make one device misbehave on the wire so you can test how client software copes: slow answers, no answer (timeout), Modbus exception replies, or dropped connections. The fault applies to every request the device receives, replaces any fault already active on it, and lasts until clear_fault is called or its optional duration_s runs out. Point values keep updating in the background. Use apply_scenario to schedule faults at set times.
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>",
"fault": "<fault>"
},
"name": "inject_fault"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fault | Yes | Fault object. One of: {"type":"delay","ms":N} (slow answers) | {"type":"no_response"} (client times out) | {"type":"exception","code":N} (Modbus exception, e.g. 4 device failure, 6 busy) | {"type":"disconnect"} (drop the TCP connection on every request). Add "duration_s":N to clear it automatically. | |
| device_id | Yes | Id of a running device, as returned by create_device, clone_device or list_devices. |