SM331 Thermocouple Wiring on S7-300: Internal Reference Junction
This reference describes the correct method to land thermocouple (TC) sensors on a Siemens SIMATIC S7-300 SM331 analog input module, focusing on the internal reference junction mode and the practical handling of the COMP+ / COMP- terminals. The procedure generalises to any S7-300 AI module that supports TC types (SM 331, AI 8 x 12 Bit, 6ES7331-7KF02-0AB0 and similar variants), and it aligns with the steps published in the Siemens "SM331 AI8x12Bit Getting Started Part 3: Thermocouples" handbook.
1. Why a Dedicated TC Input Is Required
A thermocouple generates a small, non-linear Seebeck voltage (typically 10 to 80 µV per °C depending on type) on top of which sits the thermal EMF produced at the terminal block where the dissimilar TC wires meet copper. If the module measures this raw voltage naively, the cold-junction (terminal-strip) temperature appears in the reading as a large offset error. TC-capable SM331 modules address this by including an internal precision temperature sensor at the connector and a software compensation model referenced through the COMP terminals.
General-purpose AI modules (voltage mode, ±1 V, ±5 V, ±10 V) lack the internal compensation and the calibrated linearisation tables required for JIS/IEC 60584 TC types, so a direct connection from a TC to a voltage-only channel will produce incorrect readings even at constant oven temperature. Use only AI modules that explicitly support the intended TC type in their hardware configuration catalog.
2. SM331 Variants That Support Thermocouples
Several SM331 (6ES7331-) module variants are thermocouple-capable. Confirm the MLFB and firmware state before wiring.
| MLFB | Resolution / Channels | Supported TC Types (typical) | Notes |
|---|---|---|---|
| 6ES7331-7KF02-0AB0 | 8 ch / 12 bit | B, E, J, K, L, N, R, S, T, U | Common variant, internal CJC, supports voltage / RTD / TC |
| 6ES7331-7PF01-0AB0 | 8 ch / 14 bit | B, E, J, K, L, N, R, S, T, U | Higher resolution variant, internal CJC |
| 6ES7331-7PF11-0AB0 | 8 ch / 14 bit | B, E, J, K, L, N, R, S, T, U | Isolated channel groups |
| 6ES7331-1KF02-0AB0 | 8 ch / 13 bit (SM 331-1) | Limited; check catalog | Older variant; verify TC support in HW Config |
Check the SIMATIC S7-300 SM 331 manual entry on the Siemens Industry Online Support portal for the exact channel group, diagnostic, and over-voltage behaviour of the MLFB installed in your rack.
3. Cold Junction Compensation: External vs. Internal
There are two principal methods used on SM331 modules:
3.1 Internal reference junction (module-integrated CJC)
The 40-pin front connector carries a built-in precision temperature sensor near the screw terminals. The COMP+ and COMP- inputs on the connector are shorted together (or left shorted by the supplied bridge). The module subtracts the measured terminal-strip temperature from the raw TC voltage and applies the appropriate linearisation curve for the selected TC type.
3.2 External reference junction (Pt100 / compensating box)
An external Pt100 RTD (class A or better) is wired to a free channel on the same module and configured as the reference junction. The TC cold end is held at the Pt100 isothermal block. The module then uses the external RTD value for compensation. Use this method only when the front connector cannot be kept isothermal with the field, or when accuracy better than ±1 °C is required at the cold junction.
The selection is made per channel group in STEP 7 / TIA Portal hardware configuration, "Measuring method" and "Reference junction" parameters.
4. Internal Reference Junction: COMP Terminal Handling
When the module's internal sensor is selected as the reference, the COMP+ and COMP- pins on the 40-pin front connector must be electrically bridged at the connector. This is the key wiring detail that the original installation question addresses.
Approved method: Use a short, insulated piece of plain copper wire (typical 0.5 mm² to 1.5 mm² stranded, length 20 to 50 mm) to jumper COMP+ to COMP- on the same front connector. The insulation prevents inadvertent shorts to adjacent terminal pins (M+, M-, IC+, IC-).
What is not required: Extension-grade thermocouple wire between COMP+ and COMP-. The compensation loop is purely a sense return for the internal CJC; it carries no significant current and no thermal EMF, so copper is correct.
Connector pinout excerpt (40-pin front connector, AI 8 x 12 Bit, group 0):
| Pin | Signal | Function with TC + internal CJC |
|---|---|---|
| 1 | CH0 + | TC positive leg (e.g. chromel for K) |
| 2 | CH0 - | TC negative leg (e.g. alumel for K) |
| 3 | COMP+ | Bridge to pin 4 with insulated copper wire |
| 4 | COMP- | Bridge to pin 3 with insulated copper wire |
| 5, 6, 7, 8 | CH1+ / CH1- / CH2+ / CH2- | Subsequent TC channels |
| 20 | Mana (analog ground) | Common reference for unused channels in voltage mode |
5. Thermocouple Cable Selection and Polarity
Use thermocouple-grade extension cable of the same TC type as the probe between the field termination and the SM331 front connector. Standard copper signal cable is not acceptable: any temperature difference along a copper run between the two TC junctions is uncompensated and injects direct error into the measurement.
| TC Type | Positive Leg (US/IEC colour) | Negative Leg | Typical Range | Sensitivity (≈) |
|---|---|---|---|---|
| K | NiCr (yellow / green) | NiAl (red / white) | -200 to +1370 °C | 41 µV/°C |
| J | Fe (white / black) | CuNi (red / white) | -210 to +1200 °C | 51 µV/°C |
| N | NiCrSi (orange) | NiSi (red) | -200 to +1300 °C | 38 µV/°C |
| T | Cu (blue / blue) | CuNi (red / white) | -270 to +400 °C | 40 µV/°C |
| S / R | Pt-10%Rh / Pt-13%Rh | Pt (black) | -50 to +1768 °C | 10 µV/°C |
Maintain polarity from the probe sheath through the junction box, through any intermediate terminals, to the SM331 connector. A reversed leg will read a constant negative temperature offset equal to twice the cold-junction temperature and is the single most common field fault.
Run TC extension cable in a dedicated conduit, separated from VFD output cables, motor feeders, and any 50/60 Hz high-current conductors. Use shielded, twisted pair TC extension; ground the shield at the panel end only and isolate it from the SM331 connector shell to avoid ground loops through the analog ground plane.
6. STEP 7 / TIA Portal Hardware Configuration
The SM331 channel group must be configured for the specific TC type, units, and reference junction mode. In STEP 7 (classic) HW Config:
- Open the S7-300 station, click the SM331 module slot.
- Open Object Properties > Inputs.
- For the channel group (e.g. channel 0 to 1):
- Set Measuring method to TC (thermocouple).
- Set Temperature unit to °C (or °F as required).
- Set Type to the TC letter (K, J, N, T, S, R, B, E, L, U).
- Set Reference junction to Internal.
- Set Interference frequency suppression to match the mains frequency (50 Hz or 60 Hz) for best noise rejection.
- Enable diagnostic interrupts if the application requires open-circuit detection (recommended).
- Compile and download hardware configuration.
The default FC / FB blocks such as FC105 "SCALE" and the S7-300 driver block SFB52 / SFB53 work with the raw 16-bit integer returned by the AI. For a direct °C value, use the S7-300 AI driver blocks from the standard library or the TIAPortal "AI_TC" function block; no manual linearisation is required because the module applies the IEC 60584 table internally.
Example STL (STEP 7) - read PIW 288 and convert to REAL °C (scaled ±27648):
// PEW288 holds the scaled TC value; full scale = +27648 = upper TC limit
// Scaled value is symmetric: -27648 = lower TC limit, 0 = nominal 0 °C
L PIW 288
ITD
DTR
// No SCALE call required for TC mode; module returns °C-scaled value
T MD 100 // REAL degrees Celsius
// Optional plausibility test
L 0.0
>R
SPB OK1
// Handle under-range fault
SET
R M 10.0 // TC fault flag
SPA END1
OK1: S M 10.0
END1: NOP 0
7. Step-by-Step Wiring Procedure
- Verify MLFB and firmware. Confirm the SM331 MLFB on the rack label matches the TC-capable part numbers in section 2. Note the firmware version reported in the module diagnostic buffer (accessible via STEP 7 / TIA Portal "Module Information").
- Power down the S7-300 station and isolate the analog field wiring. Open the front-connector door; do not hot-plug TC extension conductors.
- Identify channel group 0 pins on the 40-pin front connector (pins 1, 2 for the positive and negative TC leg, pins 3, 4 for COMP+ and COMP-). Repeat for each group that will carry a TC.
-
Install the COMP jumper. Cut a 30 mm length of insulated stranded copper wire (e.g. 0.75 mm² H07V-K) and land one end on
COMP+(pin 3) and the other onCOMP-(pin 4). Torque the screw terminals to 0.5 N·m. - Land the TC extension cable on the channel pins, observing polarity per the TC type. Use ferrules on stranded TC wire. Torque per the connector specification.
- Connect cable shield to the panel ground bar at the cabinet entry. Do not bond the shield at the SM331 end unless the cabinet drawing specifies a single-point ground.
- Configure the channel group in HW Config (section 6).
- Download hardware config to the CPU and warm-restart.
- Run the verification procedure in section 8 before placing the loop in automatic control.
8. Verification and Calibration
After wiring and configuration, run the following checks before trusting the readings in the process database:
- Open-circuit detect. Disconnect one TC leg at the junction box. The module should raise a channel diagnostic (wire-break / overflow bit). This confirms diagnostic wiring and that the channel is configured for TC (not voltage) mode.
- Short-circuit COMP test. With the TC connected and stable, briefly read the diagnostic buffer; the COMP jumper should not generate any diagnostic events.
- Reference comparison. Place a calibrated Pt100 probe or a calibrator block (e.g. WIKA CTI9100) at the same temperature as the TC sheath. Compare the SM331 reading against the calibrator. Acceptable error budget for type K at 200 °C with internal CJC: typically ±3 °C out of the box; ±1 °C after a single-point user calibration in HW Config.
- Reversed-leg sanity check. Warm the TC junction with a heat gun while watching the raw PIW. The value should rise. If it falls, swap the legs on the front connector.
- Noise floor. With the TC at steady state, observe the LSB-level variation. With 50 Hz interference suppression enabled, peak-to-peak noise at the PIW should be ≤ 4 LSB on a 12-bit module.
9. Troubleshooting Matrix
| Symptom | Likely Cause | Action |
|---|---|---|
| Reading offset by tens of °C, follows panel temperature | COMP+ / COMP- not bridged, or bridge broken; module cannot perform CJC | Re-install the insulated copper jumper between COMP+ and COMP- at the front connector |
| Reading rises when process cools | TC polarity reversed | Swap the two TC legs on the channel input pins |
| Reading noisy (tens of °C peak-to-peak) | TC cable run parallel to VFD / motor conductors, or interference frequency mismatch | Re-route cable, set interference frequency suppression to 50 Hz or 60 Hz in HW Config |
| Channel reads +32767 (overflow) and diagnostic "wire break" set | Open TC circuit, or wrong channel group configured for voltage instead of TC | Check TC leg continuity; reconfigure channel group for TC type |
| Channel reads 0 °C with TC at 200 °C | Compensating cable used of wrong type (e.g. type J cable with type K probe) | Replace extension cable with same-type TC grade |
| Reading drifts slowly with day/night | Front connector not isothermal; air currents across terminal block; no shielding | Install connector shroud, seal cable entries, use external CJC with Pt100 |
| All TC channels show identical erroneous value | Wrong MLFB on the slot (voltage-only AI module installed) | Verify MLFB; install TC-capable SM331 (6ES7331-7KF02 / 7PF01 / 7PF11) |
10. When to Use External Reference Junction Instead
The internal CJC relies on the assumption that the front connector and its integrated sensor are at the same temperature as the TC termination. This holds when the connector is enclosed in a stable cabinet and the field wire enters through a gland directly opposite the connector. It fails when:
- The cabinet has forced-air cooling that creates thermal gradients across the connector.
- The TC extension enters through the top of the cabinet while heat-generating devices (PS 307, CPU) sit beneath the connector.
- Required accuracy is below ±1 °C and the installation is unconditioned.
In these cases, run the TC extension directly to a remote isothermal block containing a Pt100 RTD (DIN IEC 60751, class A), wire the Pt100 to a spare SM331 channel configured for RTD, and select "Reference junction = External" pointing to that channel in HW Config.
11. Field-Commissioning Notes
- Document the COMP jumper location on the loop drawing so that future maintenance technicians do not mistake it for a wiring fault.
- Spare front connectors: when swapping a connector, transfer the COMP jumper to the new connector; do not assume the replacement is pre-jumpered.
- For type S / R / B thermocouples below 250 °C, expect very low sensitivity (a few µV/°C) and a higher error contribution from the CJC. Consider type K or N for the low end of the range.
- If the application is safety-related (SIL), the SM331 must be part of a validated S7-300F / S7-300FH configuration; the TC wiring rules and COMP jumper handling remain unchanged, but additional proof-test intervals apply.
FAQ
Can I use a plain copper wire to short the COMP+ and COMP- pins on an SM331 TC input?
Yes. With the internal reference junction selected, the COMP+ and COMP- pins must be bridged at the front connector using a short length of insulated copper wire (e.g. 0.5-1.5 mm², 20-50 mm). Do not use TC extension cable for this jumper; the compensation loop carries no thermal EMF, so copper is the correct and approved material.
Which SM331 MLFBs support direct thermocouple inputs?
Commonly 6ES7331-7KF02-0AB0 (12 bit), 6ES7331-7PF01-0AB0 (14 bit), and 6ES7331-7PF11-0AB0 (14 bit, isolated groups). Always verify the TC type list in HW Config for the exact MLFB installed; older SM331-1KF02 variants have limited TC support and may require an external CJC box.
What happens if I leave the COMP terminals open?
The internal CJC will either default to an assumed 0 °C cold-junction temperature (introducing a static offset of up to +25 °C in a 25 °C cabinet) or generate a diagnostic interrupt, depending on firmware. Always bridge the COMP pins even on unused channel groups within a configured TC group.
Do I need a Pt100 if I use internal reference junction mode?
No. Internal mode uses the precision sensor built into the SM331 front connector. A Pt100 is only required if you select "Reference junction = External" in HW Config, which is the correct choice for high-accuracy installations where the front connector is not isothermal with the TC termination.
How do I reverse a thermocouple that is reading the wrong polarity?
Swap the two TC legs on the SM331 channel input pins (CH+ and CH-) at the front connector. Do not swap at the junction box if that means copper wire carries the TC signal; keep TC extension material continuous from the probe to the module. After the swap, verify with a heat source that the reading increases with temperature.