Modbus function WRITE_MULTIPLE_REGISTERS (0x10)

        :param regs_addr: registers address (0 to 65535)
        :type regs_addr: int
        :param regs_value: registers values to write
        :type regs_value: list
        :returns: True if write ok or None if fail
        :rtype: bool or None

def write_multiple_registers(self, regs_addr, regs_value):
        """Modbus function WRITE_MULTIPLE_REGISTERS (0x10)

        :param regs_addr: registers address (0 to 65535)
        :type regs_addr: int
        :param regs_value: registers values to write
        :type regs_value: list
        :returns: True if write ok or None if fail
        :rtype: bool or None
        """
        # number of registers to write
        regs_nb = len(regs_value)
        # check params
        if not (0x0000 <= int(regs_addr) <= 0xffff):
            self.__debug_msg('write_multiple_registers(): regs_addr out of range')
            return None
        if not (0x0001 <= int(regs_nb) <= 0x007b):
            self.__debug_msg('write_multiple_registers(): number of registers out of range')
            return None
        if (int(regs_addr) + int(regs_nb)) > 0x10000:
            self.__debug_msg('write_multiple_registers(): write after ad 65535')
            return None
        # build frame
        # format reg value string
        regs_val_str = b""
        for reg in regs_value:
            # check current register value
            if not (0 <= int(reg) <= 0xffff):
                self.__debug_msg('write_multiple_registers(): regs_value out of range')
                return None
            # pack register for build frame
            regs_val_str += struct.pack('>H', reg)
        bytes_nb = len(regs_val_str)
        # format modbus frame body
        body = struct.pack('>HHB', regs_addr, regs_nb, bytes_nb) + regs_val_str
        tx_buffer = self._mbus_frame(const.WRITE_MULTIPLE_REGISTERS, body)
        # send request
        s_send = self._send_mbus(tx_buffer)
        # check error
        if not s_send:
            return None
        # receive
        f_body = self._recv_mbus()
        # check error
        if not f_body:
            return None
        # check fix frame size
        if len(f_body) != 4:
            self.__last_error = const.MB_RECV_ERR
            self.__debug_msg('write_multiple_registers(): rx frame size error')
            self.close()
            return None
        # register extract
        (rx_reg_addr, rx_reg_nb) = struct.unpack('>HH', f_body[:4])
        # check regs write
        is_ok = (rx_reg_addr == regs_addr)
        return True if is_ok else None