def METHOD_NAME(self, data):
    """
    Writes data to device or interface synchronously.
    """
    if self.closed:
        raise RuntimeError("Trying to write to a closed instrument")
    cmd = data.rstrip()
    if _USE_DEBUG:
        print("DBG-Mock: write", cmd)
    # setxx <axis> <val> --> <kenn> = <val> <unit>
    # getxx <axis> <val> --> <kenn> = <val> <unit>
    if cmd.startswith('set'):
        if _USE_ECHO:
            self.answer = [ cmd, 'OK' ]
        else:
            self.answer = [ 'OK' ]
        tmp = cmd.split()
        cmd = tmp[0].replace('set','get') + ' ' + tmp[1]
        if cmd in self.cmddef:
            val = self.cmddef[cmd]
            if isinstance( val, (list, tuple) ):
                val = val[0]
        else:
            val = ""
        val = val.split(' = ')
        if len(val) == 2:
            unit = val[1].split()
            if len(unit) > 1:
                unit = unit[1]
            else:
                unit = ""
            setval = [ val[0]+' = '+tmp[2]+' '+unit ]
            self.cmddef.update( {cmd: setval} )
        else:
            self.cmddef.update( {cmd: tmp[2]} )
    elif cmd in self.cmddef:
        if _USE_ECHO:
            self.answer.append(cmd)
        for c in self.cmddef[cmd]:
            self.answer.append(c)
        if self.answer[-1] != 'ERROR':
            self.answer.append( 'OK' )
    else:
        if _USE_ECHO:
            self.answer.append(cmd)
        self.answer.append('OK')
    return len(cmd), pyvisa.constants.StatusCode.success