mpylab.device.communication_debug module¶
This is the mpylab.device.communication_debug module.
- author:
Hans Georg Krauthäuser (main author)
- license:
GPLv3 or higher
- class mpylab.device.communication_debug.CommunicationDebug(idn, fout=None, fin=None)
Bases:
objectCommunicationDebug class.
- query(cmd, tmpl=None, send_opc=False)
- Parameters:
cmd – str, command to send
tmpl – str, a re pattern for re.match or None
send_opc – bool, append
; *OPC?to a non-query command
- Returns:
str or dict or None: dict with the parsed result
See read function for more explanation regarding the re pattern
- read(tmpl=None)
- Parameters:
tmpl – str, a re pattern for re.match or None
- Returns:
str or dict or None: dict with the parsed result or raw result as str or None if no match
- write(cmd)
- Parameters:
cmd – str, command to send
- Returns:
int: status code; number of bytes sent or 0