scpi - SCPI Interaction

Added in version pltOS: v2.0

Interact with an instrument using SCPI over USBTMC. Requires a supported USBTMC SCPI instrument attached to the PLT’s USB host.

handle is a free-form name (no ., /, :, or whitespace/newline characters) used to identify the connected instrument across connect, command, and query steps.

scpi connect - Connect to SCPI instrument

Locates the instrument’s USBTMC device and configures handle for use. If neither id: nor path: is given, the PLT selects the sole USBTMC device present; specify id: or path: to disambiguate when more than one instrument is attached.

Usage:

- command: scpi connect <handle>
  [retry: <retryCount>]
  [id: <usbDeviceID>]
  [path: <usbDevicePath>]
  [interface: <usbDeviceInterface>]

Argument

Description

handle

Used to refer to this instrument in further commands.

retryCount

Optional: Number of times to retry the test step

usbDeviceID

Optional: USB device identifiers: VID:PID.

usbDevicePath

Optional: USB device path: port. .port.

usbDeviceInterface

Optional: USB device interface: interface_number. Selects a specific interface when the device exposes more than one.

scpi command - Send a SCPI command

Send one or more SCPI commands (no response expected) to a previously connected instrument. The step fails if the transfer times out or the instrument reports an error.

The inline command argument, if given, is sent first; any with: entries are sent afterward, in list order. A step must specify at least one message, from either form.

Usage:

- command: scpi command <handle> [<command>]
  [retry: <retryCount>]
  [timeout: <timeout>]
  [with:
    [- <command>]
    [- <command>]
    [..]]

Argument

Description

handle

Handle of a previously connected SCPI instrument

command

SCPI command (for example: "*RST")

retryCount

Number of times to retry the test step (optional)

timeout

Timeout, with suffix or in milliseconds (default: 5000ms)

scpi query - Perform a SCPI Query

Send one or more SCPI queries to a previously connected instrument and capture the instrument’s response text as the step result.

As with scpi command, the inline command argument (if given) is sent first, followed by any with: entries in list order; at least one query must be specified.

Usage:

- command: scpi query <handle> [<command>]
  [extractKey: <key>...]
  [retry: <retryCount>]
  [timeout: <timeout>]
  [with:
    [- <command>]
    [- <command>]
    [..]]

Argument

Description

handle

Handle of a previously connected SCPI instrument

command

SCPI command query (for example: "*IDN?")

key

Key in which to store extracted text.

retryCount

Number of times to retry the test step (optional)

timeout

Timeout, with suffix or in milliseconds (default: 5000ms)

Examples