# Attocube Adapters

class `pymeasure.instruments.attocube.adapters.``AttocubeConsoleAdapter`(host, port, passwd, **kwargs)

  Bases: `pymeasure.adapters.telnet.TelnetAdapter`

  Adapter class for connecting to the Attocube Standard Console. This console is a Telnet prompt with password authentication.

  Parameters

    - host – host address of the instrument

    - port – TCPIP port

    - passwd – password required to open the connection

    - kwargs – Any valid key-word argument for TelnetAdapter

  `ask`(command)

    Writes a command to the instrument and returns the resulting ASCII response

    Parameters

      command – command string to be sent to the instrument

    Returns

      String ASCII response of the instrument

  `check_acknowledgement`(reply, msg='')

    checks the last reply of the instrument to be ‘OK’, otherwise a ValueError is raised.

    Parameters

      - reply – last reply string of the instrument

      - msg – optional message for the eventual error

  `extract_value`(reply)

    preprocess_reply function for the Attocube console. This function tries to extract <value> from ‘name = <value> [unit]’. If <value> can not be identified the original string is returned.

    Parameters

      reply – reply string

    Returns

      string with only the numerical value, or the original string

  `read`()

    Reads a reply of the instrument which consists of two or more lines. The first ones are the reply to the command while the last one is ‘OK’ or ‘ERROR’ to indicate any problem. In case the reply is not OK a ValueError is raised.

    Returns

      String ASCII response of the instrument.

  `write`(command, check_ack=True)

    Writes a command to the instrument

    Parameters

      - command – command string to be sent to the instrument

      - check_ack – boolean flag to decide if the acknowledgement is read back from the instrument. This should be True for set pure commands and False otherwise.