Use this P3 reference for practical PLC/HMI linking: address allocation, command/status separation, screen switching, alarms, parameter writes, and commissioning tables.
Source anchors:
OUT to the same bit operated by HMI.soft-elements-and-special-relays.md and ladder-basic-instructions.md for PLC soft-element and ladder rules.Separate these four things:
| Type | Example | Owner |
|---|---|---|
| Command request | M100 HMI start request |
HMI writes, PLC consumes. |
| Internal state | M0 motor run latch |
PLC owns. |
| Physical output | Y0 motor contactor |
PLC owns. |
| Display status | M200 motor running display, D200 speed feedback |
PLC writes, HMI reads. |
Do not let HMI directly own a physical output or a PLC coil that is also driven by normal scan logic.
| Range | Purpose | Example |
|---|---|---|
M100~M199 |
HMI command requests | start, stop, reset, jog. |
M200~M299 |
PLC status to HMI | running, ready, fault, auto/manual. |
M300~M399 |
HMI page/permission/maintenance commands | page request, login state. |
M500~M599 |
Alarm active bits | motor overload, sensor timeout. |
D100~D199 |
HMI numeric setpoints | speed, time, count. |
D200~D299 |
PLC feedback to HMI | actual speed, cycle count, position. |
D300~D349 |
HMI screen/interaction registers | screen command/current screen. |
D500~D599 |
Diagnostics/error codes | communication result, step number. |
Adjust ranges to the actual CPU model and project size.
Use when HMI requests a one-shot PLC action.
| Address | Direction | Purpose |
|---|---|---|
M100 |
HMI -> PLC | Start request. |
M101 |
PLC -> HMI | Start accepted/ack. |
M102 |
PLC -> HMI | Start rejected/fault reason available. |
D500 |
PLC -> HMI | Reject/error code. |
Sequence:
M100.M100.M101.M102 and writes D500.M100 after acknowledgement.For simple buttons, a momentary bit plus PLC edge detection is often enough.
Recommended registers:
| Address | Purpose |
|---|---|
D300 |
Screen command register. |
D301 |
Current screen report register. |
Rules:
交互 -> 控制画面变换 reads D300.D300 to 0 after jump.报告当前画面号 writes D301.D300 only on event/edge.Example:
| Event | PLC action |
|---|---|
| Alarm requires operator attention | MOV K20 D300 to jump to alarm page 20. |
| Maintenance mode entered | MOV K30 D300 to maintenance page 30. |
| Current page confirmation | Monitor D301 = K20/K30. |
For operator setpoints:
D100.D100.D110.Pattern:
| Address | Purpose |
|---|---|
D100 |
HMI input setpoint. |
D101 |
HMI input minimum or recipe value. |
D110 |
PLC accepted setpoint. |
M510 |
Setpoint invalid alarm. |
D510 |
Invalid reason code. |
Do not use HMI-entered values directly for motion/heating/pressure until PLC validates the range.
PLC owns alarm truth; HMI displays it.
| PLC bit | HMI message |
|---|---|
M500 |
Emergency stop active. |
M501 |
Motor overload. |
M502 |
Sensor timeout. |
M503 |
Communication fault. |
HMI reset button should write a request bit such as M120, not clear alarm-active bits directly. PLC clears alarms only after the condition is safe and reset is valid.
Include a hidden/maintenance screen with:
SM000, fault bits.D301.PSW counters if used.M100~M199.M200~M299.M500~M599.Protect this page with password/permission where needed.
OUT to HMI-operated command bits.