Mingcedar

Product: Mingcedar Studio DESIGNER

Template methods | Mingcedar Studio

Create reusable templates, configure instances, and choose input, keypad, or table behavior. Follow the field rules for placeholders, runtime variables, and Tag names.

Published Updated

<section id="preface" class="docs-block docs-block-intro"> <span class="section-kicker">Manual</span> <h2>Before Use</h2> <p>Create reusable templates, configure instances, and choose input, keypad, or table behavior. Follow the field rules for placeholders, runtime variables, and Tag names.</p> </section> <section id="template-library" class="docs-block"> <span class="section-kicker">Templates</span> <h2>Manage the template library</h2> <p>Templates → Library provides search, insertion, saving, metadata, import/export and deletion.</p> <div class="docs-detail-list"> <article id="template-library-item-1" class="docs-detail-row"> <strong>Open the library and find a template</strong> <p>Open MX Design → Templates → Library. Search by name, group or keyword; results update after typing stops and remain grouped. Check the card name and preview before acting.</p> <ul> <li>No result: clear Search and confirm the template exists in the current user&#39;s local library.</li><li>Many groups: scroll the library area to the required Group.</li><li>After selecting a card, Export and Delete enable or disable according to the template type.</li> </ul> </article><article id="template-library-item-2" class="docs-detail-row"> <strong>Insert by double-click, drag, or context menu</strong> <p>Double-click a card, drag it to the slide or choose Insert Template. Select the new instance and fill its variables and position in Template Edit.</p> <ul> <li>Fast insertion on the current slide: double-click.</li><li>Control the drop position: drag the card onto the slide.</li><li>Menu operation: choose Insert Template.</li><li>After insertion, verify Instance, Template, and Group.</li> </ul> </article><article id="template-library-item-3" class="docs-detail-row"> <strong>Save selected PowerPoint content as a new template</strong> <p>Select one or more reusable objects on the slide and click Save in the library. In Save as template, fill Template name, Group, and Sort order; review Captured variables and their order; then choose Save template. A new template cannot be created with no selected content.</p> <ul> <li>Template name: required; use a name that identifies the device or purpose.</li><li>Group: choose an existing group or type a new one; blank becomes Ungrouped.</li><li>Sort order: an integer from 1 to 99999; lower values appear first.</li><li>Captured variables: confirm every &lt;variable&gt; and its letter case.</li><li>After saving, search by name and confirm that the card appears.</li> </ul> </article><article id="template-library-item-4" class="docs-detail-row"> <strong>Update an existing template source</strong> <p>If the current PPT is an existing template source, Save updates it in place and retains its ID and sort order. Check the preview, name, group and variables afterward.</p> <ul> <li>Update the original template: edit and save from its source presentation.</li><li>Keep the old template as a version: save the presentation separately and use a new template name.</li><li>Insert a new instance after the update and test it.</li> </ul> </article><article id="template-library-item-5" class="docs-detail-row"> <strong>Reorder Captured variables</strong> <p>Variable order sets Template Edit field order. Drag rows, use arrow buttons or Ctrl+Up / Ctrl+Down; put frequent fields such as PLC and equipment code first.</p> <ul> <li>Drag the row handle to a new position.</li><li>Use the up or down arrow to move one place.</li><li>Use Ctrl+Up or Ctrl+Down from the keyboard.</li><li>Resolve variable-case warnings in the source objects before saving.</li><li>A template with no variables can still be saved; use &lt;Title&gt; style placeholders for editable text.</li> </ul> </article><article id="template-library-item-6" class="docs-detail-row"> <strong>Import and export .hqtpl files</strong> <p>Select a custom template and click Export to create a .hqtpl file. On another computer, click Import and choose that file. If the template contains behavior scripts, review the script warning and choose whether to trust the scripts or import without them.</p> <ul> <li>Select the target before Export; built-in templates normally cannot be exported.</li><li>Include template name and version in the exported file name.</li><li>After Import, search by name, insert one instance, and test it.</li><li>For an untrusted source, choose Import without scripts and review behaviors manually.</li> </ul> </article><article id="template-library-item-7" class="docs-detail-row"> <strong>Edit fields, edit behavior, or delete</strong> <p>The card menu provides Edit Template Behavior and Edit fields.... Use Edit fields... for name, group, sort order, and variable order. Use Edit Template Behavior for behaviors inside the template. Delete removes the selected custom template; built-in templates are normally protected.</p> <ul> <li>Metadata only: Edit fields....</li><li>Behavior inside the template: Edit Template Behavior.</li><li>Current inserted instance position or type-specific fields: choose Templates → Edit Instance on the ribbon to open Template Edit.</li><li>Export a .hqtpl archive before deleting a template that may be needed later.</li> </ul> </article> </div> </section><section id="template-creation" class="docs-block"> <span class="section-kicker">Templates</span> <h2>Create and verify a reusable template</h2> <p>Create reusable templates and configure placeholders, instance values, Input, alarms and page parameters.</p> <div class="docs-detail-list"> <article id="template-creation-item-1" class="docs-detail-row"> <strong>Choose the value mechanism before authoring</strong> <p>Choose by when the value is known: template variables for instance addresses, Input or Runtime Variable for temporary page input, and page parameters for navigation context.</p> <ul> <li>Template instance variable: filled after insertion, such as &lt;PLC&gt; or &lt;RUN_TAG&gt;.</li><li>Input template value: entered at runtime and read with template.getValue(&quot;instance name&quot;).</li><li>Runtime Variable: temporary state shared inside the current runtime page.</li><li>Page or popup parameter: sent while opening the destination and read with GetPageParameter*.</li><li>PLC Tag: device data binding. Shared access from several pages is not page-parameter passing.</li> </ul> </article><article id="template-creation-item-2" class="docs-detail-row"> <strong>1. Build a parameterized template from scratch</strong> <p>Draw and configure the components, then group them for reuse. Replace per-instance differences with angle-bracket placeholders in text, Tag fields or script strings. In scripts, keep placeholders inside string literals.</p> <ul> <li>Visible text: Device &lt;DEVICE_NO&gt;.</li><li>Tag path: &lt;PLC&gt;.&lt;RUN_TAG&gt;.</li><li>Script string: ReadTagBoolean(&quot;&lt;PLC&gt;.&lt;RUN_TAG&gt;&quot;, false).</li><li>Bit reference: &lt;STATUS_TAG&gt;[3]; keep the bit index outside the placeholder.</li><li>Parameterize only values that genuinely vary by instance.</li> </ul> <pre class="docs-code-block"><code>var running = ReadTagBoolean(&quot;&lt;PLC&gt;.&lt;RUN_TAG&gt;&quot;, false);

var alarming = GetAlarmTags([

&quot;&lt;PLC&gt;.&lt;ALARM_TAG&gt;&quot;

]);

return running &amp;&amp; !alarming;</code></pre> </article><article id="template-creation-item-3" class="docs-detail-row"> <strong>2. Name placeholders and compose tag paths</strong> <p>Wrap each variable in one pair of angle brackets. Use short ASCII uppercase names such as &lt;PLC&gt;, &lt;DEVICE_NO&gt;, and &lt;RUN_TAG&gt; in shared templates. Names may also contain non-ASCII letters, but cannot contain dots, hyphens, or spaces. Build Tag paths from variables and fixed separators.</p> <ul> <li>Valid names include &lt;PLC&gt;, &lt;DB_01&gt;, and &lt;DEVICE_NO&gt;.</li><li>Correct path: &lt;PLC&gt;.&lt;RUN_TAG&gt;; incorrect: &lt;PLC.RUN_TAG&gt;.</li><li>Correct bit reference: &lt;STATUS_TAG&gt;[3]; incorrect: &lt;STATUS_TAG[3]&gt;.</li><li>Do not use &lt;RUN-TAG&gt; or &lt;RUN TAG&gt;.</li><li>Case differences create different fields; keep one spelling for one meaning.</li> </ul> <pre class="docs-code-block"><code>// Instance: PLC=LINE01, RUN_TAG=PUMP01.RUN

ReadTagBoolean(&quot;&lt;PLC&gt;.&lt;RUN_TAG&gt;&quot;, false)

// Exported target: LINE01.PUMP01.RUN</code></pre> </article><article id="template-creation-item-4" class="docs-detail-row"> <strong>3. Save and review Captured variables</strong> <p>Select the group, save it in Templates and fill its name, group and order. Check Captured variables: fix missing or case-duplicated names in the source. Their order controls Template Edit field order.</p> <ul> <li>Template name: identify the device or purpose, for example Pump faceplate.</li><li>Group: organize by process, equipment, or project.</li><li>Sort order: lower values appear earlier in the library.</li><li>Captured variables: verify every name, count, and order.</li><li>After saving, insert a fresh instance from the library and test it.</li> </ul> </article><article id="template-creation-item-5" class="docs-detail-row"> <strong>4. Insert an instance and fill its variables</strong> <p>Insert a template, select its root group and open Templates → Edit Instance. Check identity and position, then fill Template variables. Values affect this instance only and copy with it.</p> <ul> <li>Select the instance root, not a child shape inside it.</li><li>Enter replacement values without angle brackets, for example LINE01 for PLC.</li><li>The same placeholder in text, behavior tags, and script strings receives one instance value.</li><li>A blank can be saved during editing, but tag placeholders must be resolved before final export.</li><li>Reopen Template Edit and confirm values, position, and size after saving.</li> </ul> <pre class="docs-code-block"><code>PLC = LINE01

