"Protocols" are defined through 2 file types.
The first is .json, which contains the default settings and optional codes.
The .csv files hold the registry or address definitions.
CSV = comma separated values... spreadsheets. Delimiter for csv can be , or ; ( not both ).
| variable name | data type | register | documented name | description | writable | values | read interval |
|---|
Provides a user-friendly name to work with, while retaining the original documented name as a lot of variable names are up to interpretation.
Original variable name provided from protocol documentation; when variable name is not specified, this name is used.
Defines the expected data type for the register / map entry.
| Type | Description |
|---|---|
| USHORT | A two byte ( 16 bit ) (unsigned) positive number. For protocols that return 2 byte values, this is the default type. |
| SHORT | A two byte ( 16 bit ) (signed) number (-32,768 to 32,767). |
| UINT | A four byte ( 32 bit ) positive number. |
| INT | A four byte ( 32 bit ) signed number (positive or negative). |
| 16BIT_FLAGS | two bytes split into 16 bits, each bit represents on/off flag which is defined as b#. this will translate into 16x 0/1s if no "codes" are defined. |
| 8BIT_FLAGS | A single byte split into 8 bit flags. see 16BIT_FLAGS |
| 32BIT_FLAGS | four bytes split into 32 bit flags. see 16BIT_FLAGS |
| #bit | A unsigned number comprised of # of bits. for example, 3bit is a 3 bit positive number (0 to 7). |
| ASCII | ascii text representation of data. |
| ASCII.# | for protocols with an undefined "registry" size, the length can be specified. ie: ASCII.7 will return a 7 character long string. |
| HEX | hex text representation of data. |
In the case of protocols with inconsistent byte order implementations.
A suffix of "_BE" can be added to a data type to ensure the entry is read with a big endian byte order, ie: ASCII_BE.
A suffix of "_LE" can be added to a data type to ensure the entry is read with a little endian byte order, ie: ASCII_LE.
Register defines the location, or for other protocols, the main command / id. The registers are defined in decimal form. A prefix of "x" is acceptable for hexadecimal.
For ASCII or other MultiRegister Data Types, register ranges can be defined:
7~14
A prefix of "r" will specify that the registers be "read" in backwards order.
r7~14
Bit offsets are specified with .b#, # being the bit offset.
#.b#
Byte offsets are specified with .#, # being the byte offset.
#.#
Mainly for registers / entries that support writing, such as the holding register for modbus.
R = Read Only
RD = Read Disabled
W = Write
there are two main purposes for this column.
-
Defines possible values / ranges of values for protocol validation / safety, for example:
0~100 -
Defines the values for flag data types, such as 16BIT_FLAGS; any data type can be used. The format for these flags is json. These flags / codes can also be defined via the .json file by naming them as such: "{{document_name}}_codes"
Provides a per register read interval; the minimum value is the configured transport read interval.
- x: for
read_intervalfrom transport config * # - s: for plain old seconds
- ms: for milliseconds
for example:
[transport.modbus]
read_interval = 7
7x
Would set the read interval for that register to 49 seconds.
7s
Would set the read interval to 7s.
1s
Because the transport read interval is 7 seconds, the read interval would effectively be 7 seconds.
{"b0" : "StandBy", "b1" : "On"}
Some protocols utilize combinations of bits as flags.
{"b0" : "StandBy", "b0&b1" : "Operational", "b1" : "Error" }
{"75" : "Error", "50": "Warning"}