functions
¶
Module containing helpers for the tm_devices package.
check_for_update
¶
check_for_update(package_name: str = PACKAGE_NAME, index_name: str = 'pypi') -> None
Check for an update for the provided package.
| Parameters: |
|
|---|
check_network_connection
¶
Check the network connection to the device using the external ping command.
| Parameters: |
|---|
| Returns: |
|---|
check_port_connection
¶
check_port_connection(
device_name: str, ip_address: str, port: int, timeout_seconds: int = 5
) -> bool
Check if the given port is open on the device.
| Parameters: |
|---|
| Returns: |
|
|---|
check_visa_connection
¶
check_visa_connection(config_entry: DeviceConfigEntry, visa_library: str, device_name: str) -> bool
Check if a VISA connection can be made to the device.
| Parameters: |
|
|---|
| Returns: |
|
|---|
create_visa_connection
¶
create_visa_connection(
device_config_entry: DeviceConfigEntry,
visa_library: str,
*,
retry_connection: bool = False,
second_connection_attempt_delay: int = 60,
verbose_connection_failure_logging: bool = True
) -> MessageBasedResource
Create a VISA resource.
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
detect_visa_resource_expression
¶
Check if a given string is a VISA resource expression.
This function will check if a string is a VISA resource expression and pull out the pieces needed to make a connection using the DeviceManager.
The pieces consist of
- The connection type, e.g. TCPIP, GPIB
(e.g. GPIB0). - The address of the device, an IP address
(with port separated by a colon for SOCKET connections), hostname, or
string in the format
model-serial. - The LAN device endpoint, e.g. “inst0”.
| Parameters: |
|
|---|
| Returns: |
|---|
get_model_series
¶
get_version
¶
get_visa_backend
¶
ping_address
¶
register_additional_usbtmc_mapping
¶
Register USBTMC connection information for a device that doesn’t have native tm_devices USBTMC support.
This function adds an additional mapping between the given model_series and the USBTMC
connection information provided. This mapping can then be used by tm_devices to create a
USBTMC connection to the device.
| Parameters: |
|
|---|
sanitize_enum
¶
sanitize_enum(value: str, enum_class: type[CustomStrEnum]) -> CustomStrEnum
Sanitize a string value into its enum value.
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|