RUN_TAG = PUMP01.RUN

ALARM_TAG = PUMP01.ALARM

// &lt;PLC&gt;.&lt;RUN_TAG&gt; -&gt; LINE01.PUMP01.RUN</code></pre> </article><article id="template-creation-item-6" class="docs-detail-row"> <strong>5. Input values and cross-page parameters</strong> <p>Use Input for runtime entry. Read Plain Input with template.getValue(&quot;input instance name&quot;); use Runtime Variable for same-page state. Pass device code or mode through navigation parameters, then read with GetPageParameter and explicitly convert numbers or booleans.</p> <ul> <li>Plain Input: the value stays on that Input instance until a script reads it.</li><li>Runtime Variable: temporary same-page linkage; do not treat it as durable cross-page state.</li><li>PLC Tag mode: confirmation submits according to host permission and write rules.</li><li>Page parameters: a contract between the opening page and the destination.</li><li>For complete open-and-receive examples, continue to Script scope and parameter passing.</li> </ul> <pre class="docs-code-block"><code>var setpoint = template.getValue(&quot;Speed input&quot;);

var deviceCode = GetPageParameter(&quot;deviceCode&quot;, &quot;&quot;);

var editMode = GetPageParameter(&quot;editMode&quot;, &quot;false&quot;) === &quot;true&quot;;</code></pre> </article><article id="template-creation-item-7" class="docs-detail-row"> <strong>6. Configure Alarm columns and filter scope</strong> <p>An Alarm template controls both the visible columns and the alarm scope. Select only the required columns from Time, Message, Level, PLC, Function Group, Device Group, Signal Group, Tags, Status, and Acknowledged. Then enter project codes in the relevant filters. Separate several values with commas or lines and use codes rather than display names.</p> <ul> <li>Tags: full device-code.tag-code, for example &lt;PLC&gt;.&lt;ALARM_TAG&gt;.</li><li>PLC codes: device-code only, for example &lt;PLC&gt;.</li><li>Function groups: device-code.group-code.</li><li>Device groups: device-code.group-code.</li><li>Signal groups: device-code.group-code.</li><li>An empty filter dimension adds no extra restriction; test with a known active alarm after export.</li> </ul> </article><article id="template-creation-item-8" class="docs-detail-row"> <strong>7. Test active alarms in template scripts</strong> <p>Alarm helpers return whether an active alarm matches the scope, for driving icons, colors or text. They accept arrays or comma/newline-separated text; they do not query history or acknowledge alarms.</p> <ul> <li>GetAlarmTags(values): match full tag codes.</li><li>GetAlarmPlcCodes(values): match PLC or device codes.</li><li>GetAlarmFunctionGroupCodes(values): match function-group codes.</li><li>GetAlarmDeviceGroupCodes(values): match device-group codes.</li><li>GetAlarmSignalGroupCodes(values): match signal-group codes.</li> </ul> <pre class="docs-code-block"><code>var hasTagAlarm = GetAlarmTags([

&quot;&lt;PLC&gt;.&lt;ALARM_TAG&gt;&quot;

]);

var hasDeviceAlarm = GetAlarmDeviceGroupCodes([

&quot;&lt;PLC&gt;.&lt;DEVICE_GROUP&gt;&quot;

]);

return hasTagAlarm || hasDeviceAlarm;</code></pre> </article><article id="template-creation-item-9" class="docs-detail-row"> <strong>8. Pre-export validation and troubleshooting</strong> <p>Insert at least two instances with different values and verify that their text, tags, alarm scope, and interactions remain independent. Check where Input values are stored and verify page-parameter field names and destination defaults. If export reports an unresolved variable, fill the instance or correct the source template instead of hiding the issue with fixed text.</p> <ul> <li>Unresolved &lt;variable&gt;: check for an empty instance field or an unsupported placement.</li><li>Missing Captured variable: check whether a dot, hyphen, space, or bit index was put inside the name.</li><li>Placeholder unchanged in a script: keep it inside a JavaScript string literal.</li><li>Value lost after navigation: it may need a page parameter instead of a Runtime Variable.</li><li>Wrong alarm scope: distinguish full tags, PLC codes, and the three group-code fields.</li><li>After updating a template, validate a newly inserted instance.</li> </ul> </article> </div> <div class="docs-note-grid"> <figure id="template-creation-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/templates/save-template.png" alt="Current Save as template UI with template name, group, sort order, and Captured variables" loading="lazy" decoding="async"> <figcaption> <strong>Save and review a template</strong> <p>Current Save as template UI: verify identity, grouping, ordering, and Captured variables before saving.</p> </figcaption> </figure><figure id="template-creation-image-2" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/templates/edit-instance-variables.png" alt="Current Edit template instance UI with position, size, and template variables" loading="lazy" decoding="async"> <figcaption> <strong>Fill instance variables</strong> <p>Template Edit changes only the selected instance. Verify its source and geometry before filling values.</p> </figcaption> </figure><figure id="template-creation-image-3" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/templates/edit-alarm-template.png" alt="Current Alarm template editor with visible columns and alarm filters" loading="lazy" decoding="async"> <figcaption> <strong>Configure an Alarm template</strong> <p>Choose the required alarm columns and limit scope by tag, PLC, function group, device group, or signal group.</p> </figcaption> </figure> </div> </section><section id="template-edit" class="docs-block"> <span class="section-kicker">Templates</span> <h2>Edit and configure template instances</h2> <p>Templates → Library provides search, insertion, saving, metadata, import/export and deletion.</p> <div class="docs-detail-list"> <article id="template-edit-item-1" class="docs-detail-row"> <strong>Open the library and find a template</strong> <p>Open MX Design → Templates → Library. Search by name, group or keyword; results update after typing stops and remain grouped. Check the card name and preview before acting.</p> <ul> <li>No result: clear Search and confirm the template exists in the current user&#39;s local library.</li><li>Many groups: scroll the library area to the required Group.</li><li>After selecting a card, Export and Delete enable or disable according to the template type.</li> </ul> </article><article id="template-edit-item-2" class="docs-detail-row"> <strong>Insert by double-click, drag, or context menu</strong> <p>Double-click a card, drag it to the slide or choose Insert Template. Select the new instance and fill its variables and position in Template Edit.</p> <ul> <li>Fast insertion on the current slide: double-click.</li><li>Control the drop position: drag the card onto the slide.</li><li>Menu operation: choose Insert Template.</li><li>After insertion, verify Instance, Template, and Group.</li> </ul> </article><article id="template-edit-item-3" class="docs-detail-row"> <strong>Save selected PowerPoint content as a new template</strong> <p>Select one or more reusable objects on the slide and click Save in the library. In Save as template, fill Template name, Group, and Sort order; review Captured variables and their order; then choose Save template. A new template cannot be created with no selected content.</p> <ul> <li>Template name: required; use a name that identifies the device or purpose.</li><li>Group: choose an existing group or type a new one; blank becomes Ungrouped.</li><li>Sort order: an integer from 1 to 99999; lower values appear first.</li><li>Captured variables: confirm every &lt;variable&gt; and its letter case.</li><li>After saving, search by name and confirm that the card appears.</li> </ul> </article><article id="template-edit-item-4" class="docs-detail-row"> <strong>Update an existing template source</strong> <p>If the current PPT is an existing template source, Save updates it in place and retains its ID and sort order. Check the preview, name, group and variables afterward.</p> <ul> <li>Update the original template: edit and save from its source presentation.</li><li>Keep the old template as a version: save the presentation separately and use a new template name.</li><li>Insert a new instance after the update and test it.</li> </ul> </article><article id="template-edit-item-5" class="docs-detail-row"> <strong>Reorder Captured variables</strong> <p>Variable order sets Template Edit field order. Drag rows, use arrow buttons or Ctrl+Up / Ctrl+Down; put frequent fields such as PLC and equipment code first.</p> <ul> <li>Drag the row handle to a new position.</li><li>Use the up or down arrow to move one place.</li><li>Use Ctrl+Up or Ctrl+Down from the keyboard.</li><li>Resolve variable-case warnings in the source objects before saving.</li><li>A template with no variables can still be saved; use &lt;Title&gt; style placeholders for editable text.</li> </ul> </article><article id="template-edit-item-6" class="docs-detail-row"> <strong>Import and export .hqtpl files</strong> <p>Select a custom template and click Export to create a .hqtpl file. On another computer, click Import and choose that file. If the template contains behavior scripts, review the script warning and choose whether to trust the scripts or import without them.</p> <ul> <li>Select the target before Export; built-in templates normally cannot be exported.</li><li>Include template name and version in the exported file name.</li><li>After Import, search by name, insert one instance, and test it.</li><li>For an untrusted source, choose Import without scripts and review behaviors manually.</li> </ul> </article><article id="template-edit-item-7" class="docs-detail-row"> <strong>Edit fields, edit behavior, or delete</strong> <p>The card menu provides Edit Template Behavior and Edit fields.... Use Edit fields... for name, group, sort order, and variable order. Use Edit Template Behavior for behaviors inside the template. Delete removes the selected custom template; built-in templates are normally protected.</p> <ul> <li>Metadata only: Edit fields....</li><li>Behavior inside the template: Edit Template Behavior.</li><li>Current inserted instance position or type-specific fields: choose Templates → Edit Instance on the ribbon to open Template Edit.</li><li>Export a .hqtpl archive before deleting a template that may be needed later.</li> </ul> </article><article id="template-edit-item-8" class="docs-detail-row"> <strong>Choose the value mechanism before authoring</strong> <p>Choose by when the value is known: template variables for instance addresses, Input or Runtime Variable for temporary page input, and page parameters for navigation context.</p> <ul> <li>Template instance variable: filled after insertion, such as &lt;PLC&gt; or &lt;RUN_TAG&gt;.</li><li>Input template value: entered at runtime and read with template.getValue(&quot;instance name&quot;).</li><li>Runtime Variable: temporary state shared inside the current runtime page.</li><li>Page or popup parameter: sent while opening the destination and read with GetPageParameter*.</li><li>PLC Tag: device data binding. Shared access from several pages is not page-parameter passing.</li> </ul> </article><article id="template-edit-item-9" class="docs-detail-row"> <strong>1. Build a parameterized template from scratch</strong> <p>Draw and configure the components, then group them for reuse. Replace per-instance differences with angle-bracket placeholders in text, Tag fields or script strings. In scripts, keep placeholders inside string literals.</p> <ul> <li>Visible text: Device &lt;DEVICE_NO&gt;.</li><li>Tag path: &lt;PLC&gt;.&lt;RUN_TAG&gt;.</li><li>Script string: ReadTagBoolean(&quot;&lt;PLC&gt;.&lt;RUN_TAG&gt;&quot;, false).</li><li>Bit reference: &lt;STATUS_TAG&gt;[3]; keep the bit index outside the placeholder.</li><li>Parameterize only values that genuinely vary by instance.</li> </ul> <pre class="docs-code-block"><code>var running = ReadTagBoolean(&quot;&lt;PLC&gt;.&lt;RUN_TAG&gt;&quot;, false);

