IMDHMIControls LibraryShop main store

How-to

Why a 4-20 mA valve position signal can replace limit contacts

PLC programming Published 7 min read By IMDHMI controls team

Short answer

When a replacement valve loses its full-open and full-close contacts, comparators on the scaled 4-20 mA position signal can supply those two indications to the downstream block. Confirm the scaling and units first, keep the two indications mutually exclusive with a neutral band between thresholds, and download the block without changing its interface.

On this page
  1. Can a 4-20 mA position signal replace full-open and full-close limit contacts?
  2. What do the comparators need to read before you trust thresholds like 10 and 90?
  3. How do you keep the open and closed indications mutually exclusive?
  4. Can you download FB12 without touching its instance data?
  5. What happens if you add TEMP variables to FB12?
  6. How do you test the new position indications before returning the valve to service?
  7. What can the derived indications never prove?
  8. Questions asked

A 4-20 mA position signal can replace lost full-open and full-close limit contacts, but only after you confirm the analog scaling, keep the two derived indications mutually exclusive with a neutral band between the comparator thresholds, and download the modified block without changing its interface. This article walks through that change for a single valve managed by one function block that calls a shared position block.

Can a 4-20 mA position signal replace full-open and full-close limit contacts? #

Yes, for indication purposes: two comparators on the scaled position value can drive the same two block inputs the old dry contacts drove, with a closed threshold and an open threshold separated by a neutral band. The old valve offered a three-point open/close command on two digital outputs, a 4-20 mA position signal on one analog input, and separate full-open and full-close contacts on two digital inputs. The replacement valve keeps everything except those contacts.

The comparison is not fully equivalent, and you should plan around that from the start. The old contacts were actuated by the valve mechanism itself, so they proved the valve physically reached its stops. A comparator reports what the position transmitter says. If the stem, linkage or transmitter fails, the derived indications keep reporting a plausible position. For the indication path into the shared block this is usually acceptable; for any logic that treats a limit signal as proof of a hard stop, it is not, and that path needs an independent sensor.

What do the comparators need to read before you trust thresholds like 10 and 90? #

The comparators must read a scaled position value, and constants like 10 and 90 only mean 10 percent and 90 percent after that scaling. Trace the analog channel from the raw input word through any scaling rung to the value FB12 actually passes to its comparators, and establish the units before you pick a single constant.

As an illustrative example, suppose the scaling maps 4 mA to 0 percent and 20 mA to 100 percent, and the raw input word reads 6400 counts at 4 mA and 32000 counts at 20 mA. The scaling rung is then position in percent = (raw − 6400) × 100 ÷ (32000 − 6400). At mid-travel, roughly 12 mA, the raw word reads 19200, and the scaled value is (19200 − 6400) × 100 ÷ 25600 = 50 percent. A comparator against 10 and 90 now means 10 percent and 90 percent of stroke.

If the comparator instead sees the raw word directly, a threshold of 10 counts sits near the electrical zero of the loop, below even the live-zero of 4 mA, and both indications behave wrongly from the first scan. These example counts are an example mapping, not a universal one: read the actual input configuration and the existing scaling logic in your project rather than assuming any range.

How do you keep the open and closed indications mutually exclusive? #

Use two separated thresholds: assert closed when the scaled position is at or below the low threshold, assert open when it is at or above the high threshold, and leave both false between them. With thresholds of, for example, 5 percent and 95 percent, a reading of 50 percent asserts neither, which reproduces the neutral state the old contacts gave at mid-travel.

Because no single position value can satisfy both comparisons at once, the derived indications cannot contradict each other, and the neutral band between the thresholds means a valve anywhere between its stops reports neither limit. The neutral band is doing two jobs: it separates the thresholds, and it gives room for signal noise. If the reading wanders near a threshold, size the band wider than that wander so each indication switches once per stroke instead of chattering.

The same mutual-exclusion discipline matters inside the receiving block: if its logic uses one signal to reset the other, a condition that blocks one of the two instructions leaves a stale bit standing in for a limit. The pattern where an S7 bit reset does not execute under mutually exclusive conditions covers that failure in the receiving logic; the two derived indications must never produce it.

Can you download FB12 without touching its instance data? #

Yes: as long as you add or remove nothing from the FB12 input and output interface, the change is not an interface alteration, and you can load the modified block without restructuring its instance DB. Route the comparator outputs to the same two inputs FB32 previously received from the physical contacts, and leave every other FB12 parameter, and FB32 itself, exactly as they were.

This matters because FB32 is a multi-instance call inside FB12: as the Siemens STEP 7 documentation defines it, when a function block calls another FB, the called block's instance data is stored in the calling block's instance DB, so FB32's data lives inside FB12's DB. Changing the FB12 interface would ripple into that stored data and into how the call is made. Keeping the interface fixed keeps the change local to one valve.

What happens if you add TEMP variables to FB12? #

Nothing harmful: you can add as many TEMP variables as the block needs and download it again, because TEMP values are not stored in the instance DB. Use them to hold the raw value, the scaled position and the two comparator results inside the block.

