[Program Object] - History Tagging Program Object

This is a helpful engineering tool that will automatically apply history grouping tags to your histories based on your points folder structures.

:warning: This is intended for use by those with some coding knowledge. Take the time to read the code to know exactly how it works. I will write a proper tutorial at some point in the future.

:notebook: In a future build of the ddctCommunity-rt Module we will be integrating the history tagger as part of our plugin library.

The program object is within this bog. Drag it into your N4 station.
HistoryTaggerAdvancedV3.bog (23.6 KB)

Example of what I mean by history grouping:

Usage Instructions

  1. Define History Group: Create a history group in your Niagara station with sufficient levels to cover the number of folder levels used for your points.
    image

  2. Configure the program object like shown in the example below (your configuration might be different):

Configuration Parameters:

  • Point Type: Specify the point types for the BQL query, with each point type on a new line.
  • Stop At Folder: Indicate the folder levels where the program should stop tagging. Multiple folders can be specified, each on a new line.
  • History Groupings: Define the history groupings exactly as they were created in the history group setup, with each level on a new line.
  • Base Ord: Set the entry point for the BQL query.
  • Custom Groups: Name/value pairs for adding custom tags not defined by the history group. This is optional and typically not needed.
  • Config Type: Specify the history extension type to search for.

Comments from the code:
This can be seen when viewing the code on the program object and may provide some more insight…

    _  _ _    _                  _____                       
   | || (_)__| |_ ___ _ _ _  _  |_   _|_ _ __ _ __ _ ___ _ _ 
   | __ | (_-<  _/ _ \ '_| || |   | |/ _` / _` / _` / -_) '_|
   |_||_|_/__/\__\___/_|  \_, |   |_|\__,_\__, \__, \___|_|  
                          |__/            |___/|___/         

    - pointType = A list of point types to query for. Each point type is separated by a new line
    - stopAtFolder = A list of folder levels to stop tagging at. Each stop is separated by a new line
    - baseOrd = The base for the BQL query (allows you to narrow the extent of the query)
    - customGroups = A list of name:value pairs that define custom grouping to be added to each object
    
    For Example, if the stopAtFolder is {ACSys} the program will query all points of the selected pointTypes list
    that are a chilled to ACSys and then tag them from 0 to x folder levels. There is no limit to the depth
    however you must make sure you have enough depth to your history grouping under the history service.
    
    |ACSys (Level0)
      |-L2 (Level1)
        |--AHU (Level2)
           |--AHU1 (Level3)
              |--ZnTmp1 (Level4)

After configuring these parameters, right-click on the program object and select “Execute”. This will run the tagging job and tag your history extensions based on your folder structure and defined history group levels.

Oh that’s a handy tool.
Think we could figure out how to make it non-programmer friendly and put it in the community module?

1 Like

100%! I’ll have a think about how this can be more user friendly :slight_smile: maybe some sort of UI to assists in selecting the histories you want to tag. Also we could have the program automatically generate the Niagara history group definition to remove a step or a drop down to select an existing history group to use.

I especially like the idea of a drop down of existing groups and I still haven’t seen two companies use the same setup. Even I have different setups depending on the host solution and size of the site :slight_smile:

You’re gonna have to teach me some UI magic, as I haven’t really done any of that besides the little included in the Tridium developer course :smiley:

1 Like

Haha me either, but I’m sure we can fumble our way through it :slight_smile:. I usually I just reverse engineer something tridiums made to get an idea of how things piece together.

When I work it out I’ll write a post up on the basics for future reference.

Well if that’s where we are, I’ll look into it too (at some point). It’s not all on you to figure out alone :sweat_smile:

1 Like