var alarming = GetAlarmTags([

&quot;&lt;PLC&gt;.&lt;ALARM_TAG&gt;&quot;

]);

return running &amp;&amp; !alarming;</code></pre> </article><article id="template-edit-item-10" class="docs-detail-row"> <strong>2. Name placeholders and compose tag paths</strong> <p>Wrap each variable in one pair of angle brackets. Use short ASCII uppercase names such as &lt;PLC&gt;, &lt;DEVICE_NO&gt;, and &lt;RUN_TAG&gt; in shared templates. Names may also contain non-ASCII letters, but cannot contain dots, hyphens, or spaces. Build Tag paths from variables and fixed separators.</p> <ul> <li>Valid names include &lt;PLC&gt;, &lt;DB_01&gt;, and &lt;DEVICE_NO&gt;.</li><li>Correct path: &lt;PLC&gt;.&lt;RUN_TAG&gt;; incorrect: &lt;PLC.RUN_TAG&gt;.</li><li>Correct bit reference: &lt;STATUS_TAG&gt;[3]; incorrect: &lt;STATUS_TAG[3]&gt;.</li><li>Do not use &lt;RUN-TAG&gt; or &lt;RUN TAG&gt;.</li><li>Case differences create different fields; keep one spelling for one meaning.</li> </ul> <pre class="docs-code-block"><code>// Instance: PLC=LINE01, RUN_TAG=PUMP01.RUN

ReadTagBoolean(&quot;&lt;PLC&gt;.&lt;RUN_TAG&gt;&quot;, false)

// Exported target: LINE01.PUMP01.RUN</code></pre> </article><article id="template-edit-item-11" class="docs-detail-row"> <strong>3. Save and review Captured variables</strong> <p>Select the group, save it in Templates and fill its name, group and order. Check Captured variables: fix missing or case-duplicated names in the source. Their order controls Template Edit field order.</p> <ul> <li>Template name: identify the device or purpose, for example Pump faceplate.</li><li>Group: organize by process, equipment, or project.</li><li>Sort order: lower values appear earlier in the library.</li><li>Captured variables: verify every name, count, and order.</li><li>After saving, insert a fresh instance from the library and test it.</li> </ul> </article><article id="template-edit-item-12" class="docs-detail-row"> <strong>4. Insert an instance and fill its variables</strong> <p>Insert a template, select its root group and open Templates → Edit Instance. Check identity and position, then fill Template variables. Values affect this instance only and copy with it.</p> <ul> <li>Select the instance root, not a child shape inside it.</li><li>Enter replacement values without angle brackets, for example LINE01 for PLC.</li><li>The same placeholder in text, behavior tags, and script strings receives one instance value.</li><li>A blank can be saved during editing, but tag placeholders must be resolved before final export.</li><li>Reopen Template Edit and confirm values, position, and size after saving.</li> </ul> <pre class="docs-code-block"><code>PLC = LINE01

RUN_TAG = PUMP01.RUN

ALARM_TAG = PUMP01.ALARM

// &lt;PLC&gt;.&lt;RUN_TAG&gt; -&gt; LINE01.PUMP01.RUN</code></pre> </article><article id="template-edit-item-13" class="docs-detail-row"> <strong>5. Input values and cross-page parameters</strong> <p>Use Input for runtime entry. Read Plain Input with template.getValue(&quot;input instance name&quot;); use Runtime Variable for same-page state. Pass device code or mode through navigation parameters, then read with GetPageParameter and explicitly convert numbers or booleans.</p> <ul> <li>Plain Input: the value stays on that Input instance until a script reads it.</li><li>Runtime Variable: temporary same-page linkage; do not treat it as durable cross-page state.</li><li>PLC Tag mode: confirmation submits according to host permission and write rules.</li><li>Page parameters: a contract between the opening page and the destination.</li><li>For complete open-and-receive examples, continue to Script scope and parameter passing.</li> </ul> <pre class="docs-code-block"><code>var setpoint = template.getValue(&quot;Speed input&quot;);

var deviceCode = GetPageParameter(&quot;deviceCode&quot;, &quot;&quot;);

var editMode = GetPageParameter(&quot;editMode&quot;, &quot;false&quot;) === &quot;true&quot;;</code></pre> </article><article id="template-edit-item-14" class="docs-detail-row"> <strong>6. Configure Alarm columns and filter scope</strong> <p>An Alarm template controls both the visible columns and the alarm scope. Select only the required columns from Time, Message, Level, PLC, Function Group, Device Group, Signal Group, Tags, Status, and Acknowledged. Then enter project codes in the relevant filters. Separate several values with commas or lines and use codes rather than display names.</p> <ul> <li>Tags: full device-code.tag-code, for example &lt;PLC&gt;.&lt;ALARM_TAG&gt;.</li><li>PLC codes: device-code only, for example &lt;PLC&gt;.</li><li>Function groups: device-code.group-code.</li><li>Device groups: device-code.group-code.</li><li>Signal groups: device-code.group-code.</li><li>An empty filter dimension adds no extra restriction; test with a known active alarm after export.</li> </ul> </article><article id="template-edit-item-15" class="docs-detail-row"> <strong>7. Test active alarms in template scripts</strong> <p>Alarm helpers return whether an active alarm matches the scope, for driving icons, colors or text. They accept arrays or comma/newline-separated text; they do not query history or acknowledge alarms.</p> <ul> <li>GetAlarmTags(values): match full tag codes.</li><li>GetAlarmPlcCodes(values): match PLC or device codes.</li><li>GetAlarmFunctionGroupCodes(values): match function-group codes.</li><li>GetAlarmDeviceGroupCodes(values): match device-group codes.</li><li>GetAlarmSignalGroupCodes(values): match signal-group codes.</li> </ul> <pre class="docs-code-block"><code>var hasTagAlarm = GetAlarmTags([

&quot;&lt;PLC&gt;.&lt;ALARM_TAG&gt;&quot;

]);

var hasDeviceAlarm = GetAlarmDeviceGroupCodes([

&quot;&lt;PLC&gt;.&lt;DEVICE_GROUP&gt;&quot;

]);

