code: def _performCommand(self, functioncode, payloadToSlave):
          
          DEFAULT_NUMBER_OF_BYTES_TO_READ = 1000
  
          _checkFunctioncode(functioncode, None)
          _checkString(payloadToSlave, description='payload')
  
          # Build request
          request = _embedPayload(self.address, self.mode, functioncode, payloadToSlave)
  
          # Calculate number of bytes to read
          number_of_bytes_to_read = DEFAULT_NUMBER_OF_BYTES_TO_READ
          if self.precalculate_read_size:
              try:
                  number_of_bytes_to_read = _predictResponseSize(self.mode, functioncode, payloadToSlave)
              except:
                  if self.debug:
                      template = 'MinimalModbus debug mode. Could not precalculate response size for Modbus {} mode. ' + \
                          'Will read {} bytes. request: {!r}'
                      _print_out(template.format(self.mode, number_of_bytes_to_read, request))
  
          # Communicate
          response = self._communicate(request, number_of_bytes_to_read)
  
          # Extract payload
          payloadFromSlave = _extractPayload(response, self.address, self.mode, functioncode)
          return payloadFromSlave
docs: Performs the command having the *functioncode*.
  
          Args:
              * functioncode (int): The function code for the command to be performed. Can for example be 'Write register' = 16.
              * payloadToSlave (str): Data to be transmitted to the slave (will be embedded in slaveaddress, CRC etc)
  
          Returns:
              The extracted data payload from the slave (a string). It has been stripped of CRC etc.
  
          Raises:
              ValueError, TypeError.
  
          Makes use of the :meth:`_communicate` method. The request is generated
          with the :func:`_embedPayload` function, and the parsing of the
          response is done with the :func:`_extractPayload` function.