Package reference

Translation from DLL commands

Commands

Direction

Register

Equivalent method

Write

SPC_M2CMD

Card.execute_commands

SPC_M2CMD Command

M2CMD_CARD_START

Card.start, Card.arm

SPC_M2CMD Command

M2CMD_CARD_STOP

Card.stop

SPC_M2CMD Command

M2CMD_CARD_RESET

Card.reset

SPC_M2CMD Command

M2CMD_CARD_FORCETRIGGER

Card.force_trigger

SPC_M2CMD Command

M2CMD_DATA_STARTDMA

Card.array_to_device

Read

SPC_M2STATUS

Card.get_status_information

Write

SPC_TIMEOUT

Card.set_timeout

Read

SPC_TIMEOUT

Card.get_timeout

Card identity

Direction

Register

Equivalent method

Call

spcm_hOpen

Card

Read

SPC_PCITYP

Card.get_name, Card.get_series_information

Read

SPC_PCISERIALNO

Card.get_serial_number

Read

SPC_PCIDATE

Card.get_production_date_information

Read

SPC_CALIBDATE

Card.get_calibration_date_information

Write

SPC_CARDIDENTIFICATION

Card.identification_led_enable, Card.identification_led_disable

Read

SPC_CARDIDENTIFICATION

Card.get_card_identification

Card information

Direction

Register

Equivalent method

Read

SPC_MIINST_MODULES

Card.get_number_of_front_end_modules

Read

SPC_MIINST_CHPERMODULE

Card.get_number_of_channels_per_front_end_module

Read

SPC_MIINST_MAXADCVALUE

Card.get_adc_full_scale

Read

SPC_MIINST_MINEXTCLOCK

Card.get_min_external_clock

Read

SPC_MIINST_MAXEXTCLOCK

Card.get_max_external_clock

Read

SPC_MIINST_MINEXTREFCLOCK

Card.get_min_external_reference_clock

Read

SPC_MIINST_MAXEXTREFCLOCK

Card.get_max_external_reference_clock

Hardware and PCB version

Direction

Register

Equivalent method

Read

SPC_PCIVERSION

Card.get_pci_information

Read

SPC_BASEPCBVERSION

Card.get_base_pcb_information

Read

SPC_PCIMODULEVERSION

Card.get_module_pci_information

Read

SPC_MODULEPCBVERSION

Card.get_module_pcb_information

Read

SPC_PCIEXTVERSION

Card.get_extension_pci_information

Read

SPC_EXTPCBVERSION

Card.get_extension_pcb_information

Read

SPC_PXIHWSLOTNO

Card.get_pxi_slot_number

Firmware information

Direction

Register

Equivalent method

Read

SPCM_FW_CTRL

Card.get_firmware_version_control_information

Read

SPCM_FW_CTRL_GOLDEN

Card.get_firmware_version_control_golden_information

Read

SPCM_FW_CTRL_ACTIVE

Card.get_firmware_version_control_active_information

Read

SPCM_FW_CLOCK

Card.get_firmware_version_clock_information

Read

SPCM_FW_CONFIG

Card.get_firmware_version_configuration_information

Read

SPCM_FW_MODULEA

Card.get_firmware_version_module_a_information

Read

SPCM_FW_MODULEB

Card.get_firmware_version_module_b_information

Read

SPCM_FW_MODEXTRA

Card.get_firmware_version_module_star_information

Read

SPCM_FW_POWER

Card.get_firmware_version_power_information

Driver information

Direction

Register

Equivalent method

Read

SPC_GETDRVTYPE

Card.get_driver_information

Read

SPC_GETDRVVERSION

Card.get_driver_version_information

Read

SPC_GETKERNELVERSION

Card.get_kernel_version_information

Card modifications

Direction

Register

Equivalent method

Read

SPCM_CUSTOMMOD

Card.get_modifications_information

Features and functions

Direction

Register

Equivalent method

Read

SPC_PCIFEATURES, SPC_PCIEXTFEATURES, SPC_READAOFEATURES, SPC_SEQMODE_AVAILFEATURES

Card.get_features_information

Read

SPC_FNCTYPE

Card.get_functions_information

Temperature

Direction

Register

Equivalent method

Read

SPC_MON_TC_BASE_CTRL

Card.get_temperature_base

Read

SPC_MON_TC_MODULE_0

Card.get_temperature_module_0

Read

SPC_MON_TC_MODULE_1

Card.get_temperature_module_1

Card mode

Direction

Register

Equivalent method

Write

SPC_CARDMODE

Card.use_mode_single, Card.use_mode_multi, Card.use_mode_gate, Card.use_mode_single_restart, Card.use_mode_sequence, Card.use_mode_fifo_single, Card.use_mode_fifo_multi, Card.use_mode_fifo_gate

Read

SPC_CARDMODE

Card.get_mode_information

Read

SPC_AVAILCARDMODES

Card.get_available_modes_information

Sample rate

Direction

Register

Equivalent method

Write

SPC_SAMPLERATE

Card.set_sample_rate

Read

SPC_SAMPLERATE

Card.get_sample_rate

Read

SPC_PCISAMPLERATE

Card.get_max_sample_rate

Read

SPC_MIINST_BYTESPERSAMPLE

Card.get_sample_resolution

Read

SPC_MIINST_BITSPERSAMPLE

Card.get_sample_resolution_bits

Clock

Direction

Register

Equivalent method

Write

SPC_CLOCKOUT

Card.clock_output_enable, Card.clock_output_disable

Read

SPC_CLOCKOUT

Card.get_clock_output

Read

SPC_CLOCKOUTFREQUENCY

Card.get_clock_output_frequency

Write

SPC_REFERENCECLOCK

Card.set_external_reference_frequency

Read

SPC_REFERENCECLOCK

Card.get_external_reference_frequency

Read

SPC_AVAILCLOCKMODES

Card.get_available_clock_modes_information

Write

SPC_CLOCKMODE

Card.use_clock_primary_internal, Card.use_clock_secondary_internal, Card.use_clock_external_reference, Card.use_clock_pxie_reference

Read

SPC_CLOCKMODE

Card.get_clock_mode_information

Triggers

Direction

Register

Equivalent method

Write

SPC_TRIG_DELAY

Card.set_trigger_delay

Read

SPC_TRIG_DELAY

Card.get_trigger_delay

Read

SPC_TRIG_AVAILDELAY

Card.get_max_trigger_delay

Write

SPC_TRIG_TERM

Card.trigger_impedance_use_high, Card.trigger_impedance_use_50

Read

SPC_TRIG_TERM

Card.get_trigger_impedance

Write

SPC_TRIG_EXT0_ACDC

Card.trigger_coupling_use_dc, Card.trigger_coupling_use_ac

Read

SPC_TRIG_EXT0_ACDC

Card.get_trigger_coupling

Write

SPC_TRIG_EXT0_MODE

Card.trigger_disable, Card.use_trigger_positive_edge, Card.use_trigger_negative_edge, Card.use_trigger_both_edge, Card.use_trigger_enter_window, Card.use_trigger_leave_window, Card.use_trigger_high_gate, Card.use_trigger_low_gate, Card.use_trigger_inside_window_gate, Card.use_trigger_outside_window_gate

Read

SPC_TRIG_EXT0_MODE

Card.get_trigger_mode_information

Read

SPC_TRIG_EXT0_AVAILMODES

Card.get_available_trigger_modes_information

Trigger masks

Direction

Register

Equivalent method

Write

SPC_TRIG_ORMASK

Card.set_sufficient_triggers

Read

SPC_TRIG_ORMASK

Card.get_sufficient_triggers

Read

SPC_TRIG_AVAILORMASK

Card.get_available_sufficient_triggers

Write

SPC_TRIG_CH_ORMASK0

Card.set_channels_for_sufficient_triggers

Read

SPC_TRIG_CH_ORMASK0

Card.get_channels_for_sufficient_triggers

Read

SPC_TRIG_CH_AVAILORMASK0