The Siemens discussion threads on updating an instance DB after an FB interface change make the distinction concrete: an interface update to inputs or outputs is what forces instance DB work, and TEMP additions do not, since TEMP values are not stored there. Compile the block, read the diagnostics the editor and the download report, and load the modified FB together with its instance DB as your project's normal procedure prescribes. If either report asks for an instance DB update you did not expect, stop and inspect the block declaration before loading anything.

How do you test the new position indications before returning the valve to service? #

Exercise the real valve through its full stroke under controlled conditions and watch five things: the scaled position value, both derived indications, the two FB32 inputs and the three-point command outputs. A forced bit or a simulated position is not an acceptance test; the feedback path itself has to prove the logic.

Run this list in order:

  1. Save a retrievable copy of the current project, and record the existing FB12 interface, the FB32 connections, the analog scaling and the valve's command behavior before editing anything.
  2. At the fully closed position, confirm the scaled value sits at or below the closed threshold, the closed indication true, the open indication false.
  3. At an intermediate position, confirm both indications false, and that FB32 behaves as intended with neither limit present.
  4. At the fully open position, confirm the scaled value at or above the open threshold, the open indication true, the closed indication false.
  5. Move slowly across each threshold and confirm one clean transition per crossing, with no chattering where the signal is noisy.
  6. With the analog signal invalid or the loop broken, confirm the system takes the defined fault response and no indication falsely reports a limit at FB32.

Record the thresholds, the scaling values, the observed readings and the test results in the project change record, then release the modified logic. Where the original contacts fed anything beyond indication, such as a hard-limit interlock, keep an independent sensor on that path; the same discipline you use for configuring mutually exclusive outputs applies to the output side of keeping contradictory commands apart when you revisit such logic.

What can the derived indications never prove? #

They cannot prove the valve mechanically reached its seat. The old contacts were actuated by the valve itself, so a broken stem, a slipped linkage or a jammed gate held both contacts open, and the logic saw the truth. The comparators see only the transmitter's story, and a drifting transmitter reports a confident position that never happened. That gap is the one real cost of the swap: keep the derived signals strictly as indications into FB32, and keep any requirement for positive proof of a hard limit on a separate, mechanically actuated device. One safety note applies here: if either limit contact fed a safety function rather than a process indication, this substitution is not an acceptable repair for it; that function needs its own mechanically actuated device, validated as a complete safety function.

Questions asked

Can I download FB12 again without touching its instance data?

Yes, if you add or remove nothing from the FB12 input and output interface. TEMP variables are not stored in the instance DB, so adding them does not require an instance DB update. Compile first, then load the modified FB with its instance DB as a unit and read the download diagnostics before going live.

Why do comparator thresholds of 10 and 90 need a scaling check first?

Those constants only mean 10 percent and 90 percent if the program value at the comparator is a scaled percentage. If the comparator instead sees a raw analog count from the input word, 10 and 90 sit near the electrical bottom of the range and both indications behave incorrectly. Trace the scaling before choosing constants.

What should the comparators report at mid-travel?

Both indications false. With a closed threshold at or below 5 percent and an open threshold at or above 95 percent, any position between them asserts neither limit, which reproduces the neutral state the old contacts gave between full-open and full-close. Confirm the downstream block expects that neither-limit state at mid-travel.

Can a derived position indication prove the valve reached its seat?

No. A comparator on the feedback current reports where the transmitter says the valve is. It cannot detect a broken stem, a slipped linkage or a transmitter drifting out of calibration, all of which the old mechanically actuated contacts caught. Where the process depends on proof of a hard limit, keep an independent sensor.

What hysteresis do I need on a noisy position signal?

Size the neutral band or hysteresis from the observed noise, not a fixed rule. Record the scaled value near each threshold during travel: if the reading wanders within, for example, two percent of a threshold, keep the band wider than that wander so the indication switches once per stroke instead of chattering.

Keep reading

  • How-to

    How to build ladder logic practice projects in STEP 7

    Get STEP 7 ladder practice projects from the vendor's own support portal and from the samples the installer already placed on your PC, not from a copy of a book's bundled disk. Then rebuild three circuits yourself: a start/stop latch with overload interlock, an on-delay timer sequence, and an up/down counter.

    PLC programming

  • How-to

    Scaling a 4-20 mA analog input to engineering units in CPM2 ladder

    Scale with y = x × 120 / 9999 - 20: the raw analog word reads 0 at 4 mA and 9999 at the top of the loop, so DM1010 stores -20 °C and 100 °C at the ends of the loop. Multiply before dividing into a 32-bit-wide product that holds 1,199,880, drive the rung with the Always-On bit, and read the destination as signed. If DM1010 only needs 0-9999, MOVE the raw word and skip the math.

    PLC programming

  • How-to

    Set up a CLICK PLC 4-20 mA pressure trip with a relay output

    Wire the two-wire loop into channel 1 of a C0-04AD-1, set that channel to 4-20 mA with 4 mA scaled to 0 PSI and 20 mA to 300 PSI in DF1, and drive relay output Y1 from Set and Rst coils that trip above 250 PSI and release below 230 PSI, with a loop-fault test below -10 PSI.

    PLC programming