3.4.1.3. qupulse.hardware.awgs.zihdawg¶
- class qupulse.hardware.awgs.zihdawg.ELFManager(awg_module)[source]¶
Bases:
object
This class organizes compiling and uploading of compiled programs. The source code file is named based on the code hash to cache compilation results. This requires that the waveform names are unique.
The compilation and upload itself are done asynchronously by zhinst.ziPython. To avoid spawning a useless thread for updating the status the method
compile_and_upload()
returns a generator which talks to the undelying library when needed.- class AWGModule(awg_module)[source]¶
Bases:
object
Provide an easily mockable interface to the zhinst AwgModule object
- __init__(awg_module)[source]¶
This class organizes compiling and uploading of compiled programs. The source code file is named based on the code hash to cache compilation results. This requires that the waveform names are unique.
The compilation and upload itself are done asynchronously by zhinst.ziPython. To avoid spawning a useless thread for updating the status the method
compile_and_upload()
returns a generator which talks to the undelying library when needed.
- compile_and_upload(source_string)[source]¶
The source code is saved to a file determined by the source hash, compiled and uploaded to the instrument. The function returns a generator that yields the current state of the progress. The generator is empty iff the upload is complete. An exception is raised if there is an error.
To abort send ‘abort’ to the generator.
Example
>>> my_source = 'playWave("my_wave");' >>> for state in elf_manager.compile_and_upload(my_source): ... print('Current state:', state) ... time.sleep(1)
- class qupulse.hardware.awgs.zihdawg.HDAWGChannelGroup(group_idx, group_size, identifier, timeout)[source]¶
Bases:
qupulse.hardware.awgs.base.AWG
Represents a channel pair of the Zurich Instruments HDAWG as an independent AWG entity. It represents a set of channels that have to have(hardware enforced) the same control flow and sample rate.
It keeps track of the AWG state and manages waveforms and programs on the hardware.
- MIN_WAVEFORM_LEN = 192¶
- WAVEFORM_LEN_QUANTUM = 16¶
- amplitudes()[source]¶
Query AWG channel amplitude value (not peak to peak).
From manual: The final signal amplitude is given by the product of the full scale output range of 1 V[in this example], the dimensionless amplitude scaling factor 1.0, and the actual dimensionless signal amplitude stored in the waveform memory.
- arm(name)[source]¶
Load the program ‘name’ and arm the device for running it. If name is None the awg will “dearm” its current program.
Currently hardware triggering is not implemented. The HDAWGProgramManager needs to emit code that calls waitDigTrigger to do that.
- Return type
- property awg_group_index: int¶
AWG node group index assuming 4x2 channel grouping. Then 0…3 will give appropriate index of group.
- Return type
- property awg_module: zhinst.ziPython.AwgModule¶
Each AWG channel group has its own awg module to manage program compilation and upload.
- Return type
AwgModule
- clear()[source]¶
Removes all programs and waveforms from the AWG.
Caution: This affects all programs and waveforms on the AWG, not only those uploaded using qupulse!
- Return type
- property device: qupulse.hardware.awgs.zihdawg.HDAWGRepresentation¶
Reference to HDAWG representation.
- Return type
- property programs: Set[str]¶
The set of program names that can currently be executed on the hardware AWG.
- remove(name)[source]¶
Remove a program from the AWG.
Also discards all waveforms referenced only by the program identified by name.
- property sample_rate: qupulse.utils.types.TimeType¶
The default sample rate of the AWG channel group.
- Return type
- set_volatile_parameters(program_name, parameters)[source]¶
Set the values of parameters which were marked as volatile on program creation.
- upload(name, program, channels, markers, voltage_transformation, force=False)[source]¶
Upload a program to the AWG.
Physically uploads all waveforms required by the program - excluding those already present - to the device and sets up playback sequences accordingly. This method should be cheap for program already on the device and can therefore be used for syncing. Programs that are uploaded should be fast(~1 sec) to arm.
- Parameters
name (
str
) – A name for the program on the AWG.program (
Loop
) – The program (a sequence of instructions) to upload.channels (
Tuple
[Union
[str
,int
,None
], …]) – Tuple of length num_channels that ChannelIDs of in the program to use. Position in the listto the AWG channel (corresponds) –
markers (
Tuple
[Union
[str
,int
,None
], …]) – List of channels in the program to use. Position in the List in the list corresponds toAWG channel (the) –
voltage_transformation (
Tuple
[Callable
, …]) – transformations applied to the waveforms extracted rom the program. Positionthe list corresponds to the AWG channel (in) –
force (
bool
) – If a different sequence is already present with the same name, it is overwritten if force is set to True. (default = False)
Known programs are handled in host memory most of the time. Only when uploading the device memory is touched at all.
Returning from setting user register in seqc can take from 50ms to 60 ms. Fluctuates heavily. Not a good way to have deterministic behaviour “setUserReg(PROG_SEL, PROG_IDLE);”.
- Return type
- property user_directory: str¶
“awg/src” (seqc sourcefiles), “awg/elf” (compiled AWG binaries), “awag/waves” (user defined csv waveforms).
- Type
LabOne user directory with subdirectories
- Return type
- class qupulse.hardware.awgs.zihdawg.HDAWGChannelGrouping(value)[source]¶
Bases:
enum.Enum
How many independent sequencers should run on the AWG and how the outputs should be grouped by sequencer.
- CHAN_GROUP_1x8 = 2¶
- CHAN_GROUP_2x4 = 1¶
- CHAN_GROUP_4x2 = 0¶
- exception qupulse.hardware.awgs.zihdawg.HDAWGException[source]¶
Bases:
Exception
Base exception class for HDAWG errors.
- exception qupulse.hardware.awgs.zihdawg.HDAWGIOError[source]¶
Bases:
qupulse.hardware.awgs.zihdawg.HDAWGException
,OSError
- class qupulse.hardware.awgs.zihdawg.HDAWGModulationMode(value)[source]¶
Bases:
enum.Enum
Modulation mode of waveform generator.
- ADVANCED = 5¶
- FG_1 = 3¶
- FG_2 = 4¶
- OFF = 0¶
- SINE_1 = 1¶
- SINE_2 = 2¶
- class qupulse.hardware.awgs.zihdawg.HDAWGRepresentation(device_serial=None, device_interface='1GbE', data_server_addr='localhost', data_server_port=8004, api_level_number=6, reset=False, timeout=20, grouping=None)[source]¶
Bases:
object
HDAWGRepresentation represents an HDAWG8 instruments and manages a LabOne data server api session. A data server must be running and the device be discoverable. Channels are per default grouped into pairs.
- Parameters
device_serial (
Optional
[str
]) – Device serial that uniquely identifies this device to the LabOne data serverdevice_interface (
str
) – Either ‘1GbE’ for ethernet or ‘USB’data_server_addr (
str
) – Data server address. Must be already running. Default: localhostdata_server_port (
int
) – Data server port. Default: 8004 for HDAWG, MF and UHF devicesapi_level_number (
int
) – Version of API to use for the session, higher number, newer. Default: 6 most recentreset (
bool
) – Reset device before initializationtimeout (
float
) – Timeout in seconds for uploading
- __init__(device_serial=None, device_interface='1GbE', data_server_addr='localhost', data_server_port=8004, api_level_number=6, reset=False, timeout=20, grouping=None)[source]¶
- Parameters
device_serial (
Optional
[str
]) – Device serial that uniquely identifies this device to the LabOne data serverdevice_interface (
str
) – Either ‘1GbE’ for ethernet or ‘USB’data_server_addr (
str
) – Data server address. Must be already running. Default: localhostdata_server_port (
int
) – Data server port. Default: 8004 for HDAWG, MF and UHF devicesapi_level_number (
int
) – Version of API to use for the session, higher number, newer. Default: 6 most recentreset (
bool
) – Reset device before initializationtimeout (
float
) – Timeout in seconds for uploading
- property api_session: zhinst.ziPython.ziDAQServer¶
- Return type
ziDAQServer
- property channel_grouping: qupulse.hardware.awgs.zihdawg.HDAWGChannelGrouping¶
- Return type
- property channel_pair_AB: qupulse.hardware.awgs.zihdawg.HDAWGChannelGroup¶
- Return type
- property channel_pair_CD: qupulse.hardware.awgs.zihdawg.HDAWGChannelGroup¶
- Return type
- property channel_pair_EF: qupulse.hardware.awgs.zihdawg.HDAWGChannelGroup¶
- Return type
- property channel_pair_GH: qupulse.hardware.awgs.zihdawg.HDAWGChannelGroup¶
- Return type
- property channel_tuples: Tuple[qupulse.hardware.awgs.zihdawg.HDAWGChannelGroup, ...]¶
- Return type
- get_status_table()[source]¶
Return node tree of instrument with all important settings, as well as each channel group as tuple.
- offset(channel, voltage=None)[source]¶
Query channel offset voltage and optionally set it.
- Return type
- output(channel, status=None)[source]¶
Query channel signal output status (enabled/disabled) and optionally set it. Corresponds to front LED.
- Return type
- range(channel, voltage=None)[source]¶
Query channel voltage range and optionally set it. The instruments selects the next higher available range. This is the one-sided range Vp. Total range: -Vp…Vp
- Return type
- property waveform_file_system: qupulse._program.seqc.WaveformFileSystem¶
- Return type
WaveformFileSystem
- exception qupulse.hardware.awgs.zihdawg.HDAWGRuntimeError[source]¶
Bases:
qupulse.hardware.awgs.zihdawg.HDAWGException
,RuntimeError
- exception qupulse.hardware.awgs.zihdawg.HDAWGTimeoutError[source]¶
Bases:
qupulse.hardware.awgs.zihdawg.HDAWGException
,TimeoutError
- class qupulse.hardware.awgs.zihdawg.HDAWGTriggerOutSource(value)[source]¶
Bases:
enum.Enum
Assign a signal to a marker output. This is per AWG Core.
- AWG_TRIG_1 = 0¶
- AWG_TRIG_2 = 1¶
- AWG_TRIG_3 = 2¶
- AWG_TRIG_4 = 3¶
- HIGH = 17¶
- LOW = 18¶
- OUT_1_MARK_1 = 4¶
- OUT_1_MARK_2 = 5¶
- OUT_2_MARK_1 = 6¶
- OUT_2_MARK_2 = 7¶
- TRIG_IN_1 = 8¶
- TRIG_IN_2 = 9¶
- TRIG_IN_3 = 10¶
- TRIG_IN_4 = 11¶
- TRIG_IN_5 = 12¶
- TRIG_IN_6 = 13¶
- TRIG_IN_7 = 14¶
- TRIG_IN_8 = 15¶
- exception qupulse.hardware.awgs.zihdawg.HDAWGTypeError[source]¶
Bases:
qupulse.hardware.awgs.zihdawg.HDAWGException
,TypeError
- exception qupulse.hardware.awgs.zihdawg.HDAWGValueError[source]¶
Bases:
qupulse.hardware.awgs.zihdawg.HDAWGException
,ValueError
- class qupulse.hardware.awgs.zihdawg.HDAWGVoltageRange(value)[source]¶
Bases:
enum.Enum
All available voltage ranges for the HDAWG wave outputs. Define maximum output voltage.
- RNG_1V = 1¶
- RNG_200mV = 0.2¶
- RNG_2V = 2¶
- RNG_3V = 3¶
- RNG_400mV = 0.4¶
- RNG_4V = 4¶
- RNG_5V = 5¶
- RNG_600mV = 0.6¶
- RNG_800mV = 0.8¶