Hierarchy Configuration Utility

The Hierarchy Configuration Utility is intended for Application Engineers or advanced users working with hierarchies in PME.

The utility is a command-line executable that allows you to save, restore, or add hierarchy content.

The primary purpose of the utility is to give you a way to add a large number of entries to a hierarchy rather than creating individual entries in Hierarchy Manager. This task consists of:

  • Saving a skeleton hierarchy configuration in a CSV file.
  • Editing the CSV file to associate the devices listed in the file to the nodes of the hierarchy.
  • Populating Hierarchy Manager with the updated contents of the hierarchy configuration CSV file.

The utility also provides options for:

  • Saving or replacing a hierarchy configuration currently defined in Hierarchy Manager.
  • Installing or saving a hierarchy template.
  • Refreshing a configuration cache to ensure that all devices are included when you save a hierarchy configuration.
  • Deleting a hierarchy configuration prior to restoring a saved configuration.

Throughout this document, references to "configuration" and "template" should be interpreted as follows:

  • configuration – the entries representing the node types, devices, and virtual meters that comprise the content of a hierarchy.
  • template – defines the node names, attributes, relationships, and views in Hierarchy Manager.

Hierarchy Configuration Utility command and options

Run the Hierarchy Configuration Utility command, HierarchyConfig.exe, from a Command Prompt.

To open a Command Prompt window:

  1. Use Windows Explorer to navigate to:

    ...\Power Monitoring Expert\Applications\bin.

  2. Click the bin folder and press Shift + Right-click and select Open command window here on the context menu.

The command syntax is:

HierarchyConfig.exe option <file path>\<file name>, where:

  • option: see Command options below.
  • <file path>: the location of the file that the command runs on.
  • <file name>: the name of the CSV or XML file, including the .csv or .xml file extension, respectively.

Command options

Use the command as follows (type the command and press Enter):

Running the command without options
  • To see a brief description of available command options:

    HierarchyConfig.exe

Running the command using the config option
  • To create a skeleton configuration CSV file that you can use to define a hierarchy configuration:

    HierarchyConfig.exe export config <file path>\<file name>.csv

    Note that this process creates a header row in the CSV file with percentage, node type names, and virtual meter column headings. It also includes a list of the devices in the system that are not included in a hierarchy. This allows you to specify which devices you want to include in the hierarchy when you import the configuration.

    Optional: Including all devices

    Add the alldevices option at the end of the export config command to create a CSV file that lists all of the devices, whether or not they are included in a hierarchy. This option ensures that apportioned devices or devices that constitute a virtual meter are included in the file.

    To include all devices, type the following:

    HierarchyConfig.exe export config <file path>\<file name>.csv alldevices

    Note that the CSV file created with the alldevices option is intended for reference purposes only and not for updating an existing hierarchy.

  • To add the contents of the updated skeleton configuration CSV file to Hierarchy Manager:

    HierarchyConfig.exe import config <file path>\<file name>.csv

    notice

    loss of data

    Do not use the hierarchy configuration CSV file to incrementally update an existing hierarchy.
    Use the Hierarchy Manager application to incrementally update an existing hierarchy.

    Failure to follow these instructions can result in the corruption of hierarchy data.

     

    Optional: Adding a timestamp to configuration entries

    You can also add a timestamp to the configuration entries. Adding year, month, and day information adds a start date to the imported references corresponding to the date entered. If no date information is provided, the start date of the hierarchy information is the system start date.

    To add a timestamp, type HierarchyConfig.exe import config <file path>\<file name>.xml [yyyy/mm/dd] where [yyyy/mm/dd] is the year, month and day that the imported hierarchy references use as a start date.

  • To back up a complete representation of the hierarchy and all virtual meters in an XML file:

    HierarchyConfig.exe export config <file path>\<file name>.xml

    This creates a backup of the hierarchy before you modify the hierarchy entries in Hierarchy Manager.

  • To restore a hierarchy configuration from a backup configuration XML file:

    HierarchyConfig.exe import config <file path>\<file name>.xml

    notice

    loss of data

    Do not use the hierarchy configuration XML file to incrementally update an existing hierarchy.
    Use the Hierarchy Manager application to incrementally update an existing hierarchy.

    Failure to follow these instructions can result in the corruption of hierarchy data.

     

    This process deletes the current hierarchy configuration defined in Hierarchy Manager and replaces it with the hierarchy configuration in the XML file.

  • To refresh a configuration cache to ensure that all devices are included in the saved configuration:

    HierarchyConfig.exe refresh config

  • To delete a hierarchy configuration:

    HierarchyConfig.exe delete config

    Only use this process if you have previously saved your configuration.

Running the command using the template option
  • To save the hierarchy template used in Hierarchy Manager:

    HierarchyConfig.exe export template <file path>\<file name>.xml

    The template defines the node names, attributes, and relationships used in Hierarchy Manager.

  • To replace an existing hierarchy template used in Hierarchy Manager with a different one:

    HierarchyConfig.exe import template <file path>\<file name>.xml