Skip to main content
InSource Solutions

TN - 1197 Using a Namespace to Assign Pens to the HistoricalTrend App

Description

 

This article from InSource shows assign pens to the HistoricalTrend App in runtime using an OMI namespace.

  • Author: Justin Benton
  • Published: 11/30/2021
  • Applies to: Intouch OMI 2020 and Above

Details

One strategy in order to assign pens to the HistoricalTrend App is to create a Namespace in order to write to it. The Namespace will then be called from the Pens property within the HistoricalTrend App. Here are a couple of examples.

 

Using a Button

  1. Create a Namespace and add a string attribute. We'll call it "Pentest1"

clipboard_ee589074c5b5cfa81ebfa09e3a45aac76.png

  1. Create a symbol and add a button. Add it to a pane in your layout. Configure the button.

clipboard_e0b6ed96c25585fc10ceb1d9556f6ae8b.png

Your entire string should resolve on its own. In this example, "Time_001" is my UDO name and "Attribute001" is the attribute set to historize.

  1. In the properties of the HistoricalTrend App, search for "Pens" and add MyviewApp.namespace.pentest1. Set the tag type to "In"

clipboard_e16c25c868f7cad998c75cba3543cb303.png

  1. Deploy all necessary components and launch your viewapp. Pressing the button will add a pen to your app.

 

On Show

  1. Create a Namespace as shown in the previous example.
  2. Select the "Scripts" option in your layout, and create an OnShow script.

clipboard_e7f15af505f82458cc1e04250ad908b27.png

  1. In the properties of the HistoricalTrend App, search for "Pens" and add MyviewApp.namespace.pentest1. Set the tag type to "In"

This way scripts the layout to immediately write to the Namespace when the app is shown. You can add multiple attributes using a comma.

 

 

  • Was this article helpful?