return hasTagAlarm || hasDeviceAlarm;</code></pre> </article><article id="template-edit-item-16" class="docs-detail-row"> <strong>8. Pre-export validation and troubleshooting</strong> <p>Insert at least two instances with different values and verify that their text, tags, alarm scope, and interactions remain independent. Check where Input values are stored and verify page-parameter field names and destination defaults. If export reports an unresolved variable, fill the instance or correct the source template instead of hiding the issue with fixed text.</p> <ul> <li>Unresolved &lt;variable&gt;: check for an empty instance field or an unsupported placement.</li><li>Missing Captured variable: check whether a dot, hyphen, space, or bit index was put inside the name.</li><li>Placeholder unchanged in a script: keep it inside a JavaScript string literal.</li><li>Value lost after navigation: it may need a page parameter instead of a Runtime Variable.</li><li>Wrong alarm scope: distinguish full tags, PLC codes, and the three group-code fields.</li><li>After updating a template, validate a newly inserted instance.</li> </ul> </article> </div> <div class="docs-note-grid"> <figure id="template-edit-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/templates/save-template.png" alt="Current Save as template UI with template name, group, sort order, and Captured variables" loading="lazy" decoding="async"> <figcaption> <strong>Save and review a template</strong> <p>Current Save as template UI: verify identity, grouping, ordering, and Captured variables before saving.</p> </figcaption> </figure><figure id="template-edit-image-2" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/templates/edit-instance-variables.png" alt="Current Edit template instance UI with position, size, and template variables" loading="lazy" decoding="async"> <figcaption> <strong>Fill instance variables</strong> <p>Template Edit changes only the selected instance. Verify its source and geometry before filling values.</p> </figcaption> </figure><figure id="template-edit-image-3" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/templates/edit-alarm-template.png" alt="Current Alarm template editor with visible columns and alarm filters" loading="lazy" decoding="async"> <figcaption> <strong>Configure an Alarm template</strong> <p>Choose the required alarm columns and limit scope by tag, PLC, function group, device group, or signal group.</p> </figcaption> </figure> </div> </section><section id="input-template" class="docs-block"> <span class="section-kicker">Feature</span> <h2>Input templates and their three data modes</h2> <p>Templates preserve reusable components and behaviors. Instance parameters replace equipment names, text, or other settings. Built-in templates include Input, Keypad, Table, Alarm, charts, and video. Configure instances in Template Edit and apply category-based changes with Batch Replace.</p> <div class="docs-detail-list"> <article id="input-template-item-1" class="docs-detail-row"> <strong>What it is and what it solves</strong> <p>Templates save object groups, behaviors, parameter definitions and instance values. Use placeholders for instance differences, then insert per device. Built-in templates provide dedicated fields. Template Library manages templates, Template Edit configures instances, and Batch Replace applies bulk changes.</p> </article><article id="input-template-item-2" class="docs-detail-row"> <strong>How to use it: save, insert, and the editor fields</strong> <p>Group and select the components, then save to Template Library. Double-click or drag a library card to insert an instance. Import / Export exchanges templates; Delete removes them.

Template Edit fields vary by type:</p> <ul> <li>All instances: Position and Size with X / Y / Width / Height (the top also shows read-only Instance / Template / Group)</li><li>Plain template instance: a Template Variables section lists one input per detected &lt;variable&gt; (e.g. PLC, DB, RUN_TAG); filling it applies to the whole group</li><li>input template: Input Mode (Plain Input keeps only the typed value and does not write / Runtime Variable binds a runtime variable / PLC Tag binds a PLC tag), Variable or PLC Tag (switches with the mode), Write Trigger (defaults to Immediate), Font Size</li><li>keypad template: Target Input (pick the input template on this page to drive; digit keys append a character, Back deletes one, Clear empties, OK writes through the target input)</li><li>table template: Table Name, Table Text ID, Headers, Header Text IDs, Rows (Rows accepts an array, a variable name, or a function name)</li> </ul> <pre class="docs-code-block"><code>// Use template variables in expressions (segmented / whole)

