6ES7531-7TF00-0AB0 HART Read/Write via WRREC RDREC in TIA Portal

David Krause11 min read
SiemensTIA PortalTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

6ES7531-7TF00-0AB0 HART Read/Write via WRREC/RDREC in TIA Portal V17

The Siemens SIMATIC S7-1500 module 6ES7531-7TF00-0AB0 (SM 531 AI 8xTC/RTD/R HART) is the only AI card in the S7-1500 family that integrates HART v7 communication natively on every channel, allowing a TIA Portal V17 program to pull PV/SV/TV/QV data from field devices such as the Endress+Hauser TMT142 temperature transmitter and PMP71B-1Q689/0 pressure transmitter without a handheld or third-party tool. This reference details the exact procedure for using WRREC and RDREC system functions to perform acyclic HART reads and writes from a TIA Portal project.

1. Hardware Architecture and Channel Topology

The 6ES7531-7TF00-0AB0 occupies one slot on the S7-1500 backplane and provides eight isolated differential inputs. Each input is configurable for thermocouples (types B, E, J, K, N, R, S, T, U, C, L, TXK, GOST), RTDs (Pt100, Pt200, Pt500, Pt1000, Ni100, Ni1000, Cu10, Cu50, Cu100, LG-Ni1000), or resistance measurement (0–300/600/6000 Ω). Channels 0–1 and 2–3 are paired for HART modulation; an internal HART modem per pair decodes the FSK signal riding on the 4–20 mA loop generated by the field device.

Current sourcing rule: the SM 531 does not source loop power. The 4–20 mA loop must be powered by the field device or by an external transmitter power supply (e.g., 6EP1334-3BA10 SITOP or 6ES7507-0AA00-0AB0). Do not place a passive sensor on a non-powered loop and expect HART traffic.
S7-1500 CPU e.g. 1515-2 PN TIA Portal V17 WRREC / RDREC 6ES7531-7TF00-0AB0 SM 531 AI 8xTC/RTD/R HART Ch 0-7, HART on 0-1 / 2-3 / 4-5 / 6-7 Endress+Hauser TMT142 Temp. transmitter, HART 7 PV/SV/TV/QV = TC/SC Endress+Hauser PMP71B-1Q689/0 Pressure transmitter, HART 7 PV = Pressure, SV = Level Power: 24 V DC loop supply required

2. Prerequisites

  • CPU: S7-1500 with FW ≥ 2.0 (1511/1513/1515/1516/1517/1518; ET200MP CPUs also supported).
  • Module: 6ES7531-7TF00-0AB0 firmware ≥ V1.0. Confirm FW with HW identifier via online diagnostics.
  • Engineering: TIA Portal V17 Update 4 or later, with HSP (Hardware Support Package) for the module installed. S7-PCT is not required for this workflow.
  • Field devices: HART v5/v6/v7 sensor. The TMT142 ships HART v7 by default; the PMP71B is field-selectable to HART v6 or v7.
  • Wiring: Loop supply 24 V DC, polarity-correct twisted pair, HART 250 Ω minimum at the receiver side.
  • Reference numbers: Each HART device must have a unique Long Tag (32 chars, HART v6+) or Tag (8 chars, legacy).
HSP install: Without the matching HSP the module shows as "unknown" in TIA Portal and RDREC on the HART slot will return status 80C3 (wrong record index / format). Install via Options > Manage HSP.

3. Configuring the Module in TIA Portal V17

  1. Open the project, drag the 6ES7531-7TF00-0AB0 into a free slot of the S7-1500 rack.
  2. In Properties > Module parameters, set each used channel:
    • Measurement type: TC, RTD-3 wire, RTD-4 wire, Resistance, or Disabled.
    • Smoothing: default "None"; use "Weak/Medium/Strong" if process is noisy.
    • Interference frequency suppression: 50 Hz / 60 Hz / None.
  3. In Properties > HART:
    • Enable the channel for HART.
    • Assign the HART short address (0 for point-to-point, 1–15 for multidrop).
    • Set the number of dynamic variables to acquire (4 = PV/SV/TV/QV, 8, 16).
  4. Compile hardware (Ctrl+F3) and download to the CPU. Confirm green module LED before continuing.

