Configuring Easy Chart Dynamic Tag Selection Correctly

Stefan Weidner6 min read
HMI / SCADAOther ManufacturerTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

The request path is the popup input value, then the root-container dynamic property, then the Easy Chart pen configuration, and finally the historian query. The key commissioning decision is the pen type: a database WHERE snippet can filter DB pens, but it cannot select SQLTag pens. For SQLTag history, change the chart's expert-level tagPens dataset.

Where does the tank-selection request travel?

Follow the value from its sender to the point where selection occurs. The calling window passes a tank number into the popup. A dynamic property on the popup root container receives that value. A binding then uses it either to build a DB query predicate or to update SQLTag pen definitions.

Path item DB pens SQLTag pens
Selection receiver Chart Where Clause property or a Dynamic Group snippet Expert-level tagPens dataset
History source Database history written by a SQL Bridge historical group or similar process SQLTags historian
Address and port Come from the configured database connection, not the predicate Come from the configured historian path, not a SQL clause
Query timing Controlled by the chart's history range and refresh behavior Controlled by the chart's history range and refresh behavior
Dynamic setting Filter database rows Replace or generate pen rows

Layer one first: verify that the chart can display a known, fixed pen before making it dynamic. A fixed DB pen proves the database path; a fixed SQLTag pen proves the historian path. Do not continue until the fixed trace returns data.

Which Easy Chart pen type is configured?

Open the Easy Chart configuration and identify where the working pen is defined. A pen backed by database history is a DB pen. A pen backed by the SQLTags historian is an SQLTag pen. Dynamic Groups and the chart-wide Where Clause apply only to DB pens.

Observation Decision Next action
The pen queries database history created by a historical group DB pen Build a predicate using real columns in that database schema
The pen is selected from SQLTag history SQLTag pen Update tagPens
Changing the Where Clause has no effect on an SQLTag pen Wrong selection mechanism Remove that test and inspect the pen dataset
A fixed pen shows no samples Base data path is not commissioned Repair the connection, history configuration, or requested time range first

The check is decisive: add one fixed tank pen and request a period known to contain samples. If it plots, proceed with the matching dynamic mechanism. If it does not, dynamic selection is not yet the fault domain.

How should the DB-pen Where Clause be built?

machine_num = 28 is an example predicate, not a predefined Easy Chart field. machine_num must be a real column available to every affected DB-pen query, and 28 is the selection value. The property expects a snippet of SQL WHERE-clause syntax; do not add another WHERE keyword.

The chart includes the snippet in the queries for all database pens. That creates two constraints. Every affected query must expose the referenced column, and the predicate must be valid for each underlying table or view. A column used only by one pen can break or incorrectly filter the others.

For the tank requirement, first inspect the database table or view and find the column that identifies T1Level, T1Temp, and the corresponding tags for other tanks. If that column is actually named TAGNAME, a predicate derived for tank 1 could be:

TAGNAME IN ('T1Level', 'T1Temp')

This example assumes TAGNAME is the stored text column. Replace it with the verified schema column. An expression binding can construct the two exact names from the popup's tank-number property. Exact equality is preferable to a broad LIKE pattern because it returns only the required level and temperature rows.

Use the database query tool or equivalent preview to run the completed predicate against the same source as the pens. The check passes only when it returns the two intended tank identifiers and no identifiers from another tank.

How should Dynamic Groups filter DB pens?

A Dynamic Group still operates on DB pens. The group's code snippet contains the same kind of database predicate as the chart-wide property; binding a group property such as group_test1 to an expression changes that snippet from the passed input value.

Choose the scope deliberately. Use the chart-wide Where Clause when every DB pen must receive one predicate. Use separate Dynamic Groups when different sets of DB pens require different predicates. Neither mechanism searches the SQLTags historian for matching tag names.

  1. Create and verify the required DB pens with a fixed tank selection.
  2. Add a root-container dynamic property and pass the popup input value into it.
  3. Bind the appropriate Dynamic Group property to an expression that produces a valid predicate for the verified database column.
  4. Preview the resulting property value and confirm that it contains only the SQL fragment, not an extra WHERE.
  5. Open the popup with two different tank numbers and inspect the returned pen data.

The group is commissioned when each input changes the database rows selected for that group while unrelated groups remain unchanged.

How are SQLTag pens changed from the popup value?

For SQLTag pens, build the Easy Chart for one known tank first. Then inspect tagPens and locate the cells containing the configured tag references. Use a cell-update binding, or regenerate the small dataset, so the root-container tank property changes those references.

  1. Configure two working pens for one tank: its level tag and temperature tag.
  2. Create the popup input property that receives the tank number.
  3. Bind that input to the root-container dynamic property used by the chart.
  4. Update the relevant tagPens cells so they resolve to T plus the complete tank number plus Level or Temp.
  5. Confirm that the resulting dataset still contains the required pen rows and all non-path settings from the working chart.

Do not apply LIKE to SQLTag pen selection. The chart needs concrete pen definitions in tagPens; a DB predicate does not create those definitions. The immediate check is the dataset itself: with tank 20 passed in, its two relevant references must resolve to T20Level and T20Temp.

How do you prevent T1 and T20 selection errors?

Build names from tokens rather than replacing every occurrence of a digit. A broad pattern such as %T1% can select names beginning with the same text, including tanks with additional digits. It can also capture unrelated suffixes beyond Level and Temp.

Method Recurring failure Commissioning check
Broad LIKE pattern Returns tags outside the requested two-name set List every returned identifier before plotting
Global digit replacement Changes digits elsewhere in a tag reference or setting Compare every modified dataset cell with the fixed template
Exact two-name construction Fails visibly if a required tag is absent Confirm both resolved names and both traces
Appending new pen rows on each popup change Leaves stale or duplicate pens Check row count after repeated selections

Test tank 1 and tank 20 consecutively in the same popup instance. The property, pen dataset or predicate, legend, and plotted traces must all change together before the next tank is commissioned.

FAQ

Can I use the Easy Chart Where Clause with SQLTag pens?

No. The Where Clause and Dynamic Groups filter DB pens. Change the expert-level tagPens dataset for SQLTag pens.

Does machine_num refer to an Easy Chart property?

No. In machine_num = 28, machine_num is an example database column. Use the actual column exposed by every affected DB-pen query.

Can I include WHERE in the Where Clause property?

No. Supply only the predicate snippet, such as machine_num = 28; the chart incorporates it into each DB-pen query.

Does a Dynamic Group discover matching SQLTag names?

No. A Dynamic Group changes the predicate applied to database pens. SQLTag selection requires concrete pen references in tagPens.

Can I verify the popup without changing every tank?

Test tank 1 and tank 20 because their different number lengths expose weak substitution logic. For the final verification, switch between them and confirm exactly two current traces—Level and Temp—with no stale or duplicate pens.

Back to blog