Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

Markdown from a URL
Based on  http
jamod/ and this adapter allows to connect to modbus tcp sources.


  • slave: The address of the server to connect to
  • port: The port where the service is found
  • ref: the position to start
  • count: the number of bytes to read
  • function_code: The function to use: 2 = READ_INPUT_DISCRETES, 3= READ_MULTIPLE_REGISTERS, 4= READ_INPUT_REGISTERS;
  • unitid (integer): The id of the unit to use.
  • If the source needs to be initialized:
    • write_function_code: The init function to be used: 5 = WRITE_COIL, 15 = WRITE_MULTIPLE_COILS, 16 = WRITE_MULTIPLE_REGISTERS

    • write_ref: The write position to start.

    • Depending on the function code, different values are needed

      • WRITE_COIL: a boolean e.g. ['write_boolean','true']
      • WRITE_MULTIPLE_COILS: a bitvector e.g. ['write_bitvector','10101']

      • WRITE_MULTIPLE_REGISTERS: a comma separated list e.g.: ['write_registers','100,23435,3453,452']

Depending on the function code, this operator needs different schemas in output:

READ_INPUT_DISCRETES: Return a tuple with a BitVector attribute. (TODO: describe MEP-Functions: toLong, [], and subset, BitSet is interpreted from left to right)

READ_MULTIPLE_REGISTERS:Returns a tuple with a List<Integer> attribute.

READ_INPUT_REGISTERS: Returns a tuple with a List<Integer> attribute.

Code Block
modbussource := RETRIEVE({
            transport = 'modbustcp',
            source = 'modbussource',
            datahandler = 'tuple',
            protocol = 'none',
            schema = [['value', 'BitVector']], // or [['value',List<Integer>]]
            options = [

out1 = MAP({
            expressions = [
                'value [0]',
                'value [1]',
                'value [2]',
                'value [3]',
                'value [4]',
                'value [5]',
                'value [6]',
                'value [7]'