Map the panel's current screen and switch-to-screen values through its set up menu, run the PLC's 30-minute timer while the current screen register equals the maintenance screen number, and write the main screen number into the switch-to-screen register when the timer finishes. The timer measures time on the screen, so use the panel's own idle-return setting if your rule is inactivity.
A password-protected maintenance screen is a poor place to leave a panel unattended. You can make it return to the main screen on its own with three pieces your panel and PLC already have: the current screen value, the switch-to-screen value and one timer. Map the two values through the panel's set up menu. Run the timer while the current screen register holds the maintenance screen number, and let the timer's done bit write the main screen number into the switch-to-screen register. The example below returns to main after 30 minutes, with a 15-second bench test so you never wait half an hour to find a mapping mistake. One limit to agree on before you write any logic: the PLC timer counts time on the screen, and it counts no touches.
Can a PLC return a password-protected screen to the main screen after a timeout?
Yes, and the PLC does the timing: map the current screen and switch-to-screen values in the panel's set up menu, run a PLC timer while the current screen register holds the maintenance screen number, and let the timer's done bit write the main screen number back after 30 minutes.
Both exchange settings sit under the set up menu in the panel project, and both directions are needed. Without the readback the PLC never learns which screen is showing; without the write the timer can run out while the panel stays where it is. The panel's password protection stays as it is, because the PLC only changes which screen is on display. The numbering scheme behind this, how screens get their numbers and what a PLC can drive with them, is the subject of How a PLC controls the HMI screen number.
What do you need before you start?
You need the panel project with its set up menu, the PLC program with its timer instruction, two spare data registers, one per exchange direction, and the screen numbers of the maintenance screen and the main screen read from the panel project's screen list.
- The panel project open on your PC. The PLC>Panel and Panel>PLC exchange settings live in its set up menu.
- Two spare data registers in the PLC: one the panel writes to, one the PLC writes to. Write the addresses down exactly as the software prints them.
- The maintenance and main screen numbers, taken from the screen list in the panel project. Never guess a number from a screen's title.
- The PLC programming software, with its timer instruction available.
- A test window when nobody needs the maintenance screen for live work.
How do you map the current screen and switch-to-screen registers?
Open the set up menu in the panel project, fill in both exchange directions so PLC>Panel carries the current screen value to a PLC register and Panel>PLC carries a PLC register to the panel's switch-to-screen location, then download both projects and watch the register while you change screens.
- Go to the set up menu and find the PLC>Panel and Panel>PLC exchange settings.
- Under PLC>Panel, point the panel's current screen value at a spare PLC data register, and note the address.
- Under Panel>PLC, point a second spare PLC register at the panel's switch-to-screen location, and note that address too.
- Open the screen list in the panel project and write down the maintenance and main screen numbers.
- Download the panel project, then the PLC program.
- Move between the main and maintenance screens while watching the current screen register in the PLC software.
The check is simple: the register must equal the number of the screen on display at every moment, and it must fall back to the main screen number when you navigate home. Until it tracks every screen you care about, the timer has nothing to time.
A screen number is just another value crossing that exchange. How HMI screen values map to PLC registers walks through the mapping for ordinary panel values, and the screen numbers ride the same dialog.
Does the timeout measure time on the screen or time with nobody touching it?
It measures time on the screen: a PLC timer enabled by the current screen value counts how long that screen stays selected, it never sees a touch, and an engineer who stays on the maintenance screen for 35 minutes is switched to main at minute 30, mid-task.
For the abandoned-panel case this is what you want, and it is the tool you have when the panel project offers no inactivity signal. If engineers routinely need more than half an hour on that screen, raise the preset to 60 minutes and accept the longer exposure, or use the panel's own idle detection instead. Many panels carry a built-in return-to-home setting driven by inactivity; Return an HMI screen to home after 10 minutes idle walks through one at a 10-minute setting. Arm one owner for the automatic return, this timer or the panel's idle setting, so the two never fight over the switch-to-screen register.
How do you build the 30-minute timer in the PLC?
One comparison, one timer and one write do it: compare the current screen register to the maintenance screen number to enable the timer, set the timer to 30 with the min time unit, and on the timer's done bit write the main screen number into the switch-to-screen register.
- On a new rung, compare the current screen register to the maintenance screen number and feed that comparison to the timer's enable.
- In the timer setup, pick a spare timer number, set the time unit to min and the set point to 30. The timer is a single instruction, listed as TMR, and its setup dialog takes the timer number, a set point from 1 to 9999 and a unit of ms, sec, min, hour or day.
- Keep the comparison as the timer's enable. When the panel leaves the maintenance screen the rung goes false and the accumulated value returns to zero, so every visit runs its own fresh 30 minutes.
- Use the timer's done bit to drive a write of the main screen number into the switch-to-screen register.
- The panel switches within one exchange update of that write, the current screen register then reads the main screen number, the comparison goes false, the timer resets and the done bit drops.
The switch-to-screen register still holds the main screen number after the switch, and what a panel does when the same number keeps arriving there is its own subject: PLC to panel screen switch register: retrigger the same screen covers it.
Check: with the maintenance screen selected the accumulated value climbs, it drops to 0 the moment you navigate home, and at 30 minutes the panel moves.
What does the worked example look like with real numbers?
The example uses maintenance screen 12 and main screen 1, a timer preset of 30 with the min unit, and the numbers pass because 30 minutes is 1800 seconds, inside the 1 to 9999 set point, while the same half hour is 1,800,000 ms, past that limit.
Screen 12 and screen 1 stand in for whatever your own project prints; read yours from the screen list before you type anything into the PLC. Call the two mapped registers the current screen register and the switch-to-screen register.
The sequence. At 08:00 an engineer opens screen 12 and enters the password. The current screen register reads 12, the comparison is true, and the timer starts from 0. At 08:30 the accumulated value reaches 30 min, the done bit sets, and the PLC writes 1 into the switch-to-screen register. The panel switches to screen 1, the register reads 1, the comparison goes false, and the timer resets. The panel sits on the main screen until someone navigates again.
The preset arithmetic. 30 min x 60 s/min = 1800 s, and 1800 is inside the 1 to 9999 set point, so unit sec with a preset of 1800 gives the same 30-minute return on a finer time base. In ms the same interval is 1800 s x 1000 ms/s = 1,800,000 ms, far past 9999, so a 30-minute preset does not fit the ms unit in one timer. With the min unit the preset of 30 already reads as 30 x 1 min = 30 min, which is why the example picks it.
How do you test the timeout without waiting 30 minutes?
Test the logic at 15 seconds first: set the time unit to sec and the preset to 15, open the maintenance screen, step away, and watch the panel land on the main screen a quarter of a minute later before you put the 30-minute preset back.
- Pick a window when nobody needs the maintenance screen, and tell the crew the panel will switch screens on its own.
- Set the timer to unit sec, preset 15, and download.
- Open the maintenance screen, enter the password and step away. The panel should land on the main screen within about a quarter of a minute, and the current screen register should read the main screen number.
- Run it once more, but navigate home yourself after about 10 seconds. The accumulated value must drop to 0, and no switch may happen.
- Restore unit min and preset 30, download again, and let one full cycle run during a break or at the end of a shift.
Time the test so the return cannot hide something in use: an alarm banner, a live setting or a number someone is watching vanishes from view the moment the panel jumps to main.
Recommendation: Use the PLC dwell timer for a password-protected maintenance screen: preset 30 with the min time unit, a 15-second bench test before you trust it, a preset of 60 if engineers routinely spend more than half an hour on that screen, and one owner of the automatic return, either this timer or the panel's own idle setting.
What do you check when the screen never changes?
Check the two exchange mappings and the destination number, in that order: if the current screen register never changes as you navigate, the PLC>Panel direction is wrong, and if the timer finishes without the panel moving, the Panel>PLC direction, the switch-to-screen location or the destination screen number is at fault.
- The current screen register never changes. The PLC>Panel entry is missing, points at the wrong register, or the panel project was never downloaded after mapping. Reopen the set up menu, recheck the address, download both projects and navigate once.
- The done bit sets and the panel stays put. Write the main screen number once by hand from the PLC software into the switch-to-screen register. If the panel now moves, the fault is in the ladder: the write targets the wrong register, or the done bit comes from a different timer number. If the panel still ignores the write, the Panel>PLC entry points at the wrong panel location, or the number you wrote is not a screen in the project.
- The panel moves but the register keeps reading the maintenance screen. The readback maps a different panel value. Correct the PLC>Panel entry and download again.
- The hand write works and the ladder write does nothing. Watch the write instruction while the timer finishes. The usual faults are a wrong register address in the write or a comparison against the wrong screen number in the enable rung, and both show up on screen in the PLC software.
Keep the two register addresses and the two screen numbers in the project notes. The next engineer who adds a protected screen will need all four, and the notes turn a 30-minute mystery into a 5-minute readback.
Questions
Can I give more than one screen its own timeout?
Yes. Run one timer per protected screen. Each timer's enable rung compares the current screen register to that screen's number, so only one timer runs at a time, and each done bit writes its own home screen number to the same switch-to-screen register. Keep the pairs on consecutive rungs so the next engineer can read the pattern, and leave one screen, usually the main screen, without a timeout so the panel always has a place to land.
Why did the panel go back to the maintenance screen right after the timeout?
The usual cause is a second writer. If a screen-select routine in the PLC holds the maintenance screen number in the switch-to-screen register, the panel obeys the last number it received and goes back as soon as the exchange refreshes. Watch that register while it happens, give the timeout write its own momentary pulse, and make the screen-select routine drop its request once the current screen register confirms the move.
Does the automatic return clear the password protection?
No. The PLC write only changes which screen is displayed. Whether the panel asks for the password again on the next entry is decided in the panel project's own screen settings, so test one full cycle: enter the password, let the timeout return to main, then open the maintenance screen again and confirm the panel asks for the password.
Does the 30 minutes survive a power cut?
Only if your timer is configured as retentive. With the screen comparison as its enable, the timer restarts from zero at each power-up and after every normal exit from the maintenance screen, so a power cut at minute 25 simply gives the next visit a fresh 30 minutes. If your rule needs a return to survive a restart, enable the retentive option on that timer in your PLC software and test one power cycle end to end.
Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.