4. HART Variable Model (PV, SV, TV, QV)

Variable Universal Cmd Common Cmd TMT142 default PMP71B default
PV (Primary) 1 3 Temperature °C Pressure bar
SV (Secondary) 3 3 Device temperature Level m / Volume
TV (Tertiary) 3 3 Sensor temperature Sensor temp
QV (Quaternary) 3 3 Loop current % Loop current %

All four variables are returned as IEEE-754 floats with a status byte (per HART v7 spec, command 9 returns variable code + EU units + time stamp + status). The TMT142 and PMP71B units are configurable from the device menu via HART command 11/12/13/14 or via Simatic PDM; WRREC can drive the same commands if writes are required.

5. WRREC and RDREC Function Blocks

Both functions live in the TIA Portal Standard Library under "Communication" and conform to IEC 61131-3. They implement acyclic record read/write services via PROFINET slot/index addressing.

Parameter RDREC WRREC Meaning
REQ BOOL BOOL Start on rising edge
ID HW_IO HW_IO Hardware identifier of the AI submodule or HART submodule
INDEX INT INT Record number (HART cmd + slot offset)
MLEN UINT - Max read length in bytes
LEN - UINT Write length in bytes
RECORD VARIANT/ARRAY VARIANT/ARRAY Data buffer
BUSY BOOL BOOL Operation in progress
DONE BOOL BOOL Success
ERROR BOOL BOOL Failure
STATUS WORD WORD Hex status / extended diagnostics

6. HART Record Index Map for the 6ES7531-7TF00-0AB0

The SM 531 exposes HART data through PROFINET record indexes on the HART submodule. The table below summarizes the indexes most commonly used in TIA Portal V17 with this module. Values are documented in the Siemens Function Manual "Analog Input Module AI 8xTC/RTD/R HART" (entry ID 109773780) and are confirmed against TIA V17.

INDEX (dec) Function Length (bytes) Service
1 HART CMD 0 response (Unique ID, Manufacturer, Device Type) 15 RDREC
2 HART CMD 3 (PV/SV/TV/QV with status, current, %range) 26 RDREC
3 HART CMD 9 (Device Variables 0–15 with status) 34 (1 var) – 130 (16 var) RDREC
4 HART CMD 1 (PV only, loop current) 12 RDREC
10 Generic HART pass-through (cmd + bytes) ≤ 240 RDREC / WRREC
11 HART CMD 11 (Tag, Descriptor, Date) 21 RDREC
12 HART CMD 12 (Read Message) 32 RDREC
17 HART CMD 17 (Write Message) 32 WRREC
20 Channel diagnostics block (FW, run time, errors) 48 RDREC
For commands not covered above (e.g., CMD 36/37 trim of PMP71B zero/span), use INDEX 10 generic pass-through. Build the byte array with HART preamble, delimiter, command byte, byte count, and data in your SCL code.

7. Step-by-Step: Reading PV/SV/TV/QV via SCL

7.1 Declare data types

// UDT_HART_CMD3
TYPE UDT_HART_CMD3 :
  STRUCT
    PV       : REAL;      // engineering units
    SV       : REAL;
    TV       : REAL;
    QV       : REAL;
    Loop_mA  : REAL;      // loop current
    Percent  : REAL;      // % of range
    Status   : BYTE;      // HART variable status
    Code     : BYTE;      // variable code for QV
  END_STRUCT;
END_TYPE

7.2 FB instance for cyclic read

FUNCTION_BLOCK FB_HART_ReadCmd3
VAR
  HART_ID : HW_IO;            // IO handle from PLC tags (HART submodule)
  RTrigger: BOOL;
  RDREC_1 : RDREC;
  Buf     : ARRAY[0..25] OF BYTE;
  RData   : UDT_HART_CMD3;
  Busy    : BOOL;
  Done    : BOOL;
  Err     : BOOL;
  Status  : WORD;
END_VAR

RTrigger := RTrigger;  // drive from cycle

// Trigger only when no other HART job is active
IF NOT Busy THEN
  RDREC_1(REQ := RTrigger,
          ID  := HART_ID,
          INDEX := 2,             // CMD 3 record
          MLEN := 26,
          VALID => ,
          BUSY => Busy,
          DONE => Done,
          ERROR => Err,
          STATUS => Status,
          RECORD := Buf);
