2410_LSS100100/LSS100200_SW_03.0

Creating a New Modbus Device Profile

If your Modbus device profile is not included in the preinstalled profiles in the controller, you can define your own custom profile.

Follow these steps:

  1. File format: Modbus device profiles are distributed as *.json files. You can create and edit these files using a common text editor (such as Notepad or Notepad++). Remember to save the file with the extension *.json.

  2. Profile structure example:

    {
       "manufacturer": "Schneider Electric",
       "description": "Example device",
       "mapping": [
         {
               "name": "Output 1",
               "bus_datatype": "bool",
               "type": "coil",
               "address": 0,
               "writable": 1
         },
         {
               "name": "Input 1",
               "bus_datatype": "float16",
               "type": "inputregister",
               "address": 0,
               "value_multiplier": 0.001,
               "units": "V"
         }
       ] 
    }

    • The "mapping" table in the *.json file contains information for each Modbus register, coil, input, or output.

    • Adjust the mapping settings according to your specific device:

      Parameter

      Description

      Type

      Required

      Name

      Object name, e.g. Output 2

      String

      Yes

      bus_datatype

      KNX object data type, key from dt table, e.g. float32

      String/Number

      Yes

      type

      Modbus register type, possible values: coil, discreteinput, register, inputregister.

      String

      Yes

      address

      Register address (0-based)

      Number

      Yes

      writable

      Set to true to enable writing to register if type is either coil or register.

      Boolean

      No

      write_only

      Set to true to disable reading coil or register value when "writable" is enabled.

      Boolean

      No

      datatype

      Modbus value data type. If set, conversion will be done automatically. Possible values: bool,  uint16, int16, float16, uint32, int32, float32, uint64, int64, quad10k, s10k

      String

      No

      value_delta

      New value is sent when the difference between previously sent value and current value is larger than delta. Defaults to 0 (send after each read).

      Number

      No

      value_base

      Add specified number to the resulting value.

      Number

      No

      value_multiplier

      Multiply resulting value by the specified number,value = value_base + value * value_multiplier.

      Number

      No

      value_bitmask

      Bit mask to apply, shifting is done automatically based on least significant 1 found in the mask.

      Number

      No

      value_nan

      Array of 16-bit integers. If specified and read operation returns the same array no further processing of value is done.

      Array

      No

      value_conv

      Apply one of built-in conversion functions

      String (Int)

      No

      value_custom

      Name of a built-in enumeration or a list of key -> value mapping, resulting value will be 0 if key is not found.

      String/Object

      No

      internal

      Not visible to user when set to true, should be used for scale registers.

      Boolean

      No

      units

      KNX object units/suffix

      String

      No

      address_scale

      Address of register containing value scale, value = value * 10 ^ scale

      Number

      No

      read_count

      Number of register to read at once (for devices that only support reading of a specific block of registers)

      Number

      No

      read_swap

      Swap register order during conversion (endianness)

      Boolean

      No

      read_offset

      Position of first register of data from the block of registers (0-based).

      Number

      No

      timeout

      Specify device timeout in seconds.

      If the extension device does not reply within specified time, it is considered as timeout error.

      Default values: 0.5 s for Modbus RTU, 3 s for Modbus TCP

      Number

      No

      write_multiple

      This parameter set the multiple writing function (function 15 or 16 is used instead of function 5 or 6).

      If "Type" is set to "register" and "Write_multiple" is set to "true", Modbus function 16 is used for writing to the register.

      If "Type" is set to "coil" and "Write_multiple" is set to "true", Modbus function 15 is used for writing to the coil.

      Default value is "false", which means that Modbus function 5 or 6 (depending on register type) is used for writing.

      String

      No

  3. Upload to the controller:

    • Once you have created your *.json file with all the necessary profile information, upload it to the controller via ConfiguratorModbusProfilesAdd profile.

  4. Best practice:

    • When creating a new device profile, consider using an existing profile as an example or template. You can download existing profiles from the controller to understand the structure and syntax.

For detailed instructions on custom device profile creation, refer to the application note available at Schneider Electric website.

QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?