Variables, Tags, and template parameters: field rules
Identify whether a field expects a Tag name, a variable name, a number, or text. The leading = marks an expression in selected configuration fields. It is not general script syntax and does not grant Tag access.
Data bindingDocumentation revised: 2026-10-21
Data binding: Variables, Tags, and template parameters: field rules
Identify whether a field expects a Tag name, a variable name, a number, or text. The leading = marks an expression in selected configuration fields. It is not general script syntax and does not grant Tag access.
1. Distinguish Tag names, runtime variables, and template parameters
Mingcedar supplies Tag data. Runtime variables hold state on the current page. Template parameters replace placeholders when configuring an instance. A variable containing a Tag name is still a string; a read method retrieves its value. Examples use PLC_LINE01, PUMP01, and TANK01. Replace them with names configured in your project.
Full Tag name: PLC_LINE01.PUMP01.SPEED.
Calculated Tag name: Line01TotalFlow, exactly as saved in the host.
Runtime variables: selectedSpeedTag holds a name; speedValue holds a number.
Template placeholders: <PLC> and <PUMP_CODE>, replaced with instance values.
JavaScriptJavaScript
// Page Script: store the target namevar selectedSpeedTag = "PLC_LINE01.PUMP01.SPEED";// Behavior Setup Script: read the current value during evaluationvar speedValue = ReadTagDouble(selectedSpeedTag, 0);
2. Target fields in Tag Text and write behaviors
Target tag in Tag Text and Target Tag in Write Tag or Write Tag Bit identify the read or write target. Enter a full fixed name directly, or a variable that holds the name. Use = for object properties or computed names to distinguish them from literal Tag paths. The control performs the read or write; do not call ReadTag or WriteTag inside the target field.
Fixed target: PLC_LINE01.PUMP01.SPEED.
Name variable: selectedSpeedTag; define it first and ensure it returns a string.
Object property: =bindingConfig.speedTag.
Write Tag Bit takes the parent Tag name and a separate Bit Index from 0 to 31.
3. = expressions in Input and charts
The Input PLC Tag field, chart series Tag fields, Gauge Tag, and JSON Tag treat a fixed entry as a name. To obtain the name from a page variable, enter =selectedSpeedTag. The expression must return a Tag name string, not the current Tag value or a JSON object.
JSON Tag: PLC_LINE01.REPORT01.CHART_DATA; use =selectedJsonTag for a dynamic name.
4. Variable-name fields and value fields
In Input Runtime Variable mode, enter the destination name, such as speedSetpointDraft. A dynamic name can use =selectedVariableName, which must return a valid variable-name string. The Variable field in Set Variable on Click identifies the assignment target; Value supplies the content to assign.
Fixed variable name without quotes: speedSetpointDraft.
Dynamic Input variable: define var selectedVariableName = "speedSetpointDraft"; in Page Script and enter =selectedVariableName in the field.
Value and Condition are expression fields: enter speedValue or speedValue > 1200 directly.
In JavaScript, use ReadTagDouble(selectedSpeedTag, 0). Do not pass "=selectedSpeedTag" as an API name argument.
5. Literal text and table data
Table Rows and Headers accept arrays, page array variables, or functions returning arrays. Use = to request evaluation explicitly. Quote a literal title when it could be confused with a variable. Table array data and the Tag name required by JSON Chart are different input types.
Dynamic rows: pumpRows or =buildPumpRows(), returning an array.
Literal title: "Pump station operating record".
6. Combine template parameters and page variables
Set template parameter PLC to PLC_LINE01 and define the equipment code in Page Script. The template replaces <PLC> during authoring. At runtime, the page variable supplies the remaining name. Built-in template expressions use Page Script variables and cannot access another behavior's Setup Script locals. Enter each part below in the location identified by its comment. Lines beginning with = belong in configuration fields, not in a JavaScript script body.
Variable-selected targets remain subject to export validation and Mingcedar read/write permissions. If export cannot determine a dynamic write target, use HQVISU_DECLARE_TAGS in Page Script to declare the finite candidate names associated with the expression. Those names must exist and be authorized in the host. Declarations do not bypass host permissions. Enter each part below in the location identified by its comment. Lines beginning with = belong in configuration fields, not in a JavaScript script body.
JavaScriptJavaScript
var selectedSetpointTag = "PLC_LINE01.PUMP01.SPEED_SETPOINT";HQVISU_DECLARE_TAGS({ expression: "selectedSetpointTag", read: ["PLC_LINE01.PUMP01.SPEED_SETPOINT", "PLC_LINE01.PUMP02.SPEED_SETPOINT"], write: ["PLC_LINE01.PUMP01.SPEED_SETPOINT", "PLC_LINE01.PUMP02.SPEED_SETPOINT"]});// Input PLC Tag field=selectedSetpointTag
8. Evaluation failures and target changes
An explicit expression that fails, returns a non-string, or retains an unresolved placeholder is not reinterpreted as another Tag name. Check variable scope, return type, template values, and name case.
Changing an Input target or binding mode cancels the old unsubmitted draft. Enter a new value for the new target.
A write already sent is not recalled by a subsequent target change.
A live chart clears samples from the previous target when its dynamic target changes.
Runtime variables belong to the current page. Use page parameters to transfer context to another page.