Mingcedar

Product: Mingcedar Studio DESIGNER

Range Color | Mingcedar Studio

Map a continuous value to ranges with their own fill, border, and visibility. The default configuration has five ranges; add or remove ranges as needed, from 1 to 24.

Published Updated

<div class="manual-doc-article manual-doc-article-section"><h2 id="range-color">Colors: Range Color</h2>

Map a continuous value to ranges with their own fill, border, and visibility. The default configuration has five ranges; add or remove ranges as needed, from 1 to 24.

<div class="doc-card-list">

<article class="doc-card">

<h3 id="range-color-item-1">Overview</h3>

<p>Use Range Color for temperature, pressure, level, or load bands. Four upper limits create five default ranges. Use + Add range or delete rows to configure 1–24 ranges. Enter increasing upper limits and configure an appearance for each range.</p>

</article>

<article class="doc-card">

<h3 id="range-color-item-2">Field configuration</h3>

<p>Prepare data in Setup script and return a number from Range value. Each Range actions row represents a range, with Final (+∞) as the last row. Enter each part of the example in its indicated field.</p>

<ul>

<li>Behavior name is editable; Component name is read-only.</li>

<li>Setup script (Setup Script): optional numeric preparation for this behavior.</li>

<li>Range value: a numeric expression, not a literal Tag name or color string.</li>

<li>Upper limit: enter finite, increasing numbers for all rows except the final range.</li>

<li>Fill / Border / Visibility: enable the required channels and configure each row.</li>

<li>+ Add range inserts a range; recheck adjacent boundaries after deleting a row.</li>

<li>Quality override: Follow data quality (border / hide) configures Good / Bad and hiding on bad quality. An explicit range border takes precedence over Good.</li>

<li>Save validates scripts and numeric limits. Blank, non-numeric, non-finite, or non-increasing limits block saving.</li>

</ul>

<div class="manual-code" data-code-language="javascript"><div class="manual-code-toolbar"><span>JavaScript</span><span class="manual-code-tools"><small>JavaScript</small><button type="button" data-copy-code data-copied="Copied" data-failed="Select and copy the code" aria-label="Copy code: JavaScript">Copy code</button><span class="manual-code-status" role="status"></span></span></div><pre tabindex="0" class="docs-code-block shiki github-light" style="background-color:#fff;color:#24292e" tabindex="0"><code><span class="line"><span style="color:#6A737D">// Setup script</span></span>

<span class="line"><span style="color:#D73A49">var</span><span style="color:#24292E"> temperature </span><span style="color:#D73A49">=</span><span style="color:#6F42C1"> ReadTagDouble</span><span style="color:#24292E">(</span><span style="color:#032F62">"PLC_LINE01.OVEN01.TEMPERATURE"</span><span style="color:#24292E">, </span><span style="color:#005CC5">0</span><span style="color:#24292E">);</span></span>

<span class="line"></span>

<span class="line"><span style="color:#6A737D">// Range value</span></span>

<span class="line"><span style="color:#24292E">temperature</span></span>

<span class="line"></span>

<span class="line"><span style="color:#6A737D">// Upper limit: 60, 80, 95, 110</span></span>

<span class="line"><span style="color:#6A737D">// Final (+∞): values above 110</span></span></code></pre></div>

</article>

<article class="doc-card">

<h3 id="range-color-item-3">When to use it</h3>

<p>Use color to distinguish numeric bands, for example:</p>

<ul>

<li>Temperature example: ≤60, (60,80], (80,95], (95,110], and &gt;110. Configure colors according to the process specification.</li>

<li>Load bands can indicate low, normal, high, and over-limit values. A range color does not create a host alarm event.</li>

</ul>

</article>

<article class="doc-card">

<h3 id="range-color-item-4">Limitations and troubleshooting</h3>

<p>Range boundaries and publishing checks:</p>

<ul>

<li>Four limits L1 &lt; L2 &lt; L3 &lt; L4 create five bands: value ≤ L1, L1 &lt; value ≤ L2, L2 &lt; value ≤ L3, L3 &lt; value ≤ L4, and value &gt; L4.</li>

<li>An upper limit belongs to its range. This differs from the strict Value &lt; comparison in Discrete Color.</li>

<li>N ranges use N−1 increasing upper limits. A single range has no upper limits and applies to every valid numeric value.</li>

<li>For projects using an older runtime, update the plugin and host, then export and publish the project again. After adding or removing ranges, verify fill, border, and visibility at every upper limit and in the final range.</li>

<li>Check finite values, increasing order, and output channels before saving. Invalid limits are not silently saved as 0.</li>

<li>Quality override represents data reliability; process alarms require separate host configuration.</li>

</ul>

</article>

</div>

<div class="docs-note-grid manual-doc-image-grid">

<figure class="docs-note-card manual-doc-image-card" id="range-color-image-1">

<img src="/WEB_img/HQPPT/current/color/range.png" alt="Range Color behavior editor" loading="lazy" decoding="async" />

<figcaption>

<strong>Figure 1: Range Color editor</strong>

<p>Four limits split the value into five bands, each with its own fill/border color or show/hide.</p>

</figcaption>

</figure>

</div>

</div>