Asset Models are created within Views in the Canary Admin.
An Asset Model defines the various Instances and associated tags for a type of equipment (i.e. turbine, engine, pumper). It is then used by Axiom for building screens and trends around the Asset Model. The user can easily switch the screen or trend chart to another Instance of the same Asset Type without loading a new chart or application.
The Canary Administrator is used to create and manage asset models. The Asset Model is created as a view, layered on top of other available views. The model is built from an existing set of tags (usually a dataset or existing view), where a set of user entered rules are applied that transform a browse tree structure into an Asset Model. The Asset Model is stored in a database (SQLite) which is then used by the Asset Model Plug-In to generate the desired model and access its underlying historical data.
Creating an Asset Model
To begin, open the Views Tile in the Canary Administrator.
In the Views panel (upper left), select the down arrow, and then select the “Create Asset Model” option.
A dialog will appear to enter information to get started. Except for the Model Name, these settings can be changed later if needed.
- Model Name: - Create a unique name for this view.
- View: - An existing view containing the data. If the data is from the local Historian the view will be the local machine name.
- DataSet Path(s): - In this example, the DataSet name is “Wastewater”, since we are building an Asset Model with the tags from Wastewater basins. If this field is blank, the model will use tags from all the datasets in the View.
- The DataSet Path(s) can also contain more than one DataSet separated by a semicolon. This could be used to combine data from multiple DataSets into a single view.
- Non-Asset Tags: - Determines how to handle tags not associated with an asset type, instance.
- Exclude from Model - tags are left out of the Asset Model.
- Leave As-Is - tags are listed at the root of the Asset Model.
- Place in Folder - tags are listed in a separate folder, named in an additional field.
Clicking "Next" will begin the creation of the Asset Model.
In the lower right hand corner you will also see a button named "Properties". This will expand the model's information field. Two additional options can be found here, Import Rules and Export Rules.
- Import Rules - Provides a way to import saved rules previously exported to a text file.
- Export Rules - Allows all rules from an Asset Model to be exported to a text file. Can be used to copy Asset Models to other systems, for backup or recreating with a new Model Name.
You now can begin using Regular Expressions to define Model Rules and Asset Rules by using the "Add" button in the lower left portion of the rule window.
Defining Model Rules
Rules are used to separate tags into instances of an Asset Type. For this example, we will be working with a dataset that contains 100 tags. Most have unique identifiers in the tag name that we can exploit to separate the tags into instances of an Asset Type. Transforming the tag names by creating Model Rules is recommended before creating Asset Rules to define Assets.
In the example below the first 3 rules have been applied to transform the tag names in the data set into names which can later be used as Asset instances.
The “Add”, “Edit” and “Remove” buttons provide management for creating "Rules" to separate the tags into Asset Instances. "Rule Details" displays the affects of a selected rule.
- Match: - in both Model and Asset Rules this field defines what we are searching for.
- Replace: - in the Model Rule this field defines what we are changing it to.
- Asset Type: - in the Asset Rule this is the name of the Asset.
- Exclude From Model - in the Model Rule this removes all tags found by the match expression.
The "Match:" field uses standard “Regular Expression” parsing. This is a standard and additional information can be found in this help file How do I use Regular Expressions?.
Certain characters are used by the regular expression parser and must be escaped if they exist in a tag name. To escape a character, it must be preceded with a “\” character. Here is the list of characters that need to be escaped to use them as normal literals:
- [ Opening square bracket
- \ Backslash
- ^ Caret
- $ Dollar sign
- . Period or dot
- | Vertical bar or pipe symbol
- ? Question mark
- * Asterisk or star
- + Plus sign
- ( Opening round bracket ) and the closing round bracket
As you type characters in the match field of a Model Rule, immediately below will appear the first tag name that matches your entry. The matching uses regular expression syntax allowing advanced searches to be made. The characters matched will automatically be replaced by the expression in the “Replace”. The result is displayed immediately below the replace box.
Similar rules can be created by cloning an existing rule and then editing. Select an existing rule then click "Ctrl+v". A copy of the rule will be added to the bottom of the list.
Rules are applied from the top down. This can make a difference in how Regular Expressions find matches. The drag & drop technic can be used to reorder rules.
We have shown the affects of the first rule below by clicking the "Rule Details". The regular expression "Bsn(\d+)_" finds the text 'Bsn', '(\d+)' finds and groups any decimal character plus up to the underscore '_'. 'Bsn' is then replaced with "Basin" and '$1'is the decimal characters previously grouped in the first parenthesis.
Rule #1 - Model Rule
- Match: “Bsn(\d+)_”
- Replace: “Basin$1.”
- Transforms: “Bsn1_Aer_Valve_Auto”
- Into: “Basin1.Aer_Valve_Auto”
Comments: “\d” matches any decimal digit (0 to 9) . The “(…)” does a logical grouping of part of an expression, that is used in the replace as “$1”. Additional grouping are sequential such as "$2" and "$3".
Click "OK" to view the affects of the rule.
Rule #1 Results
All tags containing "Bsn1_" are replaced with the name "Basin1". For this rule we removed "Bsn1_" from the Asset Model Tag name so all instances will have the same tag names and the grouped decimal characters are used in the Replace to give the instances unique names.
Rules #2 and #3
Each of these rules do a similar replace transform.
The screen shot below shows the definition of the "Basin" asset rule. 3 instances of the "Basin" asset are found. Other rules define the "Blower" and "Decanter" Assets.
Rule #4 - Asset Rule
- Match: “Basin\d\.”
- Creates an Asset Type "Basin"
- Creates an instance of the asset for each decimal digit found
Comments: “\d” matches any decimal digit (0 to 9) . The "\." matches the literal period, without the escape character "\" the period "." would be any one character.
Click "OK" to view the affects of the rule.
Rule #4 Results
This screen capture shows the tags contained in the "Basin1" asset instance and the child asset "Decanter" Since these Decanter tags were already part of the " Basin1" asset instance they are grouped as a child asset.
Advanced Rule Examples
Remember to escape metacharacters within the Match
- Match: “BLENDER_ENGINE_DATA\.ENG_([0-9]+)_DATA\.”
- Replace: “Engine$1.”
- Transforms: “Blender 7.BLENDER_ENGINE_DATA.ENG_1_DATA.ENG_HOURS”
- Into: “Blender 7.Engine1.ENG_HOURS”
Comments: [0-9] allows any digit 0 to 9; “\d” means the same thing. Notice we “escaped” the periods inside the find. A period means any character, so in this case it would work either way, but technically they should be escaped.
Substitution with reordering the captured Subexpressions
- Match: “BLENDER_PROCESS_DB\.AUG_(.+)\.ARV\[(\d+)]”
- Replace: “Auger$2.$1”
- Transforms: “Blender 7.BLENDER_PROCESS_DB.AUG_CONC.ARV”
- Into: “Blender 7.Auger1.CONC”
Comments: Here we have 2 sub-expression groupings. The first one, ($1) is “CONC” meaning concentration. This is part of an Auger. The Auger number is found within the “ARV” portion. We get the auger number as explained in previous examples and it is captured and used in the replace as “$2”. The (.+) captures the “CONC” sub-expression. The “.+” means 1 or more of any character.
Excluding all tags that don’t contain a certain sequence of characters
- Match: “^((?!Blw).)*$
- Exclude From Model Check Box
Comments: This will exclude from the model all tags that do not contain “Blw”. The match uses a regular expression technique called look ahead, to find tags that do not contain the letters “Blw”.