Skip to content

Device profiles

Ralf Steinert edited this page Nov 2, 2026 · 1 revision

A profile describes one device type in YAML. Two are bundled, and both are invented:

Profile Device type PV SV
pressure 0xFA01 pressure, kPa, sensor limits -100 to 2500, range 0 to 1000 sensor temperature, degC
temperature 0xFA02 temperature, degC, sensor limits -200 to 850, range 0 to 150 terminal temperature, degC

There are no profiles after real products, because most device-specific HART commands are not public. Their manufacturer ID 0x00FA deliberately belongs to nobody.

Change a device in a bench

Any key other than profile, polling_address and device_id overrides the profile:

devices:
  - {profile: pressure, polling_address: 1, device_id: 0x000001, tag: PT-101}
  - profile: pressure
    polling_address: 2
    device_id: 0x000002
    tag: PT-102
    long_tag: "Tank 2 level"
    alarm: low

With alarm: low, a failed sensor drives the loop to 3.6 mA instead of 21 mA.

Duplicate tags, polling addresses and device IDs are refused, and the error names the entry.

Write your own

Save it next to the bench file and use profile: flow.yaml:

kind: flow-transmitter
manufacturer_id: 0x00FA
device_type: 0xFA03
device_revision: 1
tag: FT-301
long_tag: "Line 3 flow"
descriptor: "SIM FLOW"
min_span: 1
alarm: high
pv:
  unit: bar
  sensor_limits: [0, 40]
  range: [0, 25]
  damping: 0.5
  source:
    - {type: constant, value: 10}
    - {type: sine, offset: 0, amplitude: 2, period: 30}
    - {type: noise, sigma: 0.05}
sv: {name: body temperature, unit: degC, source: {type: constant, value: 23.5}}

A source may be one entry or a list, whose values are added up:

Type Parameters
constant value
ramp start, stop, period
sine offset, amplitude, period
noise sigma

The units are inH2O psi bar mbar kPa degC degF K mA %. There is no flow unit, so this example measures a differential pressure in bar.

From value to loop current

The PV maps from the range (lower to upper range value) to 4-20 mA. Outside that, the current saturates at 3.8 and 20.5 mA. A failed sensor gives the alarm current. Command 40 fixes the current, and command 6 sets the 4 mA of multidrop mode.

Override the process value

To test a specific value, set it from outside. auto hands it back to the source:

hart-sim set PT-101 pv 123.4
hart-sim set PT-101 pv auto

The value still passes through the damping of the profile, 0.5 s on the bundled devices, so it does not arrive at once. Use damping: 0 if a test reads it straight away.

Next: Testing in CI.

Clone this wiki locally