Use output fields for process values and input fields for setpoints, with display format and decimals matched to the measurement and the unit as a separate text. Set limits on the HMI tag so the keypad rejects mistakes, repeat tighter limits in the PLC, and transfer the setpoint from a request tag to an active tag on a deliberate ACCEPT, ramped so the process never sees a step.
- Display only the decimals the instrument can measure.
- Panel limits prevent mistakes; PLC limits prevent damage.
- Request → ACCEPT → validate → ramp: never write straight into the running control.
Output, Input and Input/Output Fields
An I/O field has three modes: Output for display only, Input for entry only, and Input/output for both. Process values use Output so a stray touch cannot overwrite a measurement. Three properties decide readability: the display format (decimal for process values), the format pattern (digits before and after the decimal point, e.g. 9999 for rpm, 999.9 for °C) and the field length, wide enough that the largest value never shows as a row of asterisks.
| Layer | What it does | Where it is configured |
|---|---|---|
| HMI tag limits | Rejects the entry at the keypad | HMI tag properties, range |
| PLC range check | Rejects or clamps before the value is used | FB that copies request to active |
| Controller / drive limits | Restricts what the actuator can do | PID_Compact or VFD parameters |
| Alarm or status text | Tells the operator why the entry was refused | Text list on RejectCode |
Lab Flow: From VFD Feedback to a Tested Setpoint Screen
Stage 1VFD Wiring and PLC Tag Table
| PLC tag | Address | Type | Device |
|---|---|---|---|
M8_SpeedAct_Raw | %IW98 | Int | VFD analog output: actual speed 0 – 10 V = 0 – 1500 rpm |
M8_Ready | %I5.5 | Bool | VFD ready relay |
M8_SpeedRef | %QW82 | Int | Speed reference to the VFD analog input |
M8_Run | %Q2.1 | Bool | VFD run command |
Stage 2Input Mapping and Scaling into DB_IO
// FC_InputMapping – fan M8
"DB_IO".M8_SpeedAct := SCALE_X(MIN := 0.0,
VALUE := NORM_X(MIN := 0, VALUE := "M8_SpeedAct_Raw", MAX := 27648),
MAX := 1500.0);
"DB_IO".M8_Ready := "M8_Ready";
Scaling belongs in the PLC so every panel, SCADA client and archive shows the same value – see PLC analog input scaling and the logged example in HMI trends and data logs.
Stage 3Logic: Validation and Setpoint Ramp
// DB_M8 (DB80): SP_Request, SP_Target, SP_Active, RampRate : Real; // rpm, rpm/s (100.0)
// Cmd_Accept, AcceptOld, Accepted : Bool; RejectCode : Int;
// FB_SetpointRamp – STAT: tTick : TON_TIME;
IF "DB_M8".Cmd_Accept AND NOT "DB_M8".AcceptOld THEN // rising edge of ACCEPT
IF NOT "DB_IO".M8_Ready THEN
"DB_M8".RejectCode := 2;
ELSIF "DB_M8".SP_Request < 100.0 OR "DB_M8".SP_Request > 1450.0 THEN
"DB_M8".RejectCode := 1; // PLC limits: tighter than the HMI
ELSE
"DB_M8".RejectCode := 0;
"DB_M8".SP_Target := "DB_M8".SP_Request;
END_IF;
"DB_M8".Accepted := "DB_M8".RejectCode = 0;
END_IF;
"DB_M8".AcceptOld := "DB_M8".Cmd_Accept;
// Ramp the active setpoint every 100 ms
#tTick(IN := NOT #tTick.Q, PT := T#100MS);
IF #tTick.Q THEN
IF "DB_M8".SP_Active < "DB_M8".SP_Target THEN
"DB_M8".SP_Active := MIN(IN1 := "DB_M8".SP_Active + "DB_M8".RampRate * 0.1, IN2 := "DB_M8".SP_Target);
ELSIF "DB_M8".SP_Active > "DB_M8".SP_Target THEN
"DB_M8".SP_Active := MAX(IN1 := "DB_M8".SP_Active - "DB_M8".RampRate * 0.1, IN2 := "DB_M8".SP_Target);
END_IF;
END_IF;
// FC_OutputMapping – speed reference to the VFD
"M8_SpeedRef" := REAL_TO_INT(SCALE_X(MIN := 0.0, MAX := 27648.0,
VALUE := NORM_X(MIN := 0.0, VALUE := "DB_M8".SP_Active, MAX := 1500.0)));
"M8_Run" := "DB_M8".SP_Active > 0.0 AND "DB_IO".M8_Ready;
The same request/validate/activate pattern, applied to a whole set of parameters, is the recipe transfer in HMI recipe management.
Stage 4HMI Tags, Data Types and Limits
| HMI tag | Type (must match PLC) | Range on HMI tag | Used by |
|---|---|---|---|
DB_IO_M8_SpeedAct | Real | – | Output field ① |
DB_M8_SP_Request | Real | 0 – 1500 | Input field ③ |
DB_M8_Cmd_Accept | Bool | – | ACCEPT ④ |
DB_M8_SP_Active | Real | – | Output field ⑤ |
DB_M8_RejectCode | Int | – | Status ⑥ via text list |
A Real setpoint written into an Int tag loses its decimals silently – the most common cause of "setpoints that change by themselves". Drag DB members into the HMI tag table instead of typing addresses, and TIA Portal keeps the types identical.
Stage 5I/O Fields and Graphics
| # | Object | Properties | Tag / event |
|---|---|---|---|
| ① | I/O field actual speed | Mode Output, decimal, format 9999, right-aligned | DB_IO_M8_SpeedAct |
| ② | Text field unit | Separate text "rpm" next to each field | – |
| ③ | I/O field setpoint request | Mode Input, format 9999.9, limits from the HMI tag, authorisation Operator | DB_M8_SP_Request |
| ④ | Button ACCEPT | Press: SetBit, Release: ResetBit | DB_M8_Cmd_Accept |
| ⑤ | I/O field active setpoint | Mode Output, format 9999.9 | DB_M8_SP_Active |
| ⑥ | Symbolic output field | Text list: 0 Accepted, 1 outside 100 – 1450 rpm, 2 VFD not ready | DB_M8_RejectCode |
Field placement, fonts and decimals follow HMI screen design best practices; who may enter setpoints is set in HMI user administration.
Stage 6Perform and Test: Animated Setpoint Entry
Exhaust fan M8 runs on a VFD. Type a speed setpoint into the input field and press ACCEPT. The panel rejects values outside its tag limits at the keypad; the PLC checks its own, tighter limits, then ramps the active setpoint at 100 rpm/s. Switch on the two wrong designs to see a step change hit the drive and a REAL setpoint truncated by an INT tag.
Troubleshooting I/O Fields and Setpoints
| Symptom | Likely cause | First check |
|---|---|---|
| Field shows **** | Field length too short for the value | Format pattern and field length |
| Decimals disappear after entry | HMI tag Int, PLC member Real | Tag data types |
| Value accepted on panel, ignored by machine | PLC rejected it or ACCEPT not pressed | RejectCode and SP_Active |
| Process jumps after entry | Entry written directly into the active tag | Request/active pattern with ramp |
| Value keeps flickering | Too many decimals for the measurement | Format pattern |
Hands-On Lab: Fan Setpoint with Limits, Validation and Ramp
Hands-on- TIA Portal with WinCC Comfort and a panel or PLCSIM + HMI simulation
- A VFD or simulated analog values
- Estimated time: 60 minutes
Wire the VFD signals and map PLC tags
Declare M8_SpeedAct_Raw (%IW98) and M8_Ready (%I5.5) as inputs and M8_SpeedRef (%QW82) and M8_Run (%Q2.1) as outputs.
Scale the inputs into DB_IO
Convert the speed feedback to rpm with NORM_X and SCALE_X and copy M8_Ready in FC_InputMapping.
Write FB_SetpointRamp
Create DB_M8 with request, target and active setpoints, validate on ACCEPT and ramp the active setpoint at 100 rpm/s.
Create HMI tags with limits
Drag DB_M8 and DB_IO into the HMI tag table, keep every type identical to the PLC, and set the request tag range to 0 – 1500.
Build the I/O fields and buttons
Add the actual-speed output field, the request input field, separate unit texts, the ACCEPT button, the active setpoint field and the status text list.
Perform and test
Enter valid and invalid values, accept with the VFD not ready, and compare the ramp with a direct write.
Process values are readable and correctly scaled, wrong entries are stopped at the keypad and again in the PLC, and an accepted setpoint reaches the drive as a smooth ramp.
Frequently asked questions
Where should analog values be scaled, in the PLC or on the HMI?
In the PLC. Scaling once in the controller means every panel, SCADA client and archive sees the same engineering value, and there is only one place to correct if a transmitter range changes.
What happens if the HMI tag data type does not match the PLC tag?
Values are truncated or misinterpreted. A REAL written into an INT loses the decimal part, and mismatched types often show as setpoints that appear to change by themselves.
Are HMI input limits enough to protect the machine?
No. They stop mistyped entries at the keypad, but other clients can write the same tag. The PLC must repeat the range check before the value is used by the control logic.
Why should a setpoint use a request tag and an active tag?
So the operator can enter a value without immediately disturbing the process. The PLC validates the request, then transfers or ramps it into the active tag on a deliberate command.
How many decimal places should an output field show?
As many as the measurement really resolves. A speed accurate to a few rpm needs none; a temperature accurate to half a degree needs one. Extra digits are noise that operators learn to distrust.
Should the unit be part of the format pattern?
No. Put the unit in a separate text object next to the field, so the field stays numeric and the unit can be translated in multilingual projects.