Skip to content

4.3. Builtin data types

John edited this page Sep 24, 2022 · 17 revisions

The builtin data types supported by the daemon all have a name built of three alphanumeric characters.
Many of these types have a fixed length binary representation (i.e. the number of bytes "on the wire").

For types with adjustable length, the desired width can simply be appended after a colon, e.g. "HEX:4" would be four hex bytes. Types marked with a "*" in the "length" column also support consuming the remainder length of the input by using a "*" instead of a fixed number of bytes, e.g. "HEX:*".

For the bit types "BI0"-"BI7" the length suffix is the number of bits, whereas for all other types it is the number of bytes.

The following base data types are available:

DATATYPE description format example binary length binary representation
IGN ignored data 1-31,*
STR character string "Hello " 1-31,* filled up with space
NTS character string "Hello " 1-31,* filled up with 0x00
HEX hex digit string hex octet separated by space "0a 1b 2c 3d" 1-31,*
BDA BCD date "dd.mm.yyyy" "30.12.2015" 4 day first, including weekday, Sunday=0x07
BDA:3 BCD date "dd.mm.yyyy" "30.12.2015" 3 day first, excluding weekday
BDZ BCD date "dd.mm.yyyy" "30.12.2015" 4 day first, including weekday, Sunday=0x06
HDA hex date "dd.mm.yyyy" "30.12.2015" 4 day first, including weekday, Sunday=0x07
HDA:3 hex date "dd.mm.yyyy" "30.12.2015" 3 day first, excluding weekday
DAY date in days "dd.mm.yyyy" "30.12.2015" 2 days since 01.01.1900
DTM date+time in minutes "dd.mm.yyyy hh:mm" "30.12.2015 22:57" 4 date+time in minutes since 01.01.2009
BTI BCD time "hh:mm:ss" "22:57:35" 3 seconds first
HTI hex time "hh:mm:ss" "22:57:35" 3 hours first
VTI hex time "hh:mm:ss" "22:57:35" 3 seconds first
BTM BCD time "hh:mm" "22:57" 2 minutes first
HTM hex time "hh:mm" "22:57" 2 hours first
VTM hex time "hh:mm" "22:57" 2 minutes first
MIN time in minutes "hh:mm" "22:57" 2 minutes since last midnight
TTM truncated time "hh:m0" "22:50" 1 multiple of 10 minutes
TTH truncated time "hh:m0" "22:50" 6 bits multiple of 30 minutes
TTQ truncated time "hh:mm" "22:45" 7 bits multiple of 15 minutes
BDY weekday "Mon"..."Sun" "Wed" 1 Sunday=0x06
HDY weekday "Mon"..."Sun" "Wed" 1 Sunday=0x07
BCD unsigned BCD 0...99 35 1
BCD:2 unsigned BCD 0...9999 135 2
BCD:3 unsigned BCD 0...999999 10035 3
BCD:4 unsigned BCD 0...99999999 1000035 4
HCD unsigned hex BCD 0...99999999 1000035 4 each BCD byte converted to hex
HCD:1 unsigned hex BCD 0...99 35 1 each BCD byte converted to hex
HCD:2 unsigned hex BCD 0...9999 135 2 each BCD byte converted to hex
HCD:3 unsigned hex BCD 0...999999 10035 3 each BCD byte converted to hex
PIN unsigned BCD 0000...9999 0123 2
UCH unsigned integer 0...254 135 1
SCH signed integer -127...127 110 1
D1B signed integer -127...127 -110 1
D1C unsigned number 0.0...100.0 30.5 1 fraction 1/2 = divisor 2
D2B signed number -127.99...127.99 110.23 2 fraction 1/256 = divisor 256
D2C signed number -2047.9...2047.9 630.3 2 fraction 1/16 = divisor 16
FLT signed number -32.767...32.767 30.567 2 low byte first, fraction 1/1000 = divisor 1000
FLR signed number reverse -32.767...32.767 30.567 2 high byte first, fraction 1/1000 = divisor 1000
EXP signed float number -3.0e38...3.0e38 30.567 4 low byte first
EXR signed float number reverse -3.0e38...3.0e38 30.567 4 high byte first
UIN unsigned integer 0...65534 12345 2 low byte first
UIR unsigned integer reverse 0...65534 12345 2 high byte first
SIN signed integer -32767...32767 12345 2 low byte first
SIR signed integer reverse -32767...32767 -12345 2 high byte first
U3N unsigned 3 byte int 0...16777214 12345 3 low byte first
U3R unsigned 3 byte int reverse 0...16777214 12345 3 high byte first
S3N signed 3 byte int -8388607...8388607 12345 3 low byte first
S3R signed 3 byte int reverse -8388607...8388607 -12345 3 high byte first
ULG unsigned integer 0...4294967294 1234567890 4 low byte first
ULR unsigned integer reverse 0...4294967294 1234567890 4 high byte first
SLG signed integer -2147483647...2147483647 1234567890 4 low byte first
SLR signed integer reverse -2147483647...2147483647 -1234567890 4 high byte first
BI0 bit 0 0...1 (0...127 if > 1 bit) 1 1-7 bits
BI1 bit 1 0...1 (0...127 if > 1 bit) 0 1-7 bits
BI2 bit 2 0...1 (0...63 if > 1 bit) 1 1-6 bits
BI3 bit 3 0...1 (0...31 if > 1 bit) 0 1-5 bits
BI4 bit 4 0...1 (0...15 if > 1 bit) 1 1-4 bits
BI5 bit 5 0...1 (0...7 if > 1 bit) 0 1-3 bits
BI6 bit 6 0...1 (0...3 if 2 bits) 1 1-2 bits
BI7 bit 7 0...1 0 1 bit
contributed types:
TEM_P TEM parameter "0-0"..."31-255" "8-155" 2 group/id stored in different bits depending on master/slave part

Note: The length column is in bytes unless otherwise stated and the minimum length is also used as default length.