{
  "spec_version": 1,
  "slug": "waveshare-modbus-rtu-io-8ch",
  "manufacturer": "Waveshare",
  "model": "Modbus RTU IO 8CH (8 digital inputs / 8 digital outputs, RS485)",
  "category": "Remote I/O",
  "supplier_url": "https://www.waveshare.com/modbus-rtu-io-8ch.htm",
  "default_configuration": {
    "protocol": "modbus_rtu",
    "unit_id": 1,
    "addressing": "zero_based",
    "byte_order": "BigEndian",
    "word_order": "HighFirst",
    "native_interface": "rs485",
    "serial": {
      "baud_rate": 9600,
      "parity": "None",
      "data_bits": 8,
      "stop_bits": 1
    }
  },
  "coils": [
    {
      "address": 0,
      "count": 1,
      "name": "Digital output 1",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Output channel address 0x0000-0x0007: 0xFF00 = on, 0x0000 = off, 0x5500 = toggle (function 01/05/0F)."
    },
    {
      "address": 1,
      "count": 1,
      "name": "Digital output 2",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Output channel address 0x0000-0x0007: 0xFF00 = on, 0x0000 = off, 0x5500 = toggle (function 01/05/0F)."
    },
    {
      "address": 2,
      "count": 1,
      "name": "Digital output 3",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Output channel address 0x0000-0x0007: 0xFF00 = on, 0x0000 = off, 0x5500 = toggle (function 01/05/0F)."
    },
    {
      "address": 3,
      "count": 1,
      "name": "Digital output 4",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Output channel address 0x0000-0x0007: 0xFF00 = on, 0x0000 = off, 0x5500 = toggle (function 01/05/0F)."
    },
    {
      "address": 4,
      "count": 1,
      "name": "Digital output 5",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Output channel address 0x0000-0x0007: 0xFF00 = on, 0x0000 = off, 0x5500 = toggle (function 01/05/0F)."
    },
    {
      "address": 5,
      "count": 1,
      "name": "Digital output 6",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Output channel address 0x0000-0x0007: 0xFF00 = on, 0x0000 = off, 0x5500 = toggle (function 01/05/0F)."
    },
    {
      "address": 6,
      "count": 1,
      "name": "Digital output 7",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Output channel address 0x0000-0x0007: 0xFF00 = on, 0x0000 = off, 0x5500 = toggle (function 01/05/0F)."
    },
    {
      "address": 7,
      "count": 1,
      "name": "Digital output 8",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Output channel address 0x0000-0x0007: 0xFF00 = on, 0x0000 = off, 0x5500 = toggle (function 01/05/0F)."
    }
  ],
  "discrete_inputs": [
    {
      "address": 0,
      "count": 1,
      "name": "Digital input 1",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Input channel address 1x0000-1x0007, read with function 02; 0 = off, 1 = on."
    },
    {
      "address": 1,
      "count": 1,
      "name": "Digital input 2",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Input channel address 1x0000-1x0007, read with function 02; 0 = off, 1 = on."
    },
    {
      "address": 2,
      "count": 1,
      "name": "Digital input 3",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Input channel address 1x0000-1x0007, read with function 02; 0 = off, 1 = on."
    },
    {
      "address": 3,
      "count": 1,
      "name": "Digital input 4",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Input channel address 1x0000-1x0007, read with function 02; 0 = off, 1 = on."
    },
    {
      "address": 4,
      "count": 1,
      "name": "Digital input 5",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Input channel address 1x0000-1x0007, read with function 02; 0 = off, 1 = on."
    },
    {
      "address": 5,
      "count": 1,
      "name": "Digital input 6",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Input channel address 1x0000-1x0007, read with function 02; 0 = off, 1 = on."
    },
    {
      "address": 6,
      "count": 1,
      "name": "Digital input 7",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Input channel address 1x0000-1x0007, read with function 02; 0 = off, 1 = on."
    },
    {
      "address": 7,
      "count": 1,
      "name": "Digital input 8",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Input channel address 1x0000-1x0007, read with function 02; 0 = off, 1 = on."
    }
  ],
  "input_registers": [],
  "holding_registers": [
    {
      "address": 4096,
      "count": 1,
      "name": "Output channel 1 control mode",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Register 4x1000-4x1007. 0 = normal mode (the output is driven by the write commands), 1 = linkage mode (the output follows its input channel), 2 = toggle mode (the output toggles on each input pulse), 3 = edge-trigger mode (the output changes once on each input level change)."
    },
    {
      "address": 4097,
      "count": 1,
      "name": "Output channel 2 control mode",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Register 4x1000-4x1007. 0 = normal mode (the output is driven by the write commands), 1 = linkage mode (the output follows its input channel), 2 = toggle mode (the output toggles on each input pulse), 3 = edge-trigger mode (the output changes once on each input level change)."
    },
    {
      "address": 4098,
      "count": 1,
      "name": "Output channel 3 control mode",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Register 4x1000-4x1007. 0 = normal mode (the output is driven by the write commands), 1 = linkage mode (the output follows its input channel), 2 = toggle mode (the output toggles on each input pulse), 3 = edge-trigger mode (the output changes once on each input level change)."
    },
    {
      "address": 4099,
      "count": 1,
      "name": "Output channel 4 control mode",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Register 4x1000-4x1007. 0 = normal mode (the output is driven by the write commands), 1 = linkage mode (the output follows its input channel), 2 = toggle mode (the output toggles on each input pulse), 3 = edge-trigger mode (the output changes once on each input level change)."
    },
    {
      "address": 4100,
      "count": 1,
      "name": "Output channel 5 control mode",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Register 4x1000-4x1007. 0 = normal mode (the output is driven by the write commands), 1 = linkage mode (the output follows its input channel), 2 = toggle mode (the output toggles on each input pulse), 3 = edge-trigger mode (the output changes once on each input level change)."
    },
    {
      "address": 4101,
      "count": 1,
      "name": "Output channel 6 control mode",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Register 4x1000-4x1007. 0 = normal mode (the output is driven by the write commands), 1 = linkage mode (the output follows its input channel), 2 = toggle mode (the output toggles on each input pulse), 3 = edge-trigger mode (the output changes once on each input level change)."
    },
    {
      "address": 4102,
      "count": 1,
      "name": "Output channel 7 control mode",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Register 4x1000-4x1007. 0 = normal mode (the output is driven by the write commands), 1 = linkage mode (the output follows its input channel), 2 = toggle mode (the output toggles on each input pulse), 3 = edge-trigger mode (the output changes once on each input level change)."
    },
    {
      "address": 4103,
      "count": 1,
      "name": "Output channel 8 control mode",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Register 4x1000-4x1007. 0 = normal mode (the output is driven by the write commands), 1 = linkage mode (the output follows its input channel), 2 = toggle mode (the output toggles on each input pulse), 3 = edge-trigger mode (the output changes once on each input level change)."
    },
    {
      "address": 8192,
      "count": 1,
      "name": "UART parameter (baud rate and parity)",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "W",
      "description": "Register 4x2000. The table splits the word: high eight bits = parity mode (0x00-0x02), low eight bits = baud-rate mode (0x00-0x07). The page's own 'Set Baudrate Command' section lists the codes: baud rate 0x00 = 4800, 0x01 = 9600, 0x02 = 19200, 0x03 = 38400, 0x04 = 57600, 0x05 = 115200, 0x06 = 128000, 0x07 = 256000; parity 0x00 = none. That section contradicts itself on the parity codes - its send-code table prints 0x01 = even and 0x02 = odd while the identical return-code table prints 0x01 = odd and 0x02 = even - so only 0x00 (none) is unambiguous. The permission column marks this register 'Write' even though the function-code column of the same row also lists 03."
    },
    {
      "address": 16384,
      "count": 1,
      "name": "Device address",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "Register 4x4000. Stores the Modbus slave address directly, 0x0001-0x00FF. The wiki specification states '1~255 (1 by default, corresponds to the hexadecimal value of 0x01)'."
    },
    {
      "address": 32768,
      "count": 1,
      "name": "Software version",
      "data_type": "UInt16",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Register 4x8000. Divide by 100 for the version: 0x0064 = 100 = V1.00."
    }
  ],
  "combined_registers": [],
  "notes": "Source: Waveshare wiki page https://www.waveshare.com/wiki/Modbus_RTU_IO_8CH, section 'Development Protocol V2' (function-code table, register-address table and worked commands), plus the product page https://www.waveshare.com/modbus-rtu-io-8ch.htm whose specification table prints 'Default communication format 9600, N, 8, 1', the baud-rate list and the input/output characteristics, and the vendor wiki page 'Modbus Series BootLoader Description' (restoring the default device parameters gives '9600 N 8 1' and device address 0x01). The wiki page's own specification table prints the same values - 'Default Communication Format 9600, N, 8, 1' and 'Set the device address range 1~255 (1 by default, corresponds to the hexadecimal value of 0x01)' - so the frame and the address are each cited twice. The control-mode registers are named in the page's Read/Write Control Mode sections (0 = normal, 1 = linkage, 2 = toggle, 3 = edge trigger). The register table prints addresses as 0x0000-0x0007, 1x0000-1x0007, 4x1000, 4x2000, 4x4000 and 4x8000; the seed stores those numbers unchanged and declares zero_based addressing. Only the readable / read-writable blocks are seeded: the write-only command coils 0x00FF (all outputs), 0x0200-0x0207 (flash on, interval in 100 ms steps) and 0x0400-0x0407 (flash off) are left out because the schema's coil area allows R and RW only. The four output control modes behind register 4x1000 are documented only as a 0-3 range, so they are stored without invented names. The input channels are passive or active 5-36 V inputs (NPN or PNP) with bidirectional optocoupler isolation; the outputs are open-drain, 5-40 V, 500 mA per channel."
}
