You are here: Overview > Frontline DecoderScript | Decoder Structure

Structure of a Decoder

Our aim is to acquaint you with the most essential elements of DecoderScript and leave you with sufficient expertise so that you can write decoders of your own.

We will begin with a short basic overview of DecoderScript:

ComProbe turns this…

Stream of bytes

…into this:

 

Frame Display

To do this, ComProbe software uses a set of instructions called a decoder. A decoder is written in a language called DecoderScript

Here's the decoder, written in DecoderScript, that creates the Frame Display screen shown above:

 

// Copyright Monday, January 30, 2017 Frontline Test Equipment, Inc. All rights reserved.

"MyProtocol" 0x7f00fff7

DECODE

FIELD secs (Fixed 1 Byte) (Decimal) "Seconds"

FIELD distance (Fixed 1 Byte) (Decimal) "Distance"

END_MAIN_PATH

 

This is a very simple example which illustrates some very fundamental capabilities of DecoderScript.

The FIELD statements define the contents of the Frame Display. The first statement breaks down like this:

Contents of Frame Display
Item Description
Field Keyword that identifies the beginning of a field statement
secs Identifier of field definition statement.
(Fixed 1) Fixed is a size method and defines the size of the field.
(Decimal) Formats the output to be displayed in decimal format.
"Seconds" Display the value in the detail pane (lower-left corner of Frame Display) with the label "Seconds"

The decoder starts with a name ("MyProtocol" in this name that appears on the tab in Frame Display) and a value called a decoder ID. Each decoder must have a unique decoder ID.

To see the decoder above in action, do the following:

  1. Type the entire decoder into a file called mp.dec.
  2. Put file mp.dec into directory C:\Documents and Settings\All Users\Documents\Frontline Test Equipment\My Decoders.
  3. Run ComProbe software and do either a live capture or open a capture file.
  4. Open the Frame Display and do the following:

    • Select the Options menu
    • Select Protocol Stack…
    • Select __Build Your Own__
    • Press the Next button twice
    • Remove all entries from the Protocol Decode Stack list by selecting them and pressing the left arrow button.
    • Add the contents of mp.dec by selecting MyProtocol in the box on the left and pressing the right arrow button.
    • Press the Finish button.
    • In the Frame Display you will now see the packets decoded by your mp.dec decoder. It will appear on MyProtocol tab with the data decoded
    • To futher build on our short version of decoderscript writing, we will now begin to explain in a little more detail.