Skip to content

4.2. Defaults

John edited this page Dec 25, 2015 · 8 revisions

Usually, field values can not only be read from a device but also be written to that device. In order to avoid duplicate message definitions, defaults can be used.

A row starting with a star symbol "*" in front of a message type defines the defaults for further rows in that file. The defaults will then be used for blank columns of a message definition with that message type (ignoring the poll priority).

One exception to this generic approach is the "ID" column: The value of the ID column in a defaults row will be prepended to the "ID" column in message definitions of that type having an empty "PBSB" column.

Fields part of a defaults row will be prepended to the fields of a message definition of that type.

Example

By using defaults, the example from the previous chapter can be reduced to this:

type circuit name comment QQ ZZ PBSB ID field1 part type/templates divider/values unit comment field2 part type/templates divider/values unit comment
*r ehp 08 B509 0D
*w ehp 08 B509 0E
r1 brinetemp 0F00 temp D2C °C temperature sensor UCH 0=ok;85=circuit;170=cutoff sensor status
r;w brinetempcal CD00 calibration D2C K
Download CSV

Defaults for conditions

There is another version of a defaults row when it starts with "*[". In this case, the row defines a condition that can be used for conditional messages. See Conditions for details.