Search
MENU
  • Expressions
  • System architecture by project type
  • Users and Permissions
  • Configuration

    Modbus is an open communication protocol. It is typically being used for integration with HVAC devices.

    Core comes with three bus terminals. Besides TapHome internal bus they also support Modbus RTU. The LAN port on Core supports Modbus TCP. This means that you don’t need to buy any extra device from TapHome in order to connect to Modbus devices.

    Setup

    In Settings → Hardware → Modbus, define new interface:

    • Modbus RTU (Define terminal: BUS1, BUS2 or BUS3)
    • Modbus TCP (Define IP address for each device)

    If you are using Modbus RTU (via RS485 cable), make sure that terminal where your Modbus device is connected is not used for TapHome Bus. Keep in mind that you can use more than one modbus device on the same BUS but they have to use the same general modbus settings (Baudrate, Parity, Data Bits, Stop Bits) and specific Slave ID for each connected device.

    It is not possible to combine Modbus RTU devices with TapHome Bus devices on one terminal. Both interfaces are electrically compatible, but use completely different communication protocol.


    Modbus communication general settings (provided by manufacturer in manual)

    Implementation within Taphome:

    Modbus communication table provided by manufacturer

    Implementation within Taphome

    If the communication does not work in the following test, try changing the registers' addresses by -1 or +1 compared to the values in the table. This usually helps.

    In Modbus RTU or Modbus TCP interface, you can either add set of devices from template: https://taphome.atlassian.net/wiki/spaces/SUP/pages/15695874/Simple+configuration+using+templates, or define your own:

    Supported Modbus device types

    Use generic device types to define custom Modbus integration:

    Device type

    Visualisation

    Variable for write expressions

    Temperature sensor


    -- read-only --

    Thermostat


    Se

    Switch


    St

    Multi-value Switch

     

    Mu

    Dimmer / Analog Output


    Le

    Electric meter


    -- read-only --

    Modbus Wrapper


    -- read-only --

    Reed contact


    -- read-only --

    Variable

    Va

    Reading and writing values

    Types of Modbus Registers

    • C – Coil (1-bit, read/write)
    • SC – Single Coil (1-bit, read/write)
    • D – Discrete input (1-bit, read only)
    • H – Holding register (16-bit, read/write)
    • SH – Single holding register (16-bit, read/write)
    • A – Analog input (16-bit, read only)

    The ‘S’ register types are only for write functions and should be used for devices which do not support writing to multiple registers at once.

    Data Types

    • Int16 (-32,768 to 32,767)
    • Uint16 (0 to 65,535)
    • Int32 (-2,147,483,648 to 2,147,483,647)
    • Uint32 (0 to 4,294,967,295)
    • Float (IEEE 754 Single precision floating point)
    • Bool – (-inf, 0> = false, (0, inf) = true
    • BigEndianInt16
    • LittleEndianInt16
    • BigEndianUint16
    • LittleEndianUint16
    • BigEndianInt32
    • LittleEndianInt32
    • BigEndianUint32
    • LittleEndianUint32
    • BigEndianFloat
    • LittleEndianFloat

    BigEndian is the default setting for each data type e.g. Int32 is the same as BigEndianInt32.

    MODBUSR (MODBUS READ)

    MODBUSR(register_type, register_address, data_type)
    Example: MODBUSR(H, 20, Int16)/100

    Returns value of holding register on address 20 in int16 format and divides it by 100.

    MODBUSW (MODBUS WRITE)

    MODBUSW(register_type, register_address, data_type, value_to_write)
    Example: MODBUSW(H, 20, Int16, Te/100)

    Writes the temperature of the sensor divided by 100 int int16 format to holding register 20.

    MODBUSWNE (MODBUS WRITE NOT EQUAL)

    Writes to the register only if the current value is different. Reads the value, checks if equal and writes to the register if not. Useful for saving EEPROM memory.

    MODBUSWNE(register_type, register_address, data_type, value_to_write)
    Example: MODBUSWNE(H, 20, Int16, Te/100)

    First reads the value from holding register on address 20 in int16 format, compares it to the temperature sensor temperature divided by 100 and only if the values are different writes the temperature of the sensor divided by 100 int int16 format to holding register 20.

    Register addresses can also be written in hexadecimal format e.g. 20 is the same as 0x14.

    Expressions

    Expressions

    Follow this link to find more information about expressions: https://taphome.com/en/support/41123985