dso_basic module

class dso_basic.DsoBasic

Bases: object

autoset()

Set DSO Autoset

close()

close connection

connect(host: str = 'localhost', port: int = 32767)
Parameters:

port (int, optional) – port number. Defaults to 32767 is internal connection.

default()

Set DSO Default

force()

Forces an acquisition.

get_key()
get_samplerate() float

Get samplerate

Returns:

samplerate

Return type:

float

get_waveform_num(ch: int, real_value: bool = True, pos_consider: bool = True) list

This function can get waveform data as numbertic array

Parameters:
  • ch (int) – channel

  • real_value (bool, optional) – True will return real world value or it will return dso value. Defaults to True.

  • pos_consider (bool, optional) – The DSO value consider position or not. Defaults to True.

Returns:

waveform data

Return type:

list

idn() str

Get *IDN

Returns:

*IDN string

Return type:

str

is_ch_support(ch: int) bool

Check the channel is valid or not.

Parameters:

ch (int) – channel number

Returns:

True or False

Return type:

bool

is_run() bool

Check now DSO status

Return type:

bool

load_waveform_csv(file: str, real_value: bool = True, checklen: bool = True, pos_consider: bool = True) tuple[dict, list]

You can read dso waveform csv file.

Parameters:
  • file (str) – Waveform file full path.

  • real_value (bool, optional) – True will return real world value or it will return dso value. Defaults to True.

  • checklen (bool, optional) – False will ignore waveform length check. Defaults to True.

  • pos_consider (bool, optional) – The DSO value consider position or not. Defaults to True.

Returns:

The waveform header info and value.

Note

For single channel file :

  • They both 1-D.

For all channel file :

  • They both Multi-D.

    First channel’s will be info[0] and waveform[0].

    Second channel’s will be info[1] and waveform[1]. and so on.

Return type:

tuple[dict, list]

opc() str
Return type:

str

query(cmd: str) str

SCPI command query

Parameters:

cmd (str) – SCPI command

Returns:

SCPI return

Return type:

str

Note

You can query “*IDN?” SCPI command, to query return value by yourself. Try use:

.query(’*IDN?’)

readline() str
Returns:

return string

Return type:

str

run()

Set DSO RUN

set_autoset_finescale(Fine_Scale: bool)

Set DSO Autoset fine scale

Parameters:

Fine_Scale (bool) – True will set the fine scale autoset on.

set_autoset_mode(AC_Priority: bool)

Set DSO Autoset mode

Parameters:

AC_Priority (bool) – Sets the autoset mode. True:AC Priorty; False:Fit Screen.

single()

Set SINGLE

stop()

Set DSO STOP

vertical_autoset()

Set DSO Vertical Autoset

write(cmd: str)

SCPI command write

Parameters:

cmd (str) – SCPI command

Note

You can write “RUN” SCPI command, set DSO to RUN by yourself. Try use:

.write(‘RUN’)

You can write “STOP” SCPI command, set DSO to STOP by yourself. Try use:

.write(‘STOP’)

class dso_basic.ScreenBasic

Bases: object

The general screen information.

Depending on the DSO, the value may be different.

class dso_basic.ThemeBasic

Bases: object

The general theme color setting.

Depending on the DSO, the color hex value may be different.