END_IF;

IF Done AND NOT Err THEN
  RData.PV := REAL_OF_BYTES(Buf[0],Buf[1],Buf[2],Buf[3]);
  RData.SV := REAL_OF_BYTES(Buf[4],Buf[5],Buf[6],Buf[7]);
  RData.TV := REAL_OF_BYTES(Buf[8],Buf[9],Buf[10],Buf[11]);
  RData.QV := REAL_OF_BYTES(Buf[12],Buf[13],Buf[14],Buf[15]);
  RData.Loop_mA := WORD_TO_REAL(SHL(WORD_OF_BYTES(Buf[16],Buf[17]),0)) / 1000.0;
  RData.Status := Buf[24];
END_IF;

7.3 Cycle handling

Trigger reads at 1–2 s intervals to avoid HART bus contention; the SM 531 internally buffers the response so acyclic calls from user code do not block PROFINET cyclic traffic. For time-critical loops trigger on a TON with 1500 ms pulse.

8. Step-by-Step: Writing a Tag via WRREC (HART CMD 18)

FUNCTION_BLOCK FB_HART_WriteTag
VAR
  WBuf  : ARRAY[0..31] OF BYTE;
  WRREC_1: WRREC;
  Busy  : BOOL;
  Done  : BOOL;
  Err   : BOOL;
  Sts   : WORD;
END_VAR

// Build HART CMD 18 (Write Tag Descriptor) byte stream
WBuf[0] := 16#82;            // HART preamble (preamble is sent automatically)
WBuf[1] := 16#86;            // delimiter
WBuf[2] := 18;               // CMD 18
WBuf[3] := 24;               // data length incl.
// ... pack tag descriptor (16 ASCII bytes) into WBuf[4..19]

WRREC_1(REQ := TRUE,
        ID  := HART_ID,
        INDEX := 17,
        LEN  := 26,
        DONE => Done,
        ERROR => Err,
        STATUS => Sts,
        RECORD := WBuf);

9. Verification Procedure

  1. Place the CPU in RUN with the module synchronized. The DIAG LED on the SM 531 must be green.
  2. Open an HMI WinCC Unified tag that points to RData.PV. The value must match the field transmitter display.
  3. Cross-check with Endress+Hauser Fieldcare connected on the same loop via a HART USB modem: PV and SV must agree to 4 decimal places.
  4. Force a HART burst (PMP71B supports burst mode) and verify the STATUS byte = 16#00 (good non-cascade).
  5. In Online > Diagnostics, expand the SM 531 and read the channel-level "HART status". Acceptable values: 0 (OK), 1 (Var Not Found), 2 (Cmd Not Implemented), 5 (Communication Error).
  6. Log the STATUS word from RDREC; hex 0000 means success, 80A1 / 80C3 indicate record index errors, 80B1 protocol issues.

10. RDREC / WRREC STATUS Codes

STATUS (hex) Meaning Typical cause Remedy
0000 Success - Proceed
7000 Job active - Wait
7001 First call - Continue calling
7002 Subsequent call - Continue calling
80A0 Negative acknowledge HART device replied NAK Check HART command validity
80A1 Wrong record index INDEX not supported by FW Update HSP/FW; check INDEX map
80B1 Protocol error Noise, missing 250 Ω, wrong wiring Verify loop impedance
80C3 Format mismatch MLEN smaller than record size Increase MLEN to record size
80C4 Resource busy Channel executing another job Serialise HART access per channel
80FB Submodule not configured HART submodule not active Enable HART on the channel

11. Troubleshooting Matrix

Symptom Likely root cause First check Fix
RDREC always returns 80B1 HART modem cannot see device Loop voltage at device terminals Verify 24 V DC & 250 Ω; check polarity
STATUS 80A1 on all indexes FW / HSP mismatch Module FW version in Online > Diagnostics Update FW to ≥ V1.0 via SIMATIC Automation Tool
PV readable, SV always 0 HART v5 device or burst disabled CMD 0 response Enable burst or upgrade FW of sensor
Fieldcare and PLC disagree on PV Different engineering units EU code in CMD 3 response Match unit scaling in the FB
Reading takes >2 s Multidrop / multiple acyclic jobs HART address list Move to multidrop address >0 only if needed; otherwise keep address 0
PV value frozen after sensor swap Long Tag still referencing old device CMD 11 response Clear/rewrite tag from TIA Portal
CPU SF / BF LEDs on slot Wrong submodule inserted Device view slot table Insert HART submodule 1 (if not already present)

