Guide
PLC Custom Profile: Manual Endpoints Beat Every Preset
Custom lo and hi with refused equality; EU follows the raw fraction exactly.
Use custom endpoints for PLC raw count scaling when an available preset does not match the installed module, channel range, and data format. Copy the count values corresponding to the configured signal endpoints from the applicable module manual, then check the mapping with known input currents. A preset that matches those settings is equally valid; manual entry is not inherently more accurate.
For example, Rockwell Automation’s MicroLogix 1200/1500 reference manual lists 6,240 at 4 mA and 31,200 at 20 mA for the 1762-IF2OF2 in raw/proportional format. With a hypothetical linear 0–100 bar transmitter, 18,720 counts therefore represents 50.00 bar—not the 57.13 bar produced by an assumed 0–32,767 mapping. These endpoints apply to that documented configuration, not every Allen-Bradley input.
Establish the Count Range Before Scaling
Record the following before choosing a preset or entering endpoints:
- Module catalog number and applicable hardware documentation.
- Channel signal range, including whether it is configured for 0–20 mA or 4–20 mA.
- Data format, such as raw/proportional, scaled-for-PID, or engineering units.
- Count value at each configured signal endpoint.
- Transmitter engineering range and units.
- PLC tag or register being read, including any scaling already applied in the program.
Bit depth alone does not establish the count values at 4 mA and 20 mA. A generic “15-bit” profile is an assumption unless its endpoints match the module’s documented representation.
Data format matters even on the same module. The MicroLogix 1200/1500 Instruction Set Reference Manual, publication 1762-RM001H-EN-P, July 2014, page 19 lists the following values for the 1762-IF2OF2:
| Input current | Raw/proportional format | Scaled-for-PID format |
|---|---|---|
| 4 mA | 6,240 | 3,120 |
| 20 mA | 31,200 | 15,600 |
Do not mix an endpoint from one format with an endpoint from another. Also distinguish the normal signal endpoint from extended-range values: the same table lists 32,760 at 21 mA in raw/proportional format, not at 20 mA.
Calculate Engineering Units From Custom Endpoints
For a linear mapping:
[
f=\frac{R-R_L}{R_H-R_L}
]
[
E=E_L+f(E_H-E_L)
]
Where:
- (R) is the input value in counts.
- (R_L) and (R_H) are the counts at the lower and upper signal endpoints.
- (f) is the dimensionless fraction of signal span.
- (E_L) and (E_H) are the engineering values at those respective endpoints.
- (E) is the calculated value in the same engineering unit as (E_L) and (E_H), such as bar.
Keep endpoint pairs together: (R_L) corresponds to (E_L), and (R_H) corresponds to (E_H). The subscripts identify signal endpoints, not necessarily ascending engineering values. A reverse-acting range can therefore use (E_H<E_L).
Reject equal raw endpoints because (R_H-R_L=0) makes the calculation undefined. Reject missing or nonnumeric inputs rather than silently substituting defaults. Use floating-point arithmetic, or an appropriately designed fixed-point calculation, so integer division does not truncate the normalized fraction.
This relationship assumes engineering quantity is linear with the signal. Do not use it alone for an unlinearized differential-pressure flow signal, and do not add another square-root operation if the transmitter or PLC has already performed that conversion.
Worked Example: 4–20 mA to 0–100 bar
Assume:
- A 1762-IF2OF2 input using the documented 4–20 mA raw/proportional representation.
- A hypothetical transmitter configured for a linear 0–100 bar output.
- No additional scaling or nonlinear processing before the value is read.
The manual provides (R_L=6{,}240) and (R_H=31{,}200). At (R=18{,}720):
[
f=\frac{18{,}720-6{,}240}{31{,}200-6{,}240}
=\frac{12{,}480}{24{,}960}=0.5
]
[
E=0+0.5(100-0)=50.00\text{ bar}
]
The calculated reference points are:
| Applied current | Ideal raw count | Calculated pressure |
|---|---|---|
| 4 mA | 6,240 | 0.00 bar |
| 8 mA | 12,480 | 25.00 bar |
| 12 mA | 18,720 | 50.00 bar |
| 16 mA | 24,960 | 75.00 bar |
| 20 mA | 31,200 | 100.00 bar |
The intermediate counts are calculated by linear interpolation between the documented endpoints; they are not measured readings or additional manufacturer accuracy specifications. Pressure values are displayed to two decimal places, with rounding only at the final result.
For a reverse-acting 100–0 bar range, keep the same raw endpoints and enter (E_L=100) bar and (E_H=0) bar. The midpoint remains 50.00 bar, while the endpoint engineering values reverse.
Check the Mapping With Known Currents
Before injecting a signal, follow the site procedure for isolating the loop and managing any affected outputs, alarms, or interlocks. Use a suitable current source and the module’s documented wiring arrangement.
- Confirm the channel range and data format in the actual PLC configuration.
- Apply known currents at the lower endpoint, midpoint, and upper endpoint. Allow readings to settle.
- Record the applied current, unscaled input value, calculated engineering value, and channel diagnostic status.
- Compare the readings with the expected mapping. If they disagree, check configuration, tag selection, existing scaling, wiring, and diagnostics before changing endpoints.
For the documented 1762-IF2OF2, the manual identifies general-status, overrange, and underrange bits. Evaluate those indications alongside the numeric reading; a count value alone does not establish a valid measurement.
Set field acceptance limits from the applicable module specifications, current-source uncertainty, operating conditions, and site procedure—not from the decimal places in the table. Agreement with an ideal conversion checks the mapping; it does not by itself establish transmitter calibration or whole-loop accuracy.
Handle Out-of-Range Values Without Hiding Them
A raw value outside the configured endpoints produces (f<0) or (f>1). Mathematically, the formula extrapolates beyond the engineering range. Whether that value represents usable overrange, a diagnostic condition, or invalid data depends on the module and configuration.
Do not silently clamp an out-of-range reading before evaluating its status, and do not treat a reserved diagnostic code as an ordinary count. If the application requires a limited display value, retain a separate indication of the original range or diagnostic condition.
Use custom endpoints to reproduce a documented mapping—not to force an unexpected field reading to look correct. Changing the scale to conceal a mismatch can hide the configuration or measurement problem that needs investigation.
Formulas
Linear scaling
EU=LRV+frac*span; mA=4+16*fracEU follows the raw fraction on PLC pages.
Worked example
PLC Raw Counts to Engineering Value worked example (s7_4ma_mid)
Inputs: raw_counts=16589.0, plc_profile=1.0, raw_lo_custom=0.0, raw_hi_custom=27648.0, sig_lo_custom=4.0, sig_hi_custom=20.0, eu_low=0.0, eu_high=100.0
Calculation: signal_ma=12.0, eu_value=50.0, pct=50.0, v_250=3.0, clipped=0
Lesson:
Frequently asked questions
What is the most common mistake on PLC Raw Counts to Engineering Value?
Skipping the verify items: set nameplate values first, then read every flag.
What is the most common mistake on PLC Raw Counts to Engineering Value?
Skipping the verify items: set nameplate values first, then read every flag.
Sources and further verification
- PLC Raw Counts to Engineering Value calculator SenseCalc
- 4-20 mA current loop Wikipedia
Next step
Run the PLC Raw Counts to Engineering Value calculator
Related resources