Card.get_available_channels_for_sufficient_triggers

Write

SPC_TRIG_ANDMASK

Card.set_necessary_triggers

Read

SPC_TRIG_ANDMASK

Card.get_necessary_triggers

Read

SPC_TRIG_AVAILANDMASK

Card.get_available_necessary_triggers

Write

SPC_TRIG_CH_ANDMASK0

Card.set_channels_for_necessary_triggers

Read

SPC_TRIG_CH_ANDMASK0

Card.get_channels_for_necessary_triggers

Read

SPC_TRIG_CH_AVAILANDMASK0

Card.get_available_channels_for_necessary_triggers

Channels

Direction

Register

Equivalent method

Write

SPC_CHENABLE

Card.set_channels_enable

Read

SPC_CHENABLE

Card.get_channels_enable

Read

SPC_CHCOUNT

Card.get_number_of_active_channels

Write

SPC_AMP0

Card.set_amplitude

Read

SPC_AMP0

Card.get_amplitude

Write

SPC_ENABLEOUT0

Card.output_enable, Card.output_disable

Read

SPC_ENABLEOUT0

Card.get_output_enable

Write

SPC_FILTER0

Card.channel_filter_enable, Card.channel_filter_disable

Read

SPC_FILTER0

Card.get_filter

Write

SPC_DIFF0

Card.differential_enable, Card.differential_disable

Read

SPC_DIFF0

Card.get_differential

Write

SPC_DOUBLEOUT0

Card.double_enable, Card.double_disable

Read

SPC_DOUBLEOUT0

Card.get_double

Write

SPC_CH0_STOPLEVEL, SPC_CH0_CUSTOM_STOP

Card.set_channel_stop_level

Read

SPC_CH0_STOPLEVEL, SPC_CH0_CUSTOM_STOP

Card.get_channel_stop_level

Playback

Direction

Register

Equivalent method

Write

SPC_LOOPS

Card.set_number_of_loops

Read

SPC_LOOPS

Card.get_number_of_loops

Sequencing

Direction

Register

Equivalent method

Read

SPC_SEQMODE_AVAILMAXSEGMENT

Card.get_max_number_of_segments

Read

SPC_SEQMODE_AVAILMAXSTEPS

Card.get_max_number_of_sequence_steps

Read

SPC_SEQMODE_AVAILMAXLOOP

Card.get_max_number_of_loops_per_sequence_step

Read

SPC_SEQMODE_AVAILFEATURES

Card.get_available_sequence_features_information

Write

SPC_SEQMODE_MAXSEGMENTS

Card.set_number_of_segments

Read

SPC_SEQMODE_MAXSEGMENTS

Card.get_number_of_segments

Write

SPC_SEQMODE_WRITESEGMENT

Card.set_current_segment

Read

SPC_SEQMODE_WRITESEGMENT

Card.get_current_segment

Write

SPC_SEQMODE_SEGMENTSIZE

Card.set_segment_length

Read

SPC_SEQMODE_SEGMENTSIZE

Card.get_segment_length

Write

SPC_SEQMODE_STEPMEM0

Card.set_step_instruction

Read

SPC_SEQMODE_STEPMEM0

Card.get_step_instruction

Write

SPC_SEQMODE_STARTSTEP

Card.set_start_step

Read

SPC_SEQMODE_STARTSTEP

Card.get_start_step

Memory and DMA

Direction

Register

Equivalent method

Call

spcm_dwDefTransfer_i64

Card.array_to_device

Write

SPC_MEMSIZE

Card.set_memory_size

Read

SPC_MEMSIZE

Card.get_memory_size

Read

SPC_PCIMEMSIZE

Card.get_max_memory_size

Write

SPC_MEMTEST

Card.memory_test_start, Card.memory_test_stop

Read

SPC_MEMTEST

Card.get_memory_test

Multi-purpose input/output (X ports)

Direction

Register

Equivalent method

Write

SPCM_X0_MODE

Card.io_port_disable, Card.use_io_mode_digital_out, Card.use_io_mode_asynchronous_input, Card.use_io_mode_asynchronous_output, Card.use_io_mode_trigger_output, Card.use_io_mode_run_state_output, Card.use_io_mode_arm_state_output, Card.use_io_mode_continuous_marker_output, Card.use_io_mode_reference_clock_output, Card.use_io_mode_system_clock_output

Read

SPCM_X0_MODE

Card.get_io_mode_information

Read

SPCM_X0_AVAILMODES

Card.get_available_io_modes_information

Write

SPCM_XX_ASYNCIO

Card.set_io_asynchronous

Read

SPCM_XX_ASYNCIO

Card.get_io_asynchronous

Card class

class spectrum_card.Card(device_address=b'/dev/spcm0')

Opens the connection to the card using spcm_hOpen.

Parameters:

device_address (str) – Directory to the card.

arm()

Writes M2CMD_CARD_START and M2CMD_CARD_ENABLETRIGGER to SPC_M2CMD.

array_to_device(data, segment=0, aux_data=None, aux_data_channels=None)

Transfers signals from the host to the card using _transfer_array_i64.

Parameters:
  • data (list of numpy.ndarray of float) – A list of sampled waveforms to be transferred to the card. The first element in the list is the waveform that is assigned to the first enabled channel, and so on. Values are assumed to be between -1.0 and 1.0.

  • segment (int) – The segment that the waveform is loaded into. Only relevant if the card is in a mode that uses segments, such as sequencing.

  • aux_data (list of numpy.ndarray of bool) – An optional list of binary waveforms to be played out of the IO ports (X0, X1 and/or X2). Requires information given in aux_data_channels. Will automatically set up port modes and signal discretisation based on information given.

  • aux_data_channels (list of dict) – Information that says where in which channels the binary waveforms in aux_data_channels are taken from, and which port they are output. Each dict in the overall list corresponds to one of the waveforms in aux_data_channels. The dictionary should contain three elements: "Port" is an int that corresponds to which of the digital IO ports that waveform should be sent to; "Channel" is an int that corresponds to which of the channels the digital waveform should be encoded in; and "Bit" is either 15, 14 or 13, which corresponds to which bit of the channel should be sacrificed for the digital waveform. Note that this should be consistent for every segment of memory.

channel_filter_disable(channel_index)

Writes 0 to SPC_FILTER0.

Parameters:

channel_index (int) – Which channel.

channel_filter_enable(channel_index)

Writes 1 to SPC_FILTER0.

Parameters:

channel_index (int) – Which channel.

clock_output_disable()

Writes to SPC_CLOCKOUT to disable the clock output.

clock_output_enable()

Writes to SPC_CLOCKOUT to enable the clock output.

close()

Closes the connection to the card.

differential_disable(channel_index)

Writes 0 to SPC_DIFF0.

Parameters:

channel_index (int) – Which channel (0 for channels 0 and 1, 2 for channels 2 and 3).

differential_enable(channel_index)

Writes 1 to SPC_DIFF0.

Parameters:

channel_index (int) – Which channel (0 for channels 0 and 1, 2 for channels 2 and 3).

double_disable(channel_index)

Writes 0 to SPC_DOUBLEOUT0.

Parameters:

channel_index (int) – Which channel (0 for channels 0 and 1, 2 for channels 2 and 3).

double_enable(channel_index)

Writes 1 to SPC_DOUBLEOUT0.

Parameters:

channel_index (int) – Which channel (0 for channels 0 and 1, 2 for channels 2 and 3).

execute_command(command)

Writes to SPC_M2CMD. To do this without using bit codes, use execute_commands.

Parameters:

command (int) – Bit code.

execute_commands(reset=False, write_setup=False, start=False, enable_trigger=False, force_trigger=False, disable_trigger=False, stop=False, dma_start=False, dma_wait=False, dma_stop=False, wait_for_prefill=False, wait_for_trigger=False, wait_until_ready=False)

Writes to SPC_M2CMD. To call a command, set the corresponding parameter to True.

force_trigger()

Writes M2CMD_CARD_FORCETRIGGER to SPC_M2CMD.

get_adc_full_scale()

Reads SPC_MIINST_MAXADCVALUE.

Returns:

full_scale

Return type:

int

get_amplitude(channel_index)

Reads SPC_AMP0.

Parameters:

channel_index (int) – Which channel.

Returns:

amplitude – Voltage in V.

Return type:

float

get_available_channels_for_necessary_triggers()

Reads SPC_TRIG_CH_AVAILANDMASK0 and displays each channel in a list of str.

Returns:

features – A list of each channel written as a str.

Return type:

list of str

get_available_channels_for_sufficient_triggers()

Reads SPC_TRIG_CH_AVAILORMASK0 and displays each channel in a list of str.

Returns:

features – A list of each channel written as a str.

Return type:

list of str

get_available_channels_triggered_by_and_mask()

Reads SPC_TRIG_CH_AVAILANDMASK0. For decoded information, use get_available_channels_for_necessary_triggers instead.

Returns:

channels – Bit code.

Return type:

int

get_available_channels_triggered_by_or_mask()

Reads SPC_TRIG_CH_AVAILORMASK0. For decoded information, use get_available_channels_for_sufficient_triggers instead.

Returns:

channels – Bit code.

Return type:

int

get_available_clock_modes()

Reads SPC_AVAILCLOCKMODES. For decoded information, use get_available_clock_modes_information instead.

Returns:

modes – Bit code.

Return type:

int

get_available_clock_modes_information()

Reads SPC_AVAILCLOCKMODES and displays each available mode for the clock in a list.

Returns:

modes – A list of each available mode written as a str.

Return type:

list of str

get_available_io_modes(port)

Reads SPCM_X0_AVAILMODES. For decoded information, use get_available_io_modes_information instead.

Parameters:

port (int) – Which IO port.

Returns:

modes – Bit code.

Return type:

int

get_available_io_modes_information(port)

Reads SPCM_X0_AVAILMODES.

Parameters:

port (int) – Which IO port.

Returns:

modes – Modes in str format

Return type:

list of str

get_available_modes()

Reads SPC_AVAILCARDMODES. For decoded information, use get_available_modes_information instead.

Returns:

mode – Bit code.

Return type:

int

get_available_modes_information()

Reads SPC_AVAILCARDMODES and displays each available mode for the card in a list.

Returns:

modes – A list of each available mode written as a str.

Return type:

list of str

get_available_necessary_triggers()

Reads SPC_TRIG_AVAILANDMASK and displays each available necessary trigger in a list of str.

Returns:

features – A list of each available necessary trigger written as a str.

Return type:

list of str

get_available_sequence_features()

Reads SPC_SEQMODE_AVAILFEATURES. For decoded information, use get_features_information or get_available_sequence_features_information instead.

Returns:

features – Bit code.

Return type:

int

get_available_sequence_features_information()

Reads SPC_SEQMODE_AVAILFEATURES.

Returns:

features – The features that can be used in sequence mode in str format.

Return type:

list of str

get_available_sufficient_triggers()

Reads SPC_TRIG_AVAILORMASK and displays each available sufficient trigger in a list of str.

Returns:

features – A list of each available sufficient trigger written as a str.

Return type:

list of str

get_available_trigger_modes(trigger_index)

Reads SPC_TRIG_EXT0_AVAILMODES. For decoded information, use get_available_trigger_modes_information instead.

Parameters:

trigger_index (int) – Which trigger.

Returns:

modes – Bit code.

Return type:

int

get_available_trigger_modes_information(trigger_index)

Reads SPC_TRIG_EXT0_AVAILMODES.

Parameters:

trigger_index (int) – Which trigger.

Returns:

modes – Available modes in str form.

Return type:

list of str

get_available_triggers_for_and_mask()

Reads SPC_TRIG_AVAILANDMASK. For decoded information, use get_available_necessary_triggers instead.

Returns:

mode – Bit code.

Return type:

int

get_available_triggers_for_or_mask()

Reads SPC_TRIG_AVAILORMASK. For decoded information, use get_available_sufficient_triggers instead.

Returns:

mode – Bit code.

Return type:

int

get_base_pcb_information()

Reads SPC_BASEPCBVERSION and displays as a str.

Returns:

version – Version in str format.

Return type:

str

get_base_pcb_version()

Reads SPC_BASEPCBVERSION. For decoded information, use get_base_pcb_information instead.

Returns:

version – Bit code for PCB version

Return type:

int

get_calibration_date()

Reads raw data from SPC_CALIBDATE. For decoded information, use get_calibration_date_information instead.

Returns:

bit_date – Bit code for production date.

Return type:

int

get_calibration_date_information()

Reads SPC_CALIBDATE to find the calibration date of the card.

Returns:

date – Contains two entries: "Year" is an int which contains the year the card was calibrated. "Week" is an int which contains the week of the year the card was calibrated.

Return type:

dict

get_card_identification()

Reads SPC_CARDIDENTIFICATION to see if the card’s notification LED is in identification mode.

Returns:

value1 if the LED is flashing, otherwise 0.

Return type:

int

get_card_type()

Reads raw data from SPC_PCITYP. For decoded information, use get_name and get_series_information instead.

Returns:

bit_type – Bit code for card type.

Return type:

int

get_channel_enable()

Reads SPC_CHENABLE. For decoded information, use get_channels_enable.

Returns:

channels – Bit code.

Return type:

int

get_channel_stop_level(channel_index)

Reads SPC_CH0_STOPLEVEL and SPC_CH0_CUSTOM_STOP.

Parameters:

channel_index (int) – Which channel.

Returns:

stop_level – If stop level is set to a particular mode, returns that mode as a str. If this mode is SPCM_STOPLVL_CUSTOM then it returns the custom level as a float between -1.0 and 1.0.

Return type:

str or float

get_channels_enable()

Reads SPC_CHENABLE.

Returns:

channels – List of enabled channels in string form.

Return type:

list of str

get_channels_for_necessary_triggers()

Reads SPC_TRIG_CH_ANDMASK0 and displays each channel in a list of str.

Returns:

features – A list of each channel written as a str.

Return type:

list of str

get_channels_for_sufficient_triggers()

Reads SPC_TRIG_CH_ORMASK0 and displays each channel in a list of str.

Returns:

features – A list of each channel written as a str.

Return type:

list of str

get_channels_triggered_by_and_mask()

Reads SPC_TRIG_CH_ANDMASK0. For decoded information, use get_channels_for_necessary_triggers instead.

Returns:

channels – Bit code.

Return type:

int

get_channels_triggered_by_or_mask()

Reads SPC_TRIG_CH_ORMASK0. For decoded information, use get_channels_for_sufficient_triggers instead.

Returns:

channels – Bit code.

Return type:

int

get_clock_mode()

Reads SPC_CLOCKMODE. For decoded information, use get_clock_mode_information instead.

Returns:

mode – Bit code.

Return type:

int

get_clock_mode_information()

Reads SPC_CLOCKMODE and displays the current clock mode as a string.

Returns:

mode – The current clock mode written as a str.

Return type:

str

get_clock_output()

Reads SPC_CLOCKOUT.

Returns:

enabled1 if output is enabled, 0 otherwise.

Return type:

int

get_clock_output_frequency()

Reads SPC_CLOCKOUTFREQUENCY.

Returns:

frequency – Output frequency in Hz.

Return type:

int

get_current_segment()

Reads SPC_SEQMODE_WRITESEGMENT.

Returns:

segment – The segment currently “armed” for reading and writing to.

Return type:

int

get_differential(channel_index)

Reads SPC_DIFF0.

Parameters:

channel_index (int) – Which channel (0 for channels 0 and 1, 2 for channels 2 and 3).

Returns:

enable1 for enabled, 0 for disabled.

Return type:

int

get_double(channel_index)

Reads SPC_DOUBLEOUT0.

Parameters:

channel_index (int) – Which channel (0 for channels 0 and 1, 2 for channels 2 and 3).

Returns:

enable1 for enabled, 0 for disabled.