12. Field-Proven Practices

  • One acyclic job per HART channel at a time. The SM 531 internally serialises HART requests; overlapping RDREC calls on the same channel cause 80C4.
  • Never burst-mode + heavy acyclic traffic on the same channel. The burst stream and acyclic CMD share the HART bus and will collide.
  • Use Fieldcare or PDM for initial commissioning (range, units, write-protection) and reserve WRREC for runtime tag/message writes only. This matches the recommended workflow from E+H technical support.
  • Track the device revision. HART CMD 0 returns the device revision (7 for TMT142, 7 for PMP71B). Some commands differ between revision 5 and 7.
  • Loop current reading. Always read loop current from CMD 2 or CMD 3; reading it as an analog mA from the same channel is redundant and halves update rate.
  • Retain long tags across firmware updates by exporting the project; the long tag is part of the sensor NVM, not the PLC.

13. Alternate Platform Notes

  • ET200MP / SIMATIC ET200SP: The 6ES7531-7TF00-0AB0 is also usable in an ET200MP rack behind an IM 155-5 PN HF or higher. The procedure is identical.
  • S7-1200: There is no equivalent module. Use ET200MP remote IO, or migrate to S7-1500.
  • PROFINET vs PROFIBUS: The 6ES7531-7TF00-0AB0 is PROFINET only. For PROFIBUS DP, the legacy 6ES7331-7TF01-0AB0 (S7-300) follows the same WRREC/RDREC scheme but with PROFIBUS slot/index translation.
  • TIA Portal V16 vs V17: V17 added the HSP for module FW V2.0 and the channel-level HART diagnostics. Older projects will compile but show "unknown submodule" without the V17 HSP.

14. Cross-References

  • Siemens Function Manual "SM 531 AI 8xTC/RTD/R HART (6ES7531-7TF00-0AB0)", entry ID 109773780.
  • TIA Portal V17 System Manual "RDREC / WRREC", 109773506.
  • Endress+Hauser Operating Instructions for TMT142.
  • Endress+Hauser Operating Instructions for Cerabar PMP71B.
  • HART Universal Command Specification, FieldComm Group.

FAQ

What is the correct record index to read PV, SV, TV and QV from the 6ES7531-7TF00-0AB0?

Use INDEX 2 with RDREC; this returns HART CMD 3 data in 26 bytes containing all four dynamic variables in IEEE-754 format, the loop current in mA, the percentage of range and the HART status byte.

How do I read the Endress+Hauser TMT142 long tag from TIA Portal?

Trigger an RDREC call with INDEX 1 (HART CMD 0 response, 15 bytes) for unique ID, then INDEX 11 (CMD 11 response, 21 bytes) for the long tag string; build a sequence of acyclic reads with a 250 ms gap to avoid bus contention.

RDREC keeps returning STATUS 80B1, what should I check first?

Verify 24 V DC is present at the sensor terminals, the loop contains a 250 Ω resistor, polarity is correct, and that the HART submodule is enabled in the device view. The 80B1 status indicates the module cannot decode any HART frame; this is a wiring issue, not a configuration error.

Can I change the PMP71B pressure unit from bar to PSI via WRREC?

Yes, but you must use the generic pass-through INDEX 10 with a CMD 44 (Enter/Exit Fixed Current Mode) followed by CMD 50 (Read Dynamic Variable Assignments) or CMD 51 (Write Dynamic Variable Assignments). Build the byte array manually in SCL; do not expect a high-level block. Siemens recommends changing engineering units during commissioning via Fieldcare rather than at runtime.

Is TIA Portal V16 enough or do I need V17?

V17 is recommended because it ships the matching HSP and the channel-level HART diagnostics view. V16 projects can still compile against FW V1.0 modules, but V17 unlocks the INDEX 20 channel diagnostics block and improved error decoding for STATUS words.

Back to blog