CAN
The CAN driver for MBS gateways can read and write values from CAN-BUS. CAN messages have a CAN idetentifier and up to 8 bytes of data. Identifiers with 11-bit (0x000 bis 0x7FF) are supported. The support for 29-bit identifiers (CAN 2.0B) can be activated via configuration.
When writing all 8 bytes are always transmitted. Bits which are not belonging to the information are preset to „0“ resp. can be pre-defined by „nomval“.
The name of the CAN driver is: can
The routing address of the first CAN driver is: 1450
The data point list for the first CAN driver is: can1.txt
The configuration file for global settings of the CAN driver is: can1.cfg
For the CAN driver as well as all other gateway drivers the data point definitions are as follows:
Type | Description |
---|---|
M | Integer value (binary data points, counters) which can/shall only be read by the gateway |
S | Integer value which can be either read or written by the gateway. (to M-BUS writing is not possible) |
X | Floating point value (with decimal place) which can/shall only be read by the gateway |
Y | Floating point value (with decimal place) which can be either read or written by the gateway. (to M-BUS writing is not possible) |
A | String, is used e.g. with BACnet Trends and ESPA4.4.4 data points |
Addresses are defined as follows „raw <Identifier>.<Start-Byte>.<Start-Bit>.<Bitamount>“
The following definition is valid:
Parameter | Range of value | Description |
---|---|---|
<Identifier> | 0x000 - 0x7FF | Hexadecimal value of the CAN-Identifier |
<Start-Byte> | 0 - 7 | Index of Start-Bytes |
<Start-Bit> | 0 - 7 | Index of Start-Bits |
<Bitamont> | 1 - 64 | Amount of bits for this data point 1=Bool 8=Byte 16=Word 32=Doubleword or Float 64=Double |
The data point's format is defined as follows:
Format | Data Type | Range |
---|---|---|
BIT | Boolean | 0 or 1 |
UINT8 | Byte | 0 - 255 |
SINT8 | Byte | -128 - 127 |
UINT16 | Word | 0 - 65535 |
SINT16 | Word | -32768 - 32767 |
UINT32 | Doubleword | 0 - 4294967296 |
SINT32 | Doubleword | -2147483648 - 2147483647 |
FLOAT32 | Float | Floating-value 32 Bit |
FLOAT64 | Double | Floating-value 64 Bit |
The order of the bytes are defined within the format definition:
Format | Data Type | Range | Result |
---|---|---|---|
S:1 | Word Doubleword | 0x01 0x04 0x01 0x00 0x00 0x00 | 260 16777216 |
S:0 | Word Doubleword | 0x01 0x04 0x01 0x00 0x00 0x00 | 1025 1 |
Following limitations are valid for defining Start-Byte, Start-Bit and Bit amount when defining data points:
- The starting bit must be „0“, only exception is Boolean data points.
- Start-Byte + Start-Bit + Bitanzahl must not exceed 64 Bit. (e.g. Start-Byte 7 cannot be a Word data type)
Typical data point definitions:
# failure data point
[M failure] name = Communication failure query = pe
# Actual values
[M raw 1ca.0.0.1] name = Cooling (0=off, 1=on) (Byte 0, Bit 0 of the identifier 0x1ca) query = pe format = BIT
[X raw 2ca.0.0.32] name = Temperature in °C (Byte 0 to 3 of the identifier 0x2ca) query = pe format = FLOAT32
[M raw 2ca.4.0.16] name = Operation hours (Byte 4 to 5 of the identifier 0x2ca) query = pe format = UINT16
[M raw 2ca.6.0.8] name = Wattage in % (Byte 6 of the identifier 0x2ca) query = pe format = UINT8
# Given values
[S raw 10c.0.0.1] name = Cooling on/off (Byte 0, Bit 0 of the identifier 0x10c) nomval = 0 query = pe format = BIT
[Y raw 20c.0.0.32] name = Given-temperature in °C (Byte 0 to 3 of the identifier 0x20c) nomval = 40 query = pe format = FLOAT32