usb package
usb.USB_server module
Provides direct access to USB-enabled hardware.
- class usb.USB_server.USBServer
Bases:
HardwareInterfaceServerProvides direct access to USB-enabled hardware.
- baud_rate(c, baud_rate=None)
baudrate(self, c, baud_rate=None)
Sets or gets the baudrate
- name = '%LABRADNODE%_usb'
- query(self, c, data)
Make a USB query, a write followed by a read.
This query is atomic. No other communication to the device will occur while the query is in progress.
- Parameters:
c – The LabRAD context
data (string) – The string to be written to the USB bus
- read(self, c, n_bytes=None)
Read from the USB bus.
- Parameters:
c – The LabRAD context
n_bytes (int, optional) – If specified, reads only the given number of bytes.
Otherwise –
None. (reads until the device stops sending. Defaults to) –
- Returns:
The bytes returned from the device, with leading and trailing whitespace stripped
- Return type:
string
- refresh_available_interfaces()
Fill self.interfaces with available connections using Python VISA
- termination(self, c, write=None, read=None)
Sets or gets the read or write terminations.
- Parameters:
- Returns:
A tuple containing the write and read terminations.
- Return type:
- timeout(self, c, timeout=None)
Sets the timeout associated with the interface
- Parameters:
c – The LabRAD context
timeout (numeric, optional) – The timeout for the interface in seconds. Defaults to None.
- Returns:
The timeout in milliseconds
- write(self, c, data)
Write a string to the USB bus.
- Parameters:
c – The LabRAD context
data (string) – The string to be written to the USB bus