Store HMI step times and output bitmaps in one PLC table

7 min read · Published November 11, 2026

Keep the counter-and-drum sequencer and add two tables in PLC memory: one time preset word per step and one 16-bit output bitmap word per step, two above 16 outputs. Index both tables from the current step number and let a 6-inch panel edit one row at a time. Twenty steps at 20 outputs fit in 60 words.

You do not need 400 objects on the panel or one rung per cell in the matrix. Keep the sequencer the machine already runs, and move the numbers into two tables in PLC memory: one time preset word per step, and the step's output choices packed as 16-bit bitmap words. The ladder indexes both tables from the current step number, so a 20-step, 20-output machine stays a handful of rungs, and a 6-inch panel edits one row at a time instead of 400 cells. The full layout fits in 60 words of data registers; at 16 outputs per step or fewer, 40 words are enough.

What stays and what changes

Keep the advance you have: each step runs for its setpoint, the sequence moves on when the step finishes, and the last step wraps back to step 1. Keep the jog input, so the user can step through the program manually to double-check the settings. Keep the fast-forward time-base swap that runs the whole program in seconds for testing. Those behaviors run the machine today, and a table lookup leaves them alone.

Change two things. First, the per-step counter presets become one timer whose preset is fetched from the times table, so the operator edits one value per row instead of twenty separate counters. Second, the drum's fixed one-output-per-step becomes a row lookup: the row for the active step carries an on/off bit for every output. The sequencer chooses the active step; the row says what happens during it. That separation is the same move as storing HMI recipe tables in PLC memory and loading the values on demand.

One rule does the heavy lifting: when a step ends, write the entire next word, off bits included. If the program only sets bits, an output that ran in the last step and is absent from the new row stays energized.

What you need

  • A PLC whose instructions support indirect addressing, where the address an instruction uses is held in another location and can point at a different word at runtime. Your controller's instruction manual lists which data types its pointer instructions accept and how they are declared.
  • One step counter and one timer to run the sequence.
  • Two non-overlapping blocks of data registers for the tables, plus the same layout reserved where the panel writes its staging copies.
  • A 6-inch-class HMI panel with numeric entry fields and on/off objects. No recipe cartridge or special object set is needed.
  • All step times stored in one unit, tenths of a second in this pattern, so every row reads the same way.

Set up the tables and pointers

  1. Reserve the two tables. Start the times table at V2100: one word per step, the step time in tenths of a second. Start the output table at V2200: 16-bit words, one word per 16 outputs per step. Size both blocks before you build the screens, the same discipline as planning an HMI recipe table row limit before a panel ships.
  2. Turn the step number into a pointer. Read the active step from the step counter's accumulated value CTA0, convert it with BIN into V2001, then add that offset to each table base. LDA O2100, ADDB V2001, OUT V2002 points at the active step's preset. LDA O2200, ADDB V2001, OUT V2003 points at the row's first output word.
  3. Match the pointer to the row width. One 16-bit word holds 16 on/off choices, one per bit. Above 16 outputs a row is wider than one word, so multiply the step offset by the words per row before adding the output base; a pointer that steps one word per row through a two-word-per-row table lands inside the previous row. Pick one index origin and hold it everywhere: if step 1 is the first step, its offset is 0, and the panel's step numbers must use the same convention.
  4. Time each step from the pointed preset. One rung times the active step from the table: STRN T0, TMR T0 P2002. Keep the NOT condition on the time-base rung so the first count does not fire the moment the step starts, and keep the fast-forward swap between the minutes and seconds bases, SP3 and SP4. Editing that preset from the panel is the same operation as changing a PLC timer preset from an HMI panel; the pointer only makes the preset follow the step.
  5. Write the whole word to the outputs. The output rung reads the pointed row and drives the outputs: STR SP1, LD P2003, OUT VY0 sends the 16 selected bits to a consecutive output range. For outputs scattered around the rack, decode the word into internal bits and give each physical output its own rung reading its own bit.
  6. Build two panel screens. The edit screen has a step selector, one numeric field for that step's time, and a column of on/off objects for that row's outputs, following the pattern for showing 16 PLC input and output bits on one screen. The overview screen shows the whole matrix as indicator lights, nothing selectable, so the operator can watch every cell without touching anything. If the panel's recipe objects support an offline mode, the operator can edit recipe values in the panel without transferring them to the controller, which leaves the running step undisturbed until someone writes the changes.

Worked example: 20 steps and 20 outputs on a 6-inch panel

Inputs. 20 steps in the repeating cycle and 20 outputs selectable in any combination: the machine's requirement. One preset word per step in tenths of a second: the documented times table layout. 16-bit words for the output table: the documented output table layout. A 6-inch panel: the size constraint that rules out a 400-cell grid.

Rule in words. Bitmap words per row equals outputs per step divided by 16, rounded up. Words per row equals 1 preset word plus the bitmap words. Table size equals steps times words per row.

Arithmetic. 20 ÷ 16 = 1.25, so each row carries 2 bitmap words. Words per row: 1 + 2 = 3. Times table: 20 rows × 1 word = 20 words, V2100 through V2119. Output table: 20 rows × 2 words = 40 words, V2200 through V2239. Total: 20 + 40 = 60 words. The preset pointer offset is 1 word per step; the output pointer offset is 2 words per step.

Outputs per step Bitmap words per row Words per row Words for a 20-step machine
8 1 2 40
16 1 2 40
20 2 3 60
32 2 3 60

Result. The two tables reserve 60 words. The edit screen shows 21 objects for the selected row: 1 numeric field and 20 on/off objects, with the second bitmap word's spare bits unused. The 400-cell matrix exists only as data; the operator never sees it as 400 editable cells.

Decision. Above 16 outputs per step, add a second bitmap word per row and scale the output pointer by the row width; at 16 or fewer, 2 words per step cover the whole machine at 40 words for 20 steps. Every additional 16 outputs add 20 words to a 20-step machine.

How to check it worked

  • Set every row's preset to 10 (1.0 s at tenths of a second) and let it run with nobody touching the panel. The sequence must walk step 1 through step 20 and wrap back to step 1 on its own.
  • Time one step with a stopwatch at preset 30. The step must end at 3.0 s.
  • Pick an output that is on in step 1 and off in step 2 and watch it at the transition. It must drop when the new row loads; if it stays on, the program is setting bits instead of writing the word.
  • Check the three places an offset error shows: the first row, the last row, and the wrap from step 20 to step 1.
  • Jog through all 20 steps and compare each row's indicator lights with the edit screen values.
  • Run the first pass with the load circuits disconnected. Until the rows and the wrap check out, a pointer mistake energizes the wrong output.

Recommendation

Recommendation: Keep the counter-and-drum advance, the jog input and the fast-forward time base exactly as they run today. Add the two tables, times at one word per step in tenths of a second and output choices at one 16-bit word per 16 outputs, point one timer at the times table, and write the pointed word straight to the outputs each step. On a 6-inch panel, edit one row per screen and keep the full matrix on an indicators-only overview. Once a step drives more than 16 outputs, use two bitmap words per row and multiply the output pointer by the row width.

Questions

What happens when the operator edits a value while its step is running?

The timer and the output rung read the pointed addresses every scan, so a value the panel writes lands on the active step within one scan. To let the operator prepare the next set calmly, point the panel at a staging block and copy it into the live tables at a step boundary. Some panels can also hold edits offline and write them to the controller only when told.

How much memory does the pattern need at other sizes?

Words per row are one preset word plus one 16-bit word per 16 outputs, rounded up. Ten steps at eight outputs need 20 words, and 50 steps at 32 outputs need 150 words. Reserve the identical layout in the panel's staging area so one screen pattern serves every row, and size the blocks before the panel screens are built.

Why does one step show another step's outputs?

The pointer offset and the row width disagree. If a row is two or three words wide and the program adds the bare step number to the table base, step 2's pointer lands inside step 1's bitmap. Multiply the step number by the words per row before adding the base, then re-check the first row, the last row and the wrap.

Does the drum instruction have to stay in the program?

No. The drum only has to deliver a current step number the tables can index. If the existing counter-and-drum advance, jog and wrap already behave the way the machine runs, keep them and change nothing about the order. When writing fresh, a step counter advanced by one timer's done bit runs the same two tables with less to maintain.

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