Pro
15 min

Scale a 4–20 mA Pressure Transmitter

analogscaling4-20mApressurebeginner

Ready to build this?

Sign up free — no credit card required. This scenario requires the Pro plan.

Sign up to play this scenario →

Already have an account? Log in

Scale a 4–20 mA Pressure Transmitter scenario preview

Briefing

A pressure transmitter wired on the 4–20 mA loop returns raw ADC counts in the range 4 000–20 000. The PLC scales this to engineering units using the formula: **PSI = (PT_RAW − 4 000) ÷ 16 000 × 150** So 4 000 counts = 0 PSI, 12 000 counts = 75 PSI, 20 000 counts = 150 PSI. The physics engine performs this calculation and publishes a ready-to-use BOOL signal — **PUMP_OK_PRESSURE** (true when PSI < 120 and the transmitter is healthy). Your job is to write the supervisory logic: 1. Latch a **RUN_BIT** on START, drop on STOP. 2. Gate **PUMP_PERMIT** on RUN_BIT AND PUMP_OK_PRESSURE — the pump may only run when pressure is safe. 3. Latch **PRESSURE_ALARM** when running and PUMP_OK_PRESSURE drops (pressure too high). 4. Drive **FAULT_LAMP** from the **TRANSMITTER_FAULT** signal (open-circuit 4–20 mA loop: counts below 3 600). The 4–20 mA standard means a broken wire reads near 0 mA, not 0 PSI — the fault band below 3.6 mA (3 600 counts) is how you distinguish "zero pressure" from "broken transmitter".

Objectives

  • Latch RUN_BIT: SET on START, RESET on STOP
  • PUMP_PERMIT: ON when RUN_BIT AND PUMP_OK_PRESSURE (PSI < 120, no fault)
  • PRESSURE_ALARM latches when running and PUMP_OK_PRESSURE is false
  • FAULT_LAMP mirrors TRANSMITTER_FAULT (open-circuit detection)

Hints

  • Use SET/RESET coils for the latches: | START AND /PRESSURE_ALARM | S= RUN_BIT ;
  • PUMP_OK_PRESSURE is already a BOOL input — just use it as a contact in the permit rung
  • Pressure alarm: | RUN_BIT AND /PUMP_OK_PRESSURE | S= PRESSURE_ALARM ; and | STOP | R= PRESSURE_ALARM ;

I/O Table

Inputs

START

Start push-button (momentary NO)

BOOL · %I0.0

STOP

Stop push-button (momentary NO)

BOOL · %I0.1

PT_RAW

Pressure transmitter raw counts (4000–20000)

INT · %IW0

PUMP_OK_PRESSURE

Physics-published: PSI < 120 AND no fault

BOOL · %I0.2

TRANSMITTER_FAULT

Physics-published: open-circuit (< 3600 counts)

BOOL · %I0.3

Outputs

PUMP_PERMIT

Pump run permissive

BOOL · %Q0.0

PRESSURE_ALARM

High-pressure alarm (latching)

BOOL · %Q0.1

FAULT_LAMP

Transmitter fault indicator lamp

BOOL · %Q0.2

Your program will be tested against:

All test cases run automatically when you submit. Assertions are hidden until you pass.

  1. #1START with normal pressure → PUMP_PERMIT on

    PT_RAW = 12000 (75 PSI, PUMP_OK_PRESSURE = true) + START → PUMP_PERMIT on within one scan

  2. #2High pressure (PT_RAW = 19200 ≥ 120 PSI) blocks PUMP_PERMIT

    PT_RAW = 19200 (≈ 143 PSI) → PUMP_OK_PRESSURE = false → PUMP_PERMIT must not energise on START

  3. #3Pressure rises above 120 PSI while running → PRESSURE_ALARM latches

    Start with normal pressure, then raise PT_RAW above threshold → PRESSURE_ALARM latches and PUMP_PERMIT drops

  4. #4Open-circuit (PT_RAW < 3600) → FAULT_LAMP on

    Simulating a broken 4–20 mA wire: counts drop below 3600 → TRANSMITTER_FAULT → FAULT_LAMP on

Ready to build this?

Sign up free — no credit card required. This scenario requires the Pro plan.

Sign up to play this scenario →

Already have an account? Log in

Runnable simulator field guide

Pressure-scaling PLC scenario: test checklist

Direct answer

The learner can calculate the conversion, test known points, preserve quality separately and diagnose endpoint, data-type or loop faults.

Written for pLC and instrumentation learners converting a declared pressure-transmitter signal into engineering units and dependable alarm logic.

a water-based process instrumentation skid with pressure, temperature, vessel, valve and analog-loop evidence while studying analog pressure scaling, signal quality and range-boundary testing
System map / 02

NODE 01observable

Scenario setup

Pressure lower and upper range, loop or voltage signal, raw endpoints, engineering unit, numeric type, resolution, quality, clamp and alarm boundaries.

NODE 02observable

I/O and state map

Known pressure through transmitter conversion, loop, input module, raw value, scaling expression, engineering tag, display and alarm evaluation.

NODE 03observable

Normal run

Lower, midpoint, upper and intermediate points scale monotonically within the declared tolerance and correct pressure unit.

NODE 04observable

Boundary run

Underrange, overrange, open loop, reversed endpoints, integer division, negative gauge value, noise, stale data and module substitution.

NODE 05observable

Injected fault

A reference, transmitter, wiring, module, raw endpoint, data type, equation, quality, display or alarm mismatch.

NODE 06observable

Target check

The implementation checked against current transmitter and module data with approved pressure and calibration procedures.

Answer surface / 07

What is the formula for PLC pressure scaling?

Use the documented raw and engineering endpoints in a linear mapping: engineering low plus the raw fraction of span multiplied by engineering span.

Should a bad analog value be clamped into the valid pressure range?

Do not hide bad quality. A display may bound presentation, but logic should retain a separate fault or quality state for underrange, overrange and stale data.