IMDTouchKnowledge BaseShop main store

Explainer

Why numeric message codes do not map to discrete alarm bits

HMI and touchscreens Published 6 min read By IMDTouch engineering team

Short answer

The old panel's byte is a numeric selector: the full value picks one text-list entry, and bit 0 has the value 1, so a set trigger bit 0 shows the entry stored under value 1. Keep the value-driven text list for indication; decode each message code into its own discrete alarm condition when you need acknowledgment and alarm history.

On this page
  1. What a discrete alarm actually tests
  2. What the legacy byte actually encodes
  3. Why trigger bit 0 shows the text stored under value 1
  4. Why adding one text list to another cannot decode
  5. Decoding a legacy byte that carries code 3
  6. The decision for each case
  7. Commissioning checks before cut-over
  8. Questions asked

Your old Lauer panel's message byte is a numeric selector, and a WinCC flexible discrete alarm is a bit test — two different encodings, and no configuration trick converts one into the other. Bit 0 of an integer is worth 1, so when you set the bit your alarm watches, the tag reads 1 and any value-driven text list shows the entry stored under value 1, which is why the text you had written for the second position appeared. Keep the existing PLC interface by pointing a text list at the message byte when the screen only has to display the current message. When the operator must acknowledge each message and find it in alarm history, decode: one discrete alarm condition per message code, active when the selector equals that code. Adding one text list to another performs no such decoding, and that is the configuration your compiler is rejecting.

What a discrete alarm actually tests #

WinCC flexible 2008 documents the minimum configuration for a new discrete alarm as an alarm text, an alarm class, a trigger tag and a bit number. The condition follows that one bit: bit set, alarm active; bit clear, alarm inactive. The trigger never reads the tag's decimal value as a whole, so one alarm carries one condition, and four independent message codes need four discrete alarms, each pinned to its own tag and bit number. Acknowledgment and reporting ride on the alarm class, not on the bit.

What the legacy byte actually encodes #

The PCS 095 program writes whole message numbers into bytes, and the old panel displayed the text-list entry each number selected. Decimal presentation alone cannot tell you whether a byte is a selector or a bit field; the deciding evidence is how the program writes it. Logic that moves a complete message number into the byte makes it a selector. Logic that sets and clears individual bits makes it a bit field, and discrete alarms then attach to those bits directly, with no decoding. Read that logic before you configure anything on the Mobile Panel 177, because the two encodings need opposite configurations.

Why trigger bit 0 shows the text stored under value 1 #

Bit positions in an integer number upward from zero, and each position's weight is 2 raised to its position: bit 0 weighs 1, bit 1 weighs 2, bit 2 weighs 4. A text list knows nothing about positions; it matches the tag's whole value against its stored entries. Set the bit your discrete alarm watches and the tag reads 1, so the list displays the entry stored under value 1 — the text you had slotted where you expected the first position to appear. Nothing in the alarm configuration is off by one; two encodings met in one tag.

Tag value Bits set Discrete alarms that go active Text a value-driven list shows
0 none none the entry stored under value 0
1 bit 0 the alarm on bit 0 the entry stored under value 1
2 bit 1 the alarm on bit 1 the entry stored under value 2
3 bits 0 and 1 both of those alarms the entry stored under value 3

While you are in the alarm, check its fixed text separately from any text-list field embedded inside it, and confirm which tag feeds that field. Numbering drift like this is not unique to one software pairing: the fault behind why a converted PanelView Plus shows the wrong alarm numbers is the same — numbers that crossed a migration without anyone re-checking what each one meant.

Why adding one text list to another cannot decode #

The compiler error pointing at the text list is the tool rejecting a configuration, not miscounting your entries. Appending one list to another merges display entries, and display entries are not alarm conditions: the result has no event, no acknowledgment and no history line, whatever order the entries sit in. Treat the diagnostic as routing rather than semantics — open the object it names, check its entries and how it selects among them, correct it, and compile again. If the goal behind the merge was alarm behavior, the decode below is the actual fix; list arithmetic cannot stand in for it.

Decoding a legacy byte that carries code 3 #

Inputs, and where each comes from:

  • One message byte in the legacy program, which stays untouched: the case here is a PCS 095 panel replaced by a Mobile Panel 177 6-inch DP, whose panel reads the byte through a 16-bit Int tag in WinCC flexible 2008, the configuration the reported symptom came from.
  • The example code: decimal 3, chosen because it sets two bit positions at once. In this example the program writes 0 when nothing is wrong.

The rule in words: each bit position's weight is 2 raised to its position number, a value-driven text list matches the tag's whole value, and a discrete alarm tests exactly one position.

