How to Determine Tag Data Inside MOPS HDB File

Given the arbitrary MOPS *.hdb and its corresponding *.idx file, what kind of tag information inside this file ? In other word, what’s recorded time series data and its tag name inside the *.hdb file ?

To answer the above question, let’s first view the compressed sample *.idx file using your favorite hex editor:


The red box which has 0x00000065 as its value denotes the index entries, i.e. number of tags that has the data inside the particular *.hdb file. From this number, we can deduce that there are as much as 0x65 (101) tags information inside the *.hdb that corresponds to this *.idx file. Each of the tag will have arbitrary time serial data inside the *.hdb file.

To determine which tag information contained inside the *.hdb file, let’s view the decompressed *.idx file content as follow:


The red box denotes the UTID of the tag name, as for the blue one denotes how many intervals of time series data for the given UTID. In the above example, then the UTID is 0xEF (239) and # of intervals is 0x3D (61).

Since there are 101 tags inside the *.hdb file, there should be some method to perform the traversal inside the decompressed *.idx file to determine next tag entry information.

This is done by using the 3 steps of formulas as follow:


Using the above formula:


The value of 0x26C will be used as an offset inside the decompressed *.idx as follow:


So, the next index will have an UTID of 0x6AF (1711).

Now, given the UTID 239 and 1711, what’s the tag name for these UTIDs ?

This information is located at the [x]_startup.mac, where [x] is the database name, so when the database name is dbtest, then it’s inside dbtest_startup.mac:


To perform view of the data, you can create the empty database and empty group, copies the corresponding *.hdb and *.idx file to the group folder and fire up MHAdmin.exe. If you get the index entries error (utid not found) in the *.log file:


Make sure you have copied the tag name and trend data from original *.mac file, and make sure the GID inside the startup file matches the GID in the running empty group before restarting the MHAdmin.exe:


And now you can view the time series data inside this *.hdb with ease 🙂



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: