-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0642364
commit 422f71f
Showing
5 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
% function to get waveforms and sequence tables from the AWG | ||
% ------------------------------------------------------------------------- | ||
% Notes: | ||
% - the function only works with the Tabor AWG Simulator not on the real | ||
% Tabor AWG | ||
% - the function arms the program that is inspected | ||
% ------------------------------------------------------------------------- | ||
% written by Marcel Meyer 08|2018 | ||
|
||
function awg_memory_struct = get_awg_memory(program_name, awg_channel_pair_identifier) | ||
|
||
global plsdata | ||
|
||
assert(ischar(program_name), 'first argument of get_awg_memory must be string'); | ||
|
||
if nargin < 2 || isempty(awg_channel_pair_identifier) | ||
awg_channel_pair_identifier = 'AB'; | ||
else | ||
assert(ischar(awg_channel_pair_identifier), 'second argument of get_awg_memory must be string'); | ||
end | ||
|
||
% get AWG channelpair python object | ||
hws = plsdata.awg.hardwareSetup; | ||
known_awgs = util.py.py2mat(hws.known_awgs); | ||
sort_indices = cellfun(@(x)(~isempty(strfind(char(x.identifier), awg_channel_pair_identifier))), known_awgs); | ||
channelpair = known_awgs(find(sort_indices)); | ||
channelpair = channelpair{1}; | ||
|
||
% arm program at AWG | ||
try | ||
channelpair.arm(program_name); | ||
catch err | ||
warning('program seems not to be on AWG, upload it first, returning without returning memory'); | ||
warning(err.message); | ||
return | ||
end | ||
|
||
% get a plottable program object -> qctoolkit Tabor driver gets sequence | ||
% tables and waveforms from the simulator | ||
plottableProgram = channelpair.read_complete_program(); | ||
|
||
awg_memory_struct = util.py.py2mat(plottableProgram.to_builtin()); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function seq_table = get_awg_seq_table(varargin) | ||
|
||
global plsdata | ||
|
||
defaultArgs = struct(... | ||
'programName', plsdata.awg.currentProgam, ... | ||
'advancedSeqTableFlag', false ... | ||
); | ||
args = util.parse_varargin(varargin, defaultArgs); | ||
|
||
seq_table = qc.get_sequence_table(args.programName, args.advancedSeqTableFlag); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters