Author a workspace parameter template
Цей контент ще не доступний вашою мовою.
Overvis already ships parameter templates. A workspace template adds a device for this workspace
only, or replaces a shipped template here. Templates live in templates/parameters/ of a pulled
workspace checkout, next to setup.db, one JSON file per device.
Write the template
Section titled “Write the template”- Pull the workspace, and open
templates/schemas/parameter-template.schema.json. The template must match it. Do not edit or pushtemplates/README.mdortemplates/schemas/: every pull rewrites them. - If the checkout has no
templates/parameters/directory yet, create it. A pull has none until the workspace has templates of its own. - Create the JSON file at any depth under
templates/parameters/. Its path without.jsonis the template id that list and stamp use, so do not put anidin the JSON. To replace a shipped template, use the path of its id astemplates.parameter.listshows it. - Set
$schemato the relative path oftemplates/schemas/parameter-template.schema.json. Count../from the JSON file’s directory. - Build the tree (see Build the tree) and check its quality (see Check the content).
- Run
pnpm hmi checkand fix every problem. - Push the clean checkout with
pnpm hmi push. The template is available to Setup andtemplates.parameter.stamponly after the push completes.
Build the tree
Section titled “Build the tree”-
Give the template one root branch. Group the leaves the way an operator commissions the device. Sibling display names must be unique per language.
-
For Modbus leaves, use the same
table, addresses, andwriteFunctionfields as a live parameter (Modbus source). The workspace schema is the field contract. Take addresses as zero-based PDU addresses: convert 1-based or “40001”-style register numbers from the manual. -
If the device has a factory unit ID, set it as
defaultUnitId. Leaves have no unit ID of their own: stamp takes it from the request, or fromdefaultUnitIdwhen the request has none. -
For a leaf computed from other leaves, use a
calcsource:- give each input leaf a
keythat is unique in the file; - list those keys in
inputKeysin formula order (#1,#2, …); - write
formulaandreturnFormatas on a livecalcsource.
Stamp replaces the keys with the new parameter ids. Use this when the device’s scale depends on one of its own settings: read the raw value and the setting as separate leaves and compute the engineering value from them.
- give each input leaf a
{ "name": { "en": "Phase 1 current" }, "source": { "kind": "calc", "inputKeys": ["phase-1-current-raw", "current-resolution"], "formula": "#1 * #2", "returnFormat": "float" }}Check the content
Section titled “Check the content”- Take every register from the device manual or other documentation you rely on. Leave out registers it does not document, and skip reserved and always-zero rows.
- Locale maps (
name,title,reprlabels) can use one key, in the language of that documentation. To add another language, add its key with a real translation; a copy of the source string in another locale key adds nothing. - To list the template in Setup for stamping, set
visibilityto"public"."private"hides it there. - To associate the template with documentation already available to the in-app assistant, set
docsPath. Otherwise omit it or set it tonull.
Extend MC252 device identification
Section titled “Extend MC252 device identification”Do this only when you identify unknown Modbus devices on an Overvis MC252 and Overvis does not already know the model. The script and map formats are in the device-find language reference.
- Create
templates/class-find/catalog.txtwith probes that return a class name for the device. It is prepended to the Overvis catalog, so its probes run first. Put each label on its own line, and narrow every range to the values your device can hold. - Create
templates/class-find/map.jsonwith an entry for each class name your probes return. SettemplateIdto the template id, for exampleacme/foofortemplates/parameters/acme/foo.json. If the probes cannot tell several models apart, list them incandidatesinstead. To name the device without a template, leave both out. - Run
pnpm hmi check, and commit and push the overlay with the template.
To use Overvis identification only, leave the templates/class-find/ folder out.