You are here: Tips and Tricks > Overwriting Summay-Pane Column Entries

Overwriting Summay-Pane Column Entries

Consider the following statements designed to decode an FP Set Actuator command in a rather fancier way than we did in the tutorial chapter:

GROUP cmdSetActuator

{

FIELD actuator_number (Fixed 1 Byte) (Decimal)

"Actuator Number" VERIFY (FieldIsBetween 1 32)

 

FIELD rpt_actnum START_BIT (Move -1 Byte) (Fixed 1 Byte)

(Constant "Set Actuator") ALSO (Decimal)

IN_SUMMARY "Command/Response" 0 SUPPRESS_DETAIL

 

FIELD actuator_value ;

}

The first two FIELD statements decode the actuator-number field twice. This might seem odd at first but can prove very handy. Specifically the first one decodes it for display in the Decode Pane and the second adds it to the display in the Summary Pane. You may find many other clever reasons to repeat a decode in this kind of way.

Note that the second statement includes a StartBit clause that moves the pointer backwards by one byte to the actuator-number field. The first format method produces a constant string "Set Actuator". The second format method formats the actuator number in decimal creating a combined result of, for example, "Set Actuator 3". This is then inserted into the Command/Response column in the Summary Pane. Note that this column will already have an entry that has been generated by the command_code FIELD. Here we are sneakily overwriting that field to add some more information to it. Finally we see the keyword SUPPRESS_DETAIL. That means nothing should be displayed in the Decode Pane ‐ which is exactly what we want because the previous statement produced the appropriate entry for that.

Two more notes about this pair of FIELDs. First, the second FIELD could be removed and the decoder would work perfectly well, just with slightly less information appearing in the Summary Pane. Second, when we decode the field the second time we are obliged to give it a new name.