usbtmc_query
Send SCPI query commands to a USBTMC device and retrieve the response directly, combining send and receive into one action.
Instructions
Send a SCPI command and immediately receive the response.
Use for QUERY commands (with '?') that request information from the device. For SET commands (without '?'), use usbtmc_send() instead.
This is a convenience function combining send and receive operations.
Args: params (QueryInput): Input containing: - device_id (int): The unique identifier returned by usbtmc_connect() - command (str): SCPI command string to send (usually ends with '?') - wait_time (float): Time to wait between send and receive (default: 0.1s) - max_bytes (int): Maximum bytes to read (default: 1024)
Returns: dict: Result containing: - success (bool): Whether the query was successful - device_id (int): The target device_id - command (str): The command that was sent - response (str or None): Response data, or None if no data/timeout - message (str): Success or error message
Note: Wait time recommendations: - Simple queries (*IDN?, status): 0.1s (default) - Querying existing measurements: 0.1s - After changing settings: 0.5-2.0s
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||