Return type:

int

get_driver()

Reads SPC_GETDRVTYPE. For decoded information, use get_driver_information instead.

Returns:

version – Bit code.

Return type:

int

get_driver_information()

Reads SPC_GETDRVTYPE and displays in str format.

Returns:

version – Name of driver.

Return type:

str

get_driver_version()

Reads SPC_GETDRVVERSION. For decoded information, use get_driver_information instead.

Returns:

version – Bit code.

Return type:

int

get_driver_version_information()

Reads SPC_GETDRVVERSION and displays in str format.

Returns:

version – Version of driver

Return type:

str

get_extended_features()

Reads SPC_PCIEXTFEATURES. For decoded information, use get_features_information instead.

Returns:

features – Bit code.

Return type:

int

get_extension_pcb_information()

Reads SPC_EXTPCBVERSION and displays as a str.

Returns:

version – Version in str format.

Return type:

str

get_extension_pcb_version()

Reads SPC_EXTPCBVERSION. For decoded information, use get_module_pcb_information instead.

Returns:

version – Bit code for extension PCB version

Return type:

int

get_extension_pci_information()

Reads SPC_PCIEXTVERSION and displays as a dict.

Returns:

version – Contains two entries: "Hardware version" and "Firmware version".

Return type:

dict

get_extension_pci_version()

Reads SPC_PCIEXTVERSION. For decoded information, use get_extension_pci_information instead.

Returns:

version – Bit code for extension PCI version

Return type:

int

get_external_reference_frequency()

Reads SPC_REFERENCECLOCK.

Returns:

frequency – Reference frequency in Hz.

Return type:

int

get_features()

Reads SPC_PCIFEATURES. For decoded information, use get_features_information instead.

Returns:

features – Bit code.

Return type:

int

get_features_information()

Reads SPC_PCIFEATURES, SPC_PCIEXTFEATURES, SPC_READAOFEATURES, and SPC_SEQMODE_AVAILFEATURES and displays each feature of the card in a list.

Returns:

features – A list of each available feature written as a str.

Return type:

list of str

get_filter(channel_index)

Reads SPC_FILTER0.

Parameters:

channel_index (int) – Which channel.

Returns:

enable1 for enabled, 0 for disabled.

Return type:

int

get_firmware_version_clock()

Reads SPCM_FW_CLOCK. For decoded information, use get_firmware_version_clock_information instead.

Returns:

version – Bit code.

Return type:

int

get_firmware_version_clock_information()

Reads SPCM_FW_CLOCK and displays as dict.

Returns:

version – Contains two entries: "Firmware type" and "Firmware version".

Return type:

dict

get_firmware_version_configuration()

Reads SPCM_FW_CONFIG. For decoded information, use get_firmware_version_configuration_information instead.

Returns:

version – Bit code.

Return type:

int

get_firmware_version_configuration_information()

Reads SPCM_FW_CONFIG and displays as dict.

Returns:

version – Contains two entries: "Firmware type" and "Firmware version".

Return type:

dict

get_firmware_version_control()

Reads SPCM_FW_CTRL. For decoded information, use get_firmware_version_control_information instead.

Returns:

version – Bit code.

Return type:

int

get_firmware_version_control_active()

Reads SPCM_FW_CTRL_ACTIVE. For decoded information, use get_firmware_version_control_active_information instead.

Returns:

version – Bit code.

Return type:

int

get_firmware_version_control_active_information()

Reads SPCM_FW_CTRL_ACTIVE and displays as dict.

Returns:

version – Contains two entries: "Firmware type" and "Firmware version".

Return type:

dict

get_firmware_version_control_golden()

Reads SPCM_FW_CTRL_GOLDEN. For decoded information, use get_firmware_version_control_golden_information instead.

Returns:

version – Bit code.

Return type:

int

get_firmware_version_control_golden_information()

Reads SPCM_FW_CTRL_GOLDEN and displays as dict.

Returns:

version – Contains two entries: "Firmware type" and "Firmware version".

Return type:

dict

get_firmware_version_control_information()

Reads SPCM_FW_CTRL and displays as dict.

Returns:

version – Contains two entries: "Firmware type" and "Firmware version".

Return type:

dict

get_firmware_version_module_a()

Reads SPCM_FW_MODULEA. For decoded information, use get_firmware_version_module_a_information instead.

Returns:

version – Bit code.

Return type:

int

get_firmware_version_module_a_information()

Reads SPCM_FW_MODULEA and displays as dict.

Returns:

version – Contains two entries: "Firmware type" and "Firmware version".

Return type:

dict

get_firmware_version_module_b()

Reads SPCM_FW_MODULEB. For decoded information, use get_firmware_version_module_b_information instead.

Returns:

version – Bit code.

Return type:

int

get_firmware_version_module_b_information()

Reads SPCM_FW_MODULEB and displays as dict.

Returns:

version – Contains two entries: "Firmware type" and "Firmware version".

Return type:

dict

get_firmware_version_module_star()

Reads SPCM_FW_MODEXTRA. For decoded information, use get_firmware_version_module_star_information instead.

Returns:

version – Bit code.

Return type:

int

get_firmware_version_module_star_information()

Reads SPCM_FW_MODEXTRA and displays as dict.

Returns:

version – Contains two entries: "Firmware type" and "Firmware version".

Return type:

dict

get_firmware_version_power()

Reads SPCM_FW_POWER. For decoded information, use get_firmware_version_power_information instead.

Returns:

version – Bit code.

Return type:

int

get_firmware_version_power_information()

Reads SPCM_FW_POWER and displays as dict.

Returns:

version – Contains two entries: "Firmware type" and "Firmware version".

Return type:

dict

get_functions()

Reads SPC_FNCTYPE. For decoded information, use get_functions_information instead.

Returns:

features – Bit code.

Return type:

int

get_functions_information()

Reads SPC_FNCTYP and displays each function of the card in a list.

Returns:

functions – A list of each available function written as a str.

Return type:

list of str

get_io_asynchronous(port)

Reads SPCM_XX_ASYNCIO.

Parameters:

port (int) – Which IO port.

Returns:

value – Port value.

Return type:

bool

get_io_asynchronous_register()

Reads SPCM_XX_ASYNCIO. For decoded information, use … instead.

Returns:

value – Bit code.

Return type:

int

get_io_mode(port)

Reads SPCM_X0_MODE. For decoded information, use get_available_io_modes_information instead.

Parameters:

port (int) – Which IO port.

Returns:

modes – Bit code.

Return type:

int

get_io_mode_information(port)

Reads SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

Returns:

mode – Mode in str format

Return type:

str

get_is_demo_card()

Reads SPC_MIINST_ISDEMOCARD to find out if the card is a “demo” card (i.e., a software emulation).

Returns:

is_demo1 if the card is a demo, otherwise 0.

Return type:

int

get_kernel_version()

Reads SPC_GETKERNELVERSION. For decoded information, use get_driver_information instead.

Returns:

version – Bit code.

Return type:

int

get_kernel_version_information()

Reads SPC_GETKERNELVERSION and displays in str format.

Returns:

version – Version of driver

Return type:

str

get_lower_trigger_threshold(trigger_index)

Reads SPC_TRIG_EXT0_LEVEL1.

Parameters:

trigger_index (int) – Which trigger.

Returns:

threshold – Upper voltage in V.

Return type:

float

get_lower_trigger_threshold_max()

Reads SPC_TRIG_EXT_AVAIL1_MAX.

Returns:

threshold – Upper voltage in V.

Return type:

float

get_lower_trigger_threshold_min()

Reads SPC_TRIG_EXT_AVAIL1_MIN.

Returns:

threshold – Upper voltage in V.

Return type:

float

get_lower_trigger_threshold_step()

Reads SPC_TRIG_EXT_AVAIL1_STEP.

Returns:

threshold – Upper voltage in V.

Return type:

float

get_max_external_clock()

Reads SPC_MIINST_MAXEXTCLOCK.

Returns:

frequency – Maximum allowed external clock frequency in Hz.

Return type:

int

get_max_external_reference_clock()

Reads SPC_MIINST_MAXEXTREFCLOCK.

Returns:

frequency – Maximum allowed reference clock frequency in Hz.

Return type:

int

get_max_memory_size()

Reads SPC_PCIMEMSIZE.

Returns:

size – Memory size on the card in Bytes.

Return type:

int

get_max_number_of_loops_per_sequence_step()

Reads SPC_SEQMODE_AVAILMAXLOOP.

Returns:

loops – Max number of loops that can be used in each sequence step. Note that steps can also be set to loop indefinitely.

Return type:

int

get_max_number_of_segments()

Reads SPC_SEQMODE_AVAILMAXSEGMENT.

Returns:

size – Max number of segments that can be used with the card.

Return type:

int

get_max_number_of_sequence_steps()

Reads SPC_SEQMODE_AVAILMAXSTEPS.

Returns:

size – Max number of steps that can be used with the card.

Return type:

int

get_max_sample_rate()

Reads SPC_PCISAMPLERATE.

Returns:

sample_rate – The card’s maximum sample rate in Sa/s.

Return type:

int

get_max_trigger_delay()

Reads SPC_TRIG_AVAILDELAY.

Returns:

delay – Delay in number of samples.

Return type:

int

get_memory_size()

Reads SPC_MEMSIZE.

Returns:

size – Memory size in samples per channel.

Return type:

int

get_memory_test()

Reads SPC_MEMTEST.

Returns:

enable1 if mode is enabled, 0 otherwise.

Return type:

int

get_min_external_clock()

Reads SPC_MIINST_MINEXTCLOCK.

Returns:

frequency – Minimum allowed external clock frequency in Hz.

Return type:

int

get_min_external_reference_clock()

Reads SPC_MIINST_MINEXTREFCLOCK.

Returns:

frequency – Minimum allowed reference clock frequency in Hz.

Return type:

int

get_mode()

Reads SPC_CARDMODE to find the current mode that the card is in. For decoded information, use get_mode_information instead.

Returns:

mode – Bit code.

Return type:

int

get_mode_information()

Reads SPC_CARDMODE and displays the current card mode as a str.

Returns:

mode – The mode the card is in as a str.

Return type:

str

get_modifications()

Reads SPCM_CUSTOMMOD. For decoded information, use get_modifications_information instead.

Returns:

modifications – Bit code.

Return type:

int

get_modifications_information()

Reads SPCM_CUSTOMMOD and displays in dict format.

Returns:

modifications – Contains three entries for modifications for different parts of the card: "Card", "Front-end", and "Star-hub".

Return type:

dict

get_module_pcb_information()

Reads SPC_MODULEPCBVERSION and displays as a str.

Returns:

version – Version in str format.

Return type:

str

get_module_pcb_version()

Reads SPC_MODULEPCBVERSION. For decoded information, use get_module_pcb_information instead.

Returns:

version – Bit code for module PCB version

Return type:

int

get_module_pci_information()

Reads SPC_PCIMODULEVERSION and displays as a dict.

Returns:

version – Contains two entries: "Hardware version" and "Firmware version".

Return type:

dict

get_module_pci_version()

Reads SPC_PCIMODULEVERSION. For decoded information, use get_module_pci_information instead.

Returns:

version – Bit code for module PCI version

Return type:

int

get_name()

Reads SPC_PCITYP to find the name of the card.

Returns:

name – Name of the card.

Return type:

str

get_necessary_triggers()

Reads SPC_TRIG_ANDMASK and displays each necessary trigger in a list of str.

Returns:

features – A list of each necessary trigger written as a str.

Return type:

list of str

get_number_of_active_channels()

Reads SPC_CHCOUNT.

Returns:

channels – The number of enabled channels.

Return type:

int

get_number_of_channels_per_front_end_module()

Reads SPC_MIINST_CHPERMODULE.

Returns:

number

Return type:

int

get_number_of_front_end_modules()

Reads SPC_MIINST_MODULES.

Returns:

number

Return type:

int

get_number_of_loops()

Writes to SPC_LOOPS.

Returns:

number_of_loops – How many times the waveform should be looped. If set to 0, will loop indefinitely.

Return type:

int

get_number_of_segments()

Reads SPC_SEQMODE_MAXSEGMENTS.

Returns:

number_of_segments – The number of segments to split the memory into.

Return type:

int

get_output_enable(channel_index)

Reads from SPC_ENABLEOUT0.

Parameters:

channel_index (int) – Which channel.

Returns:

enable1 for enabled, 0 for disabled.

Return type:

int

get_pci_information()

Reads SPC_PCIVERSION and displays as a dict.

Returns:

version – Contains two entries: "Hardware version" and "Firmware version".

Return type:

dict

get_pci_version()

Reads SPC_PCIVERSION. For decoded information, use get_pci_information instead.

Returns:

version – Bit code for PCI version

Return type:

int

get_production_date()

Reads raw data from SPC_PCIDATE. For decoded information, use get_production_date_information instead.

Returns:

bit_date – Bit code for production date.

Return type:

int

get_production_date_information()

Reads SPC_PCIDATE to find the production date of the card.

Returns:

date – Contains two entries: "Year" is an int which contains the year the card was produced. "Week" is an int which contains the week of the year the card was produced.

Return type:

dict

get_pxi_slot_number()

Reads SPC_PXIHWSLOTNO.

Returns:

number – PXI slot number.

Return type:

str

get_readout_features()

Reads SPC_READAOFEATURES. For decoded information, use get_features_information instead.

Returns:

features – Bit code.

Return type:

int

get_sample_rate()

Reads SPC_SAMPLERATE.

Returns:

sample_rate – The current sample rate in Sa/s.

Return type:

int

get_sample_resolution()

Reads SPC_MIINST_BYTESPERSAMPLE.

Returns:

resolution – The resolution of each sample in Bytes/sample.

Return type:

int

get_sample_resolution_bits()

Reads SPC_MIINST_BITSPERSAMPLE.

Returns:

resolution – The resolution of each sample in bits/sample.

Return type:

int

get_segment_length(segment)

Reads SPC_SEQMODE_SEGMENTSIZE. Reads the length of any segment segment.

Parameters:

segment (int) – The segment to get the length of.

Returns:

size – Length of segment in samples per channel.

Return type:

int

get_segment_size()

Reads SPC_SEQMODE_SEGMENTSIZE. Reads the length of the currently armed segment.

Returns:

size – Length of segment in samples per channel.

Return type:

int

get_sequence_instruction(step)

Reads SPC_SEQMODE_STEPMEM0. For decoded information, use get_step_instruction instead.

Parameters:

step (int) – The step to write to.

Returns:

instruction – Bit code.

Return type:

int

get_serial_number()

Reads SPC_PCISERIALNO to find the series of the card.

Returns:

serial_number – Serial number of the card.

Return type:

int

get_series()

Reads raw data from SPC_PCITYP. For decoded information, use get_series_information instead.

Returns:

bit_series – Bit code for card series.

Return type:

int

get_series_information()

Reads SPC_PCITYP to find the series of the card.

Returns:

Series – Series of the card.

Return type:

str

get_start_step()

Reads SPC_SEQMODE_STARTSTEP.

Returns:

step – The starting step of the sequence.

Return type:

int

get_status()

Reads SPC_M2STATUS. For decoded information, use get_status_information instead.

Returns:

status – Bit code.

Return type:

int

get_status_information()

Reads SPC_M2STATUS.

Returns:

status – A list describing the status of the card.

Return type:

list of list

get_step_instruction(step)

Reads SPC_SEQMODE_STEPMEM0.

Parameters:

step (int) – The step to write to.

Returns:

instruction – Contains information under keys of "Segment", "Next step", "Number of loops", "Loop until trigger" and "End of sequence". Each has the same meaning as in the parameters for set_step_instruction.

Return type:

dict

get_stop_level(channel_index)

