Automatic device search
- class SCPIDeviceSearcher
Search for Zahner devices.
Each Zahner device provides two serial interfaces via USB. The USB Product ID 0xA3AD is registered for Zahner.
With this class Zahner devices are searched and can be integrated more simply. For example in the Windows device manager you can’t see immediately which comports belong to which device, because the numbers of the comports can change.
This class always returns the names of the serial interfaces with the corresponding methods.
- searchDevices() list[str]
Search connected devices with IDN command.
It is NOT recommended to use this command, because it opens all serial ports of the computer and speaks to the devices with the string *IDN?, this could cause interference with the devices.
- Returns
Returns a list with serial numbers of connected Zahner devices. The serial numbers are strings.
- searchZahnerDevices() list[str]
Search connected devices with Zahner PID and VID and IDN command.
This command should be used to search for Zahner devices. Only Zahner devices are addressed for identification with this command.
- Returns
Returns a list with serial numbers of connected Zahner devices. The serial numbers are strings.
- searchSerialInterfacesWithZahnerVIDPID() list[str]
Search serial interfaces with Zahner PID and VID.
Checks the VID and PID of the serial interfaces, if it is a Zahner device.
- Returns
List with serial interface names with Zahner PID and VID.
- searchDevicesWithIDN(ports: str = None) list[str]
Search connected devices with IDN command.
Opens all serial interfaces and sends the string *IDN? to the device and evaluates the response. If a list of serial interfaces is passed for the ports parameter, only this list of ports is checked.
- Parameters
ports – List of serial interface names to be scanned.
- Returns
Returns a list with serial numbers of connected Zahner devices. The serial numbers are strings.
- selectDevice(serialNumber: Optional[Union[int, str]] = None) Tuple[SerialCommandInterface, SerialDataInterface]
Select a found device.
This method selects a device by its serial number. If no serial number is passed, then the first found device is selected. The serial number must be specified as a string.
This function returns two values the command comport and the online live data comport. If the respective comport is not found None is returned.
The data has to be read from the online channel, otherwise the measuring device hangs. The online channel can also be used by other software like the Zahner-Lab to use it as a display.
- Parameters
serialNumber – The serial number of the device to select as str or int specify None to select the first device found.
- Returns
Two strings commandInterface, dataInterface with the port names.
- getCommandInterface() SerialCommandInterface
Select a found command interface.
Returns the name of the serial interface. If no device was selected before, the first one is selected. If no interface exists, None is returned.
- Returns
Returns a string with the name of the serial interface. None if no command interface was found.
- getDataInterface() SerialDataInterface
Select a found data interface.
Returns the name of the serial interface. If no device was selected before, the first one is selected. If no interface exists, None is returned.
- Returns
Returns a string with the name of the serial interface. None if no command interface was found.
- getMultimeterPort() Optional[str]
Returns the comport to which the multimeter is connected.
HP Multimeter is needed in-house, for calibration. This can be seen as an example if other serial devices are to be included in order to be able to find them.
- Returns
The first comport with an HP device.
- _getAvailableSerialInterfaceNames() list[str]
Detect the available serial interfaces.
This function determines the available serial interfaces independently of the platform.
- Returns
A List with available comport names.