Device¶
Serial communication with a MultispeQ device to take measurements using protocols and send commands.
Serial Connection¶
Establish serial communication with MultispeQ device.
- connect(port=None, baudrate=115200, timeout=None)[source]¶
Connect a MultspeQ device to a serial port.
- Parameters:
port (str) – Port the MultisepQ is connected to.
baudrate (int) – Set the baudrate. Default is 115,200.
timeout (float) – Set the timeout. Derault is 0.01
- Returns:
Serial connection or None if connection fails.
- Return type:
serial
- Raises:
ValueError – if port is not defined
ValueError – if port is not provided as a string
ValueError – if baudrate is not defined or provided as an integer
ValueError – if timeout is not provided as a float
SerialExeption – if device is not connected
Commands¶
Commands are raw communication with the MultispeQ device.
- is_connected(connection=None)[source]¶
Test the connection to a MultispeQ.
- Parameters:
connection (serial) – Connection to the MultispeQ.
- Returns:
True if a MultispeQ is connected, otherwise False
- Return type:
bool
- get_memory(connection=None, verbose=False)[source]¶
Get the MultispeQ setting saved in its memory (EEPROM).
- Parameters:
connection (serial) – Connection to the MultispeQ.
- Returns:
Instrument data and CRC32 checksum
- Return type:
dict, str
- send_command(connection=None, command='', verbose=False)[source]¶
Send a command to a MultispeQ device.
- Parameters:
connection (serial) – Connection to the MultispeQ.
command (str) – Command
- Returns:
Instrument output
- Return type:
str
- Raises:
ValueError – if no connection is defined
ValueError – if command is not provided as a string
Exception – if connection is not open or device connected