Query#
Sends a string (command) to the selected device and outputs the response as a character string.
Description#
Sends the entered string (command) to the selected device via the communication interface (TCP/IP, RS232, GPIB) defined for the device. A termination character (LF, CR, CR and LF or Null) is added to the entered string and the string is encoded (ISO 8859-1) as set in the device properties. After sending, the test waits for a response from the device. The received data from the device is decoded into a string using the set character encoding. Data is received until a termination character is encountered. If no response is received within the specified communication timeout the test will fail. The communication interface, timeout, termination character and encoding can be set (if the respective option is available) for the corresponding device in the device manager.
Input parameters#
| Parameter | Description |
|---|---|
| Device | The device to which the command is sent. |
| Command | The string that is send to the selected device. Must be not empty. (character encoding as set in device properties if this option is available) |
Output parameters#
| Parameter | Description |
|---|---|
| Receive | The received data as string (character encoding as set in device properties if this option is available). |
Supported devices#
Every device that is available in the device manager.
Example#
Goal:
Sending the *IDN? command to a device that can process SCPI commands and receive a response.
Setup:
Connect a device (that can process SCPI commmands) to the computer running Measmatic over TCP/IP.
flowchart LR
A(Measmatic) o---o |TCP/IP| B(Device)
In the device manager add a new generic device to the current test site configuration. Change the name, the IP address and port in the device properties of the device.
Measmatic setup:
- Add a new Query test to the test sequence by dragging and dropping a Query test from the test picker into the test sequence.
- Select the device in the Device selector and enter IDN? into the Command* input.
- Execute the test in Measmatic by pressing the run all tests or run single test (when the Query test is selected) button. If the device returns a response, this is output as a string in the result section.
See also: