Follow

Editing MTB Files

MTB is a binary Motion Tracker file. It can contain Sensor Component Readout data, data that was
already processed by the Strapdown algorithm, GPS messages, and (onboard) processed data.


When you are interested in only a part of the file or when a file is too large to be handled, it can be
convenient to edit the MTB file, before processing it in MT Manager. This application note describes
how to split an MTB file in two parts and how to safely remove data from an MTB file.


When editing an MTB file, it is important to keep the structure of the MTB file intact as this is the only
way MT Manager can read in MTB files. Also take care in cutting and copying parts of the file: a small
mistake of only one byte (e.g. forgetting to copy a checksum), will make the file corrupt.


Disclaimer: should you not be able to read in MTB files after you have edited these, but the original
file is readable, please perform the procedure again. Xsens’ support department will not provide
support on individual, edited MTB files that don’t work in MT Manager.

Splitting up an MBT File

In order to split up an MTB file, the following procedure must be followed:

  1. Load MTB file into a hex-editor
  2. Locate Configuration message/first data message
  3. Copy Configuration message to a new MTB file
  4. Cut data that needs to be saved in the new MTB file and paste it after the copied Configuration message
  5. Save both parts of the original file

Load the MTB file into a hex-editor, e.g. Free Hex Editor Neo. You will see the following:

It is convenient to change the number of columns, e.g. the size of the data messages (in Hex Editor
Neo: View -> Columns)


An MTB file first contains the configuration message, starting with FA FF 0D. You need this
configuration message in order to process data.

  • Locate the first data message, starting with FA FF 36 (FA FF 32 for legacy devices and legacy mode). In Hex Editor Neo, this is done by pressing CTRL-F, choose ‘Hex’ and type FAFF36. Confirm that this pattern of FA FF 36 is an actual data message and not a coincidence in the configuration message by looking at the length, displayed in hexadecimal format after FA FF 36: e.g. “FA FF 36 35” … means that after 54 bytes a new sequence of FA FF 36 should appear.

  • Copy (don’t cut) everything before this first FA FF 36. Copy this into a new file (CTRL-N).
    Note that this configuration message can only be used when the configuration of the MTi
    does not change!

  • Split the original data file. Go to e.g. the middle of the file by scrolling down and locate a random tart of a data message (FA FF 36). Select the FA-byte and scroll to the end of the MTB file, press shift and select the position after the last byte in the file. Cut the bytes selected.
  • Go to newly created file with the configuration message (ConfigMessage.mtb in the example
    above) and paste the bytes that you just cut from the other MTB file in here after the checksum of the configuration message (in this example, the checksum is 43):

  • If you did this correctly in Hex Editor Neo, the pasted data is red and starts with FA FF 36.
  • Save the message with extension .mtb. (File -> Save as ->....mtb). It may be useful to save this part with the original filename, followed by -part2. In this example, it would be MT_0770005A-001-
    part2.mtb
  • Close ConfigMessage.mtb without saving. This way, you can use this configuration message
    if you want to part an mtb file in more than 2 parts.
  • Save the original file (File -> Save as -> …..mtb). It may be useful to save this part as -part1:
    e.g. MT_0770005A-001-part1.mtb.
  • Close the original file without saving.

You now have two files that both can be processed in MT Manager:

Warning: Note that the behavior of the filter after the cut will be slightly different when the data is
processed as a whole or when the data is processed in the cut file. The reason is that the filter has to
reinitialize again.

Splitting up an MBT File

In order to shorten an MTB file, the following procedure must be followed:

  1. Load MTB file into a hex-editor
  2. When you want to delete the first part of a measurement:

a. Locate Configuration message/first data message

b. Delete required number of data messages

     3. When you want to delete the last part of a measurement:

         a. Locate the data message at the point where you want to end the file

         b. Delete the data message after this point

     4. Save file

It is not possible (or at least not recommended) to delete a middle part of an MTB file, as this will give large disruptions in the filter algorithm. 

Removing the first part of a MTB File

Load the MTB file into a hex-editor, e.g. Free Hex Editor Neo.

 

It is convenient to change the number of columns, e.g. the size of the data messages (in Hex Editor Neo: View -> Columns)

An MTB file first contains the configuration message, starting with FA FF 0D. You need this configuration message in order to process data.

  • Locate the first data message, starting with FA FF 36 (FA FF 32 for legacy devices and legacy mode). In Hex Editor Neo, this is done by pressing CTRL-F, choose ‘Hex’ and type FAFF36. Confirm that this FA FF 36 is an actual data message and not a coincidence in the configuration message, by looking at the length, displayed in hexadecimal format after FA FF 36: e.g. “FA FF 36 35” … means that after 54 bytes a new sequence of FA FF 36 should appear.

  • Remember the byte before FA FF 36 (this is the checksum of the configuration message). After this step, this byte should still be in the data and followed by FA FF 36. Select FA and scroll to that part of the MTB file that you want to remove. Press shift and select the first byte of a random FA FF 36 (so click on FA).
  • Delete the data messages.
  • Save the file. It is recommended to save the newly created file as a copy (e.g. File -> Save as -> MT_0770005A_001-copy.mtb).

Removing the last part of an MTB file

Load the MTB file into a hex-editor, e.g. Free Hex Editor Neo. You will see the following:

It is convenient to change the number of columns, e.g. the size of the data messages (in Hex Editor Neo: View à Columns)

 

An MTB file first contains the configuration message, starting with FA FF 0D. You need this configuration message in order to process data. Leave this configuration message in the file.

 

  • Go to the part of the file from where you want to delete data by scrolling down and locate a random start of a data message (FA FF 36). Confirm that this FA FF 36 is an actual data message by looking at the length, displayed in hexadecimal format after FA FF 36: e.g. “FA FF 36 35” … means that after 54 bytes a new sequence of FA FF 36 should appear. Select FA and scroll to the end of the MTB file, press shift and select the position after the last byte in the file.
  • Delete the data messages.
  • Save the file. It is recommended to save the newly created file as a copy (e.g. File -> Save as -> MT_0770005A_001-copy.mtb).
Was this article helpful?
0 out of 0 found this helpful
Do you have a question? Please post your question in our Community Forum