IMDTouchKnowledge BaseShop main store

How-to

How to Build a Drop-Down Product List in Crimson 3

HMI and touchscreens Published 6 min read

Short answer

Build the selector as a text display whose complex expression reads Tag[pointer], with up and down arrows that move the pointer only inside the populated range and an acceptance step that transfers the selected product's parameters. For a zero-based list of 100 color codes the valid indices are 0 through 99, and the retained pointer must be validated on Powerup.

On this page
  1. How the indexed selector works
  2. Building the selector step by step
  3. Startup, Powerup and retained selections
  4. Worked example: bounding the pointer for 100 color codes
  5. Endpoint and acceptance tests
  6. Questions asked

Crimson 3 has no ready-made drop-down widget for a data-driven list, so you build one from parts: a numeric tag acting as a pointer, a text display whose complex expression reads Tag[pointer], up and down arrows that move the pointer only while it stays inside the populated list, and an acceptance action that transfers the chosen product's parameters. This guide builds that selector for a list of 100 product codes, each correlated with laser marker power and velocity, and works the arithmetic that bounds the pointer.

How the indexed selector works #

A text display can embed a variable and use it as a pointer into an array. The expression Tag[pointer] evaluates to the entry at the pointer's current value, so moving the pointer changes the displayed text without one fixed label per product. A scrolling list extends the same idea across several text objects, each with its own expression selecting its corresponding entry.

The pointer is the single selection key. Every array it indexes — codes, marker power, velocity — must identify the same product at the same index. A missing or reordered entry in just one array creates a mismatch even while the pointer stays perfectly in range, so alignment is part of the build, not an afterthought.

Present the selector either as a popup page the operator opens and closes, or as embedded rows that stay visible next to operating data. A popup can be shown with the ShowModal function, and a key or action's Target Page property sets which page it displays. A page holding the data tag and two bevel buttons, one for up and one for down, is the minimum interaction set either way. Keeping the highlighted candidate visually distinct from the accepted product is the same separation covered in designing HMI screens for clear operator decisions.

Building the selector step by step #

  1. Define the product data. Create the tags or arrays holding the 100 color codes and their correlated laser marker power and velocity values. Walk the list once and confirm all three fields identify the same product at every selectable entry.
  2. Create the pointer tag. Make it numeric and decide what it represents: the highlighted candidate or the active product. Keep those two roles separate when browsing must not disturb machine settings.
  3. Add the code display. Put a text display on the selection page and set its complex expression to the indexed pattern Tag[pointer], using your own tag names.
  4. Add guarded arrows. The up action increments the pointer only when the next value stays inside the list; the down action mirrors it. Set both guards from the populated entry count, not from a rounded number.
  5. Extend to multiple rows. If several codes are visible at once, give each row an expression offset from the pointer, and guard the rows that would run past the last entry rather than evaluating a missing index.
  6. Add acceptance. On confirmation, copy the selected entry's power and velocity through the machine's parameter-transfer interface. Treat acceptance as an operator action on a laser: route the values through the machine's existing permissives instead of writing marker setpoints straight from the panel.
  7. Define the cancel path. If the selector is a popup, make closing it without confirming clearly different from accepting, so an abandoned candidate never leaves the machine half-configured.

Startup, Powerup and retained selections #

The terminal-level code lives in the Pages section of the tree: highlight the very top item, the person icon above the first page, not the first page itself. The middle pane then shows the terminal's general options, including code that runs on Startup, on Powerup, and On Tick, plus the timeout and popup settings.

Decide whether the application restores the last selection or starts at a designated entry. A retentive pointer survives restarts, but a retained value can outlive a change to the list, so validate it against the current list on Powerup before it is used for display or parameter lookup. Then review every piece of code that writes the pointer: initialization that always overwrites it will erase the operator's choice on every start.

Symptom Likely cause Where to look
Selection snaps back to another value A second writer: Powerup initialization or On Tick code Every action and program that writes the pointer tag
Pointer stops one short or runs past the end Arrow guards set to the wrong endpoints The arrow actions against the populated entry count
Label shows one product, parameters belong to another Arrays misaligned by a missing or reordered entry Each array at the same index

Worked example: bounding the pointer for 100 color codes #

Inputs, each from the application this selector serves: 100 list entries (one per color code, a plain count), zero-based indexing, an arrow step of 1 entry per press, a single highlighted display row, and a pointer retained across power cycles.

The rule in words: for a zero-based list of N entries, the first valid index is 0 and the last valid index is N − 1. Every arrow action and every displayed expression must keep the index inside that span at all times.

The arithmetic: N = 100, so the last index is 100 − 1 = 99. The up arrow may increment only while the pointer is below 99; the down arrow may decrement only while the pointer is above 0. Holding up from 0, the 99th press reaches 99 and the next press must do nothing, because index 100 does not exist. If the display later grows to a three-row window, the rows read pointer − 1, pointer, and pointer + 1: the top row is valid while pointer − 1 is at least 0, and the bottom row while pointer + 1 is at most 99.

The result is a valid span of 0 through 99, and the decision follows from it. Bound both arrow actions to that span, and on Powerup check the retained pointer: any value above 99 is invalid, so reset it to a defined entry before the first display or parameter lookup.

Endpoint and acceptance tests #

  • Select the first entry and hold the down arrow: the pointer stays at 0.
  • Select the last entry and hold the up arrow: the pointer stays at 99 and every visible row shows a real entry.
  • Browse without confirming: the marker power and velocity held by the controller do not change.
  • Confirm an entry: the transferred pair matches that entry's row in the parameter table.
  • Power cycle the terminal: the restored selection is valid for the list as it exists now.
  • After any edit to the list, repeat both endpoint tests, because a middle entry can hide a range error while every row expression still lands inside the list.

To prove the parameter transfer before the panel touches the marker, use the approach in testing HMI simulation against a live PLC.

Questions asked

How many tags and programs did a working selector of this kind use?

One reported build for a hundred product codes used four tags, one derived tag, two programs, and several Complex Expressions per object. Those counts describe one implementation, not a requirement. A single pointer tag, the data arrays, guarded arrow actions, and one acceptance action are the minimum that keeps display, selection, and parameter transfer explicit.

Can I copy the finished selector into another Crimson application?

Yes. Objects, programs, and tags drag and drop between open Crimson applications. When names conflict, create a folder with a unique name in the source application, drag the items you want into it, then move the folder across and resolve the conflicts afterwards. Programs and tags both support folder structure, so the technique scales to a whole library of reusable selector parts.

What pointer limits do I set for my list length?

Read the list's indexing basis first. A zero-based list of 100 entries is valid from 0 through 99, because the last index is the entry count minus one. A one-based list of the same size runs from 1 through 100. Set the arrow guards from the populated entries you actually defined, not from a rounded number that happens to be nearby.

Why does the selected product revert by itself?

Something else is writing the pointer tag. The usual suspects are Powerup initialization that resets the pointer on every start and On Tick code that runs continuously. Open the terminal settings where the Startup, Powerup, and On Tick code lives, list every writer of the pointer, and remove all of them except the arrow actions and the acceptance step.

How do I show several product codes at once instead of one?

Give each visible text object its own complex expression offset from the pointer: the row above shows the pointer minus one, the highlighted row shows the pointer, and the row below shows the pointer plus one. Guard the end rows so an out-of-range index displays a blank instead of evaluating a missing entry.

Keep reading

  • Troubleshooting

    Fixing Goto Display Buttons Locked by HMI Global Connections

    While the Global Connections remote display number is active — its DINT tag still holding 21 — FactoryTalk View ME disables every other form of navigation, so Goto Display buttons stay dead whether or not the popup is visible. Write 21 with a one-shot on bit A and let a startup macro on display 21 reset the tag to 0; the popup stays up and the buttons respond.

    HMI and touchscreens

  • Troubleshooting

    HMI Text Runs Off the Screen After Downloading the Project

    The panel and the project are both fine: the engineering PC's Windows display scaling is above 100%, so the downloaded layout lands past the panel edge even though the editor and offline simulation look correct. Set the scale to 100%, restart the PC, then redownload.

    HMI and touchscreens

  • Explainer

    Designing HMI Screens for Clear Operator Decisions

    High performance HMI design under ANSI/ISA-101.01-2015 makes abnormal conditions easier to spot than normal operation: normal running renders flat and gray, saturated color appears only on deviations, and every icon, font and color follows one documented project style. Verify the style mechanism on a single screen before scaling to the full library.

    HMI and touchscreens