Skip to content

Calculated Tags: read host results by name

ReadCalculatedTag(name, fallbackValue?) reads the latest available result of a published Mingcedar calculated Tag. Supply its saved name without selecting a PLC. The call does not execute the formula in the page.

Data accessDocumentation revised: 2026-10-21

Data access: Calculated Tags: read host results by name

ReadCalculatedTag(name, fallbackValue?) reads the latest available result of a published Mingcedar calculated Tag. Supply its saved name without selecting a PLC. The call does not execute the formula in the page.

1. Method and supported fields

Select Calculated Tag / Read in the function picker. Use the method in animation Value, Condition, Script Text, or page scripts. The global method and hqVisuDesigner.ReadCalculatedTag follow the same read rules.

TextText
ReadCalculatedTag("Line01TotalFlow")
ReadCalculatedTag("Line01TotalFlow", null)
ReadCalculatedTag("Line01Ready", false)
hqVisuDesigner.ReadCalculatedTag("Line01TotalFlow", null)

2. Names and read-only behavior

Use the name saved in the Mingcedar calculated Tag list. Line01TotalFlow requires no PLC or CALC prefix. If the saved name is Line01.TotalFlow, retain the full name. Calculated Tags have no write method and cannot serve as PLC Tag write targets for Input.

  • Names are at most 128 characters. Use ASCII letters, digits, underscores, and separator dots; each segment starts with a letter or underscore.
  • Bit suffixes such as [0] are not supported.
  • An ordinary Tag with the same name is not read as a calculated result.
  • Renaming an unpublished draft does not change the active published name. Update page references after publishing the new name.

3. Defaults and data quality

A valid result with good quality returns a number or boolean, preserving 0 and false. Unloaded, unpublished, disabled, poor-quality, unauthorized, or unavailable subscriptions return the supplied default. Omitting the default returns null. A fallback supports display handling and is not a valid calculated result.

  • Use null and display “--” when data is unavailable to distinguish it from a valid zero.
  • Use false when a condition requires a boolean fallback.
  • Use ReadTagQuality("Line01TotalFlow") to inspect quality. Data quality and process alarms have different meanings.

4. Combine a template, a name variable, and a result variable

Set template parameter CALCULATED_TAG to Line01TotalFlow. In Setup Script, store the replaced name in calculatedTagName, then read the result. Display Text formats the result. A template parameter used in several fields must satisfy every field's requirements. Use separate parameters, such as CALCULATED_TAG and SETPOINT_TAG, for calculated reads and PLC write targets. Enter Setup Script and Display Text in their respective fields.

JavaScriptJavaScript
// Setup Script
var calculatedTagName = "<CALCULATED_TAG>";
var totalFlow = ReadCalculatedTag(calculatedTagName, null);

// Script Text: Text
totalFlow === null ? "--" : totalFlow.toFixed(1) + " m³/h"

5. Runtime verification

Confirm that the host calculated Tag is published, enabled, and has good quality. Then check the page name and permissions. A dynamically supplied name must resolve to a full name string. Reads reuse host latest values and subscriptions without additional PLC polling.

Click the image again or press Esc to close