Reads SPC_CH0_STOPLEVEL. For decoded information, use get_channel_stop_level.

Parameters:

channel_index (int) – Which channel.

Returns:

stop_level_code – Bit code.

Return type:

int

get_stop_level_custom(channel_index)

Reads SPC_CH0_CUSTOM_STOP. For decoded information, use get_channel_stop_level.

Parameters:

channel_index (int) – Which channel.

Returns:

stop_level – Bit code.

Return type:

int

get_sufficient_triggers()

Reads SPC_TRIG_ORMASK and displays each sufficient trigger in a list of str.

Returns:

features – A list of each sufficient trigger written as a str.

Return type:

list of str

get_temperature_base(unit='C')

Reads SPC_MON_TK_BASE_CTRL, SPC_MON_TC_BASE_CTRL or SPC_MON_TF_BASE_CTRL.

Parameters:

unit (str) – Either "K" for temperature in Kelvin, "C" for temperature in Celsius (default), or "F" for temperature in Fahrenheit.

Returns:

temperature – Temperature in the unit selected (defaulting to Celsius).

Return type:

int

get_temperature_module_0(unit='C')

Reads SPC_MON_TK_MODULE_0, SPC_MON_TC_MODULE_0 or SPC_MON_TF_MODULE_0.

Parameters:

unit (str) – Either "K" for temperature in Kelvin, "C" for temperature in Celsius (default), or "F" for temperature in Fahrenheit.

Returns:

temperature – Temperature in the unit selected (defaulting to Celsius).

Return type:

int

get_temperature_module_1(unit='C')

Reads SPC_MON_TK_MODULE_1, SPC_MON_TC_MODULE_1 or SPC_MON_TF_MODULE_1.

Parameters:

unit (str) – Either "K" for temperature in Kelvin, "C" for temperature in Celsius (default), or "F" for temperature in Fahrenheit.

Returns:

temperature – Temperature in the unit selected (defaulting to Celsius).

Return type:

int

get_timeout()

Reads SPC_TIMEOUT.

Returns:

time_to_live – Timeout duration in seconds.

Return type:

int

get_trigger_and_mask()

Reads SPC_TRIG_ANDMASK. For decoded information, use get_necessary_triggers instead.

Returns:

mode – Bit code.

Return type:

int

get_trigger_coupling(trigger_index)

Reads SPC_TRIG_EXT0_ACDC or SPC_TRIG_EXT1_ACDC. Returns either "dc" or "ac".

Parameters:

trigger_index (int) – Which trigger.

Returns:

impedance – String of input impedance.

Return type:

str

get_trigger_delay()

Reads SPC_TRIG_DELAY.

Returns:

delay – Delay in number of samples.

Return type:

int

get_trigger_impedance()

Reads SPC_TRIG_TERM. Returns either "High" or "50 Ohm".

Returns:

impedance – String of input impedance.

Return type:

str

get_trigger_input_coupling(trigger_index)

Reads SPC_TRIG_EXT0_ACDC or SPC_TRIG_EXT1_ACDC. For decoded information, use get_trigger_coupling instead.

Parameters:

trigger_index (int) – Which trigger.

Returns:

coupling – Bit code.

Return type:

int

get_trigger_input_termination()

Reads SPC_TRIG_TERM. For decoded information, use get_trigger_impedance instead.

Returns:

type – Bit code.

Return type:

int

get_trigger_mode(trigger_index)

Reads SPC_TRIG_EXT0_MODE. For decoded information, use get_trigger_mode_information instead.

Parameters:

trigger_index (int) – Which trigger.

Returns:

mode – Bit code.

Return type:

int

get_trigger_mode_information(trigger_index)

Reads SPC_TRIG_EXT0_MODE.

Parameters:

trigger_index (int) – Which trigger.

Returns:

mode – Current mode in str form.

Return type:

str

get_trigger_or_mask()

Reads SPC_TRIG_ORMASK. For decoded information, use get_sufficient_triggers instead.

Returns:

mode – Bit code.

Return type:

int

get_upper_trigger_threshold(trigger_index)

Reads SPC_TRIG_EXT0_LEVEL0.

Parameters:

trigger_index (int) – Which trigger.

Returns:

threshold – Lower voltage in V.

Return type:

float

get_upper_trigger_threshold_max()

Reads SPC_TRIG_EXT_AVAIL0_MAX.

Returns:

threshold – Lower voltage in V.

Return type:

float

get_upper_trigger_threshold_min()

Reads SPC_TRIG_EXT_AVAIL0_MIN.

Returns:

threshold – Lower voltage in V.

Return type:

float

get_upper_trigger_threshold_step()

Reads SPC_TRIG_EXT_AVAIL0_STEP.

Returns:

threshold – Lower voltage in V.

Return type:

float

identification_led_disable()

Writes to SPC_CARDIDENTIFICATION to set the card’s notification LED to normal mode.

identification_led_enable()

Writes to SPC_CARDIDENTIFICATION to set the card’s notification LED to identification mode.

io_port_disable(port)

Writes SPCM_XMODE_DISABLE to SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

memory_test_start()

Writes 1 to SPC_MEMTEST.

memory_test_stop()

Writes 0 to SPC_MEMTEST.

output_disable(channel_index)

Writes 0 to SPC_ENABLEOUT0.

Parameters:

channel_index (int) – Which channel.

output_enable(channel_index)

Writes 1 to SPC_ENABLEOUT0.

Parameters:

channel_index (int) – Which channel.

reset()

Writes M2CMD_CARD_RESET to SPC_M2CMD.

set_amplitude(channel_index, amplitude, multiplier='')

Writes to SPC_AMP0.

Parameters:
  • channel_index (int) – Which channel.

  • amplitude (float) – Voltage.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

set_card_identification(value)

Writes to SPC_CARDIDENTIFICATION to set or unset the card’s notification LED to identification mode. You may want to use identification_led_enable and identification_led_disable instead.

Parameters:

value (int) – 1 to get the LED to flash, otherwise 0.

set_channel_enable(channels)

Writes to SPC_CHENABLE. To do this without using bit codes, use set_channels_enable.

Parameters:

channels (int) – Bit code.

set_channel_stop_level(channel_index, zero=False, low=False, high=False, hold_last=False, custom_value=None)

Writes to SPC_CH0_STOPLEVEL and SPC_CH0_CUSTOM_STOP. To set a custom value, set the parameter custom_value to a float between -1.0 and 1.0. To set it to any other stop level mode, set that parameter to True.

set_channels_enable(channel_0=False, channel_1=False, channel_2=False, channel_3=False)

Writes to SPC_CHENABLE. Set any of the parameters to True to enable that channel.

set_channels_for_necessary_triggers(channel_0=False, channel_1=False, channel_2=False, channel_3=False, channel_4=False, channel_5=False, channel_6=False, channel_7=False)

Writes to SPC_TRIG_CH_ANDMASK0. Set each parameter to True to add the channel to those effected by the AND mask.

set_channels_for_sufficient_triggers(channel_0=False, channel_1=False, channel_2=False, channel_3=False, channel_4=False, channel_5=False, channel_6=False, channel_7=False)

Writes to SPC_TRIG_CH_ORMASK0. Set each parameter to True to add the channel to those effected by the OR mask.

set_channels_triggered_by_and_mask(mask)

Writes to SPC_TRIG_CH_ANDMASK0. To do this without using bit codes, use set_channels_for_necessary_triggers.

Parameters:

channels (int) – Bit code.

set_channels_triggered_by_or_mask(mask)

Writes to SPC_TRIG_CH_ORMASK0. To do this without using bit codes, use set_channels_for_sufficient_triggers.

Parameters:

channels (int) – Bit code.

set_clock_mode(clock_mode)

Writes to SPC_CLOCKMODE. To do this without using bit codes, use use_clock_primary_internal, use_clock_secondary_internal, use_clock_external_reference, or use_clock_pxie_reference instead.

Parameters:

mode (int) – Bit code.

set_clock_output(enable)