The arithmetic: 3 = 2 + 1, which is 2 to the power 1 plus 2 to the power 0, so bit 1 and bit 0 are both set. Cross-check the neighbors: bit 0 alone reads 1, bit 1 alone reads 2, and 1 + 2 = 3 confirms both together. An alarm assigned to bit 2 stays inactive at code 3, because its weight 4 is not part of 3.

The result: the value-driven list shows exactly the single entry stored under value 3. Undecoded, the bit-mapped alarms on bit 0 and bit 1 both go active — two alarm events and two acknowledgments for what the old panel treated as one message. With the decode, exactly one condition runs.

The decision, with its threshold: if this message must appear once in alarm history and clear with one acknowledgment, decode it — a comparison in the PLC, "message byte equals 3", sets a dedicated code-3 bit, and that bit gets its own discrete alarm. The threshold sits on the screen: one alarm event per legacy message once decoded, versus two for the same code left to the bit-mapped reading. If the screen only has to show the current message, keep the value-driven list and configure no alarms at all.

The decision for each case #

  • Screen shows the current message only: point the text-list object at the existing byte. The PLC stays untouched, and the panel raises no alarm events — no history, no acknowledgment, by design.
  • Operators must acknowledge messages and keep history: decode each used code in the PLC with an equality comparison writing its own bit, then give each bit one discrete alarm with the alarm class that matches the message's severity.
  • The logic turns out to set individual bits: skip the decode and attach discrete alarms to those bits directly.

Changing the HMI tag's data type does none of this. The tag declaration only describes how the panel reads storage; the PLC still writes the same value, and widening the tag cannot turn decimal message numbers into independent conditions.

Commissioning checks before cut-over #

Drive every check with values that cannot command machine motion: write the message byte from a test context, never from a running sequence.

  • Idle check: apply the program's documented idle code, 0 in the worked example. Expect the idle text and no alarm active.
  • Single-position code: write 1. Expect the value-1 text and, undecoded, exactly the bit-0 alarm.
  • Two-position code: write 3. Decoded, exactly one alarm appears; undecoded, both bit alarms do — this tells you which encoding the screen is actually running.
  • Read the PLC value, the panel tag, the displayed text and the alarm list inside the same test window, so a stale acquisition value cannot pass for a live one.

Questions asked

How many message codes can the legacy byte carry?

One byte stores values from 0 through 255, so the legacy interface can select up to 256 distinct messages. Decode only the codes the program actually writes; unused values stay unassigned, and an unassigned value that arrives usually shows no text at all. Read the assigned values out of the legacy logic instead of guessing them from the old screen.

Where is acknowledgment configured for a decoded alarm?

In the alarm class. Alarm classes in WinCC flexible define how messages are acknowledged and reported, so give each discrete alarm a class that matches the legacy message's severity. Check the classes before cut-over: an auto-acknowledged class will clear a display the operator never confirmed, which defeats the reason you decoded the codes at all.

Can the decoded conditions share one tag?

Yes. A 16-bit Int tag holds sixteen independent bit positions, numbered 0 through 15, so one trigger tag can back sixteen separate discrete alarm conditions. Have the PLC pack the decoded code bits into that one word: each comparison sets its own position, and each alarm on the panel points at its position number.

What if operators need several messages on screen at once?

Then one selector was never the whole interface. A numeric byte shows a single entry at a time, so a legacy screen that stacked several simultaneous faults kept that information elsewhere, as a queue in the PLC or several bytes written together. Look for that storage before cut-over. Decoded conditions handle simultaneity naturally: every active code raises its own alarm line at once.

Keep reading

  • How-to

    MP270 analog trend curve setup in ProTool and WinCC flexible

    A linear trend on an MP270 needs three pieces: the S7 tag carrying the raw analog word, an HMI REAL tag scaled from it, and a trend view with a sampling cycle. This article walks the ProTool, WinCC flexible 2008 and RT Professional paths with the scaling arithmetic worked out.

    HMI and touchscreens

  • Troubleshooting

    Working around the C-More EA9 alarm banner covering buttons

    No. The C-More EA9 alarm message banner has no position setting: it is fixed at the bottom of the screen, and while an alarm is active it overlays every screen in the project. Reduce the banner height, move page-change buttons above the banner band on every screen, and verify each one with a live alarm showing.

    HMI and touchscreens

  • Troubleshooting

    Why a WinCC flexible Runtime device type is not valid for this version

    The message means the WinCC flexible Runtime component on that PC is missing or sits at a different update level than the Engineering System, not that Windows is wrong. Compare the Installed Software lists on both stations, then re-run setup in modify mode and re-apply the updates so both entries match.

    HMI and touchscreens

Removing the Green Focus Box Around a FactoryTalk View Numeric Input