Skip to content
  • There are no suggestions because the search field is empty.

Recache template reference

Sample project going over how to recache a template reference, in this case a Templated Input.

Content:

  • Summary
  • Instructions
  • Project file

Summary:

When using Template on an Input, Instance, or Flow, the pattern set that the parameters span across are "baked-in" when the related Components of that configuration are saved. If the Template Reference points to a dynamic resource, then in order to update the cached patterns for the Template parameters, one of the Components of that configuration should be resaved.

This sample project pulls data from our public OPC-UA server using a Templated Input for reading in individual tags. Test writes are made to a pipeline to trigger logic to stage new tag names, upload to the Template reference table, and then reinitialize the main pipeline that is using the Templated Input via the Project API.

Note that the Project API is typically expected to be interfaced from an external HTTP client, but this project simulates such a client within the pipeline as a demo.

Instructions:

  1. Import project file found at the bottom of this page.
  2. Enable MQTT Server on Settings page.
    1. The configuration expects the default port 1885. If using a different port, modify the Connector "mqtt_local" to point to the desired port.

  3. The project uses Project API, which is exposed on the same port as the Intelligence Hub runtime
    1. The configuration expects the default port 45245. If using a different port, modify the Connector "projectApi"
    2. Ref: https://archive.guide.highbyte.com/configuration/administration/project/project_api/
  4. The Project API is interfaced with using the "projectAPI" REST Connector. The credentials used for requesting the Bearer token is the default "administrator"/"" login credentials. If this doesn't apply, then adjust the with the appropriate credentials.
  5. Monitor the MQTT server "mqtt_local" for activity. We'll be publishing pipeline activity here:
  6. Navigate to Pipeline page. It's expected for templateOpcTags to be in Error state, since the Template Reference is pointing to a SQLite table that doesn't exist yet.
  7. Navigate to the pipeline "updateTemplateReference_initialStageUpdateRecache. The description has information on the types of commands that can be sent to this Pipeline to activate the various logic paths:
  8. Type a '0' in the Test Write and Submit Write:
  9. You can see the templated tags start to publish from the other pipeline:

  10. Submit a Test Write with value '1' next... then '2', and finally '3'

Project configuration file for importing:

Download (opens in new tab): configuration.json