Build a paged keypad for text entry on a small HMI

5 min read · Published November 14, 2026

A 3-inch panel fits about 18 usable buttons, so the keyboard has to be split over pages: 15 character keys and 3 control keys on each page, one PLC bit per key, and the string assembled in a PLC-side buffer that page changes cannot touch. Two pages carry 27 characters, the full 37-character set takes three, and an accept key commits the entry.

A 3-inch panel will not hold a keyboard, so split it. The panel fits about 18 usable buttons, which makes a keypad of two pages: 15 character keys and 3 control keys per page, one PLC bit per key, and the string assembled in PLC logic. The typed text lives in a PLC-side buffer, the page keys leave it alone, and an accept key copies the finished entry to its destination. Two pages carry a 27-character set; the full 37-character set with digits takes three. Here is the count, the build and the checks.

What you need

  • The 3-inch panel project open in the HMI software, with a page you can copy.
  • A PLC with room for a text buffer and about 35 free internal bits: 30 character keys over two pages, plus backspace and page flip on each page and one accept key.
  • The software's live data view, so you can watch the buffer while you test.
  • The character set and the destination string's length, written down before any button is drawn.

Example: two keypad pages for a 37-character set on a 3-inch panel

Inputs:

  • Panel size: 3-inch diagonal, the machine's own HMI.
  • Usable buttons per page: 18, the layout estimate for a panel this size. Check it against your own drawing before you cut the character set.
  • Full character set: 26 letters + 10 digits + 1 space = 37 characters.
  • Control keys on every page: backspace, page flip, accept = 3.

Rule in words: the character slots on a page are the usable buttons minus the control keys, and the page count is the character count divided by the slots, rounded up.

Arithmetic:

  • 18 buttons - 3 control keys = 15 character slots per page.
  • 37 characters / 15 slots per page = 2.47, rounded up to 3 pages for the full set.
  • Drop the 10 digits for a name-only field: 37 - 10 = 27 characters. 27 / 15 = 1.8, rounded up to 2 pages.
  • Spare room on two pages: 2 x 15 = 30 slots, 30 - 27 = 3 slots left for a period, a hyphen and one more symbol.

Label size, from the signage planning figure of 20 ft of viewing distance per inch of capital height (the safer reading of the FHWA figure): an operator standing 24 in away, which is 2 ft, needs capitals of 2 ft / 20 = 0.1 in, about 2.5 mm. That is the floor for every key label.

Result: two pages of buttons carry a 27-character name set with 3 slots to spare. Decision: the threshold is 30 characters, two full pages of 15 slots. Stay at or under it and you build two pages. The 37-character set sits at 3 pages, and anything past 45 characters (3 x 15) calls for a larger panel or the multi-tap style below.

Build the pages and the logic

  1. Write the character set and the destination string's length into the project notes. The destination's length is the limit every append checks against.
  2. Draw page one: 15 character keys and 3 control keys. Keep every label at or above the capital-height floor from the example.
  3. Point each character key at its own PLC bit with a momentary action: the bit is on only while the key is held.
  4. Give each character key one rung in the PLC: on the rising edge of its bit, if the length counter is below the limit, write the key's character code into the buffer at the counter's position, add 1 to the counter, and reset the bit. The key for the letter A writes the ASCII code 65.
  5. Backspace gets its own bit and rung: if the counter is above 0, subtract 1 and blank that buffer position.
  6. The page flip key changes only the page. Its rung writes nothing to the buffer.
  7. The accept key copies the buffer to the destination string and sets a one-shot flag the rest of the program can act on. This is the same commit step as saving HMI screen input to recipe storage with a second button set.
  8. Show the buffer in one text object on both pages, bound to the same tag, so the operator sees the same partial word either way. For sizing display text against the panel, putting a full page of static text on an HMI screen covers the same job.
  9. Copy page one to page two. Replace the 15 character keys and their bits, and keep the control keys where they sit.

Keep the buffer alive across page changes

Hold the buffer, the length counter and the limit in PLC memory. Storage that belongs to one screen is the usual way a half-typed word vanishes on the way to page two. PLC tags have no page, so the entry survives navigation by construction.

Keys that stop working after a page swap point at the keypad's screen assignment; checking the keypad screen assignment works that fault.

How to check it worked

One safety note first: the accepted string often names what the machine runs next, so a mismatch between the text on the panel and the string in the PLC is a stop condition. Release nothing until every check passes.

  • Press the A key once: the counter goes from 0 to 1, the buffer shows A, and the bit reads 0 again.
  • Hold A for 3 s: still one A, because the rung triggers on the edge, not on the level.
  • Type BAD, then backspace: the buffer shows BA and the counter reads 2.
  • Type part of a word, flip to page two, finish it: the entry survives, in order.
  • Fill the buffer to the limit, then press a character key: the counter stops at the limit and the byte after the buffer is untouched.
  • Backspace on an empty buffer: the counter stays at 0.
  • Read the PLC string and the panel text side by side: they match character for character.

When to build something else

If the operator picks from a known list, skip typing entirely: one button per name, the approach in naming recipes on a panel with no text entry.

If the panel is larger and the HMI software ships a keypad you can define yourself, start there; linking a user-defined keypad to a numeric entry object shows the wiring on a number field, and a text keypad uses the same mechanism.

If buttons are scarcer than logic time, phone-style multi-tap entry runs the whole set on 10 buttons, at the price of a timer and a press counter in the PLC.

And when the finished string belongs on a big board beside the line, a separate notice screen does that half of the job: shop-floor notice screens play a show from a memory card with no PLC in the loop.

Recommendation: build the two-page keypad for a short name typed now and then on a 3-inch panel: one bit per key, one PLC-side buffer, commit on accept. Add a third page when the character set passes 30, and move to a larger panel when operators type new entries every shift.

Questions

How many pages does the full 37-character set need?

Three pages. Eighteen buttons minus 3 control keys leaves 15 character slots a page, and 37 characters will not fit in the 30 slots of two pages. Three pages hold 45 slots, which leaves 8 free for a period, hyphen, slash and more symbols. If the entry can drop the 10 digits and keep letters plus space, two pages are enough.

Can phone-style multi-tap entry cut the button count?

Yes. Ten buttons carry the whole set: digits on all ten keys, and the 26 letters spread over keys 2 through 9, which is 3 or 4 letters per key. One press selects a key's first letter, a quick second press its second, and a pause commits the choice, so the PLC needs a press counter and one timer. Trade that way when buttons are scarcer than logic time.

What if the typed text disappears when the page changes?

Type three letters, flip to the second page and type three more. If the first three are gone, the buffer sits in storage that belongs to one screen, and that storage reloads on every page swap. Move the buffer, the length counter and the limit into PLC tags shown on both pages, then run the same test again.

Should the accept key clear the buffer?

Yes, after the copy. Set the length counter back to 0 so the next entry starts empty, and let the destination string keep the accepted text until the next accept overwrites it. An operator who wants to abort mid-entry backspaces to zero, which costs no extra key.

Planning information, not legal or engineering advice. Rules differ by place: check codes and permits with your local authority and your licensed trades.

Keep reading

Build your signAsk for a quote