IMDTouchKnowledge BaseShop main store

How-to

How to Access One Bit of a Word in Operator Terminal Expert

HMI and touchscreens Published 6 min read

Short answer

Append the .Xn selector to a Modbus Holding Register word variable: word.X3 binds bit 3 of %MW10, X0 through X15, with read and write. The selector is rejected on symbol-linked and internal words; isolate those bits with an expression converter or a Boolean variable addressed to the bit, and confirm each write changes only the selected bit.

On this page
  1. Match the method to the variable path
  2. Bind the bit with the holding register selector
  3. Check the bit against the word value
  4. Isolate the bit with an expression converter
  5. Point a Boolean variable at the bit
  6. Match the switch action to the command model
  7. Diagnose a binding that fails
  8. Commission the binding
  9. Questions asked

Append the .X0 to .X15 selector to a Modbus Holding Register word variable and the switch binds to that single bit: with the variable addressed to %MW10, the binding word.X3 is bit 3, readable and writable. This is the documented syntax for the Modbus Holding Registers function path — word.X0 is bit 0, word.X15 is bit 15. The selector exists only on that path. A symbol-linked word and an internal word reject it, and no variation of the symbol path fixes that: STPM221.Memory_Words.MW_10..3.Value, STPM221.Memory_Words.MW_10:3.Value, %MW10:X3 and %MW10.3 all fail. For those two paths, isolate the bit with an expression converter or point a separate Boolean variable at it. This walkthrough covers both routes and the checks that keep a packed command word safe.

Match the method to the variable path #

Open the variable list and establish how the word reaches the panel before touching any object binding. The method follows that path, not the address printed beside the symbol. The migration case behind this procedure packs each motor's commands — start, stop, manual, auto, forward, reverse — into one M221 memory word, the same word-packing habit as combining time values for HMI display on a Modicon M221 with separate memory words.

Variable path Bit method Best for
Modbus Holding Register variable .X0 to .X15 selector appended to the variable name Direct read and write, fewest added objects
Symbol-linked word Expression converter, or one Boolean variable per bit Imported named controller tags
Internal word Expression converter Local screen state and lamps

Record four things before building anything: the word address, the bit position from the PLC logic, whether the object only reads (lamp) or also writes (switch), and the old object's action — momentary, maintained, set, reset or toggle. If the project has no Modbus connection to the controller yet, create it first; the steps are the same as in configuring Modicon M221 to HMIST6500 Modbus SIO communication.

Bind the bit with the holding register selector #

  1. In the variable list, create a word variable on the Modbus Holding Registers path, addressed to the controller word — %MW10 for the motor command word.
  2. Place a numeric display on a spare screen, bind it to the whole word and confirm the value matches the online controller word. Fix any mismatch before going near the bits.
  3. In the switch's variable binding, select that word variable and append the selector: .X3 addresses bit 3, with your variable's own name in place of word in word.X3.
  4. Set the switch action to match the old object — momentary for most start and stop commands.
  5. Exercise the bit from the controller side and watch the object take both states.

Check the bit against the word value #

Prove the mapping with arithmetic before wiring real outputs. Say %MW10 reads 72 with auto on bit 6 and start on bit 3:

  • 72 = 2^6 + 2^3 = 64 + 8, binary 0000 0000 0100 1000.
  • Reading bit 3 masks the word: 72 AND 8 = 8, nonzero, so start is 1.
  • Writing start to 0 must preserve auto: 72 AND (65535 − 8) = 72 AND 65527 = 64.
  • Writing start back to 1: 64 OR 8 = 72.

The selector and a correctly configured converter perform exactly this masking. Decision point: if one switch operation changes anything beyond the selected bit's 8, the write path is replacing the whole word — stop and fix it before commissioning.

Isolate the bit with an expression converter #

The selector is not implemented for symbol-linked or internal words; typing Word.X0 against an internal variable returns an error, which is expected behavior rather than a broken install. The expression converter is the tool for both paths:

  1. Add an expression converter at the point of use and select the symbol-linked word or the internal word as its input.
  2. Set the converter's bit position, 0 through 15.
  3. Bind the lamp or switch to the converter's Boolean result.
  4. For a switch, confirm the conversion writes back to the source word — a converter that only evaluates drives lamps but cannot carry a button command to the controller.
  5. Test both bit states while a numeric display shows the whole word.

Point a Boolean variable at the bit #

The vendor's FAQ on accessing a bit from a word documents the third route: define a new Boolean variable that points at one specific bit of the word. The IEC address form is %MW10:X1 for bit 1 of %MW10 — the form used in the published bit-toggle sample — and it works in fields that accept a PLC address, never appended inside a symbol path.

  1. Add a Boolean variable to the variable list.
  2. Address it to the bit: %MW10:X3 for bit 3 of %MW10.
  3. Bind the switch or lamp to that Boolean like any other variable.
  4. Repeat per command bit — six commands packed in the motor word means six variables.

