Skip to content

Screen reuse and parameter configuration

Choose Tags, template parameters, page variables or page parameters according to when the target changes.

Screen designDocumentation revised: 2026-10-21

Screen design: Screen reuse and parameter configuration

Choose Tags, template parameters, page variables or page parameters according to when the target changes.

1. Choose a reuse method

Each template insertion creates an instance. Fill template parameters during authoring, use page variables for current-page state, and pass page parameters when opening another page.

Scroll horizontally to view the full table

Use caseConfigurationWhen the value takes effect
Place PUMP01 and PUMP02 controls side by side<PLC> / <PUMP> template parametersFill each instance before exporting
Switch one Input between two devicesA page variable holding the Tag nameA button changes the variable while the page stays open
Open the same details page for different pumpsPage parameters + GetPageParameterThe source page passes the pump when opening the destination
Switch a table between areas A and BA page variable + a function returning rowsChange the variable; the function returns the matching rows
Display a live speed instead of a one-time snapshotCall ReadTagDouble inside the evaluated functionRead again whenever the display evaluates the function

2. Distinguish a Tag name from its value

A Tag is a Mingcedar data point. speedTag holds its name; ReadTagDouble reads its value. Replace PLC_LINE01.PUMP01.SPEED with a readable numeric Tag from your project.

Scroll horizontally to view the full table

EntryMeaning
"PLC_LINE01.PUMP01.SPEED"A string containing the complete Tag name
speedTagA JavaScript variable containing that string
<PUMP>An authoring placeholder filled separately in each template instance
GetPageParameter("pump", "PUMP01")A string supplied when this page was opened; PUMP01 is the fallback
ReadTagDouble(speedTag, 0)Read the current number; 0 is a fallback, not proof that the device stopped
  1. Create a page, open MX Design → Scripts → Page Script, and enter the code below.
  2. Insert a text shape. Open MX Design → Behaviors → Browse and drag Text → Script Text onto its component node. Double-click the new behavior, clear the default Setup Script, set Condition to true, and enter speedTag + " = " + String(speedNow) in Display Text. Save.
  3. Save the PPT, export through MX Design → Export → Export HTML, and open the page in Mingcedar to inspect the displayed name and value.
Page Script: compare a Tag name with its valueJavaScript
var speedTag = "PLC_LINE01.PUMP01.SPEED";
var speedNow = ReadTagDouble(speedTag, 0);

Expected result speedNow is sampled when these lines run. For a live display, put the read in an evaluated behavior expression or table function. Declare the possible dynamic Tag names as shown in the lessons.

3. Variable syntax by field

Each row is independent. Define selectedTag in Page Script with a full Tag name of the required type. buildRows is the Table tutorial’s row-array function. Expression syntax differs by field.

Scroll horizontally to view the full table

LocationFixed or template targetPage variable
Input → PLC Tag<PLC>.<PUMP>.SPEED_SETPOINT=selectedTag
Write Tag / Write Tag Bit → Target Tag<PLC>.<PUMP>.CTRL_WORD=selectedTag
Table → Rows[["PUMP01", "1200 rpm"]]=buildRows()
Click ScriptWriteTagDouble("<PLC>.<PUMP>.SPEED_SETPOINT", 1200)WriteTagDouble(selectedTag, 1200)
State Color → ConditionReadTagBoolean("<PLC>.<PUMP>.RUN", false)ReadTagBoolean(selectedTag, false)
Write Tag Bit → Bit Index3This field takes a fixed integer; use WriteTagBit in Click Script for a dynamic index

Expected result Use = for the Input target field, pass variables directly to functions, and keep template placeholders inside JavaScript strings. Some fields only accept fixed values.

4. Convert numeric and Boolean template parameters

Use a new page for this example; no PLC data is required. LIMIT is a non-negative number and ENABLED is true or false. Template parameters substitute text, which must be converted before use.

Scroll horizontally to view the full table

InstanceLIMITENABLEDConverted values
A1500true1500 / true
B2200false2200 / false
  1. Insert a text shape and add Text → Script Text. Replace the default Setup Script with the complete code below. Set Condition to true and Display Text to String(limit) + " / " + String(enabled), then save.
  2. Select the text shape, open MX Design → Templates → Library, and click Save selection. Enter Parameter display in Template name, confirm LIMIT and ENABLED in Captured variables, then click Save.
  3. After confirming the save, remove the original placeholder text shape from this page. Save selection saves to the library without removing the original. Hiding it or moving it to another slide in the same PPT does not exclude it from a full export.
  4. Double-click the Parameter display card twice. Select each whole instance group, open MX Design → Templates → Edit Instance, enter values A and B below in Template variables, and save. Export and open the page. A should display 1500 / true and B should display 2200 / false.
Script Text → Setup ScriptJavaScript
var limitText = "<LIMIT>".trim();
var limit = Number(limitText);
if (!limitText || !Number.isFinite(limit) || limit < 0) {
  throw new Error("LIMIT must be a non-negative number");
}
var enabledText = "<ENABLED>".trim().toLowerCase();
if (enabledText !== "true" && enabledText !== "false") {
  throw new Error("ENABLED must be true or false");
}
var enabled = enabledText === "true";

If the result differs

  • Keep the quotes in Number("<LIMIT>"); var limit = <LIMIT> is not valid JavaScript.
  • Boolean("false") is true; compare the string explicitly as shown.
  • Saving a component template does not copy the current Page Script to another page.

5. Diagnose data display problems

  1. Start with constants: use [["PUMP01", "1200 rpm"]] for Table Rows, Plain Input for typing, or true / false for the indicator condition. Confirm the control itself works.
  2. Inspect the computed target: when adding Script Text, clear its default Setup Script and set Condition to true. Temporarily enter selectedTag or GetPageParameter("pump", "missing") in Display Text. A visible <PUMP> means substitution did not happen; the wrong device means selection or parameters are incorrect.
  3. Connect the real Tag last: check its name, type, communication quality and user access. After a write, compare the value read back from the device.

Expected result Check control configuration, computed parameters and data connection in that order.

Click the image again or press Esc to close