{
  "spec_version": 1,
  "slug": "siemens-pac3200",
  "manufacturer": "Siemens",
  "model": "SENTRON PAC3200",
  "category": "Energy meter",
  "supplier_url": "https://support.industry.siemens.com/cs/ww/en/view/26504150",
  "default_configuration": {
    "protocol": "modbus_tcp",
    "port": 502,
    "unit_id": 1,
    "addressing": "zero_based",
    "byte_order": "BigEndian",
    "word_order": "HighFirst"
  },
  "coils": [],
  "discrete_inputs": [
    {
      "address": 200,
      "count": 1,
      "name": "Digital input 0",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Status of digital input 0, read with function code 02 (single bit)."
    },
    {
      "address": 300,
      "count": 1,
      "name": "Digital output 0",
      "data_type": "Binary",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Status of digital output 0, read with function code 02 (single bit)."
    }
  ],
  "input_registers": [],
  "holding_registers": [
    {
      "address": 1,
      "count": 2,
      "name": "Voltage L1-N",
      "data_type": "Float32",
      "units": "V",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Phase-to-neutral voltage, phase L1."
    },
    {
      "address": 3,
      "count": 2,
      "name": "Voltage L2-N",
      "data_type": "Float32",
      "units": "V",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 5,
      "count": 2,
      "name": "Voltage L3-N",
      "data_type": "Float32",
      "units": "V",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 7,
      "count": 2,
      "name": "Voltage L1-L2",
      "data_type": "Float32",
      "units": "V",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Phase-to-phase voltage, phases L1 and L2."
    },
    {
      "address": 9,
      "count": 2,
      "name": "Voltage L2-L3",
      "data_type": "Float32",
      "units": "V",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 11,
      "count": 2,
      "name": "Voltage L3-L1",
      "data_type": "Float32",
      "units": "V",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 13,
      "count": 2,
      "name": "Current L1",
      "data_type": "Float32",
      "units": "A",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 15,
      "count": 2,
      "name": "Current L2",
      "data_type": "Float32",
      "units": "A",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 17,
      "count": 2,
      "name": "Current L3",
      "data_type": "Float32",
      "units": "A",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 19,
      "count": 2,
      "name": "Apparent power L1",
      "data_type": "Float32",
      "units": "VA",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 21,
      "count": 2,
      "name": "Apparent power L2",
      "data_type": "Float32",
      "units": "VA",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 23,
      "count": 2,
      "name": "Apparent power L3",
      "data_type": "Float32",
      "units": "VA",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 25,
      "count": 2,
      "name": "Active power L1",
      "data_type": "Float32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 27,
      "count": 2,
      "name": "Active power L2",
      "data_type": "Float32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 29,
      "count": 2,
      "name": "Active power L3",
      "data_type": "Float32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 31,
      "count": 2,
      "name": "Reactive power L1",
      "data_type": "Float32",
      "units": "var",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 33,
      "count": 2,
      "name": "Reactive power L2",
      "data_type": "Float32",
      "units": "var",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 35,
      "count": 2,
      "name": "Reactive power L3",
      "data_type": "Float32",
      "units": "var",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 37,
      "count": 2,
      "name": "Power factor L1",
      "data_type": "Float32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Displacement power factor, phase L1."
    },
    {
      "address": 39,
      "count": 2,
      "name": "Power factor L2",
      "data_type": "Float32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 41,
      "count": 2,
      "name": "Power factor L3",
      "data_type": "Float32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 43,
      "count": 2,
      "name": "THD-R voltage L1",
      "data_type": "Float32",
      "units": "%",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Total harmonic distortion of the L1 phase-to-neutral voltage, relative to the fundamental."
    },
    {
      "address": 45,
      "count": 2,
      "name": "THD-R voltage L2",
      "data_type": "Float32",
      "units": "%",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 47,
      "count": 2,
      "name": "THD-R voltage L3",
      "data_type": "Float32",
      "units": "%",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 49,
      "count": 2,
      "name": "THD-R current L1",
      "data_type": "Float32",
      "units": "%",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 51,
      "count": 2,
      "name": "THD-R current L2",
      "data_type": "Float32",
      "units": "%",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 53,
      "count": 2,
      "name": "THD-R current L3",
      "data_type": "Float32",
      "units": "%",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 55,
      "count": 2,
      "name": "Frequency",
      "data_type": "Float32",
      "units": "Hz",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 57,
      "count": 2,
      "name": "Average voltage L-N",
      "data_type": "Float32",
      "units": "V",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 59,
      "count": 2,
      "name": "Average voltage L-L",
      "data_type": "Float32",
      "units": "V",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 61,
      "count": 2,
      "name": "Average current",
      "data_type": "Float32",
      "units": "A",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 63,
      "count": 2,
      "name": "Total apparent power",
      "data_type": "Float32",
      "units": "VA",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 65,
      "count": 2,
      "name": "Total active power",
      "data_type": "Float32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 67,
      "count": 2,
      "name": "Total reactive power",
      "data_type": "Float32",
      "units": "var",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 69,
      "count": 2,
      "name": "Total power factor",
      "data_type": "Float32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 71,
      "count": 2,
      "name": "Voltage unbalance",
      "data_type": "Float32",
      "units": "%",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 73,
      "count": 2,
      "name": "Current unbalance",
      "data_type": "Float32",
      "units": "%",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 205,
      "count": 2,
      "name": "Device diagnostics and device status",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Bit field, most significant byte first: 0x01000000 no synchronization pulse, 0x02000000 device configuration menu active, 0x04000000 voltage too high, 0x08000000 current too high, 0x00010000 slot 1 module, 0x00020000 maximum pulse frequency exceeded, 0x00000100 parameters changed, 0x00000200 limit violation, 0x00000400 pulse frequency too high, 0x00000800 device restart, 0x00001000 user energy counter reset. The individual bits are also available as discrete inputs 108 to 127."
    },
    {
      "address": 211,
      "count": 2,
      "name": "Active tariff",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "0 = tariff 1, 1 = tariff 2."
    },
    {
      "address": 213,
      "count": 2,
      "name": "Operating hours counter",
      "data_type": "UInt32",
      "units": "s",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 501,
      "count": 2,
      "name": "Demand, active power imported",
      "data_type": "Float32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R",
      "description": "Current demand value over the configured demand period."
    },
    {
      "address": 503,
      "count": 2,
      "name": "Demand, reactive power imported",
      "data_type": "Float32",
      "units": "var",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 505,
      "count": 2,
      "name": "Demand, active power exported",
      "data_type": "Float32",
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 507,
      "count": 2,
      "name": "Demand, reactive power exported",
      "data_type": "Float32",
      "units": "var",
      "scale_factor": 1,
      "offset": 0,
      "access": "R"
    },
    {
      "address": 801,
      "count": 4,
      "name": "Active energy imported, tariff 1",
      "data_type": "Float64",
      "units": "Wh",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "64-bit IEEE double. Writing resets or preloads the counter."
    },
    {
      "address": 805,
      "count": 4,
      "name": "Active energy imported, tariff 2",
      "data_type": "Float64",
      "units": "Wh",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 809,
      "count": 4,
      "name": "Active energy exported, tariff 1",
      "data_type": "Float64",
      "units": "Wh",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 813,
      "count": 4,
      "name": "Active energy exported, tariff 2",
      "data_type": "Float64",
      "units": "Wh",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 817,
      "count": 4,
      "name": "Reactive energy imported, tariff 1",
      "data_type": "Float64",
      "units": "varh",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 821,
      "count": 4,
      "name": "Reactive energy imported, tariff 2",
      "data_type": "Float64",
      "units": "varh",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 825,
      "count": 4,
      "name": "Reactive energy exported, tariff 1",
      "data_type": "Float64",
      "units": "varh",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 829,
      "count": 4,
      "name": "Reactive energy exported, tariff 2",
      "data_type": "Float64",
      "units": "varh",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 833,
      "count": 4,
      "name": "Apparent energy, tariff 1",
      "data_type": "Float64",
      "units": "VAh",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 837,
      "count": 4,
      "name": "Apparent energy, tariff 2",
      "data_type": "Float64",
      "units": "VAh",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 50001,
      "count": 2,
      "name": "Connection type",
      "data_type": "UInt32",
      "units": "",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "0 = 3P4W, 1 = 3P3W, 2 = 3P4WB, 3 = 3P3WB, 4 = 1P2W."
    },
    {
      "address": 50005,
      "count": 2,
      "name": "Voltage transformer primary voltage",
      "data_type": "UInt32",
      "units": "V",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 50007,
      "count": 2,
      "name": "Voltage transformer secondary voltage",
      "data_type": "UInt32",
      "units": "V",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 50011,
      "count": 2,
      "name": "Current transformer primary current",
      "data_type": "UInt32",
      "units": "A",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW"
    },
    {
      "address": 50013,
      "count": 2,
      "name": "Current transformer secondary current",
      "data_type": "UInt32",
      "units": "A",
      "scale_factor": 1,
      "offset": 0,
      "access": "RW",
      "description": "1 or 5 A, depending on the current transformer."
    }
  ],
  "combined_registers": [
    {
      "id": "active-power-l1-l2",
      "label": "Active power L1 + L2 (calculated)",
      "operator": "+",
      "operand_a": {
        "register_type": "holding_registers",
        "register_address": 25
      },
      "operand_b": {
        "register_type": "holding_registers",
        "register_address": 27
      },
      "units": "W",
      "scale_factor": 1,
      "offset": 0
    },
    {
      "id": "active-power-total",
      "label": "Active power, all phases (calculated)",
      "operator": "+",
      "operand_a": {
        "combined_id": "active-power-l1-l2"
      },
      "operand_b": {
        "register_type": "holding_registers",
        "register_address": 29
      },
      "units": "W",
      "scale_factor": 1,
      "offset": 0,
      "description": "Sum of the three phase values, next to the device's own total at 65."
    },
    {
      "id": "active-energy-import-total",
      "label": "Active energy imported, both tariffs (calculated)",
      "operator": "+",
      "operand_a": {
        "register_type": "holding_registers",
        "register_address": 801
      },
      "operand_b": {
        "register_type": "holding_registers",
        "register_address": 805
      },
      "units": "Wh",
      "scale_factor": 1,
      "offset": 0
    },
    {
      "id": "active-energy-export-total",
      "label": "Active energy exported, both tariffs (calculated)",
      "operator": "+",
      "operand_a": {
        "register_type": "holding_registers",
        "register_address": 809
      },
      "operand_b": {
        "register_type": "holding_registers",
        "register_address": 813
      },
      "units": "Wh",
      "scale_factor": 1,
      "offset": 0
    }
  ],
  "notes": "Addresses are the \"Offset\" values in the SENTRON PAC3200 product manual (A5E01168664, chapter 3.9) and are used as wire addresses; address 0 is not used by the measured values. The manual states that all measured values can be read with function code 03 and with function code 04, so the entries below work as holding registers and, on the same addresses, as input registers. Measured values are IEEE 754 single precision (2 registers), the energy counters are IEEE 754 double precision (4 registers, Wh/varh/VAh). Energy counters and settings are writable; writing an energy counter resets or preloads it. Status bits, limit states and the digital input/output are available as discrete inputs (function code 02) at bit offsets 0-5, 50, 108-127, 200 and 300. Only the measured values, demand, energy and the transformer/demand settings are listed here; the min/max, limit and communication parameter blocks (offsets 75-201, 63001-63025) follow the same pattern in the manual."
}
