Product: Mingcedar Studio DESIGNER
Feature entry points and script method reference | Mingcedar Studio
Find configuration entry points by ribbon command, behavior, built-in template, or script method, with guidance on where each method runs.
<div class="manual-doc-article manual-doc-article-section"><h2 id="capability-reference">Reference: Feature entry points and script method reference</h2>
Find configuration entry points by ribbon command, behavior, built-in template, or script method, with guidance on where each method runs.
<div class="doc-card-list">
<article class="doc-card">
<h3 id="capability-reference-item-1">Choose an entry point by task</h3>
<p>Behavior Browser manages behaviors, Templates manages controls and reuse, and Page Script holds shared page functions and initialization. Start with one page, export it and verify it in Mingcedar. See installation and export chapters for native PowerPoint effects.</p>
<ul>
<li>New users: follow the getting-started route and the field examples in each behavior chapter.</li>
<li>Experienced users: find the behavior, template or function by name, then check its input type and execution context.</li>
<li>Developers: use the runtime script methods listed in this manual and distinguish them from native browser methods. Request acceptance does not prove a completed PLC write or download.</li>
</ul>
</article>
<article class="doc-card doc-card-warn">
<h3 id="capability-reference-item-2">Execution context and call boundaries</h3>
<p>Top-level Page Script declarations are shared within the current page. Setup Script prepares one behavior’s data; Condition, Value, and Display Text return synchronous results. Device writes require a user click or press/release action; do not initiate PLC writes from Hover Script, Page Script, or Setup Script. Put asynchronous logic inside async functions in interaction scripts. Fields that require an immediate value cannot return a Promise.</p>
<ul>
<li>Modern ECMAScript 2022 is supported; import/export declarations and top-level await are not supported in script documents.</li>
<li>Initialize through window.hqVisuDesignerPageReady = function(ctx) { ... }; ctx contains presentation, page and hqVisuDesigner.</li>
<li>A page script is not an automatic cross-page global script. Timers and network calls need bounded frequency, cleanup and failure handling.</li>
</ul>
</article>
<article class="doc-card">
<h3 id="capability-reference-item-3">Read scalar, JSON and date/time Tags and quality</h3>
<p>Names may come from strings, page variables or resolved template parameters; methods return data values. Dynamic names require host read access. Set an explicit fallback to distinguish unavailable data from valid values.</p>
<ul>
<li>ReadTagBoolean(name, fallback), ReadTagInteger(name, fallback), ReadTagDouble(name, fallback), ReadTagString(name, fallback): typed reads.</li>
<li>ReadTagJson(name, fallback) returns parsed JSON. ReadTagDateTime(name, fallback) returns Date or the fallback. Format ordinary timestamps using the project time zone; PLC DATE_AND_TIME/DTL/LDT values are timezone-free calendar values and must not be assumed to be UTC instants and converted blindly to browser-local time.</li>
<li>ReadCalculatedTag(name, fallback) reads a read-only calculated Tag by its saved name without a PLC prefix; its unavailable default is null.</li>
<li>ReadTagQuality(name, fallback) and ReadTagQualityGood(name) read good/bad quality or test good; quality is separate from the process value.</li>
<li>ReadTagBoolean("PLC_LINE01.PUMP01.STATUS[3]", false) reads one bit. Use exact tag[bit] syntax, positions 0–31 and no spaces inside brackets.</li>
<li>ReadTag(name) is a lower-level generic reader; prefer typed methods in application scripts.</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:#D73A49">const</span><span style="color:#005CC5"> report</span><span style="color:#D73A49"> =</span><span style="color:#6F42C1"> ReadTagJson</span><span style="color:#24292E">(</span><span style="color:#032F62">"PLC_LINE01.REPORT01.SUMMARY"</span><span style="color:#24292E">, </span><span style="color:#005CC5">null</span><span style="color:#24292E">);</span></span>
<span class="line"><span style="color:#D73A49">const</span><span style="color:#005CC5"> updatedAt</span><span style="color:#D73A49"> =</span><span style="color:#6F42C1"> ReadTagDateTime</span><span style="color:#24292E">(</span><span style="color:#032F62">"PLC_LINE01.REPORT01.UPDATED_AT"</span><span style="color:#24292E">, </span><span style="color:#005CC5">null</span><span style="color:#24292E">);</span></span>
<span class="line"><span style="color:#D73A49">const</span><span style="color:#005CC5"> hasTime</span><span style="color:#D73A49"> =</span><span style="color:#24292E"> updatedAt </span><span style="color:#D73A49">instanceof</span><span style="color:#6F42C1"> Date</span><span style="color:#24292E">; </span><span style="color:#6A737D">// Confirm the Tag date/time semantics before display</span></span></code></pre></div>
</article>
<article class="doc-card doc-card-warn">
<h3 id="capability-reference-item-4">Typed writes, bit writes and completion</h3>
<p>Call only during real user actions. The host checks permissions, confirmation and reasons, then handles the write. Returns may be asynchronous and do not prove PLC changes.</p>
<ul>
<li>WriteTagBoolean(name, value, options?), WriteTagInteger(name, value, options?), WriteTagDouble(name, value, options?): values must match the target type.</li>
<li>WriteTagString(name, value, options?) and WriteTagJson(name, value, options?): pass JSON-compatible objects or arrays directly rather than JSON.stringify output.</li>
<li>WriteTagDateTime(name, value, options?) accepts Date values serialized using target Tag metadata; string values must follow the host date/time contract.</li>
<li>WriteTagBit(parentName, bitIndex, action, options?): action is Set, Reset or Toggle. Supply the parent integer Tag and a separate bit index, never an ordinary write to name[bit].</li>
<li>WriteTag is the generic write entry point. Prefer the typed methods; options follow the host contract and do not bypass permissions.</li>
<li>hqVisuDesigner.writeVariable(name, value) sets a runtime variable; it is not a PLC write.</li>
</ul>
</article>
<article class="doc-card doc-card-warn">
<h3 id="capability-reference-item-5">Input templates, page parameters and browser storage</h3>
<p>template.getValue(componentName) reads the current page input template’s draft display value. Use a unique component name; a missing input throws an error. Convert numeric drafts explicitly with Number(...) and validate them. URL parameters, <Name> template substitution, runtime variables and PLC Tags have different scopes.</p>
<ul>
<li>GetPageParameter(key, fallback): first value; GetPageParameterValues(key): repeated values; GetPageParameters(): all parameters in original order.</li>
<li>Lowercase equivalents are hqVisuDesigner.getPageParameter / getPageParameterValues / getPageParameters.</li>
<li>ReadBrowserStorage(key, fallback, storageType?), WriteBrowserStorage(key, value, storageType?), RemoveBrowserStorage(key, storageType?): default local; pass "session" for sessionStorage. Storage is same-origin. Lowercase equivalents are hqVisuDesigner.readBrowserStorage / writeBrowserStorage / removeBrowserStorage.</li>
<li>The ReadBrowserStorage fallback determines decoding: {} for an object, 0 for a number, false for boolean, otherwise string by default. WriteBrowserStorage can return its input even on failure, so the return value is not proof of success. RemoveBrowserStorage returns boolean. Storage may be unavailable; hqVisuDesignerLastStorageError provides a clue. Do not store passwords or substitute it for server persistence.</li>
<li>Template Input / Get / <component name> snippets are generated from actual inputs on the current page.</li>
<li>HQVISU_PAGE_PARAMETERS (array) and HQVISU_PAGE_RESOURCE_SCOPE (object) are static, reviewable input/resource declarations. They do not read cookies, assign variables, replace GetPageParameter or grant Tag access.</li>
</ul>
</article>
<article class="doc-card">
<h3 id="capability-reference-item-6">Find and update components</h3>
<p>Methods belong to hqVisuDesigner. Use a unique current-page component name or Shape ID for nameOrId, and verify interactions with existing behaviors.</p>
<ul>
<li>findComponent(nameOrId) finds the exported component element; getComponentData(nameOrId) reads its exported configuration.</li>
<li>setComponentText(nameOrId, value), setComponentFill(nameOrId, color), setComponentBorder(nameOrId, color) update text, fill and border.</li>
<li>setComponentVisible(nameOrId, visible) controls visibility; setComponentLayout(nameOrId, {x, y, width, height, angle}) uses page coordinates.</li>
<li>refreshView() reapplies runtime state; frequent manual refresh is not a substitute for normal subscriptions.</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:#D73A49">const</span><span style="color:#005CC5"> title</span><span style="color:#D73A49"> =</span><span style="color:#24292E"> hqVisuDesigner.</span><span style="color:#6F42C1">getComponentData</span><span style="color:#24292E">(</span><span style="color:#032F62">"PumpTitle"</span><span style="color:#24292E">);</span></span>
<span class="line"><span style="color:#24292E">hqVisuDesigner.</span><span style="color:#6F42C1">setComponentText</span><span style="color:#24292E">(</span><span style="color:#032F62">"PumpTitle"</span><span style="color:#24292E">, </span><span style="color:#032F62">"Line 01 / Pump 01"</span><span style="color:#24292E">);</span></span>
<span class="line"><span style="color:#24292E">hqVisuDesigner.</span><span style="color:#6F42C1">setComponentLayout</span><span style="color:#24292E">(</span><span style="color:#032F62">"PumpTitle"</span><span style="color:#24292E">, { x: </span><span style="color:#005CC5">40</span><span style="color:#24292E">, y: </span><span style="color:#005CC5">24</span><span style="color:#24292E">, width: </span><span style="color:#005CC5">300</span><span style="color:#24292E">, height: </span><span style="color:#005CC5">36</span><span style="color:#24292E">, angle: </span><span style="color:#005CC5">0</span><span style="color:#24292E"> });</span></span></code></pre></div>
</article>
<article class="doc-card">
<h3 id="capability-reference-item-7">Navigation, popups and diagnosis</h3>
<p>Page names and Page Codes come from the current package’s page map. Cross-package navigation uses a host-managed screenCode. The host may handle navigation asynchronously, so calling a method alone does not prove completion.</p>
<ul>
<li>hqVisuDesigner.openPage(page, options?) navigates within a package. options can carry parameters, frameTarget and navigationMode; see script scope and parameter passing.</li>
<li>hqVisuDesigner.openScreen(screenCode) opens another package; hqVisuDesigner.openWebsite(url, optionsOrNewWindow?) opens a valid external link.</li>
<li>hqVisuDesigner.openAndon(page, options?) is an exported fullscreen/Andon entry point; ordinary configuration can use the Open Link display mode.</li>
<li>HQ.popup.open(pageCode, options?) and HQ.popup.close({result: value}) are runtime popup interfaces. open returns a Promise resolved on closing; see the popup chapter for the parameter and result contract.</li>
<li>hqVisuDesigner.openDiagnosis({PLC, ID, DiagnosisControl, GroupRightIndex}) requests a host diagnosis window; content and authorization belong to the host.</li>
</ul>
</article>
<article class="doc-card">
<h3 id="capability-reference-item-8">Language, current user and date/time</h3>
<p>Translations come from the runtime language dictionary, and user identity comes from the host. Clock methods use the operator’s browser-local time, not PLC time or server audit time.</p>
<ul>
<li>GetText(key, fallback?) returns a translation, the explicit fallback when missing, or the key when no fallback is supplied. getText/gettext are compatibility aliases; prefer GetText consistently.</li>
<li>hqVisuDesigner.currentLanguage() reads the language; hqVisuDesigner.useLanguage(language) changes it and refreshes runtime state; hqVisuDesigner.getText corresponds to GetText.</li>
<li>GetCurrentUsername() reads the host username for display; it is not an authorization check.</li>
<li>GetCurrentTime(format?) defaults to HH:mm:ss; GetCurrentDate(format?) to yyyy-MM-dd; GetCurrentDateTime(format?) to yyyy-MM-dd HH:mm:ss; GetCurrentDateObject() returns Date.</li>
<li>FormatDateTime(value, format?) supports yyyy/YYYY, MM, dd/DD, HH, mm and ss. Invalid dates fall back to current time, so validate business input before formatting.</li>
<li>Lowercase hqVisuDesigner methods: currentUsername, currentTime, currentDate, currentDateTime, currentDateObject and formatDateTime.</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:#D73A49">const</span><span style="color:#005CC5"> caption</span><span style="color:#D73A49"> =</span><span style="color:#6F42C1"> GetText</span><span style="color:#24292E">(</span><span style="color:#032F62">"screen.pump.ready"</span><span style="color:#24292E">, </span><span style="color:#032F62">"Ready"</span><span style="color:#24292E">);</span></span>
<span class="line"><span style="color:#D73A49">const</span><span style="color:#005CC5"> operator</span><span style="color:#D73A49"> =</span><span style="color:#6F42C1"> GetCurrentUsername</span><span style="color:#24292E">();</span></span>
<span class="line"><span style="color:#24292E">hqVisuDesigner.</span><span style="color:#6F42C1">setComponentText</span><span style="color:#24292E">(</span><span style="color:#032F62">"OperatorText"</span><span style="color:#24292E">, </span><span style="color:#032F62">`${</span><span style="color:#24292E">caption</span><span style="color:#032F62">} / ${</span><span style="color:#24292E">operator</span><span style="color:#032F62">} / ${</span><span style="color:#6F42C1">GetCurrentTime</span><span style="color:#032F62">()</span><span style="color:#032F62">}`</span><span style="color:#24292E">);</span></span></code></pre></div>
</article>
<article class="doc-card doc-card-warn">
<h3 id="capability-reference-item-9">Alarm queries and the page alarm rail</h3>
<p>GetAlarm methods return whether the current active alarms contain a match. They do not query alarm history. Full Tag names and qualified group codes are different inputs.</p>
<ul>
<li>GetAlarmTags(["PLC_LINE01.PUMP01.ALARM"]): full Tag names.</li>
<li>GetAlarmPlcCodes(["PLC_LINE01"]): PLC/device codes.</li>
<li>GetAlarmFunctionGroupCodes, GetAlarmDeviceGroupCodes and GetAlarmSignalGroupCodes accept arrays of device-qualified group codes.</li>
<li>HQVISU_PAGE_ALARM configures the page alarm rail; getPageAlarm(fallback?) reads it. showWindow controls visibility, while tags/plcCodes/functionGroupCodes/deviceGroupCodes/signalGroupCodes scope it.</li>
<li>hqVisuDesigner.getAlarmTags / getAlarmPlcCodes / getAlarmFunctionGroupCodes / getAlarmDeviceGroupCodes / getAlarmSignalGroupCodes are equivalent entry points.</li>
<li>The built-in Alarm template is a separate page control. A display template does not itself imply alarm acknowledgement, history or permission management.</li>
</ul>
</article>
<article class="doc-card doc-card-warn">
<h3 id="capability-reference-item-10">Sound and browser data downloads</h3>
<p>PlaySound(fileName, loop?) plays root-directory audio, such as PlaySound("alarm.mp3", false). Its Boolean result reports request acceptance; browser audio permissions still apply. Do not repeatedly call it in continuously evaluated expressions.</p>
<ul>
<li>hqVisuDesigner.playSound is the equivalent method. A page script may attempt autoplay, but the browser can block it; check audio permission on the operator browser.</li>
<li>ExportJson(value, fileName?) exports a serializable value; ExportTable(componentNameOrId, fileName?, format?) exports displayed text from a current built-in table.</li>
<li>ExportTags(nameOrNames, fileName?, format?) exports already-readable current Tag values and quality. Formats include csv/json/xlsx; excel aliases xlsx.</li>
<li>Start downloads from a real user click. A returned filename means a download was requested, not that it reached disk; see runtime data export for defaults, scopes and failures.</li>
<li>hqVisuDesigner.exportJson / exportTable / exportTags are equivalents. Data download and authoring-time Export HTML serve different purposes.</li>
</ul>
</article>
<article class="doc-card doc-card-warn">
<h3 id="capability-reference-item-11">Browser and JavaScript snippets in Quick Methods</h3>
<p>Quick Methods also contains standard JavaScript examples. These do not add device protocols or host services. fetch remains subject to networking, CORS, authentication and browser permissions. Use alert/confirm/prompt during user actions.</p>
<ul>
<li>Browser console logging, fetch, setTimeout, setInterval, requestAnimationFrame, document.getElementById.</li>
<li>alert, confirm, prompt; if/else, for, while, switch, try/catch; named, arrow and async functions.</li>
<li>Ternary, ??, ?., template strings, includes/filter, Math.min/max/abs/round, range mapping, destructuring, dynamic Tag and bit names.</li>
<li>The picker filters snippets by expression, Setup Script, and interaction context. Do not paste a statement block into a field expecting a single expression.</li>
</ul>
</article>
<article class="doc-card doc-card-warn">
<h3 id="capability-reference-item-12">Script API scope</h3>
<p>Use this manual’s public methods for screen scripts. Platform-integration members on runtime objects are outside the screen interaction API.</p>
<ul>
<li>Use the documented methods to read Tags, update components, or write to devices, and verify authorization and runtime results.</li>
<li>Do not mutate runtime state objects to simulate device writes or change permissions.</li>
<li>Platform integration and page lifecycle members are outside the scope of ordinary screen scripts.</li>
</ul>
</article>
<article class="doc-card">
<h3 id="capability-reference-item-13">Ribbon entry checklist</h3>
<p>Find the corresponding chapter by entry point. Reused native PowerPoint commands follow the current PowerPoint selection state.</p>
<ul>
<li>Ungroup (PowerPoint context menu)</li>
<li>Browse</li>
<li>Insert Shapes</li>
<li>Format Painter</li>
<li>Straight Connector</li>
<li>Straight Connector Arrow</li>
<li>Align Left</li>
<li>Align Center</li>
<li>Align Right</li>
<li>Align Top</li>
<li>Align Middle</li>
<li>Align Bottom</li>
<li>Distribute H</li>
<li>Distribute V</li>
<li>Rotate Left 90°</li>
<li>Rotate Right 90°</li>
<li>Bring Forward</li>
<li>Bring To Front</li>
<li>Group</li>
<li>Ungroup</li>
<li>Page Ratio</li>
<li>Nav Path</li>
<li>Page Script</li>
<li>Library</li>
<li>Edit Instance</li>
<li>Update Template</li>
<li>Batch Replace</li>
<li>Export HTML</li>
<li>This Page</li>
<li>History</li>
<li>Refresh</li>
<li>License</li>
<li>About</li>
<li>Status: Add-in Version</li>
<li>Status: PowerPoint Version</li>
<li>Status: License</li>
</ul>
</article>
<article class="doc-card">
<h3 id="capability-reference-item-14">Behavior catalog</h3>
<p>Find behaviors by their names in the editor. Each behavior has an operating chapter.</p>
<ul>
<li>Blink Color</li>
<li>Range Color</li>
<li>Script Color</li>
<li>Discrete Color</li>
<li>State Color</li>
<li>Multi-State Color</li>
<li>Move</li>
<li>Rotate</li>
<li>Scale</li>
<li>Set Variable on Click</li>
<li>Open Diagnosis</li>
<li>Open Link</li>
<li>Open Page as Popup</li>
<li>Close Current Popup</li>
<li>Write Tag</li>
<li>Write Tag Bit</li>
<li>Click Script</li>
<li>Hover Script</li>
<li>Press/Release Script</li>
<li>Script Text</li>
<li>Tag Text</li>
<li>Localized Text</li>
</ul>
</article>
<article class="doc-card">
<h3 id="capability-reference-item-15">Built-in templates</h3>
<p>Input, table, keyboard, alarm, video, and chart templates; the custom template library provides another way to reuse designs.</p>
<ul>
<li>Input</li>
<li>Table</li>
<li>Keyboard</li>
<li>Alarm</li>
<li>Video</li>
<li>Line Chart</li>
<li>Bar Chart</li>
<li>Gauge</li>
<li>JSON Chart</li>
</ul>
</article>
<article class="doc-card doc-card-tip">
<h3 id="capability-reference-item-16">Quick Methods search categories</h3>
<p>Actual catalog titles are grouped and deduplicated below. Input-template entries are generated from current-page components.</p>
<ul>
<li>Alarm: Device Groups · Function Groups · PLC · Signal Groups · Tags</li>
<li>Animation Frame: Run Next Frame</li>
<li>Array: Contains · Filter</li>
<li>Browser Storage: Read · Remove · Write</li>
<li>Component: Find · Get Data · Set Border · Set Fill · Set Layout · Set Text · Set Visibility</li>
<li>Console: Log</li>
<li>Control Flow: For Each Item · If · If Else · Switch · Try Catch · While</li>
<li>DOM: Find By ID</li>
<li>Date And Time: Current Date · Current Date Object · Current Date Time · Current Time · Format</li>
<li>Export: JSON · Table CSV · Table Excel · Table JSON · Tags</li>
<li>Expression: Nullish Fallback · Optional Property · Template String · Ternary</li>
<li>Function: Arrow Function · Async Fetch JSON · Component Highlight · Named Function</li>
<li>Language: Current · Get Text · Switch</li>
<li>Lifecycle: Page Runtime Ready</li>
<li>Navigation: Open Page · Open Screen · Open Website</li>
<li>Network: Fetch JSON</li>
<li>Number: Absolute · Clamp · Map Range · Round 2 Decimals</li>
<li>Object: Destructure</li>
<li>Page Alarm: Configure · Read</li>
<li>Page Parameters: Declare Inputs And Read Scope · Read All · Read Repeated Values · Read Value</li>
<li>Sound: Play</li>
<li>Tag Quality: Is Good · Read</li>
<li>Tag Read: Bit Boolean · Boolean · Calculated Tag · Date Time · Double · Integer · JSON · String</li>
<li>Tag Reference: Build And Read · Build And Read Bit · Build Bit Name · Build Name</li>
<li>Template Input: Get / </li>
<li>Timer: Run Once · Run Repeatedly</li>
<li>User: Current Username</li>
<li>Condition: Combined · Invert Boolean · Numeric Compare · Range Compare</li>
<li>Definition: Number Variable · Read Multiple Tags · Stable Defaults · Text Variable</li>
<li>Dialog: Alert · Confirm · Prompt</li>
<li>Host: Open Diagnosis</li>
<li>Runtime Variable: Write</li>
<li>Tag Write: Boolean · Date Time · Double · Integer · Integer Bit · JSON · String</li>
</ul>
</article>
</div></div>