Product: Mingcedar Studio DESIGNER
Choose Tag Text, Script Text, or Localized Text | Mingcedar Studio
Display one Tag value with an optional fallback, prefix, suffix and quality border.
<section id="text-behaviors" class="docs-block docs-block-intro docs-block-current"> <span class="section-kicker">Text</span> <h2>Choose Tag Text, Script Text, or Localized Text</h2> <p>Display one Tag value with an optional fallback, prefix, suffix and quality border.</p> <div class="docs-detail-list"> <article id="text-behaviors-item-1" class="docs-detail-row"> <strong>What it is and what it's for</strong> <p>Bind Tag Text to a text component and set its target and optional prefix/suffix. Use Script Text for calculations or combined values.</p> </article><article id="text-behaviors-item-2" class="docs-detail-row"> <strong>Field configuration</strong> <p>Open Tag Text and configure these fields:</p> <ul> <li>Target tag: enter the full name PLC_LINE01.OVEN01.TEMPERATURE directly. Quoted names, name-string variables, and =bindingConfig.temperatureTag are also supported. The target must be a name string; no read method is required.</li><li>Fallback value: the fallback text shown when the tag has no value; defaults to an empty string.</li><li>Prefix: text placed before the value, e.g. "Temperature: ".</li><li>Suffix: text placed after the value, e.g. " °C".</li><li>Use quality outline colors: enable a quality border. Good communication quality uses the Good color (default #000000); bad quality uses the Bad color (default #FF8800).</li> </ul> <pre class="docs-code-block"><code>Target tag: PLC_LINE01.OVEN01.TEMPERATURE
Fallback value: "--"
Prefix: "Temperature: "
Suffix: " °C"
// Display example: Temperature: 36.5 °C</code></pre> </article><article id="text-behaviors-item-3" class="docs-detail-row"> <strong>When to use it</strong> <p>Use for a direct single-Tag display, for example:</p> <ul> <li>Show a measured value (temperature, pressure, level, flow) with its unit directly on the screen.</li><li>Display a string tag such as a device operating-mode name or batch number.</li><li>If the text needs multiple tags, conditional logic, or formatting, use Script Text instead.</li> </ul> </article><article id="text-behaviors-item-4" class="docs-detail-row"> <strong>Limitations and troubleshooting</strong> <p>A fixed full name in Target tag does not require quotes. Use =bindingConfig.temperatureTag for an object property. Fallback value, Prefix, and Suffix are string expressions: quote literal text. Use Script Text for numeric variables, formatted results, or calculated Tags. Quality Border indicates data quality, not equipment state or alarms.</p> </article><article id="text-behaviors-item-5" class="docs-detail-row"> <strong>Overview</strong> <p>Script Text is under Behaviors → Text. Bind it to a text box or text-capable shape; Display Text determines the content. Use Tag Text to display a single Tag.</p> </article><article id="text-behaviors-item-6" class="docs-detail-row"> <strong>Field configuration</strong> <p>Setup Script prepares data, Display Text returns the string and Condition controls execution. Place each example part in its labeled field. Clear the default Setup Script if no preparation is needed.</p> <ul> <li>Setup Script: preparation area. Read tags, define variables, compute intermediate values (can be multi-line).</li><li>Display Text: return the string to display.</li><li>Condition: true applies the text; false skips the behavior.</li><li>Use quality outline colors: apply the Good or Bad border color according to communication quality. The border does not represent the process value or alarm state.</li> </ul> <pre class="docs-code-block"><code>// Setup Script
var pressure = ReadTagDouble("PLC_LINE01.AIR01.PRESSURE", 0.0);
// Display Text
"Pressure: " + pressure.toFixed(1) + " bar"</code></pre> </article><article id="text-behaviors-item-7" class="docs-detail-row"> <strong>When to use it</strong> <p>Use for formatted or combined dynamic information.</p> <ul> <li>Show a measurement with units and fixed decimals, e.g. "Pressure: 3.2 bar".</li><li>Combine several tags into one line, e.g. "Pump1 RUN / Speed 1450 rpm".</li><li>Output different wording by condition, e.g. "Running" when on, "Stopped" when off.</li> </ul> </article><article id="text-behaviors-item-8" class="docs-detail-row"> <strong>Troubleshooting</strong> <p>The Display Text field is an expression position that returns a single value, not a full script.</p> <ul> <li>Do not put fetch, setTimeout, or other async code in Display Text; it needs an immediate value; put such logic in a script body like Page Script/Click Script.</li><li>Keep heavy reads and calculations in Setup Script; let Display Text only do the final assembly.</li><li>Always read tags with a quoted tag name and a fallback, e.g. ReadTagDouble("PLC_LINE01.AIR01.PRESSURE", 0.0); avoid bare tag-like text.</li><li>The quality border represents communication quality (good/bad), not the process state.</li> </ul> </article><article id="text-behaviors-item-9" class="docs-detail-row"> <strong>What it is and what it's for</strong> <p>Bind Localized Text to a text component to look up its key in the global translation table. Host language changes update the display automatically, without separate pages per language.</p> </article><article id="text-behaviors-item-10" class="docs-detail-row"> <strong>Field configuration</strong> <p>In Behavior Browser, add Localized Text to a text-capable component and enter Text key and Fallback text. This mode has no script or quality override settings.</p> <ul> <li>Text key (Text ID): enter the language-catalog key, for example pump.start.</li><li>Fallback text (Default Text): readable text used when no translation is found.</li><li>Fallback order: 1) translation from the current language pack, 2) Default Text, 3) the key itself (meaning no translation matched).</li><li>Export note: the editor warns that text is flattened to one line, so multi-line content is collapsed.</li> </ul> <pre class="docs-code-block"><code>Text key: pump.start
Fallback text: Start pump</code></pre> </article><article id="text-behaviors-item-11" class="docs-detail-row"> <strong>When to use it</strong> <p>Use it for multilingual screen text, for example:</p> <ul> <li>A Start button bound to one Text Key (e.g. pump.start): shows 'Start' in English, '启动' in Chinese, from the same shape.</li><li>Screen titles, device-status text, and navigation menu items all driven by language keys, so switching the runtime language updates them all at once.</li> </ul> </article><article id="text-behaviors-item-12" class="docs-detail-row"> <strong>Limitations and troubleshooting</strong> <p>The host controls the active language; use hqVisuDesigner.useLanguage(...) to switch it from script. Missing translations display the configured fallback, then the key.</p> </article> </div> <div class="docs-note-grid"> <figure id="text-behaviors-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/text/tag-text.png" alt="Tag Text behavior editor" loading="lazy" decoding="async"> <figcaption> <strong>Tag Text editor</strong> <p>Fill the tag expression, default value, and optional prefix/suffix to show a single tag's value as text.</p> </figcaption> </figure><figure id="text-behaviors-image-2" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/text/script-text.png" alt="Script Text behavior editor" loading="lazy" decoding="async"> <figcaption> <strong>Script Text editor</strong> <p>Read tags and compute in Setup Script, then return the final string to display in Display Text.</p> </figcaption> </figure><figure id="text-behaviors-image-3" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/text/localized-text.png" alt="Localized Text behavior editor" loading="lazy" decoding="async"> <figcaption> <strong>Localized Text editor</strong> <p>Bind a text shape to a language key so the runtime shows the translation for the current language, falling back when not found.</p> </figcaption> </figure> </div> </section>