plestylib.solver.scpi#

Classes#

SCPISolver

Build SCPI command strings for parameter writes and queries.

Module Contents#

class plestylib.solver.scpi.SCPISolver#

Bases: plestylib.solver.CmdSolver

Build SCPI command strings for parameter writes and queries.

This solver converts ConfigParameter.command values into SCPI-compliant command strings and handles common Python value types for write operations.

get_write_cmd(cfg_param, value)#

Build a SCPI write command for the given parameter value.

Parameters:
  • cfg_param – Parameter metadata containing a SCPI command base.

  • value – Value to serialize into command payload.

Returns:

A formatted SCPI write command string, or None when no command is defined on cfg_param.

Notes

Supported value types are str, int, float, bool, list, and tuple. Booleans are converted to 1/0 and sequences are comma-joined.

get_query_cmd(cfg_param)#

Build a SCPI query command (? suffix) for a parameter.

Parameters:

cfg_param – Parameter metadata containing a SCPI command base.

Returns:

Query command string like <CMD>?, or None if undefined.

get_param_min_cmd(cfg_param: plestylib.solver.ConfigParameter) str | None#

Build a SCPI command to query the parameter minimum value.

Parameters:

cfg_param (plestylib.solver.ConfigParameter) – Parameter metadata containing a SCPI command base.

Returns:

Query command string like <CMD>:MIN?, or None if undefined.

Return type:

str | None

get_param_max_cmd(cfg_param: plestylib.solver.ConfigParameter) str | None#

Build a SCPI command to query the parameter maximum value.

Parameters:

cfg_param (plestylib.solver.ConfigParameter) – Parameter metadata containing a SCPI command base.

Returns:

Query command string like <CMD>:MAX?, or None if undefined.

Return type:

str | None