For a migration that rebuilds dozens of switches, this route wins: every binding stays a plain named variable, the names can mirror the old Vijeo Designer tags, and each write addresses the bit itself. Use the converter for one-off lamps and for words that exist only inside the panel.

Match the switch action to the command model #

A correct binding still operates the machine wrongly when the object's action differs from what the PLC logic expects.

  • Use momentary action when the logic samples the bit only while the operator holds the control — the usual case for start and stop.
  • Use set, reset or toggle only where the logic expects a retained command.
  • Verify polarity from the old project and the PLC code; a label reading Stop does not say whether the bit is active-high or active-low.
  • Check that no rung assigns the whole word — one whole-word assignment overwrites every HMI bit write in that scan.

Prove the action with the outputs disabled or the process simulated, because a maintained action where the logic expects momentary latches a start, and a wrong bit in a word that packs forward and reverse runs the motor the other way.

Diagnose a binding that fails #

Symptom Likely cause What to check
word.X3 rejected with an error Source is a symbol-linked or internal word, not a Holding Register variable The variable's communication source; switch to a converter or a per-bit Boolean
Lamp follows the bit, switch does nothing Converter path is read-only Write-back support, or a Boolean variable at the bit address
The wrong command operates Bit position off by one — numbering starts at X0 Compare X0 through X15 against the PLC logic
Bit changes, then snaps back Controller logic rewrites the word or the command bit Monitor the word while operating; review the rungs that write it
Other commands change too The write replaced the word instead of masking it The whole word before and after one operation

Commission the binding #

  1. Record the whole word value and the target bit state.
  2. Operate the switch once with the intended press, release or toggle sequence.
  3. Compare the word before and after — only the selected bit's contribution may differ.
  4. Confirm every command packed in the same word still operates independently.
  5. Test both transitions, then the PLC condition that clears, latches or overrides the command.
  6. Restart the terminal runtime and repeat one operation, so the binding does not depend on the engineering session.

Bit rebinding is one slice of the wider migration job; validating HMI variables during a software migration catches the addressing and scaling mistakes that bit-level work tends to hide.

Questions asked

Why does word.X3 fail on my symbol-linked variable?

The .X selector is implemented on the Modbus Holding Register variable path only. A symbol-linked word exposes its whole-word value and has no bit member, and an internal word behaves the same, so the expression is rejected rather than evaluated. Move the word onto a Holding Register variable, or isolate the bit with an expression converter or a Boolean variable addressed to the bit.

How is the bit numbering counted?

Zero-based from the least significant bit: X0 is bit 0 and adds 1 to the word value, X3 is bit 3 and adds 8, and X15 is bit 15 and adds 32768. A word reading 72 therefore carries bits 3 and 6 set, which is 64 plus 8.

Do I need one converter or one variable per bit?

On the converter route, yes: one converter extracts one bit position from one word, so a motor word carrying six commands needs six converters. The Boolean-variable route also scales one variable per bit, but every binding stays a plain named variable, which is easier to audit and rename during a migration.

Is there a utility that converts a Vijeo Designer project to Operator Terminal Expert?

No conversion utility is documented in the vendor material verified for this article. Plan a manual rebuild: recreate the screens, rebind each variable using the selector, converter or per-bit Boolean methods, and validate the project end to end before commissioning. The packed command words are the slow part, and the per-bit Boolean route keeps them manageable.

Which method should I use for a lamp that only displays a bit?

A read-only path is enough there. Any converter extraction animates a lamp, and a Holding Register word.Xn selector needs no write configuration at all. The write-direction checks matter only for switches and buttons, which must carry the operator's command back to the controller word.

Keep reading

  • Troubleshooting

    Displaying a PLC Real Value Over Modbus on an HMI

    An INTEGER display that reads the register proves the link, station and address, so a blank REAL display is a 32-bit mapping fault. Declare the HMI variable as a 32-bit float on the register pair (40064/40065), set the device double-word order to Low Word First to match the PLC, and give the numeric field six integer digits for 628402.0.

    HMI and touchscreens

  • How-to

    How to Configure a Two-State Auto/Manual Switch in WinCC Flexible

    Pair the functions on each switch event: the Manual event runs SetBit on M10.0 and ResetBit on M10.1, and the Auto event runs SetBit on M10.1 and ResetBit on M10.0. After every transition exactly one mode bit is high, which is the state the PLC mode logic expects.

    HMI and touchscreens

  • Troubleshooting

    Why HMI Indicators Stay Off Over Modbus RTU Polling

    Indicators on internal tags animate from HMI memory with no serial traffic; an indicator bound to a PLC tag needs a completed Modbus RTU read of the right address in the right data area. Confirm the PLC bit changes, then read the request and response, then fix the address at one known point.

    HMI and touchscreens