Writes to SPC_CLOCKOUT. You may instead want to use clock_output_enable and clock_output_disable.

Parameters:

enable (int) – 1 if output is enabled, 0 otherwise.

set_current_segment(segment)

Writes to SPC_SEQMODE_WRITESEGMENT.

Parameters:

segment (int) – The segment currently “armed” for reading and writing to.

set_differential(channel_index, enable)

Writes to SPC_DIFF0.

Parameters:
  • channel_index (int) – Which channel (0 for channels 0 and 1, 2 for channels 2 and 3).

  • enable (int) – 1 for enabled, 0 for disabled.

set_double(channel_index, enable)

Writes to SPC_DOUBLEOUT0.

Parameters:
  • channel_index (int) – Which channel (0 for channels 0 and 1, 2 for channels 2 and 3).

  • enable (int) – 1 for enabled, 0 for disabled.

set_external_reference_frequency(frequency, multiplier='')

Writes to SPC_REFERENCECLOCK.

Parameters:
  • frequency (int) – Reference frequency in Hz.

  • multiplier (str) – Can be metric prefixes "" (default), "k", "M" or "G".

set_filter(channel_index, enable)

Writes to SPC_FILTER0.

Parameters:
  • channel_index (int) – Which channel.

  • enable (int) – 1 for enabled, 0 for disabled.

set_io_asynchronous(port, value)

Writes to SPCM_XX_ASYNCIO.

Parameters:
  • port (int) – Which IO port.

  • value (bool) – Port value.

set_io_asynchronous_register(value)

Writes to SPCM_XX_ASYNCIO. To do this without using bit codes, use … instead.

Parameters:

value (int) – Bit code.

set_io_mode(port, mode)

Writes to SPCM_X0_MODE. To do this without using bit codes, use io_port_disable, use_io_mode_digital_out, use_io_mode_asynchronous_input, use_io_mode_asynchronous_output, use_io_mode_trigger_output, use_io_mode_run_state_output, use_io_mode_arm_state_output, use_io_mode_continuous_marker_output, use_io_mode_reference_clock_output or use_io_mode_system_clock_output instead.

Parameters:
  • port (int) – Which IO port.

  • mode (int) – Bit code.

set_lower_trigger_threshold(trigger_index, threshold, multiplier='')

Writes to SPC_TRIG_EXT0_LEVEL1.

Parameters:
  • trigger_index (int) – Which trigger.

  • threshold (float) – Voltage

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

set_memory_size(size)

Writes to SPC_MEMSIZE.

Parameters:

size (int) – Memory size in samples per channel.

set_memory_test(enable)

Writes to SPC_MEMTEST.

Parameters:

enable (int) – 1 if mode is enabled, 0 otherwise.

set_mode(mode)

Writes to SPC_CARDMODE to set the mode of the card. To do this without using bit codes, use use_mode_single, use_mode_multi, use_mode_gate, use_mode_single_restart, use_mode_sequence, use_mode_fifo_single, use_mode_fifo_multi, or use_mode_fifo_gate instead.

Parameters:

features (int) – Bit code.

set_necessary_triggers(external_0=False, external_1=False)

Writes to SPC_TRIG_ANDMASK. Set each parameter to True to add it to the AND mask.

set_number_of_loops(number_of_loops)

Writes to SPC_LOOPS.

Parameters:

number_of_loops (int) – How many times the waveform should be looped. If set to 0, will loop indefinitely.

set_number_of_segments(number_of_segments)

Writes to SPC_SEQMODE_MAXSEGMENTS.

Parameters:

number_of_segments (int) – The number of segments to split the memory into.

set_output_enable(channel_index, enable)

Writes to SPC_ENABLEOUT0.

Parameters:
  • channel_index (int) – Which channel.

  • enable (int) – 1 for enabled, 0 for disabled.

set_sample_rate(sample_rate, multiplier='')

Writes a sample rate to SPC_SAMPLERATE.

Parameters:
  • sample_rate (int) – The sample rate in S/s.

  • multiplier (str) – Can be metric prefixes "" (default), "k", "M" or "G".

set_segment_length(segment, length)

Writes to SPC_SEQMODE_SEGMENTSIZE. Sets the length of any segment segment.

Parameters:
  • segment (int) – The segment to set the length of.

  • size (int) – Length of segment in samples per channel.

set_segment_size(size)

Writes to SPC_SEQMODE_SEGMENTSIZE. Sets the length of the currently armed segment.

Parameters:

size (int) – Length of segment in samples per channel.

set_sequence_instruction(step, instruction)

Writes to SPC_SEQMODE_STEPMEM0. To do this without using bit codes, use set_step_instruction.

Parameters:
  • step (int) – The step to write to.

  • instruction (int) – Bit code.

set_start_step(step)

Writes to SPC_SEQMODE_STARTSTEP.

Parameters:

step (int) – The starting step of the sequence.

set_step_instruction(step, segment, number_of_loops=1, next_step=None, loop_until_trigger=False, end_of_sequence=False)

Writes to SPC_SEQMODE_STEPMEM0.

Parameters:
  • step (int) – The step to write to.

  • segment (int) – The segment the step points to.

  • number_of_loops (int) – How many times the step should be looped.

  • next_step (int) – The step that follows this one. If None (default), will either point to step step + 1 or, if end_of_sequence is set to True, will point to step 0.

  • loop_until_trigger (bool) – Whether to wait for a trigger until proceeding to the next step.

  • end_of_sequence (bool) – Whether or not the step is the final step in the sequence.

set_stop_level(channel_index, stop_level_code)

Writes to SPC_CH0_STOPLEVEL. To do this without using bit codes, use set_channel_stop_level.

Parameters:
  • channel_index (int) – Which channel.

  • stop_level_code (int) – Bit code.

set_stop_level_custom(channel_index, value)

Writes to SPC_CH0_CUSTOM_STOP. To do this without using bit codes, use set_channel_stop_level.

Parameters:
  • channel_index (int) – Which channel.

  • value (int) – Bit code.

set_sufficient_triggers(software=False, external_0=False, external_1=False)

Writes to SPC_TRIG_ORMASK. Set each parameter to True to add it to the OR mask.

set_timeout(time_to_live, multiplier='')

Writes to SPC_TIMEOUT.

Parameters:
  • time_to_live (int) – Timeout duration in seconds.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

set_trigger_and_mask(mask)

Writes to SPC_TRIG_ANDMASK. To do this without using bit codes, use set_necessary_triggers.

Parameters:

mask (int) – Bit code.

set_trigger_delay(delay)

Writes to SPC_TRIG_DELAY.

Parameters:

delay (int) – Delay in number of samples.

set_trigger_input_coupling(trigger_index, type)

Writes to SPC_TRIG_EXT0_ACDC or SPC_TRIG_EXT1_ACDC. To do this without using bit codes, use trigger_coupling_use_dc and trigger_coupling_use_ac.

Parameters:
  • trigger_index (int) – Which trigger.

  • type (int) – Bit code.

set_trigger_input_termination(type)

Writes to SPC_TRIG_TERM. To do this without using bit codes, use trigger_impedance_use_high and trigger_impedance_use_50.

Parameters:

type (int) – Bit code.

set_trigger_mode(trigger_index, mode)

Writes to SPC_TRIG_EXT0_MODE. To do this without using bit codes, use trigger_disable, use_trigger_positive_edge, use_trigger_negative_edge, use_trigger_both_edge, use_trigger_enter_window, use_trigger_leave_window, use_trigger_high_gate, use_trigger_low_gate, use_trigger_inside_window_gate, or use_trigger_outside_window_gate.

Parameters:
  • trigger_index (int) – Which trigger.

  • mode (int) – Bit code.

set_trigger_or_mask(mask)

Writes to SPC_TRIG_ORMASK. To do this without using bit codes, use set_sufficient_triggers.

Parameters:

mask (int) – Bit code.

set_upper_trigger_threshold(trigger_index, threshold, multiplier='')

Writes to SPC_TRIG_EXT0_LEVEL0.

