src package

Submodules

src.MPDSnCxx_Interface module

class src.MPDSnCxx_Interface.MPDSnCxx_Interface(vid, pid, serial)[source]

Bases: object

connect_device(baudrate=9600, bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False, write_timeout=None, inter_byte_timeout=None, exclusive=None)[source]

Connect to the MPDSnCxx Interface.

Parameters:
  • baudrate (int, optional) – baudrate, by default 9600

  • bytesize (_type_, optional) – bytesize, by default pyserial.EIGHTBITS

  • parity (_type_, optional) – parity, by default pyserial.PARITY_NONE

  • stopbits (_type_, optional) – stopbits, by default pyserial.STOPBITS_ONE,

  • timeout (float, optional) – timeout, by default None

  • xonxoff (bool, optional) – xonxoff, by default False

  • rtscts (bool, optional) – rtscts, by default False

  • dsrdtr (bool, optional) – dsrdtr, by default False

  • write_timeout (float, optional) – write_timeout, by default None

  • inter_byte_timeout (float, optional) – inter_byte_timeout, by default None

  • exclusive (boolean, optional) – exclusive, by default None

create_fast_command(channel=None, frequency=None, powerP=None, powerD=None, switch=None, internal=None, store=None)[source]

Create formatted quick command to set the MPDSnCxx Radio Frequency Driver in normal mode

FULL Command: LxFfff.ffPppppDdd.ddOoIiE

Parameters:
  • channel (int,) – Channel selection (x= 1 to 8 for channels, 0 for BLK selection[Oo, Ii, only] )

  • frequency (float, optional) – Frequency adjustment (fff.ff = frequency value ex-142.26 - MHz, by default None

  • powerP (int, optional) – Power adjustment (pppp = 0 to 1023), by default None

  • powerD (float, optional) – Power adjustment (dBm, ex dd.dd=17.45), by default None

  • switch (int, optional) – Switch ON/OFF (o=1/0), by default None

  • internal (int, optional) – Internal mode ON/OFF (i=1/0), by default None

  • store (int, optional) – Immediate store, by default None

Returns:

normal operation command to be sent to MPDSnCxx Radio Frequency Driver

Return type:

String

create_sweeping_command(sweeping=None, frequency_start=None, frequency_stop=None, sweeping_time=None, store=None)[source]

Create formatted quick command to set the MPDSnCxx Radio Frequency Driver in sweeping mode

FULL Command: GgAfff.fffOfff.fffUuuuuE (applies on channel 1 only)

Parameters:
  • sweeping (int) – Sweeping mode - OFF/ON - g=0/1, by default None

  • frequencyStart (float, optional) – Start frequency (fff.ff = frequency value ex-75.206 – MHz), by default None

  • frequencyStop (float, optional) – Stop frequency (fff.ff = frequency value ex-84.260 – MHz), by default None

  • SweepingTime (int, optional) – Sweeping time in microseconds by steps of 1μs from 1 to 5000, by default None

  • store (bool, optional) – Immediate store, by default None

Returns:

sweeping command to be sent to MPDSnCxx Radio Frequency Driver

Return type:

String

disconnect_device()[source]

Disconnect from the MPDSnCxx Radio Frequency Driver

print_self()[source]

Print to terminal the settings for the USB connection

read_status(long_form=False)[source]

Read the status of MPDSnCxx Radio Frequency Driver

Parameters:

long_form (bool) – Display all the status, by default False

send_quick_command(command)[source]

Sends a command to MPDSnCxx Radio Frequency Driver

Parameters:

command (String) – Formated command to be sent

Module contents