ReadTagBoolean(&#39;&lt;PLC&gt;.&lt;DB&gt;.RUN&#39;, false)

ReadTagBoolean(&#39;&lt;RUN_TAG&gt;&#39;, false)

// Instance: PLC=PLC_LINE01, DB=DB_PUMP01 -&gt; at runtime equals PLC_LINE01.DB_PUMP01.RUN</code></pre> </article><article id="input-template-item-3" class="docs-detail-row"> <strong>Fill the common Template Edit areas in order</strong> <p>Select the instance root and open Templates → Edit Instance. Check Instance, Template and Group; fill Position and Size and Template variables, then continue to the type-specific section. Variables affect this instance only.</p> <ul> <li>Instance: confirm the selected instance name.</li><li>Template: confirm the source template.</li><li>Group: confirm its library category.</li><li>X / Y: top-left position.</li><li>Width / Height: overall instance size.</li><li>Template variables: values for this instance only.</li><li>If ValidationMessage appears, correct that field before Save.</li> </ul> </article><article id="input-template-item-4" class="docs-detail-row"> <strong>Configure an Input template</strong> <p>Choose Input mode before entering a target. Plain Input stores local input only; Runtime Variable writes a page runtime variable; PLC Tag targets a device tag. Choose Immediate when confirmation should submit through the current binding, or External when another button or script will commit it. Finish with Font size.</p> <ul> <li>Plain Input: no variable or PLC tag target.</li><li>Runtime Variable: enter a fixed name such as speedSetpointDraft, or =selectedVariableName for an expression returning a variable-name string.</li><li>PLC Tag: enter PLC_LINE01.PUMP01.SPEED_SETPOINT or &lt;PLC&gt;.PUMP01.SPEED_SETPOINT as a fixed name. Use =selectedSetpointTag for a dynamic target.</li><li>Immediate: submit through the active binding after confirmation.</li><li>External: Enter and leaving the input do not submit automatically. Keypad OK still submits the target Input and does not run a custom Click Script validator.</li><li>Test display and submission, then press Esc in Input to discard a draft. Input has no data-type or numeric minimum/maximum controls; enforce business limits in the submission script.</li> </ul> </article><article id="input-template-item-5" class="docs-detail-row"> <strong>Connect a Keypad template to its target input</strong> <p>The current page must already contain an Input template. Select the Keypad instance, open Template Edit, and set Target input to that input-instance name. Save and test 0–9, Back, Clear, and OK. The current Keypad has no Cancel key; press Esc in Input to discard a draft. If the editor says no input templates were found, insert and save an Input template first.</p> <ul> <li>Configure Input before Keypad.</li><li>Target input must exist on the current page.</li><li>After renaming an input instance, recheck the Keypad target.</li><li>For PLC Tag mode, test permission, confirmation, and write results. If a Submit button must validate the numeric range, do not connect Keypad to that PLC Tag input. Use Plain Input for the draft and validate/write from the button instead.</li> </ul> </article><article id="input-template-item-6" class="docs-detail-row"> <strong>Configure a Table template</strong> <p>Table name is the displayed table title; Table text ID is its translation key. Scripts and ExportTable locate the component by its Name in Behavior Browser or its shapeId. Set Font size and column widths, then fill Headers, Header text IDs, and Rows. If any column width is set, all configured columns must total 100 percent; leave every width blank for equal columns.</p> <ul> <li>Table name: the displayed title, not the component lookup name.</li><li>Table text ID: the title translation key; a matching translation replaces Table name, and a missing translation keeps the title text.</li><li>Column layout: percentages totaling 100 percent.</li><li>Headers: visible header text.</li><li>Header text IDs: language keys or text identifiers matching the headers.</li><li>Rows: an array, page-script variable name, or function returning an array.</li><li>Test zero, one, and multiple rows after saving.</li><li>Table renders read-only text. It has no built-in filtering, pagination, cell inputs, button columns, or per-row state colors. Filter or page the array in your script; use separate Input / button objects or a custom page for editing and row actions.</li> </ul> </article><article id="input-template-item-7" class="docs-detail-row"> <strong>Configure Alarm template filters</strong> <p>Use the Alarm section to limit the alarm template&#39;s display range. Select the display options you need, then enter Tags, PLC codes, Function groups, Device groups, or Signal groups. Separate multiple values with commas or lines and use codes rather than display names.</p> <ul> <li>Tags: device-code.tag-code.</li><li>PLC codes: device-code only.</li><li>Function groups: device-code.group-code.</li><li>Device groups: device-code.group-code.</li><li>Signal groups: device-code.group-code.</li><li>After export, use a known alarm in Mingcedar to verify the filter scope.</li> </ul> </article><article id="input-template-item-8" class="docs-detail-row"> <strong>Template variables, runtime variables, and page parameters are different</strong> <p>These four value types differ in scope and lifetime:</p> <ul> <li>Template variables such as &lt;PLC&gt;, &lt;DB&gt;, and &lt;RUN_TAG&gt;: instance-level substitutions that must be resolved before export; they are not runtime page parameters.</li><li>Plain Input: stores only the current input-template value and is read with template.getValue(&quot;input template instance name&quot;); it does not cross pages automatically.</li><li>Runtime Variable: belongs to the current runtime page and is intended for same-page linkage, not cross-page messaging.</li><li>PLC Tag: belongs to the host data layer. Multiple pages may read the same Tag, but that is data binding rather than page-parameter passing.</li><li>Page parameters: sent by Open Link, openPage, or Open Page as Popup and read on the destination with GetPageParameter*.</li> </ul> </article><article id="input-template-item-9" class="docs-detail-row"> <strong>When to use it</strong> <p>Repeated equipment: save a pump or valve template, then fill each instance’s PLC, DB and other parameters to replace matching targets.

Input area: connect a Keypad to a Runtime Variable or PLC Tag Input through Target Input. Read its value with template.getValue(&quot;Input component name&quot;).

Batch Replace: verify Scope and Variables, enter Find / Replace with, and review Type / Object / Replace in / Current value / Replacement preview before clicking Replace.</p> </article><article id="input-template-item-10" class="docs-detail-row"> <strong>Limitations and troubleshooting</strong> <p>Check these settings:</p> <ul> <li>Variable names must be wrapped in angle brackets. Letters, digits, underscore, and non-ASCII letters are supported, but hyphens, dots, and spaces cannot appear inside the name. Shared templates should prefer ASCII uppercase names such as &lt;PLC&gt; and &lt;RUN_TAG&gt;; write tag paths as &lt;PLC&gt;.&lt;RUN_TAG&gt;.</li><li>Template variables are instance-level and live only on the instance root group: copying the whole group carries them along and all child shapes share one set of values; don&#39;t try to set them per child shape</li><li>Variables may be left blank while editing/inserting, but export validates them: if any unreplaced &lt;variable&gt; remains, export fails, so fill them all before exporting</li><li>Template Edit only works on a template instance root group: with a plain shape or plain group selected the button is unavailable; picking the wrong object means the editor won&#39;t open or shows no variable rows</li><li>keypad needs an input template first: if this page has no input template yet, Target Input prompts you to insert one and come back</li><li>Batch Replace covers the selected categories of text, tags, links, scripts, behavior settings, and colors. It does not change the template structure; fix the template source if each replacement still needs layout changes.</li> </ul> </article> </div> <div class="docs-note-grid"> <figure id="input-template-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/templates/edit-instance-variables.png" alt="Current Mingcedar Studio template-instance editor" loading="lazy" decoding="async"> <figcaption> <strong>Template Edit</strong> <p>Template Edit: verify the instance source and geometry, then fill variables for this instance.</p> </figcaption> </figure> </div> </section><section id="keypad-template" class="docs-block"> <span class="section-kicker">Feature</span> <h2>Connect a keypad to its target input</h2> <p>Templates preserve reusable components and behaviors. Instance parameters replace equipment names, text, or other settings. Built-in templates include Input, Keypad, Table, Alarm, charts, and video. Configure instances in Template Edit and apply category-based changes with Batch Replace.</p> <div class="docs-detail-list"> <article id="keypad-template-item-1" class="docs-detail-row"> <strong>What it is and what it solves</strong> <p>Templates save object groups, behaviors, parameter definitions and instance values. Use placeholders for instance differences, then insert per device. Built-in templates provide dedicated fields. Template Library manages templates, Template Edit configures instances, and Batch Replace applies bulk changes.</p> </article><article id="keypad-template-item-2" class="docs-detail-row"> <strong>How to use it: save, insert, and the editor fields</strong> <p>Group and select the components, then save to Template Library. Double-click or drag a library card to insert an instance. Import / Export exchanges templates; Delete removes them.

Template Edit fields vary by type:</p> <ul> <li>All instances: Position and Size with X / Y / Width / Height (the top also shows read-only Instance / Template / Group)</li><li>Plain template instance: a Template Variables section lists one input per detected &lt;variable&gt; (e.g. PLC, DB, RUN_TAG); filling it applies to the whole group</li><li>input template: Input Mode (Plain Input keeps only the typed value and does not write / Runtime Variable binds a runtime variable / PLC Tag binds a PLC tag), Variable or PLC Tag (switches with the mode), Write Trigger (defaults to Immediate), Font Size</li><li>keypad template: Target Input (pick the input template on this page to drive; digit keys append a character, Back deletes one, Clear empties, OK writes through the target input)</li><li>table template: Table Name, Table Text ID, Headers, Header Text IDs, Rows (Rows accepts an array, a variable name, or a function name)</li> </ul> <pre class="docs-code-block"><code>// Use template variables in expressions (segmented / whole)

ReadTagBoolean(&#39;&lt;PLC&gt;.&lt;DB&gt;.RUN&#39;, false)

ReadTagBoolean(&#39;&lt;RUN_TAG&gt;&#39;, false)

// Instance: PLC=PLC_LINE01, DB=DB_PUMP01 -&gt; at runtime equals PLC_LINE01.DB_PUMP01.RUN</code></pre> </article><article id="keypad-template-item-3" class="docs-detail-row"> <strong>Fill the common Template Edit areas in order</strong> <p>Select the instance root and open Templates → Edit Instance. Check Instance, Template and Group; fill Position and Size and Template variables, then continue to the type-specific section. Variables affect this instance only.</p> <ul> <li>Instance: confirm the selected instance name.</li><li>Template: confirm the source template.</li><li>Group: confirm its library category.</li><li>X / Y: top-left position.</li><li>Width / Height: overall instance size.</li><li>Template variables: values for this instance only.</li><li>If ValidationMessage appears, correct that field before Save.</li> </ul> </article><article id="keypad-template-item-4" class="docs-detail-row"> <strong>Configure an Input template</strong> <p>Choose Input mode before entering a target. Plain Input stores local input only; Runtime Variable writes a page runtime variable; PLC Tag targets a device tag. Choose Immediate when confirmation should submit through the current binding, or External when another button or script will commit it. Finish with Font size.</p> <ul> <li>Plain Input: no variable or PLC tag target.</li><li>Runtime Variable: enter a fixed name such as speedSetpointDraft, or =selectedVariableName for an expression returning a variable-name string.</li><li>PLC Tag: enter PLC_LINE01.PUMP01.SPEED_SETPOINT or &lt;PLC&gt;.PUMP01.SPEED_SETPOINT as a fixed name. Use =selectedSetpointTag for a dynamic target.</li><li>Immediate: submit through the active binding after confirmation.</li><li>External: Enter and leaving the input do not submit automatically. Keypad OK still submits the target Input and does not run a custom Click Script validator.</li><li>Test display and submission, then press Esc in Input to discard a draft. Input has no data-type or numeric minimum/maximum controls; enforce business limits in the submission script.</li> </ul> </article><article id="keypad-template-item-5" class="docs-detail-row"> <strong>Connect a Keypad template to its target input</strong> <p>The current page must already contain an Input template. Select the Keypad instance, open Template Edit, and set Target input to that input-instance name. Save and test 0–9, Back, Clear, and OK. The current Keypad has no Cancel key; press Esc in Input to discard a draft. If the editor says no input templates were found, insert and save an Input template first.</p> <ul> <li>Configure Input before Keypad.</li><li>Target input must exist on the current page.</li><li>After renaming an input instance, recheck the Keypad target.</li><li>For PLC Tag mode, test permission, confirmation, and write results. If a Submit button must validate the numeric range, do not connect Keypad to that PLC Tag input. Use Plain Input for the draft and validate/write from the button instead.</li> </ul> </article><article id="keypad-template-item-6" class="docs-detail-row"> <strong>Configure a Table template</strong> <p>Table name is the displayed table title; Table text ID is its translation key. Scripts and ExportTable locate the component by its Name in Behavior Browser or its shapeId. Set Font size and column widths, then fill Headers, Header text IDs, and Rows. If any column width is set, all configured columns must total 100 percent; leave every width blank for equal columns.</p> <ul> <li>Table name: the displayed title, not the component lookup name.</li><li>Table text ID: the title translation key; a matching translation replaces Table name, and a missing translation keeps the title text.</li><li>Column layout: percentages totaling 100 percent.</li><li>Headers: visible header text.</li><li>Header text IDs: language keys or text identifiers matching the headers.</li><li>Rows: an array, page-script variable name, or function returning an array.</li><li>Test zero, one, and multiple rows after saving.</li><li>Table renders read-only text. It has no built-in filtering, pagination, cell inputs, button columns, or per-row state colors. Filter or page the array in your script; use separate Input / button objects or a custom page for editing and row actions.</li> </ul> </article><article id="keypad-template-item-7" class="docs-detail-row"> <strong>Configure Alarm template filters</strong> <p>Use the Alarm section to limit the alarm template&#39;s display range. Select the display options you need, then enter Tags, PLC codes, Function groups, Device groups, or Signal groups. Separate multiple values with commas or lines and use codes rather than display names.</p> <ul> <li>Tags: device-code.tag-code.</li><li>PLC codes: device-code only.</li><li>Function groups: device-code.group-code.</li><li>Device groups: device-code.group-code.</li><li>Signal groups: device-code.group-code.</li><li>After export, use a known alarm in Mingcedar to verify the filter scope.</li> </ul> </article><article id="keypad-template-item-8" class="docs-detail-row"> <strong>Template variables, runtime variables, and page parameters are different</strong> <p>These four value types differ in scope and lifetime:</p> <ul> <li>Template variables such as &lt;PLC&gt;, &lt;DB&gt;, and &lt;RUN_TAG&gt;: instance-level substitutions that must be resolved before export; they are not runtime page parameters.</li><li>Plain Input: stores only the current input-template value and is read with template.getValue(&quot;input template instance name&quot;); it does not cross pages automatically.</li><li>Runtime Variable: belongs to the current runtime page and is intended for same-page linkage, not cross-page messaging.</li><li>PLC Tag: belongs to the host data layer. Multiple pages may read the same Tag, but that is data binding rather than page-parameter passing.</li><li>Page parameters: sent by Open Link, openPage, or Open Page as Popup and read on the destination with GetPageParameter*.</li> </ul> </article><article id="keypad-template-item-9" class="docs-detail-row"> <strong>When to use it</strong> <p>Repeated equipment: save a pump or valve template, then fill each instance’s PLC, DB and other parameters to replace matching targets.

Input area: connect a Keypad to a Runtime Variable or PLC Tag Input through Target Input. Read its value with template.getValue(&quot;Input component name&quot;).

Batch Replace: verify Scope and Variables, enter Find / Replace with, and review Type / Object / Replace in / Current value / Replacement preview before clicking Replace.</p> </article><article id="keypad-template-item-10" class="docs-detail-row"> <strong>Limitations and troubleshooting</strong> <p>Check these settings:</p> <ul> <li>Variable names must be wrapped in angle brackets. Letters, digits, underscore, and non-ASCII letters are supported, but hyphens, dots, and spaces cannot appear inside the name. Shared templates should prefer ASCII uppercase names such as &lt;PLC&gt; and &lt;RUN_TAG&gt;; write tag paths as &lt;PLC&gt;.&lt;RUN_TAG&gt;.</li><li>Template variables are instance-level and live only on the instance root group: copying the whole group carries them along and all child shapes share one set of values; don&#39;t try to set them per child shape</li><li>Variables may be left blank while editing/inserting, but export validates them: if any unreplaced &lt;variable&gt; remains, export fails, so fill them all before exporting</li><li>Template Edit only works on a template instance root group: with a plain shape or plain group selected the button is unavailable; picking the wrong object means the editor won&#39;t open or shows no variable rows</li><li>keypad needs an input template first: if this page has no input template yet, Target Input prompts you to insert one and come back</li><li>Batch Replace covers the selected categories of text, tags, links, scripts, behavior settings, and colors. It does not change the template structure; fix the template source if each replacement still needs layout changes.</li> </ul> </article> </div> <div class="docs-note-grid"> <figure id="keypad-template-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/templates/edit-instance-variables.png" alt="Current Mingcedar Studio template-instance editor" loading="lazy" decoding="async"> <figcaption> <strong>Template Edit</strong> <p>Template Edit: verify the instance source and geometry, then fill variables for this instance.</p> </figcaption> </figure> </div> </section><section id="table-template" class="docs-block"> <span class="section-kicker">Feature</span> <h2>Table headers, rows, and dynamic data</h2> <p>Templates preserve reusable components and behaviors. Instance parameters replace equipment names, text, or other settings. Built-in templates include Input, Keypad, Table, Alarm, charts, and video. Configure instances in Template Edit and apply category-based changes with Batch Replace.</p> <div class="docs-detail-list"> <article id="table-template-item-1" class="docs-detail-row"> <strong>What it is and what it solves</strong> <p>Templates save object groups, behaviors, parameter definitions and instance values. Use placeholders for instance differences, then insert per device. Built-in templates provide dedicated fields. Template Library manages templates, Template Edit configures instances, and Batch Replace applies bulk changes.</p> </article><article id="table-template-item-2" class="docs-detail-row"> <strong>How to use it: save, insert, and the editor fields</strong> <p>Group and select the components, then save to Template Library. Double-click or drag a library card to insert an instance. Import / Export exchanges templates; Delete removes them.

Template Edit fields vary by type:</p> <ul> <li>All instances: Position and Size with X / Y / Width / Height (the top also shows read-only Instance / Template / Group)</li><li>Plain template instance: a Template Variables section lists one input per detected &lt;variable&gt; (e.g. PLC, DB, RUN_TAG); filling it applies to the whole group</li><li>input template: Input Mode (Plain Input keeps only the typed value and does not write / Runtime Variable binds a runtime variable / PLC Tag binds a PLC tag), Variable or PLC Tag (switches with the mode), Write Trigger (defaults to Immediate), Font Size</li><li>keypad template: Target Input (pick the input template on this page to drive; digit keys append a character, Back deletes one, Clear empties, OK writes through the target input)</li><li>table template: Table Name, Table Text ID, Headers, Header Text IDs, Rows (Rows accepts an array, a variable name, or a function name)</li> </ul> <pre class="docs-code-block"><code>// Use template variables in expressions (segmented / whole)

ReadTagBoolean(&#39;&lt;PLC&gt;.&lt;DB&gt;.RUN&#39;, false)

ReadTagBoolean(&#39;&lt;RUN_TAG&gt;&#39;, false)

// Instance: PLC=PLC_LINE01, DB=DB_PUMP01 -&gt; at runtime equals PLC_LINE01.DB_PUMP01.RUN</code></pre> </article><article id="table-template-item-3" class="docs-detail-row"> <strong>Fill the common Template Edit areas in order</strong> <p>Select the instance root and open Templates → Edit Instance. Check Instance, Template and Group; fill Position and Size and Template variables, then continue to the type-specific section. Variables affect this instance only.</p> <ul> <li>Instance: confirm the selected instance name.</li><li>Template: confirm the source template.</li><li>Group: confirm its library category.</li><li>X / Y: top-left position.</li><li>Width / Height: overall instance size.</li><li>Template variables: values for this instance only.</li><li>If ValidationMessage appears, correct that field before Save.</li> </ul> </article><article id="table-template-item-4" class="docs-detail-row"> <strong>Configure an Input template</strong> <p>Choose Input mode before entering a target. Plain Input stores local input only; Runtime Variable writes a page runtime variable; PLC Tag targets a device tag. Choose Immediate when confirmation should submit through the current binding, or External when another button or script will commit it. Finish with Font size.</p> <ul> <li>Plain Input: no variable or PLC tag target.</li><li>Runtime Variable: enter a fixed name such as speedSetpointDraft, or =selectedVariableName for an expression returning a variable-name string.</li><li>PLC Tag: enter PLC_LINE01.PUMP01.SPEED_SETPOINT or &lt;PLC&gt;.PUMP01.SPEED_SETPOINT as a fixed name. Use =selectedSetpointTag for a dynamic target.</li><li>Immediate: submit through the active binding after confirmation.</li><li>External: Enter and leaving the input do not submit automatically. Keypad OK still submits the target Input and does not run a custom Click Script validator.</li><li>Test display and submission, then press Esc in Input to discard a draft. Input has no data-type or numeric minimum/maximum controls; enforce business limits in the submission script.</li> </ul> </article><article id="table-template-item-5" class="docs-detail-row"> <strong>Connect a Keypad template to its target input</strong> <p>The current page must already contain an Input template. Select the Keypad instance, open Template Edit, and set Target input to that input-instance name. Save and test 0–9, Back, Clear, and OK. The current Keypad has no Cancel key; press Esc in Input to discard a draft. If the editor says no input templates were found, insert and save an Input template first.</p> <ul> <li>Configure Input before Keypad.</li><li>Target input must exist on the current page.</li><li>After renaming an input instance, recheck the Keypad target.</li><li>For PLC Tag mode, test permission, confirmation, and write results. If a Submit button must validate the numeric range, do not connect Keypad to that PLC Tag input. Use Plain Input for the draft and validate/write from the button instead.</li> </ul> </article><article id="table-template-item-6" class="docs-detail-row"> <strong>Configure a Table template</strong> <p>Table name is the displayed table title; Table text ID is its translation key. Scripts and ExportTable locate the component by its Name in Behavior Browser or its shapeId. Set Font size and column widths, then fill Headers, Header text IDs, and Rows. If any column width is set, all configured columns must total 100 percent; leave every width blank for equal columns.</p> <ul> <li>Table name: the displayed title, not the component lookup name.</li><li>Table text ID: the title translation key; a matching translation replaces Table name, and a missing translation keeps the title text.</li><li>Column layout: percentages totaling 100 percent.</li><li>Headers: visible header text.</li><li>Header text IDs: language keys or text identifiers matching the headers.</li><li>Rows: an array, page-script variable name, or function returning an array.</li><li>Test zero, one, and multiple rows after saving.</li><li>Table renders read-only text. It has no built-in filtering, pagination, cell inputs, button columns, or per-row state colors. Filter or page the array in your script; use separate Input / button objects or a custom page for editing and row actions.</li> </ul> </article><article id="table-template-item-7" class="docs-detail-row"> <strong>Configure Alarm template filters</strong> <p>Use the Alarm section to limit the alarm template&#39;s display range. Select the display options you need, then enter Tags, PLC codes, Function groups, Device groups, or Signal groups. Separate multiple values with commas or lines and use codes rather than display names.</p> <ul> <li>Tags: device-code.tag-code.</li><li>PLC codes: device-code only.</li><li>Function groups: device-code.group-code.</li><li>Device groups: device-code.group-code.</li><li>Signal groups: device-code.group-code.</li><li>After export, use a known alarm in Mingcedar to verify the filter scope.</li> </ul> </article><article id="table-template-item-8" class="docs-detail-row"> <strong>Template variables, runtime variables, and page parameters are different</strong> <p>These four value types differ in scope and lifetime:</p> <ul> <li>Template variables such as &lt;PLC&gt;, &lt;DB&gt;, and &lt;RUN_TAG&gt;: instance-level substitutions that must be resolved before export; they are not runtime page parameters.</li><li>Plain Input: stores only the current input-template value and is read with template.getValue(&quot;input template instance name&quot;); it does not cross pages automatically.</li><li>Runtime Variable: belongs to the current runtime page and is intended for same-page linkage, not cross-page messaging.</li><li>PLC Tag: belongs to the host data layer. Multiple pages may read the same Tag, but that is data binding rather than page-parameter passing.</li><li>Page parameters: sent by Open Link, openPage, or Open Page as Popup and read on the destination with GetPageParameter*.</li> </ul> </article><article id="table-template-item-9" class="docs-detail-row"> <strong>When to use it</strong> <p>Repeated equipment: save a pump or valve template, then fill each instance’s PLC, DB and other parameters to replace matching targets.

Input area: connect a Keypad to a Runtime Variable or PLC Tag Input through Target Input. Read its value with template.getValue(&quot;Input component name&quot;).

Batch Replace: verify Scope and Variables, enter Find / Replace with, and review Type / Object / Replace in / Current value / Replacement preview before clicking Replace.</p> </article><article id="table-template-item-10" class="docs-detail-row"> <strong>Limitations and troubleshooting</strong> <p>Check these settings:</p> <ul> <li>Variable names must be wrapped in angle brackets. Letters, digits, underscore, and non-ASCII letters are supported, but hyphens, dots, and spaces cannot appear inside the name. Shared templates should prefer ASCII uppercase names such as &lt;PLC&gt; and &lt;RUN_TAG&gt;; write tag paths as &lt;PLC&gt;.&lt;RUN_TAG&gt;.</li><li>Template variables are instance-level and live only on the instance root group: copying the whole group carries them along and all child shapes share one set of values; don&#39;t try to set them per child shape</li><li>Variables may be left blank while editing/inserting, but export validates them: if any unreplaced &lt;variable&gt; remains, export fails, so fill them all before exporting</li><li>Template Edit only works on a template instance root group: with a plain shape or plain group selected the button is unavailable; picking the wrong object means the editor won&#39;t open or shows no variable rows</li><li>keypad needs an input template first: if this page has no input template yet, Target Input prompts you to insert one and come back</li><li>Batch Replace covers the selected categories of text, tags, links, scripts, behavior settings, and colors. It does not change the template structure; fix the template source if each replacement still needs layout changes.</li> </ul> </article> </div> <div class="docs-note-grid"> <figure id="table-template-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/templates/edit-instance-variables.png" alt="Current Mingcedar Studio template-instance editor" loading="lazy" decoding="async"> <figcaption> <strong>Template Edit</strong> <p>Template Edit: verify the instance source and geometry, then fill variables for this instance.</p> </figcaption> </figure> </div> </section><section id="template-runtime" class="docs-block"> <span class="section-kicker">Feature</span> <h2>Read template input values from scripts</h2> <p>Templates preserve reusable components and behaviors. Instance parameters replace equipment names, text, or other settings. Built-in templates include Input, Keypad, Table, Alarm, charts, and video. Configure instances in Template Edit and apply category-based changes with Batch Replace.</p> <div class="docs-detail-list"> <article id="template-runtime-item-1" class="docs-detail-row"> <strong>What it is and what it solves</strong> <p>Templates save object groups, behaviors, parameter definitions and instance values. Use placeholders for instance differences, then insert per device. Built-in templates provide dedicated fields. Template Library manages templates, Template Edit configures instances, and Batch Replace applies bulk changes.</p> </article><article id="template-runtime-item-2" class="docs-detail-row"> <strong>How to use it: save, insert, and the editor fields</strong> <p>Group and select the components, then save to Template Library. Double-click or drag a library card to insert an instance. Import / Export exchanges templates; Delete removes them.

Template Edit fields vary by type:</p> <ul> <li>All instances: Position and Size with X / Y / Width / Height (the top also shows read-only Instance / Template / Group)</li><li>Plain template instance: a Template Variables section lists one input per detected &lt;variable&gt; (e.g. PLC, DB, RUN_TAG); filling it applies to the whole group</li><li>input template: Input Mode (Plain Input keeps only the typed value and does not write / Runtime Variable binds a runtime variable / PLC Tag binds a PLC tag), Variable or PLC Tag (switches with the mode), Write Trigger (defaults to Immediate), Font Size</li><li>keypad template: Target Input (pick the input template on this page to drive; digit keys append a character, Back deletes one, Clear empties, OK writes through the target input)</li><li>table template: Table Name, Table Text ID, Headers, Header Text IDs, Rows (Rows accepts an array, a variable name, or a function name)</li> </ul> <pre class="docs-code-block"><code>// Use template variables in expressions (segmented / whole)

ReadTagBoolean(&#39;&lt;PLC&gt;.&lt;DB&gt;.RUN&#39;, false)

ReadTagBoolean(&#39;&lt;RUN_TAG&gt;&#39;, false)

// Instance: PLC=PLC_LINE01, DB=DB_PUMP01 -&gt; at runtime equals PLC_LINE01.DB_PUMP01.RUN</code></pre> </article><article id="template-runtime-item-3" class="docs-detail-row"> <strong>Fill the common Template Edit areas in order</strong> <p>Select the instance root and open Templates → Edit Instance. Check Instance, Template and Group; fill Position and Size and Template variables, then continue to the type-specific section. Variables affect this instance only.</p> <ul> <li>Instance: confirm the selected instance name.</li><li>Template: confirm the source template.</li><li>Group: confirm its library category.</li><li>X / Y: top-left position.</li><li>Width / Height: overall instance size.</li><li>Template variables: values for this instance only.</li><li>If ValidationMessage appears, correct that field before Save.</li> </ul> </article><article id="template-runtime-item-4" class="docs-detail-row"> <strong>Configure an Input template</strong> <p>Choose Input mode before entering a target. Plain Input stores local input only; Runtime Variable writes a page runtime variable; PLC Tag targets a device tag. Choose Immediate when confirmation should submit through the current binding, or External when another button or script will commit it. Finish with Font size.</p> <ul> <li>Plain Input: no variable or PLC tag target.</li><li>Runtime Variable: enter a fixed name such as speedSetpointDraft, or =selectedVariableName for an expression returning a variable-name string.</li><li>PLC Tag: enter PLC_LINE01.PUMP01.SPEED_SETPOINT or &lt;PLC&gt;.PUMP01.SPEED_SETPOINT as a fixed name. Use =selectedSetpointTag for a dynamic target.</li><li>Immediate: submit through the active binding after confirmation.</li><li>External: Enter and leaving the input do not submit automatically. Keypad OK still submits the target Input and does not run a custom Click Script validator.</li><li>Test display and submission, then press Esc in Input to discard a draft. Input has no data-type or numeric minimum/maximum controls; enforce business limits in the submission script.</li> </ul> </article><article id="template-runtime-item-5" class="docs-detail-row"> <strong>Connect a Keypad template to its target input</strong> <p>The current page must already contain an Input template. Select the Keypad instance, open Template Edit, and set Target input to that input-instance name. Save and test 0–9, Back, Clear, and OK. The current Keypad has no Cancel key; press Esc in Input to discard a draft. If the editor says no input templates were found, insert and save an Input template first.</p> <ul> <li>Configure Input before Keypad.</li><li>Target input must exist on the current page.</li><li>After renaming an input instance, recheck the Keypad target.</li><li>For PLC Tag mode, test permission, confirmation, and write results. If a Submit button must validate the numeric range, do not connect Keypad to that PLC Tag input. Use Plain Input for the draft and validate/write from the button instead.</li> </ul> </article><article id="template-runtime-item-6" class="docs-detail-row"> <strong>Configure a Table template</strong> <p>Table name is the displayed table title; Table text ID is its translation key. Scripts and ExportTable locate the component by its Name in Behavior Browser or its shapeId. Set Font size and column widths, then fill Headers, Header text IDs, and Rows. If any column width is set, all configured columns must total 100 percent; leave every width blank for equal columns.</p> <ul> <li>Table name: the displayed title, not the component lookup name.</li><li>Table text ID: the title translation key; a matching translation replaces Table name, and a missing translation keeps the title text.</li><li>Column layout: percentages totaling 100 percent.</li><li>Headers: visible header text.</li><li>Header text IDs: language keys or text identifiers matching the headers.</li><li>Rows: an array, page-script variable name, or function returning an array.</li><li>Test zero, one, and multiple rows after saving.</li><li>Table renders read-only text. It has no built-in filtering, pagination, cell inputs, button columns, or per-row state colors. Filter or page the array in your script; use separate Input / button objects or a custom page for editing and row actions.</li> </ul> </article><article id="template-runtime-item-7" class="docs-detail-row"> <strong>Configure Alarm template filters</strong> <p>Use the Alarm section to limit the alarm template&#39;s display range. Select the display options you need, then enter Tags, PLC codes, Function groups, Device groups, or Signal groups. Separate multiple values with commas or lines and use codes rather than display names.</p> <ul> <li>Tags: device-code.tag-code.</li><li>PLC codes: device-code only.</li><li>Function groups: device-code.group-code.</li><li>Device groups: device-code.group-code.</li><li>Signal groups: device-code.group-code.</li><li>After export, use a known alarm in Mingcedar to verify the filter scope.</li> </ul> </article><article id="template-runtime-item-8" class="docs-detail-row"> <strong>Template variables, runtime variables, and page parameters are different</strong> <p>These four value types differ in scope and lifetime:</p> <ul> <li>Template variables such as &lt;PLC&gt;, &lt;DB&gt;, and &lt;RUN_TAG&gt;: instance-level substitutions that must be resolved before export; they are not runtime page parameters.</li><li>Plain Input: stores only the current input-template value and is read with template.getValue(&quot;input template instance name&quot;); it does not cross pages automatically.</li><li>Runtime Variable: belongs to the current runtime page and is intended for same-page linkage, not cross-page messaging.</li><li>PLC Tag: belongs to the host data layer. Multiple pages may read the same Tag, but that is data binding rather than page-parameter passing.</li><li>Page parameters: sent by Open Link, openPage, or Open Page as Popup and read on the destination with GetPageParameter*.</li> </ul> </article><article id="template-runtime-item-9" class="docs-detail-row"> <strong>When to use it</strong> <p>Repeated equipment: save a pump or valve template, then fill each instance’s PLC, DB and other parameters to replace matching targets.

Input area: connect a Keypad to a Runtime Variable or PLC Tag Input through Target Input. Read its value with template.getValue(&quot;Input component name&quot;).

Batch Replace: verify Scope and Variables, enter Find / Replace with, and review Type / Object / Replace in / Current value / Replacement preview before clicking Replace.</p> </article><article id="template-runtime-item-10" class="docs-detail-row"> <strong>Limitations and troubleshooting</strong> <p>Check these settings:</p> <ul> <li>Variable names must be wrapped in angle brackets. Letters, digits, underscore, and non-ASCII letters are supported, but hyphens, dots, and spaces cannot appear inside the name. Shared templates should prefer ASCII uppercase names such as &lt;PLC&gt; and &lt;RUN_TAG&gt;; write tag paths as &lt;PLC&gt;.&lt;RUN_TAG&gt;.</li><li>Template variables are instance-level and live only on the instance root group: copying the whole group carries them along and all child shapes share one set of values; don&#39;t try to set them per child shape</li><li>Variables may be left blank while editing/inserting, but export validates them: if any unreplaced &lt;variable&gt; remains, export fails, so fill them all before exporting</li><li>Template Edit only works on a template instance root group: with a plain shape or plain group selected the button is unavailable; picking the wrong object means the editor won&#39;t open or shows no variable rows</li><li>keypad needs an input template first: if this page has no input template yet, Target Input prompts you to insert one and come back</li><li>Batch Replace covers the selected categories of text, tags, links, scripts, behavior settings, and colors. It does not change the template structure; fix the template source if each replacement still needs layout changes.</li> </ul> </article><article id="template-runtime-item-11" class="docs-detail-row"> <strong>Start with the five script locations</strong> <p>Code location determines scope, execution timing, and async/write permissions. Mingcedar Studio has no global script document spanning all pages.</p> <ul> <li>Page Script: belongs to the current page. Top-level var, let, const, class, and function declarations are available to animations and expressions on that page.</li><li>hqVisuDesignerPageReady(ctx): runs once after the page runtime is ready and suits component initialization; constants and helpers needed by the first animation evaluation still belong at Page Script top level.</li><li>Setup Script: prepares variables and intermediate results for one behavior only; it is not a page-global area.</li><li>Condition / Value / Display Text / Fill / Border / Visibility / Source value: synchronous expression slots that must immediately return one result.</li><li>Click / Hover / Press-Release Script: full event-driven script bodies. WriteTag is allowed only for a genuine Click, Press, or Release; Hover cannot write device data.</li> </ul> </article><article id="template-runtime-item-12" class="docs-detail-row"> <strong>Recommended animation-script split</strong> <p>Keep shared Tag prefixes, ranges, and conversion functions in Page Script. Color and text behaviors that provide Setup Script can prepare local results there. Move, Rotate, and Scale have no Setup Script or Post Operations field. Put reads and conversions directly in Source value or Rotation input and reusable helpers in Page Script.</p> <pre class="docs-code-block"><code>// Current Page Script

const tankTagPrefix = &quot;PLC_LINE01.TANK01&quot;;

function percent(value, min, max) {

return Math.max(0, Math.min(100, (value - min) * 100 / (max - min)));

}

// Scale: Source value

percent(ReadTagDouble(tankTagPrefix + &quot;.LEVEL&quot;, 0), 0, 10)

// Source minimum / maximum: 0 / 100

// Limit minimum / maximum: 0 / 100

// At limit minimum / maximum: 0 / 1

// Moving edge: Top</code></pre> </article><article id="template-runtime-item-13" class="docs-detail-row"> <strong>Synchronous, asynchronous, and write boundaries</strong> <p>Do not put fetch, Promise, setTimeout, or setInterval directly in an expression slot because animation evaluation needs an immediate result. Prepare asynchronous data in an async function in Page Script, hqVisuDesignerPageReady, Click Script, or Hover Script, then expose a page variable or host data source for the animation to read. await is valid only inside an async function; top-level await and import/export module syntax are unsupported. Device writes require a genuine user click, press, or release and remain subject to host permission, confirmation, reason, and audit controls.</p> </article><article id="template-runtime-item-14" class="docs-detail-row"> <strong>Navigation parameters: supported content</strong> <p>In Open Link, select Internal page to enter values under Parameters (optional). For other Destinations, fill the fields for that target type. Scripted navigation passes parameters in the second hqVisuDesigner.openPage argument. Values may be strings, numbers, booleans, or null; the destination reads strings and reads null as an empty string.</p> <ul> <li>parameters must be an array whose entries have { key, value }.</li><li>The array preserves order and repeated keys. A plain object is not the formal openPage parameter shape.</li><li>frameTarget supports frame, fullscreen, and _blank; openInNewWindow: true is equivalent to _blank.</li><li>Use openPage within one package. Use openScreen(screenCode) across packages, but generic Jump Parameters are not guaranteed across a screen-package boundary.</li><li>Website / File URL parameters become URL query values and are read according to the destination system&#39;s query rules.</li> </ul> <pre class="docs-code-block"><code>hqVisuDesigner.openPage(&quot;device_details&quot;, {

frameTarget: &quot;frame&quot;,

parameters: [

{ key: &quot;PLC&quot;, value: &quot;PLC_LINE01&quot; },

{ key: &quot;Device&quot;, value: &quot;PUMP_01&quot; },

{ key: &quot;Mode&quot;, value: 1 },

{ key: &quot;Enabled&quot;, value: true }

]

});</code></pre> </article><article id="template-runtime-item-15" class="docs-detail-row"> <strong>Destination reads and type conversion</strong> <p>Read parameters in the destination Page Script and validate before use. GetPageParameter returns the first matching value; GetPageParameterValues returns every value for a repeated key; GetPageParameters returns every { key, value } in original order. All three also have hqVisuDesigner namespace forms. Every read value is a string, so explicitly convert numbers and booleans and constrain allowed characters before building a Tag name.</p> <pre class="docs-code-block"><code>var plc = GetPageParameter(&quot;PLC&quot;, &quot;&quot;);

var device = GetPageParameter(&quot;Device&quot;, &quot;&quot;);

var modeText = GetPageParameter(&quot;Mode&quot;, &quot;0&quot;);

var enabledText = GetPageParameter(&quot;Enabled&quot;, &quot;false&quot;);

if (!/^[A-Za-z0-9_-]{1,64}$/.test(plc) ||

!/^[A-Za-z0-9_-]{1,64}$/.test(device)) {

throw new Error(&quot;Invalid page parameter&quot;);

}

var mode = Number.parseInt(modeText, 10);

var enabled = enabledText === &quot;true&quot;;

var statusTag = plc + &quot;.&quot; + device + &quot;.STATUS&quot;;</code></pre> </article><article id="template-runtime-item-16" class="docs-detail-row"> <strong>Popup parameters and close results</strong> <p>The static Open Page as Popup input accepts a JSON object, not a top-level array. With Build page parameters with an expression enabled, the runtime accepts an object or an ordered array of { key, value } entries; use an array for repeated keys. The popup destination still reads values through GetPageParameter*. Close Current Popup&#39;s Result expression is a reverse result channel from the popup to its opener and may return a boolean, number, string, or object; it is separate from the query parameters used to open the popup.</p> </article><article id="template-runtime-item-17" class="docs-detail-row"> <strong>Count, length, and security limits</strong> <p>The Runtime keeps at most 64 navigation parameters. A key is limited to 256 characters and a value to 2048 characters; invalid entries are ignored. Parameters enter the URL query and must not carry passwords, tokens, authorization proof, sensitive personal data, or large JSON payloads. Cookie, localStorage, and sessionStorage depend on origin, iframe, and host loading details and are not a formal cross-page parameter protocol. Page parameters cannot expand host-granted Tag, page, or user permissions.</p> </article><article id="template-runtime-item-18" class="docs-detail-row"> <strong>Separate four value mechanisms and troubleshoot in order</strong> <p>Template variables, Runtime Variables, PLC Tags, and page parameters solve different problems. Template variables are substituted on an instance and before export; Runtime Variables link state on the current page; PLC Tags belong to the host data layer; page parameters carry context only when a destination is opened. If a read is empty, check whether the target type supports parameters, key spelling and case, whether parameters is an array, count/length limits, whether the host took over navigation, whether the destination URL contains the query, and whether a cross-package relative path was used by mistake.</p> </article> </div> <div class="docs-note-grid"> <figure id="template-runtime-image-1" class="docs-note-card manual-doc-image-card"> <img src="/WEB_img/HQPPT/current/templates/edit-instance-variables.png" alt="Current Mingcedar Studio template-instance editor" loading="lazy" decoding="async"> <figcaption> <strong>Template Edit</strong> <p>Template Edit: verify the instance source and geometry, then fill variables for this instance.</p> </figcaption> </figure> </div> </section>