Parameters:
  • trigger_index (int) – Which trigger.

  • threshold (float) – Voltage

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

start()

Writes M2CMD_CARD_START to SPC_M2CMD.

stop()

Writes M2CMD_CARD_STOP to SPC_M2CMD.

trigger_coupling_use_ac(trigger_index=1)

Writes to SPC_TRIG_EXT0_ACDC or SPC_TRIG_EXT1_ACDC. Sets trigger coupling to ac.

Parameters:

trigger_index (int) – Which trigger.

trigger_coupling_use_dc(trigger_index=1)

Writes to SPC_TRIG_EXT0_ACDC or SPC_TRIG_EXT1_ACDC. Sets trigger coupling to dc.

Parameters:

trigger_index (int) – Which trigger.

trigger_disable(trigger_index, make_sufficient=True)

Writes SPC_TM_NONE to SPC_TRIG_EXT0_MODE.

Parameters:
trigger_impedance_use_50()

Writes to SPC_TRIG_TERM. Sets impedance to 50 Ohm.

trigger_impedance_use_high()

Writes to SPC_TRIG_TERM. Sets impedance to 1 kOhm.

use_clock_external_reference()

Writes SPC_CM_EXTREFCLOCK to SPC_CLOCKMODE.

use_clock_primary_internal()

Writes SPC_CM_INTPLL to SPC_CLOCKMODE.

use_clock_pxie_reference()

Writes SPC_CM_PXIREFCLOCK to SPC_CLOCKMODE.

use_clock_secondary_internal()

Writes SPC_CM_QUARTZ2 to SPC_CLOCKMODE.

use_io_mode_arm_state_output(port)

Writes SPCM_XMODE_ARMSTATE to SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

use_io_mode_asynchronous_input(port)

Writes SPCM_XMODE_ASYNCIN to SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

use_io_mode_asynchronous_output(port)

Writes SPCM_XMODE_ASYNCOUT to SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

use_io_mode_continuous_marker_output(port)

Writes SPCM_XMODE_CONTOUTMARK to SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

use_io_mode_digital_out(port, channel, bit)

Writes SPCM_XMODE_DIGOUT to SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

use_io_mode_reference_clock_output(port)

Writes SPCM_XMODE_REFCLKOUT to SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

use_io_mode_run_state_output(port)

Writes SPCM_XMODE_RUNSTATE to SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

use_io_mode_system_clock_output(port)

Writes SPCM_XMODE_SYSCLKOUT to SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

use_io_mode_trigger_output(port)

Writes SPCM_XMODE_TRIGOUT to SPCM_X0_MODE.

Parameters:

port (int) – Which IO port.

use_mode_fifo_gate()

Writes to SPC_CARDMODE to set the mode of the card to SPC_REP_FIFO_GATE.

use_mode_fifo_multi()

Writes to SPC_CARDMODE to set the mode of the card to SPC_REP_FIFO_MULTI.

use_mode_fifo_single()

Writes to SPC_CARDMODE to set the mode of the card to SPC_REP_FIFO_SINGLE.

use_mode_gate()

Writes to SPC_CARDMODE to set the mode of the card to SPC_REP_STD_GATE.

use_mode_multi()

Writes to SPC_CARDMODE to set the mode of the card to SPC_REP_STD_MULTI.

use_mode_sequence()

Writes to SPC_CARDMODE to set the mode of the card to SPC_REP_STD_SEQUENCE.

use_mode_single()

Writes to SPC_CARDMODE to set the mode of the card to SPC_REP_STD_SINGLE.

use_mode_single_restart()

Writes to SPC_CARDMODE to set the mode of the card to SPC_REP_STD_SINGLERESTART.

use_trigger_both_edge(trigger_index, threshold, multiplier='', make_sufficient=True)

Writes SPC_TM_BOTH to SPC_TRIG_EXT0_MODE.

Parameters:
  • trigger_index (int) – Which trigger.

  • threshold (float) – Voltage.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

  • make_sufficient (bool) – If True (default), adds this trigger to the OR mask (see set_sufficient_triggers).

use_trigger_enter_window(trigger_index, lower_threshold, upper_threshold, multiplier='', make_sufficient=True)

Writes SPC_TM_WINENTER to SPC_TRIG_EXT0_MODE.

Parameters:
  • trigger_index (int) – Which trigger.

  • lower_threshold (float) – Voltage.

  • upper_threshold (float) – Voltage.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

  • make_sufficient (bool) – If True (default), adds this trigger to the OR mask (see set_sufficient_triggers).

use_trigger_high_gate(trigger_index, threshold, multiplier='', make_sufficient=False)

Writes SPC_TM_HIGH to SPC_TRIG_EXT0_MODE.

Parameters:
  • trigger_index (int) – Which trigger.

  • threshold (float) – Voltage.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

  • make_sufficient (bool) – If True (False is default), adds this trigger to the OR mask (see set_sufficient_triggers).

use_trigger_inside_window_gate(trigger_index, lower_threshold, upper_threshold, multiplier='', make_sufficient=False)

Writes SPC_TM_INWIN to SPC_TRIG_EXT0_MODE.

Parameters:
  • trigger_index (int) – Which trigger.

  • lower_threshold (float) – Voltage.

  • upper_threshold (float) – Voltage.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

  • make_sufficient (bool) – If True (False is default), adds this trigger to the OR mask (see set_sufficient_triggers).

use_trigger_leave_window(trigger_index, lower_threshold, upper_threshold, multiplier='', make_sufficient=True)

Writes SPC_TM_WINLEAVE to SPC_TRIG_EXT0_MODE.

Parameters:
  • trigger_index (int) – Which trigger.

  • lower_threshold (float) – Voltage.

  • upper_threshold (float) – Voltage.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

  • make_sufficient (bool) – If True (default), adds this trigger to the OR mask (see set_sufficient_triggers).

use_trigger_low_gate(trigger_index, threshold, multiplier='', make_sufficient=False)

Writes SPC_TM_LOW to SPC_TRIG_EXT0_MODE.

Parameters:
  • trigger_index (int) – Which trigger.

  • threshold (float) – Voltage.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

  • make_sufficient (bool) – If True (False is default), adds this trigger to the OR mask (see set_sufficient_triggers).

use_trigger_negative_edge(trigger_index, threshold, multiplier='', re_arm_threshold=None, make_sufficient=True)

Writes SPC_TM_NEG to SPC_TRIG_EXT0_MODE.

Parameters:
  • trigger_index (int) – Which trigger.

  • threshold (float) – Voltage.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

  • re_arm_threshold (float) – Is None by default. Can be set to a voltage (in units determined by multiplier) such that the trigger level must go over this threshold to be re-armed after a trigger (using flag SPC_TM_REARM).

  • make_sufficient (bool) – If True (default), adds this trigger to the OR mask (see set_sufficient_triggers).

use_trigger_outside_window_gate(trigger_index, lower_threshold, upper_threshold, multiplier='', make_sufficient=False)

Writes SPC_TM_OUTSIDEWIN to SPC_TRIG_EXT0_MODE.

Parameters:
  • trigger_index (int) – Which trigger.

  • lower_threshold (float) – Voltage.

  • upper_threshold (float) – Voltage.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

  • make_sufficient (bool) – If True (False is default), adds this trigger to the OR mask (see set_sufficient_triggers).

use_trigger_positive_edge(trigger_index, threshold, multiplier='', re_arm_threshold=None, make_sufficient=True)

Writes SPC_TM_POS to SPC_TRIG_EXT0_MODE.

Parameters:
  • trigger_index (int) – Which trigger.

  • threshold (float) – Voltage.

  • multiplier (str) – Can be metric prefixes "" (default), or "m".

  • re_arm_threshold (float) – Is None by default. Can be set to a voltage (in units determined by multiplier) such that the trigger level must go under this threshold to be re-armed after a trigger (using flag SPC_TM_REARM).

  • make_sufficient (bool) – If True (default), adds this trigger to the OR mask (see set_sufficient_triggers).