Skip to content

Gateway configuration

The gateway page: the configurations with their status

The edit drawer of a configuration

Every setting, with its key in config.json, is in the configuration settings reference.

The row menu: Edit, Rename, Duplicate, Test Connection, Disable and Delete

Each named configuration (Services > PowerChart Ultra) has a name of its own: a chart finds its configuration by name whatever the case, so two names that differ only in case are refused, and two such configurations already stored (copied in by hand, say) do not run until all but one are renamed or deleted; the gateway page says so. Each has:

Setting Meaning
Database connection Where saved charts are stored. Blank: charts can be explored but not saved. Any database Ignition supports; titles, folders and tag paths outside ASCII need a database whose text columns hold Unicode (see below).
Table prefix Put in front of every table name (pcu_ gives pcu_chart), which is lower case (Line1_ gives line1_chart). A letter, then letters, digits and underscores, at most 20. Each configuration needs its own tables: the tables record which configuration they belong to by its key (the uuid in its resource.json, which a rename keeps and the gateway page's copy makes new), also while it is disabled, so a renamed configuration keeps them; one that is deleted, or that now names another table prefix, hands them on to the next configuration that uses them (one moved to another connection with the same prefix only once that connection shows its own tables claimed, since two connection names can reach one database). A chart table belongs to one gateway: two gateways on one database need different table prefixes.
Admin role Users with this role open, change and delete every chart.
Roles that may save Empty: every signed-in user. Anonymous sessions never save.
Roles that may share Empty: everyone who may save.
Roles that may add notes Who may add, change and delete notes (historian annotations on the pens' tags). Empty: everyone who may save. The admin role always may. Other users can still add a note that stays with their chart.
Allowed historians Pens read history only from these historian providers. Empty: all. Live values follow the browse roots, so a realtime tag in the roots still shows live.
Tag browser roots Tag paths such as [default]Plant; the browser starts here and pens must be under one of them. Empty: every tag provider but [System] (the gateway's own tags), which a chart then neither shows nor reads; name a root under [System] to trend those.
Maximum pens, range (days), export points Limits per chart: 1 to 200 pens, 1 to 36,600 days, 1,000 to 20,000,000 points. Empty (the default): 200 pens, no limit on the range (a chart still shows 100 years at most, from 1 February 1970 to 31 December 9999, and the gateway reads no range beyond that), 20,000,000 points per export.
State colours Colours of step-lane states for every chart of this configuration, one per line: a state's value or label, then a colour, such as Cleaning = #2f6fb0 (case does not matter; True and False name booleans). States not listed get an automatic colour. A chart can set its own colours per pen, and a binding per state (see Bound pens); a binding's colour wins over the chart's, and the chart's over the configuration's, also when one names the state by its value and the other by its label.
Alarm journal Journal for the alarm overlay. Blank: no alarm overlay. The overlay covers ranges up to 31 days and finds alarms that went active up to 7 days before the range (older ones while still active, or when their clear or acknowledgement falls in that week or later), with their clear up to about three months after the range. The journal is read in windows of bounded time, newest first, and a clear after the range is asked for by the alarm's event id, so a chattering alarm does not make one read load weeks of rows; past 50,000 rows the newest alarms are shown and the chart says some were left out.

Changing the database connection or table prefix of a configuration with saved charts points it at other tables, where none of them are: they stay in the old tables, and changing back shows them again. The edit drawer shows a warning as soon as either field differs from the stored one ("Saving switches this configuration to other tables"), and such a change is stored only when the same Save has Switch Chart Storage ticked (Saved Charts, in the edit drawer only). Without it, Save Changes is refused in one line that points at the warning ("Not saved: 12 saved charts would stop showing. Tick Switch Chart Storage to switch (see the warning above)."). The box confirms that one Save: it is never kept (the gateway clears it right after the Save, and the drawer always opens with it clear), and nothing is remembered between Saves, so a refused or cancelled edit, or another session, never confirms a later one. The platform shows the refusal as an error toast; a module cannot change its kind. The platform's form cannot show a field only when it applies, so the box is always in the edit drawer, with its use in its description.

The page is built from the platform's own resource components, as Ignition's built-in pages are: the list with each configuration's status, a create wizard and an edit drawer with the settings in sections (Limits and Display behind Show Advanced on a new configuration), and a row menu with Edit, Rename, Duplicate, Test Connection, Disable and Delete. A change applies at once, without a gateway restart, also to the charts open on it: they keep what is on screen and take the new limits, state colours and permissions (a chart that no longer fits is cut, and says so; in a sync group only that chart shows less, the group keeps its range). Their tag tree starts again and their tags are read again; a change of what may be read (the roots, the historians, the alarm journal) also reads their history, bars, comparisons, notes and alarms again, keeping the chart's pens and settings. A change of the database connection or table prefix, or a configuration made, removed or renamed, starts those charts again as a change of their configuration prop does.

  • Status: RUNNING (with the saved chart count, checked in the background about every 15 seconds), NO DATABASE (charts can be explored, not saved), DISABLED, or FAULTED; click FAULTED for the reason, such as a database connection that does not exist or a setting with a mistake.
  • Test Connection checks the tables now and counts the saved charts.
  • Checked before saving, on the page and for every other way in: a valid name, table prefix, tag browser roots and state colours, limits within their range, and chart tables of its own (a table prefix another configuration uses on the same database is refused, and so is a Duplicate of a configuration that saves charts, as the copy would share its tables). The refusal says why.
  • Lists (roles, historians, roots, state colours) are typed one per line.

Configurations are ordinary 8.3 config resources (data/config/resources/core/com.mustrysolutions.powerchartultra/configuration/<name>/), so they can be kept in Git and deployed like any other resource, and they have the platform's REST API at /data/api/v1/resources/{list,find,...}/com.mustrysolutions.powerchartultra/configuration (lists as JSON arrays, or as text with one entry per line). A configuration stored with a mistake shows as faulted with the reason, with a warning in the gateway log: one whose settings break a rule still loads, and a chart that uses it says why and shows nothing until it is corrected; one whose config.json cannot be read at all (a limit that is no whole number, say) does not run, and keeps the chart table it owns until it can be read again (also when another configuration has its name but for case). A renamed configuration keeps its chart table, enabled or disabled, also when its old name is given to a new configuration and when another configuration reaches the same database through a second connection. Two records with one key (a configuration folder copied by hand) do not run, and the gateway page says why: delete the copy, or remove the uuid from its resource.json so it gets a key of its own. A rename first brings the configuration's chart table up to date and records its key there, reading the table again at every rename whatever the gateway found before; while its database does not answer, the rename is refused with why, and the table stays its own. A table claimed before keys takes a key only from the configuration of exactly the name it records: while another configuration has that name but for case, or none has it exactly, no key is written and the rename that would write it is refused, saying what to rename or delete first. An upgrade keeps every configuration; a description that the earlier page kept as an attribute moves to the resource's own description on start, and a configuration without a key (written by hand) is given one, its chart table kept.

The component's configuration prop names the configuration it uses. The gateway ignores writes to it from the browser, but it trusts bindings: bind it only to values the browser cannot set (not to a URL or page parameter, nor to a session property a client script writes), or a user could pick a looser configuration. When it changes, the chart reads everything again under the new configuration; a saved chart on screen goes (the chart stays as an unsaved one) unless the view asks for it through chartId or the page's path, and then opens again under the new one.

A tag's own read permissions in Ignition (the security levels of its Read Permissions) apply to everything a chart shows of it, on top of the configuration's browse roots and historians. A session whose security levels do not meet them (Perspective's: Public, Authenticated, the user's roles, the security zones) gets no history, bars, export, notes, alarms, live values or tag info of the tag, and the tag browser and search do not list it. Its pen says "Your security levels do not allow reading this tag", nothing more. The historians do not check read permissions, so the gateway does: it reads the tag under the session's security levels before each read and again right before the answer goes out, under the levels the session holds then, and an answer goes out only while the session still holds the levels that last read was made under (a sign-in or sign-out in between refuses it). Bars wait for all their pens, so their tags are read again once all are in: a pen whose permissions were tightened while another was slow sends nothing. Live values are checked as each one comes and again right before each batch goes out (a batch whose check was read under levels the session no longer holds, or that would go out after a sign-in or sign-out or a switch or change of the configuration that no longer allows its tags, is dropped, and the chart subscribes again and reads its range); browse and search check what they found once more right before they answer. A note is added, changed, moved or removed only once its place with the tag's historian is taken and the tag is read again after it: permissions tightened while the note waited for that place store nothing. A tag that no longer exists has no permissions left to check: its stored history stays readable within the roots.

A read is allowed only when the tag's provider answered. The gateway asks the provider for the tag's name under the session's levels (not its value, which is bad whenever a device is down), so a tag on a remote tag provider whose gateway is not connected is refused while the provider is unavailable, with why: "The tag provider could not say whether your security levels allow reading this tag (Bad_NotConnected)". Its history is not shown even though the historian could still read it.

<prefix>chart holds one row per saved chart: id, owner (identity provider and user name), title, folder, visibility (private, everyone, roles), the roles it is shared with, the chart state as JSON, created and updated times, the last editor, a revision and a deletion time. Deleted charts stay as tombstones so a link to one says "deleted". Columns are only ever added on upgrade (through Ignition's DBTableSchema), never dropped, so an upgrade keeps every chart.

<prefix>favourite holds one row per user and starred chart: a key made from the user (identity provider and user name) and the chart id, the identity provider (in the user_source column), user name, chart id and when it was starred. A configuration's stars are in its own tables, like its charts. The table is created on the first start of a version that has favourites; existing charts are untouched. If the database account may not create it, saved charts keep working: favourites say they are unavailable and why, the configuration's status shows it, and the table is made once it can be (Test Connection, or a use a minute later). A star is matched to its user exactly, case and all, as a chart's owner is, also on a database that compares text without case.

Text columns take the types of the connection's database translator: on SQL Server NVARCHAR(255) and NVARCHAR(MAX) (Unicode, whatever the database's collation), on PostgreSQL and MySQL VARCHAR(255) and TEXT, on Oracle VARCHAR2(255) and NCLOB. Those VARCHAR columns hold what the database's character set holds: a title, folder or tag path outside it (Débit, 流量) is stored as ? or refused. Use a Unicode database (PostgreSQL UTF8, MySQL and MariaDB utf8mb4, Oracle AL32UTF8). Checked on PostgreSQL (UTF8), H2 and SQLite.


Copied from the section "Gateway configuration" of the README when the site is built. Source: README.md.