Modbus TCP simulator in Docker

Cowpoke is a free Modbus TCP simulator that runs in one Docker container. Start it, and your HMI, SCADA or gateway has a Modbus device to poll before the real one exists.

docker run -d -p 8080:8080 -p 5020:5020 -e COWPOKE_ADMIN_PASSWORD=change-me ohmsteadhq/cowpoke

Open http://localhost:8080, add a Modbus TCP service in server mode, and give it tags. Or write the same thing as YAML:

services:
  - id: pump-plc
    kind: modbus
    mode: server
    settings: { port: 5020 }
    tags:
      - { name: tank_level, datatype: float32, register: 0, units: "%", simulate: { kind: sine, min: 30, max: 70, period_ms: 60000 } }
      - { name: pump_run, datatype: bool, table: coil, register: 0 }
      - { name: flow, datatype: int16, table: input_register, register: 10, scale: 0.1, simulate: { kind: walk, min: 8, max: 16, step: 0.4 } }
      - { name: drive_speed, datatype: uint16, register: 0, unit: 2 }

What it simulates

What comes with it

Compared with single-purpose Modbus simulators

A small Modbus-only image is fine when all you need is a register to poll. Cowpoke is for when the test grows: more devices, other protocols (OPC UA, EtherNet/IP, S7, MQTT, IO-Link), recorded history, and checks that tell you why a value is wrong.

More from Cowpoke: OPC UA simulator · S7 PLC simulator · Neuron alternative.

Questions about your plant's protocols?