Mingcedar

Product: Mingcedar Studio DESIGNER

Write Tag | Mingcedar Studio

Click to submit a Tag value for start, stop, setpoint or reset requests. Verify the host write result after submission.

Published Updated

<div class="manual-doc-article manual-doc-article-section"><h2 id="interaction-write-tag">Interactions: Write Tag</h2>

Click to submit a Tag value for start, stop, setpoint or reset requests. Verify the host write result after submission.

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

<article class="doc-card">

<h3 id="interaction-write-tag-item-1">Overview</h3>

<p>Write Tag submits a value to Mingcedar, which checks permissions, confirmation and write handling. Editor preview does not write devices. Use Write Tag Bit for one bit of an integer.</p>

</article>

<article class="doc-card">

<h3 id="interaction-write-tag-item-2">Field configuration</h3>

<p>Bind Write Tag and set Target Tag and Value. Configure Setup Script, Condition and appearance options as needed.</p>

<ul>

<li>Target Tag: the tag-name expression to write to. Enter the tag name directly, or use a template placeholder for reuse; the hint reads &quot;Use Bit Index for bit writes.&quot;</li>

<li>Value: the value to write. Use a single expression or JavaScript that returns a value. The initial value is 1.</li>

<li>Setup Script: optional; prepare shared variables or helper logic for Value to use.</li>

<li>Condition: controls whether the behavior can run; it defaults to true. A false result prevents this behavior from running.</li>

<li>Options: Show hand cursor when enabled, Use bold border when enabled, Hide when disabled.</li>

</ul>

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

<span class="line"><span style="color:#D73A49">var</span><span style="color:#24292E"> nextSetpoint </span><span style="color:#D73A49">=</span><span style="color:#005CC5"> 1200</span><span style="color:#24292E">;</span></span>

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

<span class="line"><span style="color:#6A737D">// Target Tag</span></span>

<span class="line"><span style="color:#005CC5">PLC_LINE01</span><span style="color:#24292E">.</span><span style="color:#005CC5">PUMP01</span><span style="color:#24292E">.</span><span style="color:#005CC5">SPEED_SETPOINT</span></span>

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

<span class="line"><span style="color:#6A737D">// Value (submit the setpoint)</span></span>

<span class="line"><span style="color:#24292E">nextSetpoint</span></span></code></pre></div>

</article>

<article class="doc-card">

<h3 id="interaction-write-tag-item-3">When to use it</h3>

<p>Use for click-triggered start, stop, setpoint or reset requests. Collect operator values with Input and choose the submission behavior or Click Script.</p>

</article>

<article class="doc-card doc-card-warn">

<h3 id="interaction-write-tag-item-4">Limitations and troubleshooting</h3>

<p>Submission does not confirm success; check the host result.</p>

<ul>

<li>Target Tag holds a tag-name expression, not necessarily a quoted string; just enter the tag name as the editor expects.</li>

<li>If Value is multi-line script, it must end with return, otherwise nothing is written.</li>

<li>The write may not take effect immediately: the host may run permission checks, a confirm dialog, an async write, or reject it; host write handlers may return a Promise.</li>

<li>Do not hand-assemble an integer here just to flip one bit. Use Write Tag Bit for that.</li>

</ul>

</article>

</div>

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

<figure class="docs-note-card manual-doc-image-card" id="interaction-write-tag-image-1">

<img src="/WEB_img/HQPPT/current/write/write-normal.png" alt="Write Tag behavior editor" loading="lazy" decoding="async" />

<figcaption>

<strong>Figure 1: Write Tag editor</strong>

<p>Enter the target tag and the value to write; on click it writes to that tag, and the host decides whether the write succeeds.</p>

</figcaption>

</figure>

</div>

</div>