diff --git a/+qes/+hwdriver/+async/@MWSource/GetFreqPwer.m b/+qes/+hwdriver/+async/@MWSource/GetFreqPwer.m new file mode 100644 index 0000000..1991819 --- /dev/null +++ b/+qes/+hwdriver/+async/@MWSource/GetFreqPwer.m @@ -0,0 +1,23 @@ +function [d1, d2] = GetFreqPwer(obj) +% query frequency and power from instrument +% + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agle82xx','agle8200','agl e82xx','agl e8200',... + 'rohde&schwarz sma100', 'r&s sma100',... + 'anritsu_mg3692c'} + d1 = query(obj.interfaceobj,':SOUR:FREQ?'); + d1.addCallback(@(x)str2double(x)); + d2 = mtwisted.defer.wrap(@obj.interfaceobj.fprintf,':SOUR:POW?'); + d2.addCallback(@(x)str2double(x)); + otherwise + d1 = mtwisted.defer.fail(... + mtwisted.Failure(MException(... + 'qes:hwdriver:MWSource:GetFreqPwerFail',['Unsupported instrument: ',TYP]))); + d2 = d1; + end +end diff --git a/+qes/+hwdriver/+async/@MWSource/GetInstance.m b/+qes/+hwdriver/+async/@MWSource/GetInstance.m new file mode 100644 index 0000000..7dbb28a --- /dev/null +++ b/+qes/+hwdriver/+async/@MWSource/GetInstance.m @@ -0,0 +1,55 @@ +function obj = GetInstance(name,interfaceobj,drivertype) + % if called without input arguments, the first valid instance is + % returned, if 'name' is not empty, the instance that matches 'name' + % is returned if exits, if not exit, a new instance is created(in this + % case all input arguments should be specified) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + persistent objlst; + if isempty(objlst) + if nargin == 0 || isempty(name) + error('MWSource:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + end + if nargin > 2 + obj = qes.hwdriver.MWSource(name,interfaceobj,drivertype); + else + obj = qes.hwdriver.MWSource(name,interfaceobj); + end + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of delete objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 || isempty(name) + error('MWSource:GetInstanceError',... + 'No existing instance, all input paramenter should be specified!'); + end + if nargin > 2 + obj = qes.hwdriver.MWSource(name,interfaceobj,drivertype); + else + obj = qes.hwdriver.MWSource(name,interfaceobj); + end + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+async/@MWSource/GetOnOff.m b/+qes/+hwdriver/+async/@MWSource/GetOnOff.m new file mode 100644 index 0000000..83d6912 --- /dev/null +++ b/+qes/+hwdriver/+async/@MWSource/GetOnOff.m @@ -0,0 +1,19 @@ +function d = GetOnOff(obj) + % query instrument output status + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agle82xx','agle8200','agl e82xx','agl e8200',... + 'rohde&schwarz sma100', 'r&s sma100',... + 'anritsu_mg3692c'} + d = query(obj.interfaceobj,':OUTP?'); % operate + d.addCallback(@(x)strcmp(r(1),'1')); + otherwise + d = mtwisted.defer.fail(... + mtwisted.Failure(MException(... + 'qes:hwdriver:MWSource:GetOnOffFail',['Unsupported instrument: ',TYP]))); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+async/@MWSource/InitializeInstr.asv b/+qes/+hwdriver/+async/@MWSource/InitializeInstr.asv new file mode 100644 index 0000000..0673645 --- /dev/null +++ b/+qes/+hwdriver/+async/@MWSource/InitializeInstr.asv @@ -0,0 +1,41 @@ +function d = InitializeInstr(obj) + % Initialize instrument + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agle82xx','agle8200','agl e82xx','agl e8200'} + d = Set_Agle82xx_rssma100_anritsu_mg36xx(obj); + obj.freqlimits = [250e-6,40]; % GHz + obj.powerlimits = [-120,20]; % dBm + case {'rohde&schwarz sma100', 'r&s sma100'} + d = Set_Agle82xx_rssma100_anritsu_mg36xx(obj); + case {'anritsu_mg3692c'} + d = Set_Agle82xx_rssma100_anritsu_mg36xx(obj); + obj.freqlimits = [2e9,20e9]; % GHz + obj.powerlimits = [-130,22]; % dBm + otherwise + d = mtwisted.defer.fail(... + mtwisted.Failure(MException(... + 'qes:hwdriver:MWSource:InitializeInstrFail',['Unsupported instrument: ',TYP]))); + end +end + +function d = Set_Agle82xx_rssma100_anritsu_mg36xx(obj) + d1 = fprintf(obj.interfaceobj,'*RST'); + d1 = fprintf(obj.interfaceobj,':SOUR:FREQ:MODE FIX'); + d1 = fprintf(obj.interfaceobj,'*RST'); + d1 = fprintf(obj.interfaceobj,'*RST'); + + d2 = mtwisted.defer.wrap(@obj.interfaceobj.fprintf,':SOUR:FREQ:MODE FIX'); + d3 = mtwisted.defer.wrap(@obj.interfaceobj.fprintf,':SOUR:POW:MODE FIX'); + % set reference oscillator source to auto: + % Applying a 10 MHz signal to the Reference Oscillator connector automatically sets the + % Reference Oscillator to EXTernal, when NO signal is present at the 10 MHz + % Reference Oscillator connector, internal source is used. + d4 = mtwisted.defer.wrap(@obj.interfaceobj.fprintf,':ROSCillator:SOURce:AUTO ON'); + mtwisted.defer.queueDeferreds(d1, d2, d3, d4); +end diff --git a/+qes/+hwdriver/+async/@MWSource/InitializeInstr.m b/+qes/+hwdriver/+async/@MWSource/InitializeInstr.m new file mode 100644 index 0000000..5f19423 --- /dev/null +++ b/+qes/+hwdriver/+async/@MWSource/InitializeInstr.m @@ -0,0 +1,36 @@ +function d = InitializeInstr(obj) + % Initialize instrument + % set reference oscillator source to auto: + % Applying a 10 MHz signal to the Reference Oscillator connector automatically sets the + % Reference Oscillator to EXTernal, when NO signal is present at the 10 MHz + % Reference Oscillator connector, internal source is used. + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agle82xx','agle8200','agl e82xx','agl e8200'} + % implement a deferred list + [d1,d2,d3,d4] = Set_Agle82xx_rssma100_anritsu_mg36xx(obj); + obj.freqlimits = [250e-6,40]; % GHz + obj.powerlimits = [-120,20]; % dBm + case {'rohde&schwarz sma100', 'r&s sma100'} + d = Set_Agle82xx_rssma100_anritsu_mg36xx(obj); + case {'anritsu_mg3692c'} + d = Set_Agle82xx_rssma100_anritsu_mg36xx(obj); + obj.freqlimits = [2e9,20e9]; % GHz + obj.powerlimits = [-130,22]; % dBm + otherwise + d = mtwisted.defer.fail(... + mtwisted.Failure(MException(... + 'qes:hwdriver:MWSource:InitializeInstrFail',['Unsupported instrument: ',TYP]))); + end +end + +function [d1,d2,d3,d4] = Set_Agle82xx_rssma100_anritsu_mg36xx(obj) + d1 = fprintf(obj.interfaceobj,'*RST'); + d2 = fprintf(obj.interfaceobj,':SOUR:FREQ:MODE FIX'); + d3 = fprintf(obj.interfaceobj,':SOUR:POW:MODE FIX'); + d4 = fprintf(obj.interfaceobj,':ROSCillator:SOURce:AUTO ON'); +end diff --git a/+qes/+hwdriver/+async/@MWSource/MWSource.m b/+qes/+hwdriver/+async/@MWSource/MWSource.m new file mode 100644 index 0000000..7caf1a9 --- /dev/null +++ b/+qes/+hwdriver/+async/@MWSource/MWSource.m @@ -0,0 +1,109 @@ +classdef MWSource < qes.hwdriver.Instrument + % microwave source driver, async + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties % (AbortSet = true) do not use AbortSet + frequency % Hz + power % dBm + on % true/false, output on/off + end + properties % (SetAccess = immutable) + freqlimits + powerlimits + end + methods (Access = private) + function obj = MWSource(name,interfaceobj,drivertype) + if isempty(interfaceobj) + error('MWSource:InvalidInput',... + 'Input ''%s'' can not be empty!',... + 'interfaceobj'); + end + interfaceobj.Timeout = 10; + if nargin < 3 + drivertype = []; + end + obj = obj@qes.hwdriver.Instrument(name,interfaceobj,drivertype); + ErrMsg = obj.InitializeInstr(); + if ~isempty(ErrMsg) + error('MWSource:InstSetError',[obj.name, ': %s'], ErrMsg); + end + end + d = InitializeInstr(obj) + d = SetPower(obj,val) + d = SetFreq(obj,val) + [Freq, Power]=GetFreqPwer(obj) + d = SetOnOff(obj,OnOrOff) + onstatus = GetOnOff(obj) + end + methods (Static) + obj = GetInstance(name,interfaceobj,drivertype) + end + methods + function set.frequency(obj,val) + if isempty(val) + obj.frequency = val; + return; + end + if isempty(val) || ~isnumeric(val) || ~isreal(val) || val <= 0 + error('MWSource:SetError','Invalid frequency value.'); + end + if ~isempty(obj.freqlimits) &&... + (val < obj.freqlimits(1) || val > obj.freqlimits(2)) + warning('MWSource:OutOfLimit','Frequency value out of limits.'); + return; + end + d = SetFreq(obj,val); + obj.frequency = val; + end + function frequency = get.frequency(obj) + [frequency, ~] = GetFreqPwer(obj); + end + function set.power(obj,val) + if isempty(val) || ~isnumeric(val) || ~isreal(val) + error('MWSource:SetError','Invalid power value.'); + end + if ~isempty(obj.powerlimits) &&... + (val < obj.powerlimits(1) || val > obj.powerlimits(2)) + warning('MWSource:OutOfLimit',[obj.name, ': Power value out of limits!']); + return; + end + SetPower(obj,val); + obj.power = val; + end + function power = get.power(obj) + [~, power] = GetFreqPwer(obj); + end + function set.on(obj,val) + if isempty(val) + error('MWSource:SetOnOff', 'value of ''on'' must be a bolean.'); + end + if ~islogical(val) + if val == 0 || val == 1 + val = logical(val); + else + error('MWSource:SetOnOff', 'value of ''on'' must be a bolean.'); + end + end + obj.SetOnOff(val); + obj.on = val; + end + function val = get.on(obj) + val = GetOnOff(obj); + end + function On(obj) + % set on, this method is introduced for functional + % programming. + obj.on = true; + end + function Off(obj) + % set off, this method is introduced for functional + % programming. + obj.on = false; + end + function delete(obj) + obj.on = false; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+async/@MWSource/SetFreq.m b/+qes/+hwdriver/+async/@MWSource/SetFreq.m new file mode 100644 index 0000000..383da46 --- /dev/null +++ b/+qes/+hwdriver/+async/@MWSource/SetFreq.m @@ -0,0 +1,20 @@ +function d = SetFreq(obj,val) +% set microwave source frequecy and power +% + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agilent e82xx','agilent e8200','agle82xx','agle8200','agl e82xx','agl e8200',... + 'anritsu_mg3692c'} + d = fprintf(obj.interfaceobj,[':SOUR:FREQ:FIX ',num2str(val(1),'%0.3f'),'Hz']); + case {'rohde&schwarz sma100', 'r&s sma100','rssma100'} + d = fprintf(obj.interfaceobj,[':SOUR:FREQ ',num2str(val(1),'%0.3f'),'Hz']); + otherwise + d = mtwisted.defer.fail(... + mtwisted.Failure(MException(... + 'qes:hwdriver:MWSource:SetFreqFail',['Unsupported instrument: ',TYP]))); + end +end diff --git a/+qes/+hwdriver/+async/@MWSource/SetOnOff.m b/+qes/+hwdriver/+async/@MWSource/SetOnOff.m new file mode 100644 index 0000000..fdca0fa --- /dev/null +++ b/+qes/+hwdriver/+async/@MWSource/SetOnOff.m @@ -0,0 +1,21 @@ +function d = SetOnOff(obj,On) + % set instrument output to on or off + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + TYP = lower(obj.drivertype); + switch TYP + case {'agle82xx','agle8200','agl e82xx','agl e8200',... + 'rohde&schwarz sma100', 'r&s sma100',... + 'anritsu_mg3692c'} + if On + d = fprintf(obj.interfaceobj,':OUTP ON '); + else + d = fprintf(obj.interfaceobj,':OUTP OFF '); + end + otherwise + d = mtwisted.defer.fail(... + mtwisted.Failure(MException(... + 'qes:hwdriver:MWSource:SetOnOffFail',['Unsupported instrument: ',TYP]))); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+async/@MWSource/SetPower.m b/+qes/+hwdriver/+async/@MWSource/SetPower.m new file mode 100644 index 0000000..d177b68 --- /dev/null +++ b/+qes/+hwdriver/+async/@MWSource/SetPower.m @@ -0,0 +1,20 @@ +function SetPower(obj,val) +% set microwave source frequecy and power +% + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agilent e82xx','agilent e8200','agle82xx','agle8200','agl e82xx','agl e8200',... + 'anritsu_mg3692c'} + d = fprintf(obj.interfaceobj,[':SOUR:POWER ',num2str(val(1),'%0.2f'),'DBM']); + case {'rohde&schwarz sma100', 'r&s sma100','rssma100'} + d = fprintf(obj.interfaceobj,[':SOUR:POW ',num2str(val(1),'%0.2f')]); + otherwise + d = mtwisted.defer.fail(... + mtwisted.Failure(MException(... + 'qes:hwdriver:MWSource:SetPowerFail',['Unsupported instrument: ',TYP]))); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/+ustcadda_backen/USTCADC.m b/+qes/+hwdriver/+sync/+ustcadda_backen/USTCADC.m new file mode 100644 index 0000000..7358992 --- /dev/null +++ b/+qes/+hwdriver/+sync/+ustcadda_backen/USTCADC.m @@ -0,0 +1,123 @@ +classdef USTCADC < handle + properties + isopen; + status; + selectnum + end + + properties (GetAccess = private,Constant = true) + driver = 'USTCADCDriver'; + driverh = 'USTCADCDriver.h'; + end + + methods + function obj = USTCADC(num) + obj.isopen = false; + obj.status = 'close'; + obj.selectnum = num; + driverfilename = [obj.driver,'.dll']; + if(~libisloaded(obj.driver)) + loadlibrary(driverfilename,obj.driverh); + end + end + + function Open(obj) + if ~obj.isopen + ret = calllib(obj.driver,'OpenADC',int32(obj.selectnum)); + if(ret == 0) + obj.status = 'open'; + obj.isopen = true; + else + error('USTCDA:OpenError','Open ADC failed!'); + end + end + end + + function Close(obj) + if obj.isopen + ret = calllib(obj.driver,'CloseADC'); + if(ret == 0) + obj.status = 'close'; + obj.isopen = false; + else + error('USTCDA:CloseError','Close ADC failed!'); + end + end + end + + function SetSampleDepth(obj,depth) + if obj.isopen + data = [0,18,depth/256,mod(depth,256)]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(4),pdata); + if(ret ~= 0) + error('USTCDA:SendPacket','SetSampleDepth failed!'); + end + end + end + + function ClearBuff(obj) + if obj.isopen + ret = calllib(obj.driver,'ClearBuff'); + if(ret ~= 0) + error('USTCDA:ClearBuff','ClearBuff failed!'); + end + end + end + + function SetTrigCount(obj,count) + if obj.isopen + data = [0,19,count/256,mod(count,256)]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(4),pdata); + if(ret ~= 0) + error('USTCDA:SendPacket','SetTrigCount failed!'); + end + end + end + + function SetMacAddr(obj,mac) + if obj.isopen + data = [0,17]; + data = [data,mac]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(length(mac)+2),pdata); + if(ret ~= 0) + error('USTCDA:SendPacket','SetMacAddr failed!'); + end + end + end + + function ForceTrig(obj) + if obj.isopen + data = [0,1,238,238,238,238,238,238]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(8),pdata); + if(ret ~= 0) + error('USTCDA:SendPacket','ForceTrig failed!'); + end + end + end + + function EnableADC(obj) + if obj.isopen + data = [0,3,238,238,238,238,238,238]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(8),pdata); + if(ret ~= 0) + error('USTCDA:SendPacket','EnableADC failed!'); + end + end + end + + function [ret,I,Q] = RecvData(obj,row,column) + if obj.isopen + I = zeros(row*column,1); + Q = zeros(row*column,1); + pI = libpointer('uint8Ptr', I); + pQ = libpointer('uint8Ptr', Q); + [ret,I,Q] = calllib(obj.driver,'RecvData',int32(row*column),int32(column),pI,pQ); + end + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/+ustcadda_backen/USTCDAC.m b/+qes/+hwdriver/+sync/+ustcadda_backen/USTCDAC.m new file mode 100644 index 0000000..1ac44a3 --- /dev/null +++ b/+qes/+hwdriver/+sync/+ustcadda_backen/USTCDAC.m @@ -0,0 +1,421 @@ +% FileName:USTCDAC.m +% Author:GuoCheng +% E-mail:fortune@mail.ustc.edu.cn +% All right reserved @ GuoCheng. +% Create at 2016.11.23 + +classdef USTCDAC < handle + properties (SetAccess = private) + timeout = 10 % seconds + end + + properties (SetAccess = private) + id = []; + ip = ''; + port = 0; + status = 'close'; + isopen = 0; + end + + properties (GetAccess = private,Constant = true) + driver = 'USTCDACDriver'; + driverh = 'USTCDACDriver.h'; + end + + properties (SetAccess = private, GetAccess = private) + ibuffer; % input buffer + obuffer; % output buffer + errorstatus = false; + end + + methods(Static = true) + function seq = Generate(count) + function_ctrl = 64;%53-63λ + trigger_ctrl = 0;%48-55λ + counter_ctrl = 0;%32-47룬¼ÆÊ±¼ÆÊýÆ÷ + length_wave = count;%16-31λ,Êä³ö²¨Ðγ¤¶È + address_wave = 0;%0-15²¨ÐÎÆðʼµØÖ· + seqlength = 4096; %¹²4096¸öÐòÁпØÖÆÊý¾Ý¿é + seq = zeros(1,seqlength*4); % ¹²4096¸öÐòÁÐÊý¾Ý + for k = 0:(seqlength-1) + seq(4*k+1) = counter_ctrl; + seq(4*k+2) = function_ctrl*256 + trigger_ctrl; + seq(4*k+3) = address_wave; + seq(4*k+4) = length_wave; + end + end + end + + methods + function obj = USTCDAC(ip,port) %construct function. + obj.ip = ip; + obj.port = port; + driverfilename = [obj.driver,'.dll']; + if(~libisloaded(obj.driver)) + loadlibrary(driverfilename,obj.driverh); + end + end + + function Open(obj) %open the device + if ~obj.isopen + [ret,pid,~] = calllib(obj.driver,'Open',0,obj.ip,obj.port); + if(ret == 0) + obj.id = uint32(pid); + obj.status = 'open'; + obj.isopen = true; + InitDevice(obj); + else + error('USTCDA:OpenError','Open DAC failed!'); + end + end + end + + function Close(obj) + if obj.isopen + if(libisloaded(obj.driver)) + ret = calllib(obj.driver,'Close',uint32(obj.id)); + if(ret == -1) + error('USTCDA:CloseError','Close DA failed.'); + end + end + obj.id = []; + obj.status = 'closed'; + obj.isopen = false; + end + end + + function InitDevice(obj) + %init gain of B03 +% if (obj.id == 3020007616)%init B03,ip180 + WriteGain(obj,0,511); + WriteGain(obj,1,511); + WriteGain(obj,2,511); + WriteGain(obj,3,511); +% end +% if(obj.id == 352430272)%init B07,ip21 +% WriteGain(obj,0,975); +% WriteGain(obj,1,974); +% WriteGain(obj,2,978); +% WriteGain(obj,3,982); +% end + SetTrigSel(obj,3); + obj.SetTotalCount(8000); + obj.SetDACStart(1); + obj.SetDACStop(5); + obj.SetTrigStart(36); + obj.SetTrigStop(100); + obj.SetTrigInterval(200*1e-6); + obj.SetTrigCount(10); + obj.SetLoop(1,1,1,1); + obj.SetIsMaster(0); + end + + function StartStop(obj,index) % + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'WriteInstruction', obj.id,uint32(hex2dec('00000405')),uint32(index),0); + if(ret == -1) + error('USTCADDA:StartStopError','Start/Stop failed.'); + end + end + + function FlipRAM(obj,index) + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'WriteInstruction', obj.id,uint32(hex2dec('00000305')),uint32(index),0); + if(ret == -1) + error('USTCADDA:FlipRAMError','FlipRAM failed.'); + end + end + + function SetLoop(obj,arg1,arg2,arg3,arg4) + if ~obj.isopen + obj.Open(); + end + para1 = arg1*2^16 + arg2; + para2 = arg3*2^16 + arg4; + ret = calllib(obj.driver,'WriteInstruction', obj.id,uint32(hex2dec('00000905')),uint32(para1),uint32(para2)); + if(ret == -1) + error('USTCADDA:SetLoopError','SetLoop failed.'); + end + end + + function ret = SetTotalCount(obj,count) + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),1,uint32(count*2^16)); + if(ret == -1) + error('USTCADDA:SetTotalCount','Set SetTotalCount failed.'); + end + end + + function ret = SetDACStart(obj,count) + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),2,uint32(count*2^16)); + if(ret == -1) + error('USTCADDA:SetDACStart','Set SetDACStart failed.'); + end + end + + function ret = SetDACStop(obj,count) + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),3,uint32(count*2^16)); + if(ret == -1) + error('USTCADDA:SetDACStop','Set SetDACStop failed.'); + end + end + + function ret = SetTrigStart(obj,count) + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),4,uint32(count*2^16)); + if(ret == -1) + error('USTCADDA:SetTrigStart','Set SetTrigStart failed.'); + end + end + + function ret = SetTrigStop(obj,count) + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),5,uint32(count*2^16)); + if(ret == -1) + error('USTCADDA:SetTrigStop','Set SetTrigStop failed.'); + end + end + + function SetIsMaster(obj,ismaster) + if ~obj.isopen + obj.Open(); + end + ret= calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),6,uint32(ismaster*2^16)); + if(ret == -1) + error('USTCADDA:SetIsMaster','Set SetIsMaster failed.'); + end + end + + function SetTrigSel(obj,sel) + if ~obj.isopen + obj.Open(); + end + ret= calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),7,uint32(sel*2^16)); + if(ret == -1) + error('USTCADDA:SetTrigSel','Set SetTrigSel failed.'); + end + end + + function ret = SendIntTrig(obj) + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),8,uint32(2^16)); + if(ret == -1) + error('USTCADDA:SendIntTrig','Set SendIntTrig failed.'); + end + end + + function ret = SetTrigInterval(obj,T) + % T unit: seconds + if ~obj.isopen + obj.Open(); + end + count = T/4e-9; + ret= calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001805')),9,uint32(count*2^12)); + if(ret == -1) + error('USTCADDA:SelectTrigIntervalError','Set trigger interval failed.'); + end + end + + function ret = SetTrigCount(obj,count) + if ~obj.isopen + obj.Open(); + end + ret= calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001805')),10,uint32(count*2^12)); + if(ret == -1) + error('USTCADDA:SetTrigCountError','Set trigger Count failed.'); + end + end + + function WriteWave(obj,ch,offset,data0) + if ~obj.isopen + obj.Open(); + end + for k = 1:length(data0)/2 + temp = data0(2*k); + data0(2*k) = data0(2*k-1); + data0(2*k-1) = temp; + end + len = length(data0); + data = data0; + if(mod(len,32) ~= 0) + len = (floor(len/32)+1)*32; + data = zeros(1,len); + data(1:length(data0)) = data0; + end + obj.StartStop(240); + seq = qes.hwdriver.sync.ustcadda_backen.USTCDAC.Generate(length(data0)/8); + WriteSeq(obj,ch,0,seq); + pval = libpointer('uint16Ptr', data); + startaddr = ch*2*2^18+2*offset; + len = length(data)*2; + [ret,~] = calllib(obj.driver,'WriteMemory',obj.id,uint32(hex2dec('000000004')),uint32(startaddr),uint32(len),pval); + if(ret == -1) + error('USTCADDA:WriteWaveError','WriteWave failed.'); + end + obj.StartStop(15); + end + + function WriteSeq(obj,ch,offset,data) + if ~obj.isopen + obj.Open(); + end + pval = libpointer('uint16Ptr', data); + startaddr = (ch*2+1)*2^18+offset*8;%²ÉÑùµãµÄÄÚ´æÆðʼµØÖ·£¬µ¥Î»ÊÇ×Ö½Ú¡£ + len = length(data)*2;%×Ö½Ú¸öÊý£¬ÒÔ²ÉÑùµãΪµ¥Î»¡£ + [ret,~] = calllib(obj.driver,'WriteMemory',obj.id,uint32(hex2dec('00000004')),uint32(startaddr),uint32(len),pval); + if(ret == -1) + error('USTCADDA:WriteSeqError','WriteSeq failed.'); + end + end + + function ret = ReadWave(obj,ch,offset,len) + if ~obj.isopen + obj.Open(); + end + startaddr = (ch*2)*2^18 + 2*offset; + [ret,pwave] = calllib(obj.driver,'ReadMemory',obj.pid,uint32(hex2dec('00000003')),uint32(startaddr),uint32(len*2),0); + if(ret == 0) + ret = pwave; % ret = get(pwave,'Value'); + else + error('USTCADDA:ReadWaveError','ReadWave failed.'); + end + end + + function ret = ReadSeq(obj,ch,offset,len) + if ~obj.isopen + obj.Open(); + end + startaddr = (ch*2+1)*2^18 + offset*8; + [ret,pwave] = calllib(obj.driver,'ReadMemory',obj.pid,uint32(hex2dec('00000003')),uint32(startaddr),uint32(len*8),0); + if(ret == 0) + ret = pwave; % ret = get(pwave,'Value'); + else + error('USTCADDA:ReadSeqError','ReadSeq failed.'); + end + end + + function ret = ReadReg(obj,addr) + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'ReadInstruction',obj.id,uint32(hex2dec('00000001')),uint32(addr),0); + if(ret == -1) + error('USTCADDA:ReadRegError','WriteReg failed.'); + end + end + + function ret = WriteReg(obj,addr,data) + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00000002')),uint32(addr),uint32(data)); + if(ret == -1) + error('USTCADDA:WriteRegError','WriteReg failed.'); + end + end + + function ret = WriteGain(obj,channel,data) + if ~obj.isopen + obj.Open(); + end + ret = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00000702')),uint32(channel),uint32(data)); + if(ret == -1) + error('USTCADDA:WriteGain','WriteGain failed.'); + end + end + + function flushinput(obj) + obj.ibuffer = []; + end + + function flushoutput(obj) + obj.obuffer = []; + end + + function response = query(obj,cmd) + obj.HandleCmd(cmd); + response = obj.ibuffer; + obj.ibuffer = []; + end + + function fprintf(obj,cmd) + obj.HandleCmd(cmd); + end + + function fopen(obj) + obj.Open(); + end + + function fclose(obj) + obj.Close(); + end + + function close(obj) + obj.Close(); + end + + function delete(obj) + obj.Close(); + end + end + + methods (Static = true) + + function SetParallel() + if(libisloaded(USTCDAC.driver)) + ret = calllib(USTCDAC.driver,'SetTaskMode'); + if(ret == -1) + error('USTCADDA:SetParallel','SetParallel failed.'); + end + else + error('USTCADDA:SetParallel','Library does not load!'); + end + end + + function StartTask() + if(libisloaded(USTCDAC.driver)) + ret = calllib(USTCDAC.driver,'StartTask'); + if(ret == -1) + warning('USTCADDA:StartTask','Does not run in parallel mode!.'); + end + else + error('USTCADDA:SetParallel','Library does not load!'); + end + end + end + + methods (Access = private) + function HandleCmd(obj, cmd) + cmd = upper(cmd); + switch cmd + case '*IDN?' + obj.ibuffer = 'USTC,USTC_DA_V1'; + obj.errorstatus = false; + case {'*CLS','*RST'} + % to be implemented + obj.errorstatus = false; + otherwise + obj.ibuffer = ['Unrecognized command string: ', cmd]; + obj.errorstatus = true; + end + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/CreateSequence.m b/+qes/+hwdriver/+sync/@awg/CreateSequence.m new file mode 100644 index 0000000..c6d057d --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/CreateSequence.m @@ -0,0 +1,67 @@ +function CreateSequence(obj,chnlnum,wvfrmnamelst) + % Create a squence for channel chnlnum whith waveforms specified by + % names in wvfrmnamelst(cell).Waveforms to form the sequence should + % already exit in the awg, if not, send them by SendWave before + % creating the sequence. + % example: + % AWG1.CreateSequence(2,{'wv1','wv5','untitled1','wv5',''wv3'}) + % creates a sequence for channel 2 of AWG1, whith 'wv1' at the head + % of the sequence. + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + N = numel(wvfrmnamelst); + if N < 2 + error('AWG:CreateSequenceError','zero or one waveform can not form a sequence'); + end + switch TYP + case {'tek5000','tek5k','tek7000','tek7k','tek70000','tek70k'} + % AWG: Tecktronix AWG 5000. The following code could also work + % for Tecktronix AWG 7000 and 70000(not tested). + if isempty(chnlnum) || round(chnlnum)~=chnlnum || chnlnum <=0 || chnlnum > obj.nchnls + error('AWG:CreateSequenceError','invalid chnlnum!'); + end + switch TYP + case{'tek5000','tek5k'} + if N > 7998 + error('AWG:CreateSequenceError','sequence waveform number bigger than Tek awg 7998 maximum 16000'); + end + case{'tek7000','tek7k'} + if N > 16000 + error('AWG:CreateSequenceError','sequence waveform number bigger than Tek awg 7000 maximum 16000'); + end + case{'tek70000','tek70k'} + + end + fprintf(obj.interfaceobj,'AWGC:RMOD SEQuence'); + fprintf(obj.interfaceobj, ['SEQUENCE:LENGTH ', num2str(N)]); + for ii = 1:N + WvfrmName = wvfrmnamelst{ii}; + if isempty(WvfrmName) || ~ischar(WvfrmName) || ~isvarname(WvfrmName) + error('AWG:CreateSequenceError','Invalid waveform name!'); + end + end + for ii = 1:N + fprintf(obj.interfaceobj, ['SEQUENCE:ELEMENT', num2str(ii,'%d'),... + ':WAVEFORM', num2str(chnlnum,'%d'), ' "', wvfrmnamelst{ii}, '"']); + fprintf(obj.interfaceobj, ['SEQUENCE:ELEMENT', num2str(ii,'%d'), ':GOTO:STATE 1']); + if ii ~= N + fprintf(obj.interfaceobj, ['SEQUENCE:ELEMENT', num2str(ii,'%d'), ':GOTO:INDEX ', num2str(ii+1)]); + else + fprintf(obj.interfaceobj, ['SEQUENCE:ELEMENT', num2str(ii,'%d'), ':GOTO:INDEX 1']); + end + if obj.trigmode == 1 % internal + fprintf(obj.interfaceobj, ['SEQUENCE:ELEMENT', num2str(ii,'%d'), ':TWAIT 0']); + else + fprintf(obj.interfaceobj, ['SEQUENCE:ELEMENT', num2str(ii,'%d'), ':TWAIT 1']); + end + end + case {'ustc_da_v1'} + error('AWG:CreateSequenceError','Not implemented!'); + otherwise + error('AWG:CreateSequenceError','Unsupported awg!'); + end +end diff --git a/+qes/+hwdriver/+sync/@awg/DelWave.m b/+qes/+hwdriver/+sync/@awg/DelWave.m new file mode 100644 index 0000000..e3feee5 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/DelWave.m @@ -0,0 +1,28 @@ +function DelWave(obj,wavename) + % Run or Stop AWG + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k',... + 'tek7000','tek7k',... + 'tek70000','tek70k'} + if nargin == 1 + fprintf(obj.interfaceobj, 'WLIS:WAV:DEL ALL'); + else + fprintf(obj.interfaceobj, ['WLIS:WAV:DEL "',wavename, '"']); + end + case {'tek5000','tek5k',} + if nargin == 1 + fprintf(obj.interfaceobj, 'WLIS:WAV:DEL ALL'); + else + fprintf(obj.interfaceobj, ['WLIS:WAV:DEL "',wavename, '"']); + end + case {'ustc_da_v1'} + otherwise + error('AWG:StopError','Unsupported awg!'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/GetAWGOnOff.m b/+qes/+hwdriver/+sync/@awg/GetAWGOnOff.m new file mode 100644 index 0000000..ad87bab --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/GetAWGOnOff.m @@ -0,0 +1,42 @@ +function val = GetAWGOnOff(obj) + % Get awg running status + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k',... + 'tek7000','tek7k',... + 'tek70000','tek70k'} + flushinput(obj.interfaceobj); % query dose not flush input butter(R2013b) + temp = query(obj.interfaceobj,'AWGControl:RSTate?'); + if isempty(temp(1)) + error('AWG:GetAWGOnOff','unrecognized qurery result!'); + end + status = str2double(temp(1)); + if status == 0 + val = false; + elseif status >= 1 + val = true; + else + error('AWG:GetAWGOnOff','unrecognized qurery result!'); + end + case {'hp33120','agl33120','hp33220','agl33220'} % not tested + flushinput(obj.interfaceobj); % query dose not flush input butter(R2013b) + temp = query(obj.interfaceobj,'BM:STAT?'); + if strcmp(temp(1),'0') + val = false; + elseif strcmp(temp(1),'1') + val = true; + else + error('AWG:GetAWGOnOff','unrecognized qurery result!'); + end + case {'ustc_da_v1'} + warning('AWG:GetAWGOnOff','Not implemented!'); + val = true; + otherwise + error('AWG:StopError','Unsupported awg!'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/GetChnlOnOff.m b/+qes/+hwdriver/+sync/@awg/GetChnlOnOff.m new file mode 100644 index 0000000..114cdf7 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/GetChnlOnOff.m @@ -0,0 +1,33 @@ +function val = GetChnlOnOff(obj,chnl) + % query output status of the channel chnl + % this method is intended to be called within + % the method On of class waveform only. + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k',... + 'tek7000','tek7k',... + 'tek70000','tek70k'} + % AWG: Tecktronix AWG 5000,7000,70000 + flushinput(obj.interfaceobj); % query dose not flush input butter(R2013b) + str = query(obj.interfaceobj,['OUTP', num2str(chnl), ':STAT?']); + if strcmp(str(1), '1') + val = true; + elseif strcmp(str(1), '0') + val = false; + else + error('AWG:GetChnlOnOff', 'an instrument query got unexpected result.'); + end + case {'hp33120','agl33120','hp33220','agl33220'} + val = obj.on; + case {'ustc_da_v1'} + waring('not implemented.'); + val = true; + otherwise + error('AWG:SendWaveError','Unsupported awg!'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/GetInstance.m b/+qes/+hwdriver/+sync/@awg/GetInstance.m new file mode 100644 index 0000000..f4bce4a --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/GetInstance.m @@ -0,0 +1,55 @@ +function obj = GetInstance(name,interfaceobj,drivertype) + % if called without input arguments, the first valid instance is + % returned, if 'name' is not empty, the instance that matches 'name' + % is returned if exits, if not exit, a new instance is created(in this + % case all input arguments should be specified) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + persistent objlst; + if isempty(objlst) + if nargin == 0 || isempty(name) + error('awg:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + end + if nargin > 2 + obj = qes.hwdriver.sync.awg(name,interfaceobj,drivertype); + else + obj = qes.hwdriver.sync.awg(name,interfaceobj); + end + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of delete objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 || isempty(name) + error('awg:GetInstanceError',... + 'No existing instance, all input paramenter should be specified!'); + end + if nargin > 2 + obj = qes.hwdriver.sync.awg(name,interfaceobj,drivertype); + else + obj = qes.hwdriver.sync.awg(name,interfaceobj); + end + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/InitializeInstr.m b/+qes/+hwdriver/+sync/@awg/InitializeInstr.m new file mode 100644 index 0000000..77c6bd7 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/InitializeInstr.m @@ -0,0 +1,45 @@ +function [varargout] = InitializeInstr(obj) +% + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + ErrorMsg = []; + % todo: + % set ext trig level, slop, impedance etc + + + if ~strcmp(obj.interfaceobj.Status,'closed') + fclose(obj.interfaceobj); + end + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k'} + % AWG: Tecktronix AWG 5000 + obj.interfaceobj.Timeout = 120; % seconds, this may need be increased in some special applictions + obj.interfaceobj.InputBufferSize = 20000000; % bytes, should be enough for most applications + obj.interfaceobj.OutputBufferSize = 20000000; % bytes, should be enough for most applications + obj.interfaceobj.ByteOrder = 'littleEndian'; + case {'tek7000','tek7k'} + % AWG: Tecktronix AWG 7000 + obj.interfaceobj.Timeout = 120; % seconds, this may need be increased in some special applictions + obj.interfaceobj.InputBufferSize = 50000000; % bytes, should be enough for most applications + obj.interfaceobj.OutputBufferSize = 50000000; % bytes, should be enough for most applications + obj.interfaceobj.ByteOrder = 'littleEndian'; + case {'tek70000','tek70k'} + % AWG: Tecktronix AWG 70000 + obj.interfaceobj.Timeout = 900; % seconds, this may need be increased in some special applictions + % note: maximum timeout is 1000. + obj.interfaceobj.InputBufferSize = 100000000; % bytes, should be enough for most applications + obj.interfaceobj.OutputBufferSize = 100000000; % bytes, should be enough for most applications + obj.interfaceobj.ByteOrder = 'littleEndian'; + case {'ustc_da_v1'} + + otherwise + error('AWG:SetInterfaceObj','Unsupported awg: ''%s''', TYP); + end + fopen(obj.interfaceobj); + + + varargout{1} = ErrorMsg; +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/LoadWave.m b/+qes/+hwdriver/+sync/@awg/LoadWave.m new file mode 100644 index 0000000..07f11d9 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/LoadWave.m @@ -0,0 +1,32 @@ +function LoadWave(obj,WaveformObj,Delay) + % Load wave into the specified awg channel. + % this method is intended to be called within + % the method LoadWave of class waveform only. + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if nargin < 3 + Delay = 0; + end + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k','tek7000','tek7k'} % tek awg dose not support delay. + % AWG: Tecktronix AWG 5000,7000,70000 + WvfrmName = WaveformObj.name; + ChnlIdx = WaveformObj.awgchnl; + fprintf(obj.interfaceobj,['SOUR', num2str(ChnlIdx), ':WAV "', WvfrmName, '"']); + fprintf(obj.interfaceobj,['SOUR', num2str(WaveformObj.awgchnl),':VOLT:AMPL 0.6']); + fprintf(obj.interfaceobj,['SOUR', num2str(WaveformObj.awgchnl),':VOLT:OFFS 0']); + fprintf(obj.interfaceobj,['AWGCONTROL:DOUTPUT', num2str(WaveformObj.awgchnl), ':STATE 1']); + case {'hp33120','agl33120','hp33220','agl33220'} % not tested + % todo + case {'ustc_da_v1'} + obj.interfaceobj.LoadWave(WaveformObj.awgchnl,WaveformObj.name,Delay); % add delay + otherwise + error('AWG:LoadWaveError','Unsupported awg!'); + end +end + + \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/PrepareWvData.m b/+qes/+hwdriver/+sync/@awg/PrepareWvData.m new file mode 100644 index 0000000..678000b --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/PrepareWvData.m @@ -0,0 +1,50 @@ +function [WaveformData] = PrepareWvData(WaveformObj,DAVpp,NB) + % this function is a static private method + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + t = WaveformObj.t0:WaveformObj.t0+WaveformObj.length-1; + y = WaveformObj(t); + if WaveformObj.iq + WaveformData = [real(y);imag(y)]; + N = 2; + else + WaveformData = real(y); + N = 1; + end + + for ii = 1:N + VHi = max(WaveformData(ii,:)); + VLo = min(WaveformData(ii,:)); + Vpp = VHi - VLo; + WaveformData(ii,:) = WaveformData(ii,:) - (VHi + VLo)/2; + if Vpp > 0 + WaveformData(ii,:) = WaveformData(ii,:)/Vpp; + end + + if Vpp > 0 + WaveformData(ii,:) = WaveformData(ii,:) + 0.5; + end + + RequiredMinDAVpp = 2*max(abs(VHi),abs(VLo)); + if DAVpp < RequiredMinDAVpp - 1e-4 + error('AWG:PrepareWvDataError',['Waveform Vpp out of DA Vpp range, maximum: ', num2str(DAVpp,'%0.4f'), ', ', num2str(RequiredMinDAVpp,'%0.4f'),' required.']); + end + + K = 2^NB-1; + if Vpp > 0 + r1 = (1-RequiredMinDAVpp/DAVpp)/2; + r2 = Vpp/DAVpp; + if abs(VHi)>= abs(VLo) + WaveformData(ii,:) = round(K*(r2*WaveformData(ii,:)+1-r2-r1)); + else + WaveformData(ii,:) = round(K*(r2*WaveformData(ii,:)+r1)); + end + else % DC + WaveformData(ii,1:end) = (2^(NB-1)-1)*(1 + VHi/(DAVpp/2)); + end + end + WaveformData = uint16(WaveformData); +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/PrepareWvData_Tek70k.m b/+qes/+hwdriver/+sync/@awg/PrepareWvData_Tek70k.m new file mode 100644 index 0000000..16858fe --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/PrepareWvData_Tek70k.m @@ -0,0 +1,63 @@ +function [WaveformData] = PrepareWvData_Tek70k(WaveformObj) + % this function is a static private method + % Tek awg 70k only support float wave data + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + t = WaveformObj.t0:WaveformObj.t0+WaveformObj.length-1; + y = WaveformObj(t); + if WaveformObj.iq + WaveformData = [real(y);imag(y)]; + else + WaveformData = real(y); + end + WaveformData = WaveformData*4; % this is due to a singular feature of awg 70k: output is 1/4 in amplitude of the waveform data. + +% WvfrmVpp = WaveformObj.vpp; +% Offset = WaveformObj.offset; +% VHi = Offset + WvfrmVpp/2; +% VLo = Offset - WvfrmVpp/2; +% AWGVpp = 2*max(abs(VHi),abs(VLo)); +% if WaveformObj.fixawgvpp +% % todo +% end + +% marker are removed in newer version for efficiency consideration +% Vpp = 0.5; +% Offset = 0; +% MarkerData = []; +% MarkerVpp = []; +% MarkerOffset = []; +% if isempty(WaveformObj.markers) % no markers +% return; +% end +% if isempty(WaveformObj.markers{1}.wvdata) +% WaveformObj.markers{1}.GenWave(); +% end +% MarkerVpp = NaN*zeros(1,2); +% MarkerOffset = NaN*zeros(1,2); +% Marker1Data = WaveformObj.markers{1}.wvdata; +% if range(Marker1Data) > 0 +% Marker1Data = Marker1Data + 0.5; +% end +% Marker1Data(Marker1Data<0.5) = 0; % marker data can only be 0 or 1. +% Marker1Data(Marker1Data>=0.5) = 1; +% MarkerVpp(1) = WaveformObj.markers{1}.vpp; +% MarkerOffset(1) = WaveformObj.markers{1}.offset; +% Marker2Data = zeros(1,WaveformObj.length); +% if numel(WaveformObj.markers) == 2 +% if isempty(WaveformObj.markers{2}.wvdata) +% WaveformObj.markers{2}.GenWave(); +% end +% Marker2Data = WaveformObj.markers{2}.wvdata; +% if range(Marker2Data) > 0 +% Marker2Data = Marker2Data + 0.5; +% end +% Marker2Data(Marker2Data<0.5) = 0; % marker data can only be 0 or 1. +% Marker2Data(Marker2Data>=0.5) = 1; +% MarkerVpp(2) = WaveformObj.markers{2}.vpp; +% MarkerOffset(2) = WaveformObj.markers{2}.offset; +% end +% MarkerData = uint8(Marker1Data*2^6 + Marker2Data*2^7); +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/Run.m b/+qes/+hwdriver/+sync/@awg/Run.m new file mode 100644 index 0000000..ba10977 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/Run.m @@ -0,0 +1,52 @@ +function varargout = Run(obj,N) + % Run awg to output waveform N times, wave data should be already transfered + % to AWG. N < 1, stop + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + N = round(N); + varargout = {}; + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k',... + 'tek7000','tek7k',... + 'tek70000','tek70k'} + % AWG: Tecktronix AWG 5000,7000,70000 + if N >= 1 + for ii = 1:length(obj.nchnls) + try + fprintf(obj.interfaceobj,['OUTP', num2str(ii), ':STAT ON']); + catch + end + end + fprintf(obj.interfaceobj,'AWGC:RUN'); +% while 1 % checking takes time, this is +% % drags downs measurement time considerably when +% % a lot of channels are used +% bol = obj.GetChnlOnOff(chnl); +% if ~islogical(bol) +% warnning('AWG:SetAWG','query instrument status failed, on status unknown'); +% break; +% elseif bol +% break; +% elseif isprop(obj,'timeout') && toc > obj.timeout +% warnning('AWG:SetAWG','query instrument status timed out, on status unknown'); +% break; +% end +% pause(0.1); +% end + else + for ii = 1:length(obj.nchnls) + try + fprintf(obj.interfaceobj,['OUTP', num2str(ii), ':STAT OFF']); + catch + end + end + end + case {'ustc_da_v1'} + % Run for USTCADDA is do in the Measurement object + otherwise + error('AWG:OffError','Unsupported awg!'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/SendWave.m b/+qes/+hwdriver/+sync/@awg/SendWave.m new file mode 100644 index 0000000..17a87f0 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/SendWave.m @@ -0,0 +1,221 @@ +function SendWave(obj,WaveformObj) + % send waveform to awg. this method is intended to be called within + % the method SendWave of class waveform only. + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k'} + % AWG: Tecktronix AWG 5000 + WaveformData = qes.hwdriver.sync.awg.PrepareWvData(WaveformObj,0.6,14); + if WaveformObj.iq + if isempty(WaveformObj.name) + WvfrmName = ['Untitled_',datestr(now,'yymmdd_HHMMSS'),'_',num2str(10000*rand(1),'%0.0f'),'_I']; + else + WvfrmName = [WaveformObj.name,'_I']; + end + startidx = 0; + wvdatasize = WaveformObj.length; + fprintf(obj.interfaceobj, ['WLIS:WAV:DEL "',WaveformObj.name, '"']); + WvfrmNameStr = ['WLIS:WAV:NEW "', WvfrmName, '"']; + WvfrmWriteStr = ['WLIS:WAV:DATA "', WvfrmName, '"',',',num2str(startidx),',',num2str(wvdatasize),... + ',#', num2str(length(num2str(2*wvdatasize))), num2str(2*wvdatasize)]; + % create a waveform in the AWG waveform list + % send by integer is 2.5 times faster than send by float. + fprintf(obj.interfaceobj,[WvfrmNameStr,',', num2str(wvdatasize), ',INT']); + % send waveform data to the newly created waveform + fwrite(obj.interfaceobj,WvfrmWriteStr); + fwrite(obj.interfaceobj,WaveformData(1,startidx+1:startidx+wvdatasize),'uint16'); % 'uint16'! NOT 'int16' + fwrite(obj.interfaceobj, 10); + + if isempty(WaveformObj.name) + WvfrmName = ['Untitled_',datestr(now,'yymmdd_HHMMSS'),'_',num2str(10000*rand(1),'%0.0f'),'_Q']; + else + WvfrmName = [WaveformObj.name,'_Q']; + end + startidx = 0; + wvdatasize = WaveformObj.length; + fprintf(obj.interfaceobj, ['WLIS:WAV:DEL "',WaveformObj.name, '"']); + WvfrmNameStr = ['WLIS:WAV:NEW "', WvfrmName, '"']; + WvfrmWriteStr = ['WLIS:WAV:DATA "', WvfrmName, '"',',',num2str(startidx),',',num2str(wvdatasize),... + ',#', num2str(length(num2str(2*wvdatasize))), num2str(2*wvdatasize)]; + % create a waveform in the AWG waveform list + % send by integer is 2.5 times faster than send by float. + fprintf(obj.interfaceobj,[WvfrmNameStr,',', num2str(wvdatasize), ',INT']); + % send waveform data to the newly created waveform + fwrite(obj.interfaceobj,WvfrmWriteStr); + fwrite(obj.interfaceobj,WaveformData(2,startidx+1:startidx+wvdatasize),'uint16'); % 'uint16'! NOT 'int16' + fwrite(obj.interfaceobj, 10); + else + if isempty(WaveformObj.name) + WvfrmName = ['Untitled_',datestr(now,'yymmdd_HHMMSS'),'_',num2str(10000*rand(1),'%0.0f')]; + else + WvfrmName = WaveformObj.name; + end + startidx = 0; + wvdatasize = WaveformObj.length; + fprintf(obj.interfaceobj, ['WLIS:WAV:DEL "',WaveformObj.name, '"']); + WvfrmNameStr = ['WLIS:WAV:NEW "', WvfrmName, '"']; + WvfrmWriteStr = ['WLIS:WAV:DATA "', WvfrmName, '"',',',num2str(startidx),',',num2str(wvdatasize),... + ',#', num2str(length(num2str(2*wvdatasize))), num2str(2*wvdatasize)]; + % create a waveform in the AWG waveform list + % send by integer is 2.5 times faster than send by float. + fprintf(obj.interfaceobj,[WvfrmNameStr,',', num2str(wvdatasize), ',INT']); + % send waveform data to the newly created waveform + fwrite(obj.interfaceobj,WvfrmWriteStr); + fwrite(obj.interfaceobj,WaveformData(startidx+1:startidx+wvdatasize),'uint16'); % 'uint16'! NOT 'int16' + fwrite(obj.interfaceobj, 10); + end + case {'tek7000','tek7k'} + % AWG: Tecktronix awg 7000 + WaveformData = qes.hwdriver.sync.awg.PrepareWvData(WaveformObj,0.5,10); + if WaveformObj.iq + if isempty(WaveformObj.name) + WvfrmName = ['Untitled_',datestr(now,'yymmdd_HHMMSS'),'_',num2str(10000*rand(1),'%0.0f'),'_I']; + else + WvfrmName = [WaveformObj.name,'_I']; + end + startidx = 0; + wvdatasize = WaveformObj.length; + WvfrmNameStr = ['WLIS:WAV:NEW "', WvfrmName, '"']; + WvfrmWriteStr = ['WLIS:WAV:DATA "', WvfrmName, '"',',',num2str(startidx),',',num2str(wvdatasize),... + ',#', num2str(length(num2str(2*wvdatasize))), num2str(2*wvdatasize)]; + % create a waveform in the AWG waveform list + % send by integer is 2.5 times faster than send by float. + fwrite(obj.interfaceobj,[WvfrmNameStr,',', num2str(wvdatasize), ',INT',10]); + % send waveform data to the newly created waveform + fwrite(obj.interfaceobj,WvfrmWriteStr); + fwrite(obj.interfaceobj,WaveformData(1,startidx+1:startidx+wvdatasize),'uint16'); % 'uint16'! NOT 'int16' + fwrite(obj.interfaceobj, 10); + + if isempty(WaveformObj.name) + WvfrmName = ['Untitled_',datestr(now,'yymmdd_HHMMSS'),'_',num2str(10000*rand(1),'%0.0f'),'_Q']; + else + WvfrmName = [WaveformObj.name,'_Q']; + end + startidx = 0; + wvdatasize = WaveformObj.length; + WvfrmNameStr = ['WLIS:WAV:NEW "', WvfrmName, '"']; + WvfrmWriteStr = ['WLIS:WAV:DATA "', WvfrmName, '"',',',num2str(startidx),',',num2str(wvdatasize),... + ',#', num2str(length(num2str(2*wvdatasize))), num2str(2*wvdatasize)]; + % create a waveform in the AWG waveform list + % send by integer is 2.5 times faster than send by float. + fwrite(obj.interfaceobj,[WvfrmNameStr,',', num2str(wvdatasize), ',INT',10]); + % send waveform data to the newly created waveform + fwrite(obj.interfaceobj,WvfrmWriteStr); + fwrite(obj.interfaceobj,WaveformData(2,startidx+1:startidx+wvdatasize),'uint16'); % 'uint16'! NOT 'int16' + fwrite(obj.interfaceobj, 10); + else + if isempty(WaveformObj.name) + WvfrmName = ['Untitled_',datestr(now,'yymmdd_HHMMSS'),'_',num2str(10000*rand(1),'%0.0f')]; + else + WvfrmName = [WaveformObj.name]; + end + startidx = 0; + wvdatasize = WaveformObj.length; + WvfrmNameStr = ['WLIS:WAV:NEW "', WvfrmName, '"']; + WvfrmWriteStr = ['WLIS:WAV:DATA "', WvfrmName, '"',',',num2str(startidx),',',num2str(wvdatasize),... + ',#', num2str(length(num2str(2*wvdatasize))), num2str(2*wvdatasize)]; + % create a waveform in the AWG waveform list + % send by integer is 2.5 times faster than send by float. + fwrite(obj.interfaceobj,[WvfrmNameStr,',', num2str(wvdatasize), ',INT',10]); + % send waveform data to the newly created waveform + fwrite(obj.interfaceobj,WvfrmWriteStr); + fwrite(obj.interfaceobj,WaveformData(startidx+1:startidx+wvdatasize),'uint16'); % 'uint16'! NOT 'int16' + fwrite(obj.interfaceobj, 10); + end + case {'tek70000','tek70k'} + % AWG: Tecktronix AWG 70000 + if WaveformObj.length < 4800 + error('AWG:SendWaveError','Waveform length short than Tek 70000 minimum: 4800 points!'); + end + WaveformData = qes.hwdriver.sync.awg.PrepareWvData_Tek70k(WaveformObj); + if WaveformObj.iq + if isempty(WaveformObj.name) + WvfrmName = ['Untitled_',datestr(now,'yymmdd_HHMMSS'),'_',num2str(10000*rand(1),'%0.0f'),'_I']; + else + WvfrmName = [WaveformObj.name,'_I']; + end + startidx = 0; + wvdatasize = WaveformObj.length; + if isprop(WaveformObj,'uploadstartidx') && isprop(WaveformObj,'uploadendidx') &&... + ~isempty(WaveformObj.uploadstartidx) && ~isempty(WaveformObj.uploadendidx) + startidx = WaveformObj.uploadstartidx - 1; + wvdatasize = WaveformObj.uploadendidx - WaveformObj.uploadstartidx + 1; + end + WvfrmNameStr = ['WLIS:WAV:NEW "', WvfrmName, '"']; + WvfrmWriteStr = ['WLIS:WAV:DATA "', WvfrmName, '"',',',num2str(startidx),',',num2str(wvdatasize),... + ',#', num2str(length(num2str(4*wvdatasize))), num2str(4*wvdatasize)]; % float point, 4 bytes per data point + % create a waveform in the AWG waveform list + fprintf(obj.interfaceobj,[WvfrmNameStr,',', num2str(wvdatasize)]); + % send waveform data to the newly created waveform + fwrite(obj.interfaceobj,WvfrmWriteStr); + fwrite(obj.interfaceobj,WaveformData(1,startidx+1:startidx+wvdatasize),'float'); % awg 70k only support floating point waveform data points + fwrite(obj.interfaceobj, 10); + + if isempty(WaveformObj.name) + WvfrmName = ['Untitled_',datestr(now,'yymmdd_HHMMSS'),'_',num2str(10000*rand(1),'%0.0f'),'_Q']; + else + WvfrmName = [WaveformObj.name,'_Q']; + end + startidx = 0; + wvdatasize = WaveformObj.length; + if isprop(WaveformObj,'uploadstartidx') && isprop(WaveformObj,'uploadendidx') &&... + ~isempty(WaveformObj.uploadstartidx) && ~isempty(WaveformObj.uploadendidx) + startidx = WaveformObj.uploadstartidx - 1; + wvdatasize = WaveformObj.uploadendidx - WaveformObj.uploadstartidx + 1; + end + WvfrmNameStr = ['WLIS:WAV:NEW "', WvfrmName, '"']; + WvfrmWriteStr = ['WLIS:WAV:DATA "', WvfrmName, '"',',',num2str(startidx),',',num2str(wvdatasize),... + ',#', num2str(length(num2str(4*wvdatasize))), num2str(4*wvdatasize)]; % float point, 4 bytes per data point + % create a waveform in the AWG waveform list + fprintf(obj.interfaceobj,[WvfrmNameStr,',', num2str(wvdatasize)]); + % send waveform data to the newly created waveform + fwrite(obj.interfaceobj,WvfrmWriteStr); + fwrite(obj.interfaceobj,WaveformData(2,startidx+1:startidx+wvdatasize),'float'); % awg 70k only support floating point waveform data points + fwrite(obj.interfaceobj, 10); + else + if isempty(WaveformObj.name) + WvfrmName = ['Untitled_',datestr(now,'yymmdd_HHMMSS'),'_',num2str(10000*rand(1),'%0.0f')]; + else + WvfrmName = [WaveformObj.name]; + end + startidx = 0; + wvdatasize = WaveformObj.length; + if isprop(WaveformObj,'uploadstartidx') && isprop(WaveformObj,'uploadendidx') &&... + ~isempty(WaveformObj.uploadstartidx) && ~isempty(WaveformObj.uploadendidx) + startidx = WaveformObj.uploadstartidx - 1; + wvdatasize = WaveformObj.uploadendidx - WaveformObj.uploadstartidx + 1; + end + WvfrmNameStr = ['WLIS:WAV:NEW "', WvfrmName, '"']; + WvfrmWriteStr = ['WLIS:WAV:DATA "', WvfrmName, '"',',',num2str(startidx),',',num2str(wvdatasize),... + ',#', num2str(length(num2str(4*wvdatasize))), num2str(4*wvdatasize)]; % float point, 4 bytes per data point + % create a waveform in the AWG waveform list + fprintf(obj.interfaceobj,[WvfrmNameStr,',', num2str(wvdatasize)]); + % send waveform data to the newly created waveform + fwrite(obj.interfaceobj,WvfrmWriteStr); + fwrite(obj.interfaceobj,WaveformData(startidx+1:startidx+wvdatasize),'float'); % awg 70k only support floating point waveform data points + fwrite(obj.interfaceobj, 10); + end + case {'hp33120','agl33120','hp33220','agl33220'} % not tested + % todo + case {'ustc_da_v1'} + WaveformData = qes.hwdriver.sync.awg.PrepareWvData(WaveformObj,0.67,16); +% WaveformData(:,1:10000) = 0; % debug +% WaveformData(:,10001:20000) = 65535; % debug + if WaveformObj.iq + obj.interfaceobj.SendWave(WaveformObj.awgchnl(1),WaveformData(1,:)); + obj.interfaceobj.SendWave(WaveformObj.awgchnl(2),WaveformData(2,:)); + else + obj.interfaceobj.SendWave(WaveformObj.awgchnl,WaveformData); + end +% figure(); +% plot(WaveformData(1,:)); + + otherwise + error('awg:SendWaveError','Unsupported awg!'); + end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/SetAWGOnOff.m b/+qes/+hwdriver/+sync/@awg/SetAWGOnOff.m new file mode 100644 index 0000000..28b64f6 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/SetAWGOnOff.m @@ -0,0 +1,36 @@ +function SetAWGOnOff(obj,On) + % Run or Stop AWG + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k',... + 'tek7000','tek7k',... + 'tek70000','tek70k'} + % AWG: Tecktronix AWG 5000,7000,70000 + if On + if isempty(cell2mat(obj.waveforms)) + error('AWG:SetAWG','no waveform'); + end + fprintf(obj.interfaceobj,'AWGC:RUN'); + tic + while 1 + if obj.on + break; + elseif isprop(obj,'timeout') && toc > obj.timeout + warnning('AWG:SetAWG','query instrument status timed out, on status unknown'); + break; + end + pause(0.5); + end + else + fprintf(obj.interfaceobj,'AWGC:STOP'); + end + case {'ustc_da_v1'} + otherwise + error('AWG:StopError','Unsupported awg!'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/SetChnlOnOff.m b/+qes/+hwdriver/+sync/@awg/SetChnlOnOff.m new file mode 100644 index 0000000..408deac --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/SetChnlOnOff.m @@ -0,0 +1,41 @@ +function SetChnlOnOff(obj,chnl,on,N) + % Set the specified awg channel output on/off. + % on = true/false, output on/off + % this method is intended to be called within + % the method Off of class waveform only. + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k',... + 'tek7000','tek7k',... + 'tek70000','tek70k'} + % AWG: Tecktronix AWG 5000,7000,70000 + if on + fprintf(obj.interfaceobj,['OUTP', num2str(chnl), ':STAT ON']); +% while 1 % checking takes time, this is drags +% % drags downs measurement time considerably when +% % a lot of channels are used +% bol = obj.GetChnlOnOff(chnl); +% if ~islogical(bol) +% warnning('AWG:SetAWG','query instrument status failed, on status unknown'); +% break; +% elseif bol +% break; +% elseif isprop(obj,'timeout') && toc > obj.timeout +% warnning('AWG:SetAWG','query instrument status timed out, on status unknown'); +% break; +% end +% pause(0.1); +% end + else + fprintf(obj.interfaceobj,['OUTP', num2str(chnl), ':STAT OFF']); + end + case {'ustc_da_v1'} + otherwise + error('AWG:OffError','Unsupported awg!'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/SetInterfaceObj.m b/+qes/+hwdriver/+sync/@awg/SetInterfaceObj.m new file mode 100644 index 0000000..20b19b1 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/SetInterfaceObj.m @@ -0,0 +1,9 @@ +function SetInterfaceObj(obj) + % Set byte transmission order, static private method + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@awg/SetRunMode.m b/+qes/+hwdriver/+sync/@awg/SetRunMode.m new file mode 100644 index 0000000..2ffdbd1 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/SetRunMode.m @@ -0,0 +1,43 @@ +function SetRunMode(obj) + % Set run mode, triggered of continues + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k',... + 'tek7000','tek7k'} + % AWG: Tecktronix AWG 5000, 7000 + switch obj.runmode + case 1 % triggered mode + fprintf(obj.interfaceobj,'AWGC:RMOD TRIG'); + fprintf(obj.interfaceobj,'TRIG:WVAL FIRS'); + case 2 % sequence mode + fprintf(obj.interfaceobj,'AWGC:RMOD SEQuence'); + case 3 % gated mode + fprintf(obj.interfaceobj,'AWGC:RMOD GAT'); + fprintf(obj.interfaceobj,'TRIG:WVAL FIRS'); + case 4 % continues mode + fprintf(obj.interfaceobj,'AWGC:RMOD CONT'); + otherwise + error('AWG:InvalidPoperty','Invalid runmode value for Tecktronix AWG 5000/7000(valid: 0/1/2/3 for triggered/sequence/gated/continues)'); + end + case {'tek70000','tek70k'} + % AWG: Tecktronix AWG 70000 + switch obj.runmode + case 0 % triggered mode + fprintf(obj.interfaceobj,'AWGC:RMOD TRIG'); + fprintf(obj.interfaceobj,'TRIG:WVAL FIRS'); + case 1 % sequence mode + fprintf(obj.interfaceobj,'AWGC:RMOD SEQuence'); + otherwise + error('AWG:InvalidPoperty','Invalid runmode value for Tecktronix AWG 70000(valid: 0/1 for triggered/sequence)'); + end + case {'ustc_da_v1'} + disp('Set Run Mmode Not implemented!'); + otherwise + error('AWG:SetRunModeError','Unsupported awg!'); + end +end diff --git a/+qes/+hwdriver/+sync/@awg/SetSmplRate.m b/+qes/+hwdriver/+sync/@awg/SetSmplRate.m new file mode 100644 index 0000000..3807665 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/SetSmplRate.m @@ -0,0 +1,35 @@ +function SetSmplRate(obj) + % Set sampling rate + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k',... + 'tek7000','tek7k',... + 'tek70000','tek70k'} + % AWG: Tecktronix AWG 5000,7000,70000 + switch TYP + case {'tek5000','tek5k'} + if obj.smplrate > 1.2e9 || obj.smplrate < 10e6 + error('AWG:SetSmplRateError','TekAWG5000: Sampling freqeuncy out of range(max:1.2GHz, min:10MHz)!'); + end + case {'tek7000','tek7k'} + if obj.smplrate > 12e9 || obj.smplrate < 10e6 + error('AWG:SetSmplRateError','TekAWG7000: Sampling freqeuncy out of range(max:12GHz, min:10MHz)!'); + end + case {'tek70000','tek70k'} + if obj.smplrate > 50e9 || obj.smplrate < 1.49e3 + error('AWG:SetSmplRateError','TekAWG70000: Sampling freqeuncy out of range(max:50GHz, min:1.49kHz)!'); + end + end + % Set sampling frequency. Note: 'SOUR1' dose not mean it's + % the sampling frequency of chnl1/source1! + fprintf(obj.interfaceobj,['SOUR1', [':FREQ ', num2str(obj.smplrate/1e9,'%0.9f'), 'GHZ']]); + case {'ustc_da_v1'} + otherwise + error('AWG:SetSmplRateError','Unsupported awg!'); + end +end diff --git a/+qes/+hwdriver/+sync/@awg/SetTrigInterval.m b/+qes/+hwdriver/+sync/@awg/SetTrigInterval.m new file mode 100644 index 0000000..9468056 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/SetTrigInterval.m @@ -0,0 +1,24 @@ +function SetTrigInterval(obj) + % Set trigger interval, internal trigger only + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if obj.trigmode ~= 1 % external trig + warning('AWG:SetTrigInterval',... + 'AWG has been set to external trigger mode, set trig interval is for internal trigger mode only!'); + return; + end + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k',... + 'tek7000','tek7k',... + 'tek70000','tek70k'} + % AWG: Tecktronix AWG 5000,7000,70000 + fprintf(obj.interfaceobj,['TRIG:SEQ:TIM ', num2str(1e3*obj.triginterval,'%0.3f'),'MS']); + case {'ustc_da_v1'} + otherwise + error('AWG:SetTrigIntervalError','Unsupported awg!'); + end +end diff --git a/+qes/+hwdriver/+sync/@awg/SetTrigMode.m b/+qes/+hwdriver/+sync/@awg/SetTrigMode.m new file mode 100644 index 0000000..306c9b6 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/SetTrigMode.m @@ -0,0 +1,25 @@ +function SetTrigMode(obj) + % Set trigger mode, internal or external + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'tek5000','tek5k',... + 'tek7000','tek7k',... + 'tek70000','tek70k'} + % AWG: Tecktronix AWG 5000,7000,70000 + if obj.trigmode == 1 + fprintf(obj.interfaceobj,'TRIG:SEQ:SOUR INT'); + elseif obj.trigmode == 2 + fprintf(obj.interfaceobj,'TRIG:SEQ:SOUR EXT'); + else + error('AWG:SetTirgModeError','Unrecognized trig mode!'); + end + case {'ustc_da_v1'} + otherwise + error('AWG:SetTirgModeError','Unsupported awg!'); + end +end diff --git a/+qes/+hwdriver/+sync/@awg/awg.m b/+qes/+hwdriver/+sync/@awg/awg.m new file mode 100644 index 0000000..15c3626 --- /dev/null +++ b/+qes/+hwdriver/+sync/@awg/awg.m @@ -0,0 +1,148 @@ +classdef awg < qes.hwdriver.sync.instrument + % arbitary waveform generator(awg) driver, basic. + % basic properties and functions of an awg, for extensive properties + % and functions, use class awg_e. + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties + nchnls % number of channels(number of channels may differ even for the same awg model, so has to be set by user) + end + properties (SetAccess = private) + % id of the waveforms of each channel, + waveforms + end + properties % (AbortSet = true) do not use AbortSet + smplrate % sampling rate, unit: Hz + runmode = 1; % 1/2..., implication depends on the specific awg model, for tek5014: 0,1,2,3-triggered(default)/sequence/gated/continues + trigmode = 1; % 1/2, internal(default) or external + triginterval % trigger frequency = 1/triginterval (Hz), not needed if trigmode is external + end + methods (Access = private) + function obj = awg(name,interfaceobj,drivertype) + if isempty(interfaceobj) + error('awg:InvalidInput',... + 'Input ''%s'' can not be empty!',... + 'interfaceobj'); + end + if nargin < 3 + drivertype = []; + end + obj = obj@qes.hwdriver.sync.instrument(name,interfaceobj,drivertype); + ErrMsg = obj.InitializeInstr(); + if ~isempty(ErrMsg) + error('awg:InstSetError',[obj.name, ': %s'], ErrMsg); + end + % because set methods are not called during object creation for + % properties with default value(not sure on this point), set + % RunMode and TrigMode with default value. + SetRunMode(obj); + SetTrigMode(obj); + + end + [varargout] = InitializeInstr(obj) + SetSmplRate(obj) + SetRunMode(obj) + SetTrigMode(obj) + SetTrigInterval(obj) + end + methods (Static) + obj = GetInstance(name,interfaceobj,drivertype) + end + methods (Static = true, Access = private) + [WaveformData, Vpp, Offset,MarkerData,MarkerVpp,MarkerOffset] = PrepareWvData_Tek70k(WaveformObj) + [WaveformData] = PrepareWvData(WaveformObj,DAVpp,NB) + end + methods + varargout = Run(obj,N) + function set.nchnls(obj,val) + if ~isempty(obj.nchnls) && obj.nchnls ~= val + error('awg:SetPropError','nchnls(number of channel) is an immutable property, once set, it is not allowed to be changed!'); + end + if isempty(val) || val <= 0 || ceil(val) ~=val + error('awg:InvalidInput','nchnls value should be positive integer!'); + end + obj.nchnls = val; + obj.waveforms = cell(obj.nchnls,1); + end + function set.smplrate(obj,val) + if isempty(val) || val <= 0 + error('awg:InvalidInput','smplrate value should be a positive number!'); + end + obj.smplrate = val; + SetSmplRate(obj); + end + function val = get.smplrate(obj) + % query from the instrument is to be implemented in the future. + val = obj.smplrate; + end + function set.runmode(obj,val) + if isempty(val) || val<0 || ceil(val) ~=val + error('awg:InvalidInput','runmode value should be a positive integer!'); + end + obj.runmode = val; + SetRunMode(obj); + end + function val = get.runmode(obj) + % query from the instrument is to be implemented in the future. + val = obj.runmode; + end + function set.trigmode(obj,val) + if isempty(val) || val<=0 || round(val) ~=val + error('awg:InvalidInput','trigmode value can only be 0(internal) or 1(external)!'); + end + if val >2 + val = 2; + end + obj.trigmode = val; + SetTrigMode(obj); + end + function val = get.trigmode(obj) + % query from the instrument is to be implemented in the future. + val = obj.trigmode; + end + function set.triginterval(obj,val) + if isempty(val) || val <= 0 + error('awg:InvalidInput','triginterval value should be a positive number!'); + end + obj.triginterval = val; + SetTrigInterval(obj); + end + function val = get.triginterval(obj) + % query from the instrument is to be implemented in the future. + val = obj.triginterval; + end + function ret = AddWaveform(obj,wvfrmobj,chnl) + ret = 0; + if ~isa(wvfrmobj,'Waveform') || ~IsValid(wvfrmobj) + error('awg:AddWaveform','wvfrmobj not valid or not a Waveform class object.'); + end + if ceil(chnl) ~=chnl || chnl <=0 + error('awg:AddWaveform','chnl should be a positive integer!'); + end + if isempty(obj.nchnls) || chnl > obj.nchnls + error('awg:AddWaveform','chnl inconsistent with the awg or number of channels not set.'); + end + if ~isempty(obj.waveforms{chnl}) + if obj.waveforms{chnl} == wvfrmobj.id + return; + end + oldwvobj = HandleQES.FindByProp('id',obj.waveforms{chnl}); + if isempty(oldwvobj) % in such case, the waveform has been removed already +% warning('awg:AddWaveform','There is already a waveform object attached to this channel, this waveform will be removed.'); + else + oldwvobj{1}.awgchnl = []; + warning(['awg:AddWaveform',' Waveform ''',oldwvobj{1}.name,... + '''(id:', num2str(oldwvobj{1}.id,'%0.0f'),') seems to be running on the channel to output waveform ''',... + wvfrmobj.name, '''(id:', num2str(wvfrmobj.id,'%0.0f'),'), it will be removed.']); + end + end + obj.waveforms{chnl} = wvfrmobj.id; + end + end + methods (Hidden = true) % hidden, only to be indirectly called by methods of Waveform class objects + SendWave(obj,WaveformObj) + LoadWave(obj,WaveformObj) + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@mwSource/GetFreqPwer.m b/+qes/+hwdriver/+sync/@mwSource/GetFreqPwer.m new file mode 100644 index 0000000..588b3d8 --- /dev/null +++ b/+qes/+hwdriver/+sync/@mwSource/GetFreqPwer.m @@ -0,0 +1,19 @@ +function [Frequency, Power] = GetFreqPwer(obj) +% query frequency and power from instrument +% + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agle82xx','agle8200','agl e82xx','agl e8200',... + 'rohde&schwarz sma100', 'r&s sma100',... + 'anritsu_mg3692c'} + Frequency = str2double(query(obj.interfaceobj,':SOUR:FREQ?')); + Power = str2double(query(obj.interfaceobj, ':SOUR:POW?')); + case {} + otherwise + error('MWSource:QueryError', ['Unsupported instrument: ',TYP]); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@mwSource/GetInstance.m b/+qes/+hwdriver/+sync/@mwSource/GetInstance.m new file mode 100644 index 0000000..d8d1769 --- /dev/null +++ b/+qes/+hwdriver/+sync/@mwSource/GetInstance.m @@ -0,0 +1,55 @@ +function obj = GetInstance(name,interfaceobj,drivertype) + % if called without input arguments, the first valid instance is + % returned, if 'name' is not empty, the instance that matches 'name' + % is returned if exits, if not exit, a new instance is created(in this + % case all input arguments should be specified) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + persistent objlst; + if isempty(objlst) + if nargin == 0 || isempty(name) + error('MWSource:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + end + if nargin > 2 + obj = qes.hwdriver.sync.mwSource(name,interfaceobj,drivertype); + else + obj = qes.hwdriver.sync.mwSource(name,interfaceobj); + end + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of delete objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 || isempty(name) + error('MWSource:GetInstanceError',... + 'No existing instance, all input paramenter should be specified!'); + end + if nargin > 2 + obj = qes.hwdriver.sync.mwSource(name,interfaceobj,drivertype); + else + obj = qes.hwdriver.sync.mwSource(name,interfaceobj); + end + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@mwSource/GetOnOff.m b/+qes/+hwdriver/+sync/@mwSource/GetOnOff.m new file mode 100644 index 0000000..30543da --- /dev/null +++ b/+qes/+hwdriver/+sync/@mwSource/GetOnOff.m @@ -0,0 +1,21 @@ +function On = GetOnOff(obj) + % query instrument output status + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agle82xx','agle8200','agl e82xx','agl e8200',... + 'rohde&schwarz sma100', 'r&s sma100',... + 'anritsu_mg3692c'} + str = query(obj.interfaceobj,':OUTP?'); % operate + if strcmp(str(1),'1') + On = true; + else + On = false; + end + otherwise + error('DCSource:GetOnOff', ['Unsupported instrument: ',TYP]); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@mwSource/InitializeInstr.m b/+qes/+hwdriver/+sync/@mwSource/InitializeInstr.m new file mode 100644 index 0000000..3fc2087 --- /dev/null +++ b/+qes/+hwdriver/+sync/@mwSource/InitializeInstr.m @@ -0,0 +1,46 @@ +function [varargout] = InitializeInstr(obj) + % Initialize instrument + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + ErrMsg = ''; + switch TYP + case {'agle82xx','agle8200','agl e82xx','agl e8200'} + fprintf(obj.interfaceobj,'*RST'); + fprintf(obj.interfaceobj,':SOUR:FREQ:MODE FIX'); + fprintf(obj.interfaceobj, ':SOUR:POW:MODE FIX'); + % set reference oscillator source to auto: + % Applying a 10 MHz signal to the Reference Oscillator connector automatically sets the + % Reference Oscillator to EXTernal, when NO signal is present at the 10 MHz + % Reference Oscillator connector, internal source is used. + fprintf(obj.interfaceobj, ':ROSCillator:SOURce:AUTO ON'); + obj.freqlimits = [250e-6,40]; % GHz + obj.powerlimits = [-120,20]; % dBm + case {'rohde&schwarz sma100', 'r&s sma100'} + fprintf(obj.interfaceobj,'*RST'); + fprintf(obj.interfaceobj,':SOUR:FREQ:MODE FIX'); % FIX CW are synonymous + fprintf(obj.interfaceobj,':SOUR:POW:MODE FIX'); + % Applying a 10 MHz signal to the Reference Oscillator connector automatically sets the + % Reference Oscillator to EXTernal, when NO signal is present at the 10 MHz + % Reference Oscillator connector, internal source is used. + fprintf(obj.interfaceobj, ':ROSCillator:SOURce:AUTO ON'); + obj.freqlimits = [9e-6,6]; % GHz + obj.powerlimits = [-130,20]; % dBm + case {'anritsu_mg3692c'} + fprintf(obj.interfaceobj,'*RST'); + fprintf(obj.interfaceobj,':SOUR:FREQ:MODE FIX'); % FIX CW are synonymous + fprintf(obj.interfaceobj,':SOUR:POW:MODE FIX'); + % Applying a 10 MHz signal to the Reference Oscillator connector automatically sets the + % Reference Oscillator to EXTernal, when NO signal is present at the 10 MHz + % Reference Oscillator connector, internal source is used. + fprintf(obj.interfaceobj, ':ROSCillator:SOURce:AUTO ON'); + obj.freqlimits = [2e9,20e9]; % GHz + obj.powerlimits = [-130,22]; % dBm + otherwise + ErrMsg = ['Unsupported instrument: ',TYP]; + end + varargout{1} = ErrMsg; +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@mwSource/SetFreq.m b/+qes/+hwdriver/+sync/@mwSource/SetFreq.m new file mode 100644 index 0000000..37e2ba8 --- /dev/null +++ b/+qes/+hwdriver/+sync/@mwSource/SetFreq.m @@ -0,0 +1,18 @@ +function SetFreq(obj,val) +% set microwave source frequecy and power +% + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agilent e82xx','agilent e8200','agle82xx','agle8200','agl e82xx','agl e8200',... + 'anritsu_mg3692c'} + fprintf(obj.interfaceobj,[':SOUR:FREQ:FIX ',num2str(val(1),'%0.3f'),'Hz']); + case {'rohde&schwarz sma100', 'r&s sma100','rssma100'} + fprintf(obj.interfaceobj,[':SOUR:FREQ ',num2str(val(1),'%0.3f'),'Hz']); + otherwise + error('MWSource:SetError', ['Unsupported instrument: ',TYP]); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@mwSource/SetOnOff.m b/+qes/+hwdriver/+sync/@mwSource/SetOnOff.m new file mode 100644 index 0000000..12c8ba7 --- /dev/null +++ b/+qes/+hwdriver/+sync/@mwSource/SetOnOff.m @@ -0,0 +1,19 @@ +function SetOnOff(obj,On) + % set instrument output to on or off + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + TYP = lower(obj.drivertype); + switch TYP + case {'agle82xx','agle8200','agl e82xx','agl e8200',... + 'rohde&schwarz sma100', 'r&s sma100',... + 'anritsu_mg3692c'} + if On + fprintf(obj.interfaceobj,':OUTP ON '); + else + fprintf(obj.interfaceobj,':OUTP OFF '); + end + otherwise + error('MWSource:SetOnOff', ['Unsupported instrument: ',TYP]); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@mwSource/SetPower.m b/+qes/+hwdriver/+sync/@mwSource/SetPower.m new file mode 100644 index 0000000..1212014 --- /dev/null +++ b/+qes/+hwdriver/+sync/@mwSource/SetPower.m @@ -0,0 +1,18 @@ +function SetPower(obj,val) +% set microwave source frequecy and power +% + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agilent e82xx','agilent e8200','agle82xx','agle8200','agl e82xx','agl e8200',... + 'anritsu_mg3692c'} + fprintf(obj.interfaceobj,[':SOUR:POWER ',num2str(val(1),'%0.2f'),'DBM']); + case {'rohde&schwarz sma100', 'r&s sma100','rssma100'} + fprintf(obj.interfaceobj,[':SOUR:POW ',num2str(val(1),'%0.2f')]); + otherwise + error('MWSource:SetError', ['Unsupported instrument: ',TYP]); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@mwSource/mwSource.m b/+qes/+hwdriver/+sync/@mwSource/mwSource.m new file mode 100644 index 0000000..9359716 --- /dev/null +++ b/+qes/+hwdriver/+sync/@mwSource/mwSource.m @@ -0,0 +1,109 @@ +classdef mwSource < qes.hwdriver.sync.instrument + % microwave source driver + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties % (AbortSet = true) do not use AbortSet + frequency % Hz + power % dBm + on % true/false, output on/off + end + properties % (SetAccess = immutable) + freqlimits + powerlimits + end + methods (Access = private) + function obj = mwSource(name,interfaceobj,drivertype) + if isempty(interfaceobj) + error('mwSource:InvalidInput',... + 'Input ''%s'' can not be empty!',... + 'interfaceobj'); + end + set(interfaceobj,'Timeout',10); + if nargin < 3 + drivertype = []; + end + obj = obj@qes.hwdriver.sync.instrument(name,interfaceobj,drivertype); + ErrMsg = obj.InitializeInstr(); + if ~isempty(ErrMsg) + error('mwSource:InstSetError',[obj.name, ': %s'], ErrMsg); + end + end + [varargout] = InitializeInstr(obj) + SetPower(obj,val) + SetFreq(obj,val) + [Freq, Power]=GetFreqPwer(obj) + SetOnOff(obj,OnOrOff) + onstatus = GetOnOff(obj) + end + methods (Static) + obj = GetInstance(name,interfaceobj,drivertype) + end + methods + function set.frequency(obj,val) + if isempty(val) + obj.frequency = val; + return; + end + if isempty(val) || ~isnumeric(val) || ~isreal(val) || val <= 0 + error('mwSource:SetError','Invalid frequency value.'); + end + if ~isempty(obj.freqlimits) &&... + (val < obj.freqlimits(1) || val > obj.freqlimits(2)) + error('mwSource:OutOfLimit','Frequency value out of limits.'); + return; + end + SetFreq(obj,val); + obj.frequency = val; + end + function frequency = get.frequency(obj) + [frequency, ~] = GetFreqPwer(obj); + end + function set.power(obj,val) + if isempty(val) || ~isnumeric(val) || ~isreal(val) + error('mwSource:SetError','Invalid power value.'); + end + if ~isempty(obj.powerlimits) &&... + (val < obj.powerlimits(1) || val > obj.powerlimits(2)) + error('mwSource:OutOfLimit',[obj.name, ': Power value out of limits!']); + return; + end + SetPower(obj,val); + obj.power = val; + end + function power = get.power(obj) + [~, power] = GetFreqPwer(obj); + end + function set.on(obj,val) + if isempty(val) + error('mwSource:SetOnOff', 'value of ''on'' must be a bolean.'); + end + if ~islogical(val) + if val == 0 || val == 1 + val = logical(val); + else + error('mwSource:SetOnOff', 'value of ''on'' must be a bolean.'); + end + end + obj.SetOnOff(val); + obj.on = val; + end + function val = get.on(obj) + val = GetOnOff(obj); + end + function On(obj) + % set on, this method is introduced for functional + % programming. + obj.on = true; + end + function Off(obj) + % set off, this method is introduced for functional + % programming. + obj.on = false; + end + function delete(obj) + obj.on = false; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@networkAnalyzer/CreateMeasurement.m b/+qes/+hwdriver/+sync/@networkAnalyzer/CreateMeasurement.m new file mode 100644 index 0000000..904dea0 --- /dev/null +++ b/+qes/+hwdriver/+sync/@networkAnalyzer/CreateMeasurement.m @@ -0,0 +1,74 @@ +function CreateMeasurement(obj, MeasurementName, SIdx) + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if ~ischar(MeasurementName) + error('SParamMeter:InvalidInput','Invalid measurement name'); + end + if ~isreal(SIdx) || length(SIdx)~=2 || round(SIdx(1)) ~= SIdx(1) ||... + round(SIdx(2)) ~= SIdx(2) || any(SIdx) < 1 || any(SIdx>obj.numports) + error('SParamMeter:InvalidInput','Invalid SIdx'); + end + if isempty(obj.swpstartfreq) || isempty(obj.swpstopfreq) || isempty(obj.swppoints)||... + isempty(obj.bandwidth) + error('SParamMeter:InvalidInput','Some parameters are not set.'); + end + if length(obj.swpstartfreq) ~= length(obj.swpstopfreq) ||... + length(obj.swpstartfreq) ~= length(obj.swppoints) ||... + length(obj.swpstartfreq) ~= length(obj.bandwidth) + error('SParamMeter:InvalidInput','swpstartfreq, swpstopfreq, swppoints and bandwidth are not of the same size.'); + end + + TYP = lower(obj.drivertype); + switch TYP + case {'agilent_n5230c'} + if any(obj.swpstartfreq >= obj.swpstopfreq) + error('swpstartfreq >= swpstopfreq'); + end + if any(obj.swppoints < 2) || sum(obj.swppoints) > 20001 + error('swppoints out of range.'); + end + cmd = [':CALCulate:PARameter:DEFine:EXTended ',MeasurementName,',S',num2str(SIdx(1)),num2str(SIdx(2))]; + fprintf(obj.interfaceobj,cmd); + NSeg = length(obj.swpstartfreq); + obj.numsegments = NSeg; + try + if length(obj.swpstartfreq) > 1 + fprintf(obj.interfaceobj,'SENS:SEGM:DEL:ALL'); + fprintf(obj.interfaceobj,'SENS:SEGM:ARB ON'); + fprintf(obj.interfaceobj,'SENS:SEGM:BWID:CONT ON'); + fprintf(obj.interfaceobj,'SENS:SEGM:POW:CONT OFF'); + for ii = 1:NSeg + fprintf(obj.interfaceobj,sprintf('SENS:SEGM%d:ADD',ii)); + fprintf(obj.interfaceobj,sprintf('SENS:SEGM%d:FREQ:START %d',ii,obj.swpstartfreq(ii))); + fprintf(obj.interfaceobj,sprintf('SENS:SEGM%d:FREQ:STOP %d',ii,obj.swpstopfreq(ii))); + fprintf(obj.interfaceobj,sprintf('SENS:SEGM%d:SWE:POIN %d',ii,obj.swppoints(ii))); + if obj.bandwidth(ii) < 1e3 + fprintf(obj.interfaceobj,['SENS:BWID ', num2str(obj.bandwidth(ii),'%0.1fHz')]); + else + fprintf(obj.interfaceobj,['SENS:BWID ', num2str(obj.bandwidth(ii)/1e3,'%0.1fKHz')]); + end + fprintf(obj.interfaceobj,sprintf('SENS:SEGM%d ON',ii)); + end + fprintf(obj.interfaceobj,'SENS:SWE:TYPE SEGM'); + else + if obj.bandwidth(1) < 1e3 + fprintf(obj.interfaceobj,['SENS:BWID ', num2str(obj.bandwidth(1),'%0.1Hz')]); + else + fprintf(obj.interfaceobj,['SENS:BWID ', num2str(obj.bandwidth(1)/1e3,'%0.1fKHz')]); + end + fprintf(obj.interfaceobj,[':SENSe:FREQuency:STARt ',num2str(obj.swpstartfreq)]); + fprintf(obj.interfaceobj,[':SENSe:FREQuency:STOP ',num2str(obj.swpstopfreq)]); + fprintf(obj.interfaceobj,[':SENSe:SWEep:POINts ', num2str(obj.swppoints)]); + fprintf(obj.interfaceobj,'SENS:SWE:TYPE LIN'); + end + catch + error('SParamMeter:CreateMeasurement', 'Setting instrument failed.'); + end + otherwise + error('SParamMeter:CreateMeasurement', ['Unsupported instrument: ',TYP]); + end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@networkAnalyzer/DeleteMeasurement.m b/+qes/+hwdriver/+sync/@networkAnalyzer/DeleteMeasurement.m new file mode 100644 index 0000000..dcbcadc --- /dev/null +++ b/+qes/+hwdriver/+sync/@networkAnalyzer/DeleteMeasurement.m @@ -0,0 +1,36 @@ +function DeleteMeasurement(obj, MeasurementName) + % Delete measurement. + % if MeasurementName not specified, delete all + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if nargin == 1 + MeasurementName = []; + end + if ~isempty(MeasurementName) && ~ischar(MeasurementName) + error('SParamMeter:InvalidInput','Invalid measurement name.'); + end + + TYP = lower(obj.drivertype); + try + switch TYP + case {'agilent_n5230c'} + if isempty(MeasurementName) % delete all + fprintf(obj.interfaceobj,':CALCulate:PARameter:DELete:ALL'); + else + measurementlist = obj.measurements; + if isempty(measurementlist) || ~ismember(MeasurementName,measurementlist) + warning('SParamMeter:DeletMeasurement', ['Measurement ', MeasurementName ,' not exist.']); + else + fprintf(obj.interfaceobj,[':CALCulate:PARameter:DELete:NAME ',MeasurementName]); + end + end + otherwise + error('SParamMeter:DeletMeasurement', ['Unsupported instrument: ',TYP]); + end + catch + error('SParamMeter:DeletMeasurement', 'Setting instrument failed.'); + end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@networkAnalyzer/GetData.m b/+qes/+hwdriver/+sync/@networkAnalyzer/GetData.m new file mode 100644 index 0000000..c2f9125 --- /dev/null +++ b/+qes/+hwdriver/+sync/@networkAnalyzer/GetData.m @@ -0,0 +1,69 @@ +function [Freq, S] = GetData(obj) + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + switch TYP + case {'agilent_n5230c'} +% fprintf(obj.interfaceobj,':ABORt'); + fprintf(obj.interfaceobj,':SENSe1:AVERage:CLEar'); + tic; + % real swpstartfreq, swpstopfreq or swppoints might be + % different from their set values in case of set values out + % of permissible range, so the Freq here is calculated by + % quering the real values of swpstartfreq, swpstopfreq and + % swppoints from the instrument. + if obj.numsegments == 1 + obj.swpstartfreq = str2double(query(obj.interfaceobj,':SENSe:FREQuency:STARt?')); + else + obj.swpstartfreq = NaN*ones(1,obj.numsegments); + for ii = 1:obj.numsegments + obj.swpstartfreq(ii) = str2double(query(obj.interfaceobj,sprintf('SENS:SEGM%d:FREQ:START?',ii))); + end + end + if obj.numsegments == 1 + obj.swpstopfreq = str2double(query(obj.interfaceobj,':SENSe:FREQuency:STOP?')); + else + obj.swpstopfreq = NaN*ones(1,obj.numsegments); + for ii = 1:obj.numsegments + obj.swpstopfreq(ii) = str2double(query(obj.interfaceobj,sprintf('SENS:SEGM%d:FREQ:STOP?',ii))); + end + end + if obj.numsegments == 1 + obj.swppoints = str2double(query(obj.interfaceobj,':SENSe:SWEep:POINts?')); + else + obj.swppoints = NaN*ones(1,obj.numsegments); + for ii = 1:obj.numsegments + obj.swppoints(ii) = str2double(query(obj.interfaceobj,sprintf('SENS:SEGM%d:SWE:POIN?',ii))); + end + end + if obj.averaging + while 1 && toc < obj.timeout + status = str2double(query(obj.interfaceobj,':STATus:OPERation:AVERaging1:CONDition?')); + if status ~= 0 + break; + end + pause(0.1); + end + end + textdata = query(obj.interfaceobj, ':CALCulate:DATA? SDATA'); + S = eval(['[',textdata,']']); + S = S(1:2:end) + 1i*S(2:2:end); + + Freq = NaN*ones(1,sum(obj.swppoints)); + dp = 0; + for ii = 1:obj.numsegments + ndp = dp+obj.swppoints(ii); + Freq(dp+1:ndp) = linspace(obj.swpstartfreq(ii),obj.swpstopfreq(ii),obj.swppoints(ii)); + dp = ndp; + end + if length(S) ~= dp + error('SParamMeter:GetData',... + 'Data buffer size too small or data size too big, try increse buffer size or reduce data size.'); + end + otherwise + error('SParamMeter:GetData', ['Unsupported instrument: ',TYP]); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@networkAnalyzer/GetInstance.m b/+qes/+hwdriver/+sync/@networkAnalyzer/GetInstance.m new file mode 100644 index 0000000..f38cb13 --- /dev/null +++ b/+qes/+hwdriver/+sync/@networkAnalyzer/GetInstance.m @@ -0,0 +1,55 @@ +function obj = GetInstance(name,interfaceobj,drivertype) + % if called without input arguments, the first valid instance is + % returned, if 'name' is not empty, the instance that matches 'name' + % is returned if exits, if not exit, a new instance is created(in this + % case all input arguments should be specified) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + persistent objlst; + if isempty(objlst) + if nargin == 0 || isempty(name) + error('networkAnalyzer:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + end + if nargin > 2 + obj = qes.hwdriver.sync.networkAnalyzer(name,interfaceobj,drivertype); + else + obj = qes.hwdriver.sync.networkAnalyzer(name,interfaceobj); + end + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of delete objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 || isempty(name) + error('networkAnalyzer:GetInstanceError',... + 'No existing instance, all input paramenter should be specified!'); + end + if nargin > 2 + obj = qes.hwdriver.sync.networkAnalyzer(name,interfaceobj,drivertype); + else + obj = qes.hwdriver.sync.networkAnalyzer(name,interfaceobj); + end + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@networkAnalyzer/GetMeasurements.m b/+qes/+hwdriver/+sync/@networkAnalyzer/GetMeasurements.m new file mode 100644 index 0000000..44211d7 --- /dev/null +++ b/+qes/+hwdriver/+sync/@networkAnalyzer/GetMeasurements.m @@ -0,0 +1,30 @@ +function val = GetMeasurements(obj) + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + try + switch TYP + case {'agilent_n5230c'} + str = query(obj.interfaceobj, ':CALCulate:PARameter:CATalog?'); + if length(str) < 2 + val = []; + return; + end + str = strrep(str,',','''},{'''); + str = strtrim(strrep(str,'"','')); + str = eval(['[{''',str,'''}]']); + val = str(1:2:end); + if ~isempty(val) && strcmp(val{1},'NO CATALOG') + val = []; + end + otherwise + error('SParamMeter:GetMeasurement', ['Unsupported instrument: ',TYP]); + end + catch + error('SParamMeter:GetMeasurement', 'Query instrument failed.'); + end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@networkAnalyzer/GetOnOff.m b/+qes/+hwdriver/+sync/@networkAnalyzer/GetOnOff.m new file mode 100644 index 0000000..37c23e8 --- /dev/null +++ b/+qes/+hwdriver/+sync/@networkAnalyzer/GetOnOff.m @@ -0,0 +1,18 @@ +function bol = GetOnOff(obj) + % Get instrument output to on or off + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + TYP = lower(obj.drivertype); + try + switch TYP + case {'agilent_n5230c'} + str = query(obj.interfaceobj,':OUTPut:STATe?'); + bol = logical(str2double(str)); + otherwise + error('SParamMeter:GetOnOff', ['Unsupported instrument: ',TYP]); + end + catch + error('SParamMeter:GetOnOff', 'Query instrument failed.'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@networkAnalyzer/InitializeInstr.m b/+qes/+hwdriver/+sync/@networkAnalyzer/InitializeInstr.m new file mode 100644 index 0000000..bdba9a6 --- /dev/null +++ b/+qes/+hwdriver/+sync/@networkAnalyzer/InitializeInstr.m @@ -0,0 +1,34 @@ +function [varargout] = InitializeInstr(obj) + % Initialize instrument + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + ErrMsg = ''; + try + switch TYP + case {'agilent_n5230c'} + obj.timeout = 120; % seconds + if strcmp(obj.interfaceobj.Status,'open') + fclose(obj.interfaceobj); + end + obj.interfaceobj.Timeout=120; + obj.interfaceobj.InputBufferSize = 20000000; % bytes, should be enough for most applications + if strcmp(obj.interfaceobj.Status,'closed') + fopen(obj.interfaceobj); + end + fprintf(obj.interfaceobj,'*RST'); + % set work mode to linear(default) + fprintf(obj.interfaceobj,':INITiate:IMMediate'); % trig + obj.DeleteMeasurement(); % after reset, a default measurement is automatically created by the instrument, we don't need it. + obj.numports = 2; % 2 ports + otherwise + ErrMsg = ['Unsupported instrument: ',TYP]; + end + catch + ErrMsg = 'Could not initialize instrument!'; + end + varargout{1} = ErrMsg; +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@networkAnalyzer/SetOnOff.m b/+qes/+hwdriver/+sync/@networkAnalyzer/SetOnOff.m new file mode 100644 index 0000000..6a25b6d --- /dev/null +++ b/+qes/+hwdriver/+sync/@networkAnalyzer/SetOnOff.m @@ -0,0 +1,21 @@ +function SetOnOff(obj,On) + % set instrument output to on or off + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + TYP = lower(obj.drivertype); + try + switch TYP + case {'agilent_n5230c'} + if On + fprintf(obj.interfaceobj,':OUTPut:STATe ON'); + else + fprintf(obj.interfaceobj,':OUTPut:STATe OFF'); + end + otherwise + error('SParamMeter:SetOnOff', ['Unsupported instrument: ',TYP]); + end + catch + error('SParamMeter:SetOnOff', 'Setting instrument failed.'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/@networkAnalyzer/networkAnalyzer.m b/+qes/+hwdriver/+sync/@networkAnalyzer/networkAnalyzer.m new file mode 100644 index 0000000..d3b1ebb --- /dev/null +++ b/+qes/+hwdriver/+sync/@networkAnalyzer/networkAnalyzer.m @@ -0,0 +1,202 @@ +classdef networkAnalyzer < qes.hwdriver.sync.instrument + % Network analyzer driver for S-parameters, basic. + % Currently support Agilent PNA E8300 series network analyzers only. + % Agilent PNA E8300/agilent_n5230c series network analyzers ROSCillator source is + % selected automatically: + % Applying a 10 MHz signal to the Reference Oscillator connector automatically sets the + % Reference Oscillator to EXTernal, when NO signal is present at the 10 MHz + % Reference Oscillator connector, internal source is used. + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties + on = false % output off/on + avgcounts % average factor, avgcounts = 1 to disable averaging. + swpstartfreq % Hz, an array in case of segment sweep + swpstopfreq % Hz, an array in case of segment sweep + swppoints % number of sweep points, an array in case of segment sweep + bandwidth % Hz + swpmode % sweep mode: 0/1/2/3 continuous/groups/hold/single + power % dBm + trigmode = 0 % 0/1/2, immediate/'external/manual + measurements % name list of all created measurements + measurement % name the measurement to get data from + end + properties (GetAccess = private, SetAccess = private) + numports % number of ports + averaging = false % average or not + numsegments = 1 + end + + methods (Access = private) + function obj = networkAnalyzer(name,interfaceobj,drivertype) + if isempty(interfaceobj) + error('networkAnalyzer:InvalidInput',... + 'Input ''%s'' can not be empty!',... + 'interfaceobj'); + end + if nargin < 3 + drivertype = []; + end + obj = obj@qes.hwdriver.sync.instrument(name,interfaceobj,drivertype); + ErrMsg = obj.InitializeInstr(); + if ~isempty(ErrMsg) + error('networkAnalyzer:InstSetError',[obj.name, ': %s'], ErrMsg); + end + end + [ varargout] = InitializeInstr(obj) + val = GetMeasurements(obj) + SetOnOff(obj,On) + bol = GetOnOff(obj) + end + methods (Static) + obj = GetInstance(name,interfaceobj,drivertype) + end + methods + CreateMeasurement(obj, MeasurementName, SIdx) + DeleteMeasurement(obj, MeasurementName) + [Freq, S] = GetData(obj) + function set.bandwidth(obj,val) + % for Agilent Technologies,N52xx, N83xx series only + AgilentN83xxOptions = [1,1.5, 2,3,5,7]; + AgilentN83xxOptions = [AgilentN83xxOptions,AgilentN83xxOptions*10,AgilentN83xxOptions*100,... + AgilentN83xxOptions*1e3,AgilentN83xxOptions*10e3,100e3,150e3,200e3,250e3]; + AgilentN83xxOptions(2) = []; + + for ii = 1:length(val) + [~, idx] = min(abs((AgilentN83xxOptions-val(ii)))); + val_ = AgilentN83xxOptions(idx); + if val_ ~= val(ii) + warning('networkAnalyzer:SetBandwidth', ['Bandwidth rounded to the closest allowed value of ', num2str(val_,'%0.0f'),'Hz.']); + end + val(ii) = val_; + end + obj.bandwidth = val; + end + function val = get.measurements(obj) + val = GetMeasurements(obj); + end + function val = get.measurement(obj) + str = query(obj.interfaceobj,':CALCulate:PARameter:SELect?'); + val = strtrim(strrep(str,'"','')); + end + function set.measurement(obj, MeasurementName) + measurementlist = obj.measurements; + if isempty(measurementlist) || ~ismember(MeasurementName,measurementlist) + error('networkAnalyzer:SetMeasurement', ['Measurement ', MeasurementName ,' not exist.']); + else + fprintf(obj.interfaceobj,[':CALCulate:PARameter:SELect ',MeasurementName]); + end + end + function val = get.on(obj) + val = GetOnOff(obj); + end + function set.on(obj, val) + if isempty(val) + error('networkAnalyzer:SetOnOff', 'value of ''on'' must be a bolean.'); + end + if ~islogical(val) + if val == 0 || val == 1 + val = logical(val); + else + error('networkAnalyzer:SetOnOff', 'value of ''on'' must be a bolean.'); + end + end + SetOnOff(obj,val); + obj.on = val; + end + + function val = get.avgcounts(obj) + cmd = ':SENSe1:AVERage:COUNt'; + val = str2double(query(obj.interfaceobj,[cmd '?'])); + end + function set.avgcounts(obj, value) + if value > 1 + fprintf(obj.interfaceobj,':SENSe1:AVERage:STATe ON'); + fprintf(obj.interfaceobj,[':SENSe1:AVERage:COUNt ',num2str(value)]); + obj.averaging = true; + else + fprintf(obj.interfaceobj,':SENSe1:AVERage:STATe OFF'); + obj.averaging = false; + end + obj.avgcounts = value; + end + function val = get.swpmode(obj) + str = strtrim(query(obj.interfaceobj,':SENSe:SWEep:MODE?')); + switch str + case 'CONT' + val = 0; + case 'SING' + val = 1; + case 'GRO' + val = 2; + case 'HOLD' + val = 3; + otherwise + val = []; + end + end + function set.swpmode(obj,val) + switch val + case 0 + fprintf(obj.interfaceobj,':SENSe:SWEep:MODE CONTinuous'); + case 1 + fprintf(obj.interfaceobj,':SENSe:SWEep:MODE SINGle'); + case 2 + fprintf(obj.interfaceobj,':SENSe:SWEep:MODE GROups'); + case 3 + fprintf(obj.interfaceobj,':SENSe:SWEep:MODE HOLD'); + otherwise + error('Invalid input'); + end + obj.swpmode = val; + end + function val = get.power(obj) + val = str2double(query(obj.interfaceobj,':SOURce:POWer:LEVel:IMMediate:AMPLitude?')); + end + function set.power(obj, value) + if value < -30 || value > 20 % Agilent PNA E8300 series + error('power out of limits'); + end + fprintf(obj.interfaceobj,[':SOURce:POWer:LEVel:IMMediate:AMPLitude ', num2str(value)]); + obj.power = value; + end + function val = get.trigmode(obj) + str = strtrim(query(obj.interfaceobj,':TRIGger:SEQuence:SOURce?')); + switch str + case 'IMM' + val = 0; + case 'EXT' + val = 1; + case 'MAN' + val = 2; + otherwise + val = []; + end + end + function set.trigmode(obj, val) + switch val + case 0 + fprintf(obj.interfaceobj,':TRIGger:SEQuence:SOURce IMMediate'); + case 1 + fprintf(obj.interfaceobj,':TRIGger:SEQuence:SOURce EXTernal'); + case 2 + fprintf(obj.interfaceobj,':TRIGger:SEQuence:SOURce MANual'); + otherwise + error('Invalid input'); + end + obj.trigmode = val; + end + end +end + +% to create a measurement for S12 and name it as Test1 +% ':CALCulate:PARameter:DEFine:EXTended Test1,S12' + +% to select the measurement named Test1 +% ':CALCulate1:PARameter:SELect TEST1' + +% to display a trace in window 2 for the measurement named Test1 +% ':DISPlay:WINDow2:TRACe:FEED Test1' + diff --git a/+qes/+hwdriver/+sync/@ustcadda/ustcadda.m b/+qes/+hwdriver/+sync/@ustcadda/ustcadda.m new file mode 100644 index 0000000..80a8591 --- /dev/null +++ b/+qes/+hwdriver/+sync/@ustcadda/ustcadda.m @@ -0,0 +1,82 @@ +classdef ustcadda < handle & qes.hwdriver.icinterface_compatible + properties + record_ln = 2000; + end + properties (Constant = true) + smplrate = 1e9 + end + properties (SetAccess = private, GetAccess = private) + ad; + da1; + da2; + master; + end + methods + function obj = ustcadda() +% mac=['34';'97';'f6';'8d';'41';'45']; + mac=['68';'05';'CA';'30';'AA';'78']; + mac = uint32(hex2dec(mac)); + obj.ad = qes.hwdriver.sync.ustcadda_backen.USTCADC(2); + obj.ad.Open(); + obj.ad.SetMacAddr(mac'); + obj.da1 = qes.hwdriver.sync.ustcadda_backen.USTCDAC('10.0.1.180',80); + obj.da1.Open(); + obj.da1.SetIsMaster(1); + obj.da2 = qes.hwdriver.sync.ustcadda_backen.USTCDAC('10.0.1.21',80); + obj.da2.Open(); + + obj.master = obj.da1; + end + function [da,da_channel]= Translate(obj,channel) + if(channel>4) + da = obj.da2; + da_channel = channel - 5; + else + da = obj.da1; + da_channel = channel - 1; + end + end + + function SendWave(obj,channel,data) + [da,da_channel] = Translate(obj,channel); + da.WriteWave(da_channel,0,data); + end + + function LoadWave(obj,channel,data,delay)%new function + [da,da_channel] = Translate(obj,channel); + delay_count = floor(delay/4e-9); + da.LoadWave(da_channel,0,data,delay_count);%Èç¹ûÊÇ0ͨµÀ£¬¶ÔÆë + if(da_channel == 0) + trig_start = 65; + trig_width = 40; + da.SetTrigStart(trig_start+257.5*delay_count); + da.SetTrigStop(trig_start +257.5*delay_count + trig_width); + end + end + +% function SetVpp(obj, channel, value) +% [da,da_channel] = Translate(obj,channel); +% da.SetVpp(da_channel,value); +% end + + function [I,Q] = Run(obj,count) + depth = obj.record_ln; + obj.master.SetTrigCount(count); + obj.ad.SetSampleDepth(depth); + obj.ad.SetTrigCount(count); + ret = -1; + while(ret ~= 0) + obj.ad.EnableADC(); + obj.master.SendIntTrig(); + [ret,I,Q] = obj.ad.RecvData(count,depth); + end + I = (reshape(I,[depth,count]))'; + Q = (reshape(Q,[depth,count]))'; + end + + function Config(obj) + TempConfig(obj.da1); + TempConfig(obj.da2); + end + end +end diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/ATSApi_thunk_pcwin64.dll b/+qes/+hwdriver/+sync/_todo/@AlazarATS/ATSApi_thunk_pcwin64.dll new file mode 100644 index 0000000..3779220 Binary files /dev/null and b/+qes/+hwdriver/+sync/_todo/@AlazarATS/ATSApi_thunk_pcwin64.dll differ diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarATS.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarATS.m new file mode 100644 index 0000000..d64da54 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarATS.m @@ -0,0 +1,323 @@ +classdef AlazarATS < Hardware + % dirver for Alazar Tech ATS Digitizer + % Tested with AlazarTech ATS9360-FIFO 12-bit, 1.8 GS/s, 2-channel digitizer + % other models may not supported. + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% version: 2016/12/10, tested, improved efficiency +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties + % Hz, sampling rate when clocksource = 1(internal), value cast to one of the available options: + % [1e3, 2e3, 5e3,... +% 10e3, 20e3, 50e3,... +% 100e3, 200e3 500e3,... +% 1e6, 2e6, 5e6,... +% 10e6, 20e6, 25e6, 50e6,... +% 100e6, 125e6, 160e6, 180e6, 200e6, 250e6, 400e6, 500e6, 800e6,... +% 1e9, 1.2e9, 1.5e9, 1.6e9, 1.8e9]; + smplrate + workmode = 1; % 1/2, triggered(default)/continues + timeout = 15; % seconds, default:30 seconds. + + chnl1enabled@logical scalar = true; % logical, channel 1 enabled or not + chnl2enabled@logical scalar = true; % logical, channel 2 enabled or not + % Channel Vpp, Channel Vpp value will be cast to one of the availbale options: + % [20e-3, 40e-3, 50e-3, 80e-3,... +% 100e-3, 125e-3, 200e-3, 250e-3, 400e-3, 500e-3, 800e-3... +% 1, 1.25, 2, 2.5, 4, 5, 8,... +% 10, 16, 20, 40]; + chnl1range = 0.4; + chnl2range = 0.4; + + num_records = 1000; % number of records to aquire + record_ln = 1000; % record length in samples + % 1/2, internal/external, internal clock source is recommended incase of external is used, + % smplrate is not used, the sample rate is the frequency of the external clock plugged in. + clocksource = 2; + end + properties (Constant = true, Hidden = true, GetAccess = private) + samplerate_options = [1e3, 2e3, 5e3,... + 10e3, 20e3, 50e3,... + 100e3, 200e3 500e3,... + 1e6, 2e6, 5e6,... + 10e6, 20e6, 25e6, 50e6,... + 100e6, 125e6, 160e6, 180e6, 200e6, 250e6, 400e6, 500e6, 800e6,... + 1e9, 1.2e9, 1.5e9, 1.6e9, 1.8e9,... + 2e9]; + samplerate_codes = [hex2dec('00000001'),hex2dec('00000002'),hex2dec('00000004'),... + hex2dec('00000008'),hex2dec('0000000A'),hex2dec('0000000C'),... + hex2dec('0000000E'),hex2dec('00000010'),hex2dec('00000012'),... + hex2dec('00000014'),hex2dec('00000018'),hex2dec('0000001A'),... + hex2dec('0000001C'),hex2dec('0000001E'),hex2dec('00000021'),hex2dec('00000022'),... + hex2dec('00000024'),hex2dec('00000025'),hex2dec('00000026'),hex2dec('00000027'),hex2dec('00000028'),hex2dec('0000002B'),hex2dec('0000002D'),hex2dec('00000030'),hex2dec('00000032'),... + hex2dec('00000035'),hex2dec('00000037'),hex2dec('0000003A'),hex2dec('0000003B'),hex2dec('0000003D'),... + hex2dec('0000003F'),hex2dec('00000040')]; % the last one is external clock + range_options = [20e-3, 40e-3, 50e-3, 80e-3,... + 100e-3, 125e-3, 200e-3, 250e-3, 400e-3, 500e-3, 800e-3... + 1, 1.25, 2, 2.5, 4, 5, 8,... + 10, 16, 20, 40]; + range_codes = [hex2dec('00000001');hex2dec('00000002');hex2dec('00000003');hex2dec('00000004');... + hex2dec('00000005');hex2dec('00000028');hex2dec('00000006');hex2dec('00000030');hex2dec('00000007');hex2dec('00000008');hex2dec('00000009');... + hex2dec('0000000A');hex2dec('00000021');hex2dec('0000000B');hex2dec('00000025');hex2dec('0000000C');hex2dec('0000000D');hex2dec('0000000E');... + hex2dec('0000000F');hex2dec('00000012');hex2dec('00000010');hex2dec('00000011')]; + end + properties (Constant = true, Hidden = true, GetAccess = private) + triggerlevel = 0.2; % Volts + trigposslop = true; % true/false, tirgger slop positive or negative + end + properties (Hidden = true, SetAccess = private, GetAccess = private) + deviceobj + end + methods (Access = private) + function obj = AlazarATS(name, BoardGroupID, BoardID) + % AlazarATS deviceobj is created by + if ~ischar(name) + error('AlazarATS:InvalidInputType',... + 'Input ''%s'' must be a character string!',... + 'name'); + end + obj = obj@Hardware(name); + if nargin < 2 + BoardGroupID = 1; + BoardID = 1; + end + if ~AlazarATS.LoadLib() + error('AlazarATS:LoadLibFailed','Load lib failed.'); + end + obj.deviceobj = calllib('ATSApi', 'AlazarGetBoardBySystemID', BoardGroupID, BoardID); + + ApiSuccess = 512; + TRIG_ENGINE_OP_J = hex2dec('00000000'); + TRIG_ENGINE_J = hex2dec('00000000'); + TRIG_ENGINE_K = hex2dec('00000001'); + TRIG_EXTERNAL = hex2dec('00000002'); + TRIG_DISABLE = hex2dec('00000003'); + TRIGGER_SLOPE_POSITIVE = hex2dec('00000001'); + TRIGGER_SLOPE_NEGATIVE = hex2dec('00000002'); + AC_COUPLING = hex2dec('00000001'); + DC_COUPLING = hex2dec('00000002'); + ETR_2V5 = hex2dec('00000003'); + AUX_OUT_TRIGGER = 0; + + % Select trigger inputs and levels as required + % TriggerSlope:0 is NEGATIVE, 1 is POSITIVE. + if obj.trigposslop + TriggerSlope = 1; + else + TriggerSlope = 0; + end + % TriggerLevel + % In our case, the range of trigger is [-2.5V,2.5V],corresponds to + % integer located in [0,255]. + TriggerLevel_V = obj.triggerlevel; + TriggerLevel = fix(128+127*(TriggerLevel_V/2.5)); + if TriggerSlope == 0; + retCode = ... + calllib('ATSApi', 'AlazarSetTriggerOperation', ... + obj.deviceobj, ... % HANDLE -- board handle + TRIG_ENGINE_OP_J, ... % U32 -- trigger operation + TRIG_ENGINE_J, ... % U32 -- trigger engine id + TRIG_EXTERNAL, ... % U32 -- trigger source id + TRIGGER_SLOPE_NEGATIVE, ... % U32 -- trigger slope id + TriggerLevel, ... % U32 -- trigger level from 0 (-range) to 255 (+range) + TRIG_ENGINE_K, ... % U32 -- trigger engine id + TRIG_DISABLE, ... % U32 -- trigger source id for engine K + TRIGGER_SLOPE_POSITIVE, ... % U32 -- trigger slope id + 128 ... % U32 -- trigger level from 0 (-range) to 255 (+range) + ); + elseif TriggerSlope == 1; + retCode = ... + calllib('ATSApi', 'AlazarSetTriggerOperation', ... + obj.deviceobj, ... % HANDLE -- board handle + TRIG_ENGINE_OP_J, ... % U32 -- trigger operation + TRIG_ENGINE_J, ... % U32 -- trigger engine id + TRIG_EXTERNAL, ... % U32 -- trigger source id + TRIGGER_SLOPE_POSITIVE, ... % U32 -- trigger slope id + TriggerLevel, ... % U32 -- trigger level from 0 (-range) to 255 (+range) + TRIG_ENGINE_K, ... % U32 -- trigger engine id + TRIG_DISABLE, ... % U32 -- trigger source id for engine K + TRIGGER_SLOPE_POSITIVE, ... % U32 -- trigger slope id + 128 ... % U32 -- trigger level from 0 (-range) to 255 (+range) + ); + end + if retCode ~= ApiSuccess + error('Error: AlazarSetTriggerOperation failed -- %s\n', AlazarATS.errorToText(retCode)); + end + + % TODO: Select external trigger parameters as required + retCode = ... + calllib('ATSApi', 'AlazarSetExternalTrigger', ... + obj.deviceobj, ... % HANDLE -- board handle + DC_COUPLING, ... % U32 -- external trigger coupling id + ETR_2V5 ... % U32 -- external trigger range id + ); + if retCode ~= ApiSuccess + error('Error: AlazarSetExternalTrigger failed -- %s\n', AlazarATS.errorToText(retCode)); + end + + % TODO: Set trigger delay as required. + triggerDelay_sec = 0; + triggerDelay_samples = 0; + % triggerDelay_samples = uint32(floor(triggerDelay_sec * samplesPerSec + 0.5)); + retCode = calllib('ATSApi', 'AlazarSetTriggerDelay', obj.deviceobj, triggerDelay_samples); + if retCode ~= ApiSuccess + error('Error: AlazarSetTriggerDelay failed -- %s\n', AlazarATS.errorToText(retCode)); + end + + % TODO: Set trigger timeout as required. + + % NOTE: + % The board will wait for a for this amount of time for a trigger event. + % If a trigger event does not arrive, then the board will automatically + % trigger. Set the trigger timeout value to 0 to force the board to wait + % forever for a trigger event. + % + % IMPORTANT: + % The trigger timeout value should be set to zero after appropriate + % trigger parameters have been determined, otherwise the + % board may trigger if the timeout interval expires before a + % hardware trigger event arrives. + triggerTimeout_sec = 0; + triggerTimeout_clocks = 0; + % triggerTimeout_clocks = uint32(floor(triggerTimeout_sec / 10.e-6 + 0.5)); + retCode = ... + calllib('ATSApi', 'AlazarSetTriggerTimeOut', ... + obj.deviceobj, ... % HANDLE -- board handle + triggerTimeout_clocks ... % U32 -- timeout_sec / 10.e-6 (0 == wait forever) + ); + if retCode ~= ApiSuccess + error('Error: AlazarSetTriggerTimeOut failed -- %s\n', AlazarATS.errorToText(retCode)); + end + + % TODO: Configure AUX I/O connector as required + retCode = ... + calllib('ATSApi', 'AlazarConfigureAuxIO', ... + obj.deviceobj, ... % HANDLE -- board handle + AUX_OUT_TRIGGER, ... % U32 -- mode + 0 ... % U32 -- parameter + ); + if retCode ~= ApiSuccess + error('Error: AlazarConfigureAuxIO failed -- %s\n', AlazarATS.errorToText(retCode)); + end + + + + end + end + methods (Static = true, Hidden = true) + AlazarDefs + obj = GetInstance(name, BoardGroupID, BoardID) + LoadLibStatus = LoadLib() + [methodinfo,structs,enuminfo,ThunkLibName] = AlazarInclude_pcwin32() + [methodinfo,structs,enuminfo,ThunkLibName] = AlazarInclude_pcwin64() + [methodinfo,structs,enuminfo]=AlazarInclude() + [text] = errorToText(errorCode) + end + methods + function set.smplrate(obj,val) + if obj.clocksource == 2; % external +% scode = obj.samplerate_codes(end); +% retCode = ... +% calllib('ATSApi', 'AlazarSetCaptureClock', ... +% obj.deviceobj, ... % HANDLE -- board handle +% 2, ... % U32 -- clock source id +% scode,... % U32 -- sample rate id +% 0, ... % U32 -- clock edge id +% 0 ... % U32 -- clock decimation +% ); +% if retCode ~= int32(512) +% error('Error: AlazarSetCaptureClock failed -- %s\n', AlazarATS.errorToText(retCode)); +% end + obj.smplrate = val; + else + [~,idx]=min(abs(val - obj.samplerate_options)); +% scode = obj.samplerate_codes(idx); +% retCode = ... +% calllib('ATSApi', 'AlazarSetCaptureClock', ... +% obj.deviceobj, ... % HANDLE -- board handle +% 1, ... % U32 -- clock source id +% scode,... % U32 -- sample rate id +% 0, ... % U32 -- clock edge id +% 0 ... % U32 -- clock decimation +% ); +% if retCode ~= int32(512) +% error('Error: AlazarSetCaptureClock failed -- %s\n', AlazarATS.errorToText(retCode)); +% end + obj.smplrate = obj.samplerate_options(idx); + end + end + function set.workmode(obj,val) + if val ~=1 && val ~= 2 + error('AlazarATS:InvalidInput','available workmodes 1/2 trigger/continues!'); + end + obj.workmode = val; + end + function set.clocksource(obj,val) + if val ~=1 && val ~= 2 + error('AlazarATS:InvalidInput','available clocksource 1/2 internal/external!'); + end + obj.clocksource = val; + end + function set.chnl1range(obj,val) + [~,idx]=min(abs(val - obj.range_options)); + rcode = obj.range_codes(idx); + retCode = ... + calllib('ATSApi', 'AlazarInputControl', ... + obj.deviceobj, ... % HANDLE -- board handle + 1, ... % U8 -- input channel + 2, ... % U32 -- input coupling id + rcode, ... % U32 -- input range id + 2 ... % U32 -- input impedance id % 50 Ohm + ); + if retCode ~= 512 + error('Error: AlazarInputControl failed -- %s\n', AlazarATS.errorToText(retCode)); + end + obj.chnl1range = obj.range_options(idx); + end + function set.chnl2range(obj,val) + [~,idx]=min(abs(val - obj.range_options)); + rcode = obj.range_codes(idx); + retCode = ... + calllib('ATSApi', 'AlazarInputControl', ... + obj.deviceobj, ... % HANDLE -- board handle + 2, ... % U8 -- input channel + 2, ... % U32 -- input coupling id + rcode, ... % U32 -- input range id + 2 ... % U32 -- input impedance id % 50 Ohm + ); + if retCode ~= 512 + error('Error: AlazarInputControl failed -- %s\n', AlazarATS.errorToText(retCode)); + end + obj.chnl2range = obj.range_options(idx); + end + + function set.num_records(obj,val) + val = round(val); + if isempty(val) || val <=0 + error('AlazarATS:InvalidInput','num_records should be a positive integer!'); + end + obj.num_records = val; + end + function set.record_ln(obj,val) + val = round(val); + if isempty(val) || val <=0 + error('AlazarATS:InvalidInput','record_ln should be a positive integer!'); + end + if mod(val,128) ~= 0 + val_ = 128*max(ceil(val/128),3); + warning('AlazarATS:numperseg_value_error','record_ln can only be a multiple of 128 and has a minmum of 384, value increased from %s to %s',... + num2str(val,'%0.0f'), num2str(val_,'%0.0f')); + val= val_; + end + obj.record_ln = val; + end + VoltSignal = FetchData(obj) + function Reset(obj) + % Reset divice object, do this incase of unable to connect + % error + error('not implemeted for AlazarATS'); + end + end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarDefs.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarDefs.m new file mode 100644 index 0000000..b9dff53 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarDefs.m @@ -0,0 +1,569 @@ +% ------------------------------------------------------------------------- +% Title: AlazarDefs.m +% Version: 6.1.0 +% Date: 2013/01/30 +% -------------------------------------------------------------------------- + +%--------------------------------------------------------------------------- +% +% Copyright (c) 2008-2013 AlazarTech, Inc. +% +% AlazarTech, Inc. licenses this software under specific terms and +% conditions. Use of any of the software or derivatives thereof in any +% product without an AlazarTech digitizer board is strictly prohibited. +% +% AlazarTech, Inc. provides this software AS IS, WITHOUT ANY WARRANTY, +% EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF +% MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. AlazarTech makes no +% guarantee or representations regarding the use of, or the results of the +% use of, the software and documentation in terms of correctness, accuracy, +% reliability, currentness, or otherwise; and you rely on the software, +% documentation and results solely at your own risk. +% +% IN NO EVENT SHALL ALAZARTECH BE LIABLE FOR ANY LOSS OF USE, LOSS OF +% BUSINESS, LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL +% DAMAGES OF ANY KIND. IN NO EVENT SHALL ALAZARTECH'S TOTAL LIABILITY EXCEED +% THE SUM PAID TO ALAZARTECH FOR THE PRODUCT LICENSED HEREUNDER. +% +%--------------------------------------------------------------------------- + +%-------------------------------------------------------------------------- +% Return codes +%-------------------------------------------------------------------------- + +ApiSuccess = int32(512); +ApiFailed = int32(513); +ApiAccessDenied = int32(514); +ApiDmaChannelUnavailable = int32(515); +ApiDmaChannelInvalid = int32(516); +ApiDmaChannelTypeError = int32(517); +ApiDmaInProgress = int32(518); +ApiDmaDone = int32(519); +ApiDmaPaused = int32(520); +ApiDmaNotPaused = int32(521); +ApiDmaCommandInvalid = int32(522); +ApiDmaManReady = int32(523); +ApiDmaManNotReady = int32(524); +ApiDmaInvalidChannelPriority = int32(525); +ApiDmaManCorrupted = int32(526); +ApiDmaInvalidElementIndex = int32(527); +ApiDmaNoMoreElements = int32(528); +ApiDmaSglInvalid = int32(529); +ApiDmaSglQueueFull = int32(530); +ApiNullParam = int32(531); +ApiInvalidBusIndex = int32(532); +ApiUnsupportedFunction = int32(533); +ApiInvalidPciSpace = int32(534); +ApiInvalidIopSpace = int32(535); +ApiInvalidSize = int32(536); +ApiInvalidAddress = int32(537); +ApiInvalidAccessType = int32(538); +ApiInvalidIndex = int32(539); +ApiMuNotReady = int32(540); +ApiMuFifoEmpty = int32(541); +ApiMuFifoFull = int32(542); +ApiInvalidRegister = int32(543); +ApiDoorbellClearFailed = int32(544); +ApiInvalidUserPin = int32(545); +ApiInvalidUserState = int32(546); +ApiEepromNotPresent = int32(547); +ApiEepromTypeNotSupported = int32(548); +ApiEepromBlank = int32(549); +ApiConfigAccessFailed = int32(550); +ApiInvalidDeviceInfo = int32(551); +ApiNoActiveDriver = int32(552); +ApiInsufficientResources = int32(553); +ApiObjectAlreadyAllocated = int32(554); +ApiAlreadyInitialized = int32(555); +ApiNotInitialized = int32(556); +ApiBadConfigRegEndianMode = int32(557); +ApiInvalidPowerState = int32(558); +ApiPowerDown = int32(559); +ApiFlybyNotSupported = int32(560); +ApiNotSupportThisChannel = int32(561); +ApiNoAction = int32(562); +ApiHSNotSupported = int32(563); +ApiVPDNotSupported = int32(564); +ApiVpdNotEnabled = int32(565); +ApiNoMoreCap = int32(566); +ApiInvalidOffset = int32(567); +ApiBadPinDirection = int32(568); +ApiPciTimeout = int32(569); +ApiDmaChannelClosed = int32(570); +ApiDmaChannelError = int32(571); +ApiInvalidHandle = int32(572); +ApiBufferNotReady = int32(573); +ApiInvalidData = int32(574); +ApiDoNothing = int32(575); +ApiDmaSglBuildFailed = int32(576); +ApiPMNotSupported = int32(577); +ApiInvalidDriverVersion = int32(578); +ApiWaitTimeout = int32(579); +ApiWaitCanceled = int32(580); +ApiBufferTooSmall = int32(581); +ApiBufferOverflow = int32(582); +ApiInvalidBuffer = int32(583); +ApiInvalidRecordsPerBuffer = int32(584); +ApiDmaPending = int32(585); +ApiLockAndProbePagesFailed = int32(586); +ApiWaitAbandoned = int32(587); +ApiWaitFailed = int32(588); +ApiTransferComplete = int32(589); +ApiPllNotLocked = int32(590); +ApiNotSupportedInDualChannelMode = int32(591); +ApiNotSupportedInQuadChannelMode = int32(592); +ApiFileIoError = int32(593); +ApiInvalidClockFrequency = int32(594); + +%-------------------------------------------------------------------------- +% Board types +%-------------------------------------------------------------------------- + +ATS_NONE = int32(0); +ATS850 = int32(1); +ATS310 = int32(2); +ATS330 = int32(3); +ATS855 = int32(4); +ATS315 = int32(5); +ATS335 = int32(6); +ATS460 = int32(7); +ATS860 = int32(8); +ATS660 = int32(9); +ATS665 = int32(10); +ATS9462 = int32(11); +ATS9434 = int32(12); +ATS9870 = int32(13); +ATS9350 = int32(14); +ATS9325 = int32(15); +ATS9440 = int32(16); +ATS9410 = int32(17); +ATS9351 = int32(18); +ATS9310 = int32(19); +ATS9461 = int32(20); +ATS9850 = int32(21); +ATS9625 = int32(22); +ATG6500 = int32(23); +ATS9626 = int32(24); +ATS9360 = int32(25); +ATS_LAST = int32(26); + +%-------------------------------------------------------------------------- +% Clock Control +%-------------------------------------------------------------------------- + +% Clock sources +INTERNAL_CLOCK = hex2dec('00000001'); +EXTERNAL_CLOCK = hex2dec('00000002'); +FAST_EXTERNAL_CLOCK = hex2dec('00000002')'; +MEDIMUM_EXTERNAL_CLOCK = hex2dec('00000003')'; +MEDIUM_EXTERNAL_CLOCK = hex2dec('00000003')'; +SLOW_EXTERNAL_CLOCK = hex2dec('00000004')'; +EXTERNAL_CLOCK_AC = hex2dec('00000005')'; +EXTERNAL_CLOCK_DC = hex2dec('00000006')'; +EXTERNAL_CLOCK_10MHz_REF = hex2dec('00000007')'; +INTERNAL_CLOCK_DIV_5 = hex2dec('000000010')'; +MASTER_CLOCK = hex2dec('000000011')'; + +% Internal sample rates +SAMPLE_RATE_1KSPS = hex2dec('00000001'); +SAMPLE_RATE_2KSPS = hex2dec('00000002'); +SAMPLE_RATE_5KSPS = hex2dec('00000004'); +SAMPLE_RATE_10KSPS = hex2dec('00000008'); +SAMPLE_RATE_20KSPS = hex2dec('0000000A'); +SAMPLE_RATE_50KSPS = hex2dec('0000000C'); +SAMPLE_RATE_100KSPS = hex2dec('0000000E'); +SAMPLE_RATE_200KSPS = hex2dec('00000010'); +SAMPLE_RATE_500KSPS = hex2dec('00000012'); +SAMPLE_RATE_1MSPS = hex2dec('00000014'); +SAMPLE_RATE_2MSPS = hex2dec('00000018'); +SAMPLE_RATE_5MSPS = hex2dec('0000001A'); +SAMPLE_RATE_10MSPS = hex2dec('0000001C'); +SAMPLE_RATE_20MSPS = hex2dec('0000001E'); +SAMPLE_RATE_25MSPS = hex2dec('00000021'); +SAMPLE_RATE_50MSPS = hex2dec('00000022'); +SAMPLE_RATE_100MSPS = hex2dec('00000024'); +SAMPLE_RATE_125MSPS = hex2dec('00000025'); +SAMPLE_RATE_160MSPS = hex2dec('00000026'); +SAMPLE_RATE_180MSPS = hex2dec('00000027'); +SAMPLE_RATE_200MSPS = hex2dec('00000028'); +SAMPLE_RATE_250MSPS = hex2dec('0000002B'); +SAMPLE_RATE_400MSPS = hex2dec('0000002D'); +SAMPLE_RATE_500MSPS = hex2dec('00000030'); +SAMPLE_RATE_800MSPS = hex2dec('00000032'); +SAMPLE_RATE_1GSPS = hex2dec('00000035'); +SAMPLE_RATE_1000MSPS = hex2dec('00000035'); +SAMPLE_RATE_1200MSPS = hex2dec('00000037'); +SAMPLE_RATE_1500MSPS = hex2dec('0000003A'); +SAMPLE_RATE_1600MSPS = hex2dec('0000003B'); +SAMPLE_RATE_1800MSPS = hex2dec('0000003D'); +SAMPLE_RATE_2000MSPS = hex2dec('0000003F'); +SAMPLE_RATE_2GSPS = hex2dec('0000003F'); +SAMPLE_RATE_USER_DEF = hex2dec('00000040'); + +% Clock edges +CLOCK_EDGE_RISING = hex2dec('00000000'); +CLOCK_EDGE_FALLING = hex2dec('00000001'); + +% Decimation +DECIMATE_BY_8 = hex2dec('00000008'); +DECIMATE_BY_64 = hex2dec('00000040'); + +%-------------------------------------------------------------------------- +% Input Control +%-------------------------------------------------------------------------- + +% Input channels +CHANNEL_ALL = hex2dec('00000000'); +CHANNEL_A = hex2dec('00000001'); +CHANNEL_B = hex2dec('00000002'); +CHANNEL_C = hex2dec('00000004'); +CHANNEL_D = hex2dec('00000008'); +CHANNEL_E = hex2dec('00000010'); +CHANNEL_F = hex2dec('00000012'); +CHANNEL_G = hex2dec('00000014'); +CHANNEL_H = hex2dec('00000018'); + +% Input ranges +INPUT_RANGE_PM_20_MV = hex2dec('00000001'); +INPUT_RANGE_PM_40_MV = hex2dec('00000002'); +INPUT_RANGE_PM_50_MV = hex2dec('00000003'); +INPUT_RANGE_PM_80_MV = hex2dec('00000004'); +INPUT_RANGE_PM_100_MV = hex2dec('00000005'); +INPUT_RANGE_PM_200_MV = hex2dec('00000006'); +INPUT_RANGE_PM_400_MV = hex2dec('00000007'); +INPUT_RANGE_PM_500_MV = hex2dec('00000008'); +INPUT_RANGE_PM_800_MV = hex2dec('00000009'); +INPUT_RANGE_PM_1_V = hex2dec('0000000A'); +INPUT_RANGE_PM_2_V = hex2dec('0000000B'); +INPUT_RANGE_PM_4_V = hex2dec('0000000C'); +INPUT_RANGE_PM_5_V = hex2dec('0000000D'); +INPUT_RANGE_PM_8_V = hex2dec('0000000E'); +INPUT_RANGE_PM_10_V = hex2dec('0000000F'); +INPUT_RANGE_PM_20_V = hex2dec('00000010'); +INPUT_RANGE_PM_40_V = hex2dec('00000011'); +INPUT_RANGE_PM_16_V = hex2dec('00000012'); +INPUT_RANGE_HIFI = hex2dec('00000020'); +INPUT_RANGE_PM_1_V_25 = hex2dec('00000021'); +INPUT_RANGE_PM_2_V_5 = hex2dec('00000025'); +INPUT_RANGE_PM_125_MV = hex2dec('00000028'); +INPUT_RANGE_PM_250_MV = hex2dec('00000030'); + +% Input impedances +IMPEDANCE_1M_OHM = hex2dec('00000001'); +IMPEDANCE_50_OHM = hex2dec('00000002'); +IMPEDANCE_75_OHM = hex2dec('00000004'); +IMPEDANCE_300_OHM = hex2dec('00000008'); +IMPEDANCE_600_OHM = hex2dec('0000000A'); + +% Input coupling +AC_COUPLING = hex2dec('00000001'); +DC_COUPLING = hex2dec('00000002'); + +%-------------------------------------------------------------------------- +% Trigger Control +%-------------------------------------------------------------------------- + +% Trigger engines +TRIG_ENGINE_J = hex2dec('00000000'); +TRIG_ENGINE_K = hex2dec('00000001'); + +% Trigger engine operations +TRIG_ENGINE_OP_J = hex2dec('00000000'); +TRIG_ENGINE_OP_K = hex2dec('00000001'); +TRIG_ENGINE_OP_J_OR_K = hex2dec('00000002'); +TRIG_ENGINE_OP_J_AND_K = hex2dec('00000003'); +TRIG_ENGINE_OP_J_XOR_K = hex2dec('00000004'); +TRIG_ENGINE_OP_J_AND_NOT_K = hex2dec('00000005'); +TRIG_ENGINE_OP_NOT_J_AND_K = hex2dec('00000006'); + +% Trigger engine sources +TRIG_CHAN_A = hex2dec('00000000'); +TRIG_CHAN_B = hex2dec('00000001'); +TRIG_EXTERNAL = hex2dec('00000002'); +TRIG_DISABLE = hex2dec('00000003'); +TRIG_CHAN_C = hex2dec('00000004'); +TRIG_CHAN_D = hex2dec('00000005'); + +% Trigger slopes +TRIGGER_SLOPE_POSITIVE = hex2dec('00000001'); +TRIGGER_SLOPE_NEGATIVE = hex2dec('00000002'); + +% External trigger ranges +ETR_DIV5 = hex2dec('00000000'); +ETR_X1 = hex2dec('00000001'); +ETR_5V = hex2dec('00000000'); +ETR_1V = hex2dec('00000001'); +ETR_TTL = hex2dec('00000002'); +ETR_2V5 = hex2dec('00000003'); + +%-------------------------------------------------------------------------- +% Auxiliary I/O and LED Control +%-------------------------------------------------------------------------- + +% AUX outputs +AUX_OUT_TRIGGER = 0; +AUX_OUT_PACER = 2; +AUX_OUT_BUSY = 4; +AUX_OUT_CLOCK = 6; +AUX_OUT_RESERVED = 8; +AUX_OUT_CAPTURE_ALMOST_DONE = 10; +AUX_OUT_AUXILIARY = 12; +AUX_OUT_SERIAL_DATA = 14; +AUX_OUT_TRIGGER_ENABLE = 16; + +% AUX inputs +AUX_IN_TRIGGER_ENABLE = 1; +AUX_IN_DIGITAL_TRIGGER = 3; +AUX_IN_GATE = 5; +AUX_IN_CAPTURE_ON_DEMAND = 7; +AUX_IN_RESET_TIMESTAMP = 9; +AUX_IN_SLOW_EXTERNAL_CLOCK = 11; +AUX_IN_AUXILIARY = 13; +AUX_IN_SERIAL_DATA = 15; + +AUX_INPUT_AUXILIARY = 13; +AUX_INPUT_SERIAL_DATA = 15; + +% LED states +LED_OFF = hex2dec('00000000'); +LED_ON = hex2dec('00000001'); + +%-------------------------------------------------------------------------- +% Get/Set Parameters +%-------------------------------------------------------------------------- + +NUMBER_OF_RECORDS = hex2dec('10000001'); +PRETRIGGER_AMOUNT = hex2dec('10000002'); +RECORD_LENGTH = hex2dec('10000003'); +TRIGGER_ENGINE = hex2dec('10000004'); +TRIGGER_DELAY = hex2dec('10000005'); +TRIGGER_TIMEOUT = hex2dec('10000006'); +SAMPLE_RATE = hex2dec('10000007'); +CONFIGURATION_MODE = hex2dec('10000008'); +DATA_WIDTH = hex2dec('10000009'); +SAMPLE_SIZE = DATA_WIDTH; +AUTO_CALIBRATE = hex2dec('1000000A'); +TRIGGER_XXXXX = hex2dec('1000000B'); +CLOCK_SOURCE = hex2dec('1000000C'); +CLOCK_SLOPE = hex2dec('1000000D'); +IMPEDANCE = hex2dec('1000000E'); +INPUT_RANGE = hex2dec('1000000F'); +COUPLING = hex2dec('10000010'); +MAX_TIMEOUTS_ALLOWED = hex2dec('10000011'); +ATS_OPERATING_MODE = hex2dec('10000012'); +CLOCK_DECIMATION_EXTERNAL = hex2dec('10000013'); +LED_CONTROL = hex2dec('10000014'); +ATTENUATOR_RELAY = hex2dec('10000018'); +EXT_TRIGGER_COUPLING = hex2dec('1000001A'); +EXT_TRIGGER_ATTENUATOR_RELAY = hex2dec('1000001C'); +TRIGGER_ENGINE_SOURCE = hex2dec('1000001E'); +TRIGGER_ENGINE_SLOPE = hex2dec('10000020'); +SEND_DAC_VALUE = hex2dec('10000021'); +SLEEP_DEVICE = hex2dec('10000022'); +GET_DAC_VALUE = hex2dec('10000023'); +GET_SERIAL_NUMBER = hex2dec('10000024'); +GET_FIRST_CAL_DATE = hex2dec('10000025'); +GET_LATEST_CAL_DATE = hex2dec('10000026'); +GET_LATEST_TEST_DATE = hex2dec('10000027'); +SEND_RELAY_VALUE = hex2dec('10000028'); +GET_LATEST_CAL_DATE_MONTH = hex2dec('1000002D'); +GET_LATEST_CAL_DATE_DAY = hex2dec('1000002E'); +GET_LATEST_CAL_DATE_YEAR = hex2dec('1000002F'); +GET_PCIE_LINK_SPEED = hex2dec('10000030'); +GET_PCIE_LINK_WIDTH = hex2dec('10000031'); +SETGET_ASYNC_BUFFCOUNT = hex2dec('10000040'); +SET_DATA_FORMAT = hex2dec('10000041'); +GET_DATA_FORMAT = hex2dec('10000042'); +DATA_FORMAT_UNSIGNED = 0; +DATA_FORMAT_SIGNED = 1; +SET_SINGLE_CHANNEL_MODE = hex2dec('10000043'); +MEMORY_SIZE = hex2dec('1000002A'); +BOARD_TYPE = hex2dec('1000002B'); +ASOPC_TYPE = hex2dec('1000002C'); +GET_BOARD_OPTIONS_LOW = hex2dec('10000037'); +GET_BOARD_OPTIONS_HIGH = hex2dec('10000038'); +OPTION_STREAMING_DMA = uint32(2^0); +OPTION_AVERAGE_INPUT = uint32(2^1); +OPTION_EXTERNAL_CLOCK = uint32(2^1); +OPTION_DUAL_PORT_MEMORY = uint32(2^2); +OPTION_180MHZ_OSCILLATOR = uint32(2^3); +OPTION_LVTTL_EXT_CLOCK = uint32(2^4); +OPTION_SW_SPI = uint32(2^5); +OPTION_ALT_INPUT_RANGES = uint32(2^6); +OPTION_VARIABLE_RATE_10MHZ_PLL = uint32(2^7); + +TRANSFER_OFFET = hex2dec('10000030'); +TRANSFER_LENGTH = hex2dec('10000031'); +TRANSFER_RECORD_OFFSET = hex2dec('10000032'); +TRANSFER_NUM_OF_RECORDS = hex2dec('10000033'); +TRANSFER_MAPPING_RATIO = hex2dec('10000034'); +TRIGGER_ADDRESS_AND_TIMESTAMP = hex2dec('10000035'); +MASTER_SLAVE_INDEPENDENT = hex2dec('10000036'); +TRIGGERED = hex2dec('10000040'); +BUSY = hex2dec('10000041'); +WHO_TRIGGERED = hex2dec('10000042'); +SET_DATA_FORMAT = hex2dec('10000041'); +GET_DATA_FORMAT = hex2dec('10000042'); +DATA_FORMAT_UNSIGNED = 0; +DATA_FORMAT_SIGNED = 1; +SET_SINGLE_CHANNEL_MODE = hex2dec('10000043'); +GET_SAMPLES_PER_TIMESTAMP_CLOCK = hex2dec('10000044'); +GET_RECORDS_CAPTURED = hex2dec('10000045'); +GET_MAX_PRETRIGGER_SAMPLES = hex2dec('10000046'); +SET_ADC_MODE = hex2dec('10000047'); +ECC_MODE = hex2dec('10000048'); +ECC_DISABLE = 0; +ECC_ENABLE = 1; +GET_AUX_INPUT_LEVEL = hex2dec('10000049'); +AUX_INPUT_LOW = 0; +AUX_INPUT_HIGH = 1; +GET_ASYNC_BUFFERS_PENDING = hex2dec('10000050'); +GET_ASYNC_BUFFERS_PENDING_FULL = hex2dec('10000051'); +GET_ASYNC_BUFFERS_PENDING_EMPTY = hex2dec('10000052'); +ACF_SAMPLES_PER_RECORD = hex2dec('10000060'); +ACF_RECORDS_TO_AVERAGE = hex2dec('10000061'); +EXT_TRIGGER_IMPEDANCE = hex2dec('10000065'); +EXT_TRIG_50_OHMS = 0; +EXT_TRIG_300_OHMS = 1; +GET_CHANNELS_PER_BOARD = hex2dec('10000070'); +GET_CPF_DEVICE = hex2dec('10000071'); +CPF_DEVICE_UNKNOWN = 0; +CPF_DEVICE_EP3SL50 = 1; +CPF_DEVICE_EP3SE260 = 2; +PACK_MODE = hex2dec('10000072'); +PACK_DEFAULT = 0; +PACK_8_BITS_PER_SAMPLE = 1; +GET_FPGA_TEMPERATURE = hex2dec('10000080'); + +% Master/Slave Configuration +BOARD_IS_INDEPENDENT = hex2dec('00000000'); +BOARD_IS_MASTER = hex2dec('00000001'); +BOARD_IS_SLAVE = hex2dec('00000002'); +BOARD_IS_LAST_SLAVE = hex2dec('00000003'); + +% Attenuator Relay +AR_X1 = hex2dec('00000000'); +AR_DIV40 = hex2dec('00000001'); + +% Device Sleep state +POWER_OFF = hex2dec('00000000'); +POWER_ON = hex2dec('00000001'); + +% Software Events control +SW_EVENTS_OFF = hex2dec('00000000'); +SW_EVENTS_ON = hex2dec('00000001'); + +% TimeStamp Value Reset Control +TIMESTAMP_RESET_FIRSTTIME_ONLY = hex2dec('00000000'); +TIMESTAMP_RESET_ALWAYS = hex2dec('00000001'); + +% DAC Names used by API AlazarDACSettingAdjust +ATS460_DAC_A_GAIN = hex2dec('00000001'); +ATS460_DAC_A_OFFSET = hex2dec('00000002'); +ATS460_DAC_A_POSITION = hex2dec('00000003'); +ATS460_DAC_B_GAIN = hex2dec('00000009'); +ATS460_DAC_B_OFFSET = hex2dec('0000000A'); +ATS460_DAC_B_POSITION = hex2dec('0000000B'); +ATS460_DAC_EXTERNAL_CLK_REF = hex2dec('00000007'); + +% DAC Names Specific to the ATS660 +ATS660_DAC_A_GAIN = hex2dec('00000001'); +ATS660_DAC_A_OFFSET = hex2dec('00000002'); +ATS660_DAC_A_POSITION = hex2dec('00000003'); +ATS660_DAC_B_GAIN = hex2dec('00000009'); +ATS660_DAC_B_OFFSET = hex2dec('0000000A'); +ATS660_DAC_B_POSITION = hex2dec('0000000B'); +ATS660_DAC_EXTERNAL_CLK_REF = hex2dec('00000007'); + +% DAC Names Specific to the ATS665 +ATS665_DAC_A_GAIN = hex2dec('00000001'); +ATS665_DAC_A_OFFSET = hex2dec('00000002'); +ATS665_DAC_A_POSITION = hex2dec('00000003'); +ATS665_DAC_B_GAIN = hex2dec('00000009'); +ATS665_DAC_B_OFFSET = hex2dec('0000000A'); +ATS665_DAC_B_POSITION = hex2dec('0000000B'); +ATS665_DAC_EXTERNAL_CLK_REF = hex2dec('00000007'); + +% Error return values +SETDAC_INVALID_SETGET = 660; +SETDAC_INVALID_CHANNEL = 661; +SETDAC_INVALID_DACNAME = 662; +SETDAC_INVALID_COUPLING = 663; +SETDAC_INVALID_RANGE = 664; +SETDAC_INVALID_IMPEDANCE = 665; +SETDAC_BAD_GET_PTR = 667; +SETDAC_INVALID_BOARDTYPE = 668; + +% Constants to be used in the Application when dealing with Custom FPGAs +FPGA_GETFIRST = hex2dec('FFFFFFFF'); +FPGA_GETNEXT = hex2dec('FFFFFFFE'); +FPGA_GETLAST = hex2dec('FFFFFFFC'); + +%-------------------------------------------------------------------------- +% AutoDMA Control +%-------------------------------------------------------------------------- + +% AutoDMA flags +ADMA_EXTERNAL_STARTCAPTURE = hex2dec('00000001'); +ADMA_ENABLE_RECORD_HEADERS = hex2dec('00000008'); +ADMA_SINGLE_DMA_CHANNEL = hex2dec('00000010'); +ADMA_ALLOC_BUFFERS = hex2dec('00000020'); +ADMA_TRADITIONAL_MODE = hex2dec('00000000'); +ADMA_CONTINUOUS_MODE = hex2dec('00000100'); +ADMA_NPT = hex2dec('00000200'); +ADMA_TRIGGERED_STREAMING = hex2dec('00000400'); +ADMA_FIFO_ONLY_STREAMING = hex2dec('00000800'); +ADMA_INTERLEAVE_SAMPLES = hex2dec('00001000'); +ADMA_GET_PROCESSED_DATA = hex2dec('00002000'); + +% AutoDMA header constants +ADMA_CLOCKSOURCE = hex2dec('00000001'); +ADMA_CLOCKEDGE = hex2dec('00000002'); +ADMA_SAMPLERATE = hex2dec('00000003'); +ADMA_INPUTRANGE = hex2dec('00000004'); +ADMA_INPUTCOUPLING = hex2dec('00000005'); +ADMA_IMPUTIMPEDENCE = hex2dec('00000006'); +ADMA_EXTTRIGGERED = hex2dec('00000007'); +ADMA_CHA_TRIGGERED = hex2dec('00000008'); +ADMA_CHB_TRIGGERED = hex2dec('00000009'); +ADMA_TIMEOUT = hex2dec('0000000A'); +ADMA_THISCHANTRIGGERED = hex2dec('0000000B'); +ADMA_SERIALNUMBER = hex2dec('0000000C'); +ADMA_SYSTEMNUMBER = hex2dec('0000000D'); +ADMA_BOARDNUMBER = hex2dec('0000000E'); +ADMA_WHICHCHANNEL = hex2dec('0000000F'); +ADMA_SAMPLERESOLUTION = hex2dec('00000010'); +ADMA_DATAFORMAT = hex2dec('00000011'); + +%-------------------------------------------------------------------------- +% AlazarSetClockSwitchOver +%-------------------------------------------------------------------------- + +CSO_DUMMY_CLOCK_DISABLE = 0; +CSO_DUMMY_CLOCK_TIMER = 1; +CSO_DUMMY_CLOCK_EXT_TRIGGER = 2; +CSO_DUMMY_CLOCK_TIMER_ON_TIMER_OFF = 3; + +%-------------------------------------------------------------------------- +% User-programmable FPGA +%-------------------------------------------------------------------------- + +% AlazarCoprocessorDownload +CPF_OPTION_DMA_DOWNLOAD = 1; + +% User-programmable FPGA device types +CPF_DEVICE_UNKNOWN = 0; +CPF_DEVICE_EP3SL50 = 1; +CPF_DEVICE_EP3SE260 = 2; + +% Framework defined registers +CPF_REG_SIGNATURE = 0; +CPF_REG_REVISION = 1; +CPF_REG_VERSION = 2; +CPF_REG_STATUS = 3; + +%-------------------------------------------------------------------------- +% AlazarSetExternalTriggerOperationForScanning +%-------------------------------------------------------------------------- + +STOS_OPTION_DEFER_START_CAPTURE = 1; diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarInclude.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarInclude.m new file mode 100644 index 0000000..f08021c --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarInclude.m @@ -0,0 +1,221 @@ +function [methodinfo,structs,enuminfo]=AlazarInclude() +%ALAZARINCLUDE Create structures to define interfaces found in 'AlazarApi'. + +%This function was generated by loadlibrary.m parser version 1.1.6.13 on Wed Jan 30 15:22:08 2013 +%perl options:'AlazarApi.i -outfile=AlazarInclude.m' +ival={cell(1,0)}; % change 0 to the actual number of functions to preallocate the data. +fcns=struct('name',ival,'calltype',ival,'LHS',ival,'RHS',ival,'alias',ival); +structs=[];enuminfo=[];fcnNum=1; +% unsigned int AlazarGetOEMFPGAName ( int opcodeID , char * FullPath , unsigned long * error ); +fcns.name{fcnNum}='AlazarGetOEMFPGAName'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'int32', 'cstring', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarOEMSetWorkingDirectory ( char * wDir , unsigned long * error ); +fcns.name{fcnNum}='AlazarOEMSetWorkingDirectory'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'cstring', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarOEMGetWorkingDirectory ( char * wDir , unsigned long * error ); +fcns.name{fcnNum}='AlazarOEMGetWorkingDirectory'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'cstring', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarParseFPGAName ( const char * FullName , char * Name , unsigned int * Type , unsigned int * MemSize , unsigned int * MajVer , unsigned int * MinVer , unsigned int * MajRev , unsigned int * MinRev , unsigned int * error ); +fcns.name{fcnNum}='AlazarParseFPGAName'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'cstring', 'cstring', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarOEMDownLoadFPGA ( void * h , char * FileName , unsigned int * RetValue ); +fcns.name{fcnNum}='AlazarOEMDownLoadFPGA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarDownLoadFPGA ( void * h , char * FileName , unsigned int * RetValue ); +fcns.name{fcnNum}='AlazarDownLoadFPGA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarReadWriteTest ( void * h , unsigned int * Buffer , unsigned int SizeToWrite , unsigned int SizeToRead ); +fcns.name{fcnNum}='AlazarReadWriteTest'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32Ptr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarMemoryTest ( void * h , unsigned int * errors ); +fcns.name{fcnNum}='AlazarMemoryTest'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarBusyFlag ( void * h , int * BusyFlag ); +fcns.name{fcnNum}='AlazarBusyFlag'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'int32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarTriggeredFlag ( void * h , int * TriggeredFlag ); +fcns.name{fcnNum}='AlazarTriggeredFlag'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'int32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarBoardsFound (); +fcns.name{fcnNum}='AlazarBoardsFound'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1; +% void * AlazarOpen ( char * BoardNameID ); +fcns.name{fcnNum}='AlazarOpen'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'cstring'};fcnNum=fcnNum+1; +% void AlazarClose ( void * h ); +fcns.name{fcnNum}='AlazarClose'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}=[]; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% MSILS AlazarGetBoardKind ( void * h ); +fcns.name{fcnNum}='AlazarGetBoardKind'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='MSILS'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetCPLDVersion ( void * h , unsigned char * Major , unsigned char * Minor ); +fcns.name{fcnNum}='AlazarGetCPLDVersion'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetChannelInfo ( void * h , unsigned int * MemSize , unsigned char * SampleSize ); +fcns.name{fcnNum}='AlazarGetChannelInfo'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetSDKVersion ( unsigned char * Major , unsigned char * Minor , unsigned char * Revision ); +fcns.name{fcnNum}='AlazarGetSDKVersion'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint8Ptr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetDriverVersion ( unsigned char * Major , unsigned char * Minor , unsigned char * Revision ); +fcns.name{fcnNum}='AlazarGetDriverVersion'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint8Ptr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarInputControl ( void * h , unsigned char Channel , unsigned int Coupling , unsigned int InputRange , unsigned int Impedance ); +fcns.name{fcnNum}='AlazarInputControl'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetPosition ( void * h , unsigned char Channel , int PMPercent , unsigned int InputRange ); +fcns.name{fcnNum}='AlazarSetPosition'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'int32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetExternalTrigger ( void * h , unsigned int Coupling , unsigned int Range ); +fcns.name{fcnNum}='AlazarSetExternalTrigger'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerDelay ( void * h , unsigned int Delay ); +fcns.name{fcnNum}='AlazarSetTriggerDelay'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerTimeOut ( void * h , unsigned int to_ns ); +fcns.name{fcnNum}='AlazarSetTriggerTimeOut'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarTriggerTimedOut ( void * h ); +fcns.name{fcnNum}='AlazarTriggerTimedOut'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetTriggerAddress ( void * h , unsigned int Record , unsigned int * TriggerAddress , unsigned int * TimeStampHighPart , unsigned int * TimeStampLowPart ); +fcns.name{fcnNum}='AlazarGetTriggerAddress'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerOperation ( void * h , unsigned int TriggerOperation , unsigned int TriggerEngine1 , unsigned int Source1 , unsigned int Slope1 , unsigned int Level1 , unsigned int TriggerEngine2 , unsigned int Source2 , unsigned int Slope2 , unsigned int Level2 ); +fcns.name{fcnNum}='AlazarSetTriggerOperation'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetTriggerTimestamp ( void * h , unsigned int Record , U64 * Timestamp_samples ); +fcns.name{fcnNum}='AlazarGetTriggerTimestamp'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerOperationForScanning ( void * h , unsigned int slope , unsigned int level , unsigned int options ); +fcns.name{fcnNum}='AlazarSetTriggerOperationForScanning'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarAbortCapture ( void * h ); +fcns.name{fcnNum}='AlazarAbortCapture'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarForceTrigger ( void * h ); +fcns.name{fcnNum}='AlazarForceTrigger'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarForceTriggerEnable ( void * h ); +fcns.name{fcnNum}='AlazarForceTriggerEnable'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarStartCapture ( void * h ); +fcns.name{fcnNum}='AlazarStartCapture'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarCaptureMode ( void * h , unsigned int Mode ); +fcns.name{fcnNum}='AlazarCaptureMode'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarStreamCapture ( void * h , void * Buffer , unsigned int BufferSize , unsigned int DeviceOption , unsigned int ChannelSelect , unsigned int * error ); +fcns.name{fcnNum}='AlazarStreamCapture'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarHyperDisp ( void * h , void * Buffer , unsigned int BufferSize , unsigned char * ViewBuffer , unsigned int ViewBufferSize , unsigned int NumOfPixels , unsigned int Option , unsigned int ChannelSelect , unsigned int Record , long TransferOffset , unsigned int * error ); +fcns.name{fcnNum}='AlazarHyperDisp'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint8Ptr', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'int32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarFastPRRCapture ( void * h , void * Buffer , unsigned int BufferSize , unsigned int DeviceOption , unsigned int ChannelSelect , unsigned int * error ); +fcns.name{fcnNum}='AlazarFastPRRCapture'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarBusy ( void * h ); +fcns.name{fcnNum}='AlazarBusy'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarTriggered ( void * h ); +fcns.name{fcnNum}='AlazarTriggered'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetStatus ( void * h ); +fcns.name{fcnNum}='AlazarGetStatus'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarDetectMultipleRecord ( void * h ); +fcns.name{fcnNum}='AlazarDetectMultipleRecord'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarSetRecordCount ( void * h , unsigned int Count ); +fcns.name{fcnNum}='AlazarSetRecordCount'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetRecordSize ( void * h , unsigned int PreSize , unsigned int PostSize ); +fcns.name{fcnNum}='AlazarSetRecordSize'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetCaptureClock ( void * h , unsigned int Source , unsigned int Rate , unsigned int Edge , unsigned int Decimation ); +fcns.name{fcnNum}='AlazarSetCaptureClock'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetExternalClockLevel ( void * h , float percent ); +fcns.name{fcnNum}='AlazarSetExternalClockLevel'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'single'};fcnNum=fcnNum+1; +% unsigned int AlazarSetClockSwitchOver ( void * hBoard , unsigned int uMode , unsigned int uDummyClockOnTime_ns , unsigned int uReserved ); +fcns.name{fcnNum}='AlazarSetClockSwitchOver'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarRead ( void * h , unsigned int Channel , void * Buffer , int ElementSize , long Record , long TransferOffset , unsigned int TransferLength ); +fcns.name{fcnNum}='AlazarRead'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr', 'int32', 'int32', 'int32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetParameter ( void * h , unsigned char Channel , unsigned int Parameter , long Value ); +fcns.name{fcnNum}='AlazarSetParameter'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'int32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetParameterUL ( void * h , unsigned char Channel , unsigned int Parameter , unsigned int Value ); +fcns.name{fcnNum}='AlazarSetParameterUL'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetParameter ( void * h , unsigned char Channel , unsigned int Parameter , long * RetValue ); +fcns.name{fcnNum}='AlazarGetParameter'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'int32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetParameterUL ( void * h , unsigned char Channel , unsigned int Parameter , unsigned int * RetValue ); +fcns.name{fcnNum}='AlazarGetParameterUL'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% void * AlazarGetSystemHandle ( unsigned int sid ); +fcns.name{fcnNum}='AlazarGetSystemHandle'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarNumOfSystems (); +fcns.name{fcnNum}='AlazarNumOfSystems'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1; +% unsigned int AlazarBoardsInSystemBySystemID ( unsigned int sid ); +fcns.name{fcnNum}='AlazarBoardsInSystemBySystemID'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarBoardsInSystemByHandle ( void * systemHandle ); +fcns.name{fcnNum}='AlazarBoardsInSystemByHandle'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% void * AlazarGetBoardBySystemID ( unsigned int sid , unsigned int brdNum ); +fcns.name{fcnNum}='AlazarGetBoardBySystemID'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'uint32', 'uint32'};fcnNum=fcnNum+1; +% void * AlazarGetBoardBySystemHandle ( void * systemHandle , unsigned int brdNum ); +fcns.name{fcnNum}='AlazarGetBoardBySystemHandle'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetLED ( void * h , unsigned int state ); +fcns.name{fcnNum}='AlazarSetLED'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarQueryCapability ( void * h , unsigned int request , unsigned int value , unsigned int * retValue ); +fcns.name{fcnNum}='AlazarQueryCapability'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarMaxSglTransfer ( ALAZAR_BOARDTYPES bt ); +fcns.name{fcnNum}='AlazarMaxSglTransfer'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'BoardTypes'};fcnNum=fcnNum+1; +% unsigned int AlazarGetMaxRecordsCapable ( void * h , unsigned int RecordLength , unsigned int * num ); +fcns.name{fcnNum}='AlazarGetMaxRecordsCapable'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetWhoTriggeredBySystemHandle ( void * systemHandle , unsigned int brdNum , unsigned int recNum ); +fcns.name{fcnNum}='AlazarGetWhoTriggeredBySystemHandle'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetWhoTriggeredBySystemID ( unsigned int sid , unsigned int brdNum , unsigned int recNum ); +fcns.name{fcnNum}='AlazarGetWhoTriggeredBySystemID'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetBWLimit ( void * h , unsigned int Channel , unsigned int enable ); +fcns.name{fcnNum}='AlazarSetBWLimit'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSleepDevice ( void * h , unsigned int state ); +fcns.name{fcnNum}='AlazarSleepDevice'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarStartAutoDMA ( void * h , void * Buffer1 , unsigned int UseHeader , unsigned int ChannelSelect , long TransferOffset , unsigned int TransferLength , long RecordsPerBuffer , long RecordCount , int * error , unsigned int r1 , unsigned int r2 , unsigned int * r3 , unsigned int * r4 ); +fcns.name{fcnNum}='AlazarStartAutoDMA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32', 'int32', 'uint32', 'int32', 'int32', 'int32Ptr', 'uint32', 'uint32', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetNextAutoDMABuffer ( void * h , void * Buffer1 , void * Buffer2 , long * WhichOne , long * RecordsTransfered , int * error , unsigned int r1 , unsigned int r2 , long * TriggersOccurred , unsigned int * r4 ); +fcns.name{fcnNum}='AlazarGetNextAutoDMABuffer'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'voidPtr', 'int32Ptr', 'int32Ptr', 'int32Ptr', 'uint32', 'uint32', 'int32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetNextBuffer ( void * h , void * Buffer1 , void * Buffer2 , long * WhichOne , long * RecordsTransfered , int * error , unsigned int r1 , unsigned int r2 , long * TriggersOccurred , unsigned int * r4 ); +fcns.name{fcnNum}='AlazarGetNextBuffer'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'voidPtr', 'int32Ptr', 'int32Ptr', 'int32Ptr', 'uint32', 'uint32', 'int32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarCloseAUTODma ( void * h ); +fcns.name{fcnNum}='AlazarCloseAUTODma'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarAbortAutoDMA ( void * h , void * Buffer , int * error , unsigned int r1 , unsigned int r2 , unsigned int * r3 , unsigned int * r4 ); +fcns.name{fcnNum}='AlazarAbortAutoDMA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'int32Ptr', 'uint32', 'uint32', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetAutoDMAHeaderValue ( void * h , unsigned int Channel , void * DataBuffer , unsigned int Record , unsigned int Parameter , int * error ); +fcns.name{fcnNum}='AlazarGetAutoDMAHeaderValue'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr', 'uint32', 'uint32', 'int32Ptr'};fcnNum=fcnNum+1; +% float AlazarGetAutoDMAHeaderTimeStamp ( void * h , unsigned int Channel , void * DataBuffer , unsigned int Record , int * error ); +fcns.name{fcnNum}='AlazarGetAutoDMAHeaderTimeStamp'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='single'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr', 'uint32', 'int32Ptr'};fcnNum=fcnNum+1; +% void * AlazarGetAutoDMAPtr ( void * h , unsigned int DataOrHeader , unsigned int Channel , void * DataBuffer , unsigned int Record , int * error ); +fcns.name{fcnNum}='AlazarGetAutoDMAPtr'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'voidPtr', 'uint32', 'int32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarWaitForBufferReady ( void * h , long tms ); +fcns.name{fcnNum}='AlazarWaitForBufferReady'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'int32'};fcnNum=fcnNum+1; +% unsigned int AlazarEvents ( void * h , unsigned int enable ); +fcns.name{fcnNum}='AlazarEvents'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarBeforeAsyncRead ( void * hBoard , unsigned int uChannelSelect , long lTransferOffset , unsigned int uSamplesPerRecord , unsigned int uRecordsPerBuffer , unsigned int uRecordsPerAcquisition , unsigned int uFlags ); +fcns.name{fcnNum}='AlazarBeforeAsyncRead'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'int32', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarAsyncRead ( void * hBoard , void * pBuffer , unsigned int BytesToRead , OVERLAPPED * pOverlapped ); +fcns.name{fcnNum}='AlazarAsyncRead'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 's_OVERLAPPEDPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarAbortAsyncRead ( void * hBoard ); +fcns.name{fcnNum}='AlazarAbortAsyncRead'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarPostAsyncBuffer ( void * hDevice , void * pBuffer , unsigned int uBufferLength_bytes ); +fcns.name{fcnNum}='AlazarPostAsyncBuffer'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarWaitAsyncBufferComplete ( void * hDevice , void * pBuffer , unsigned int uTimeout_ms ); +fcns.name{fcnNum}='AlazarWaitAsyncBufferComplete'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarWaitNextAsyncBufferComplete ( void * hDevice , void * pBuffer , unsigned int uBufferLength_bytes , unsigned int uTimeout_ms ); +fcns.name{fcnNum}='AlazarWaitNextAsyncBufferComplete'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarCreateStreamFileA ( void * hDevice , const char * pszFilePath ); +fcns.name{fcnNum}='AlazarCreateStreamFileA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring'};fcnNum=fcnNum+1; +% unsigned int AlazarCreateStreamFileW ( void * hDevice , const WCHAR * pszFilePath ); +fcns.name{fcnNum}='AlazarCreateStreamFileW'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint16Ptr'};fcnNum=fcnNum+1; +% long AlazarFlushAutoDMA ( void * h ); +fcns.name{fcnNum}='AlazarFlushAutoDMA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='int32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% void AlazarStopAutoDMA ( void * h ); +fcns.name{fcnNum}='AlazarStopAutoDMA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}=[]; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarResetTimeStamp ( void * h , unsigned int resetFlag ); +fcns.name{fcnNum}='AlazarResetTimeStamp'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarReadRegister ( void * hDevice , unsigned int offset , unsigned int * retVal , unsigned int pswrd ); +fcns.name{fcnNum}='AlazarReadRegister'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarWriteRegister ( void * hDevice , unsigned int offset , unsigned int Val , unsigned int pswrd ); +fcns.name{fcnNum}='AlazarWriteRegister'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarDACSetting ( void * h , unsigned int SetGet , unsigned int OriginalOrModified , unsigned char Channel , unsigned int DACNAME , unsigned int Coupling , unsigned int InputRange , unsigned int Impedance , unsigned int * getVal , unsigned int setVal , unsigned int * error ); +fcns.name{fcnNum}='AlazarDACSetting'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint8', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32Ptr', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarConfigureAuxIO ( void * hDevice , unsigned int uMode , unsigned int uParameter ); +fcns.name{fcnNum}='AlazarConfigureAuxIO'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% const char * AlazarErrorToText ( unsigned int code ); +fcns.name{fcnNum}='AlazarErrorToText'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='cstring'; fcns.RHS{fcnNum}={'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarConfigureSampleSkipping ( void * hBoard , unsigned int uMode , unsigned int uSampleClocksPerRecord , unsigned short * pwClockSkipMask ); +fcns.name{fcnNum}='AlazarConfigureSampleSkipping'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint16Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorRegisterRead ( void * hDevice , unsigned int offset , unsigned int * pValue ); +fcns.name{fcnNum}='AlazarCoprocessorRegisterRead'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorRegisterWrite ( void * hDevice , unsigned int offset , unsigned int value ); +fcns.name{fcnNum}='AlazarCoprocessorRegisterWrite'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorDownloadA ( void * hBoard , char * pszFileName , unsigned int uOptions ); +fcns.name{fcnNum}='AlazarCoprocessorDownloadA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorDownloadW ( void * hBoard , WCHAR * pszFileName , unsigned int uOptions ); +fcns.name{fcnNum}='AlazarCoprocessorDownloadW'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint16Ptr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetBoardRevision ( void * hBoard , unsigned char * Major , unsigned char * Minor ); +fcns.name{fcnNum}='AlazarGetBoardRevision'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarConfigureRecordAverage ( void * hBoard , unsigned int uMode , unsigned int uSamplesPerRecord , unsigned int uRecordsPerAverage , unsigned int uOptions ); +fcns.name{fcnNum}='AlazarConfigureRecordAverage'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned char * AlazarAllocBufferU8 ( void * hBoard , unsigned int uSampleCount ); +fcns.name{fcnNum}='AlazarAllocBufferU8'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint8Ptr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarFreeBufferU8 ( void * hBoard , unsigned char * pBuffer ); +fcns.name{fcnNum}='AlazarFreeBufferU8'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned short * AlazarAllocBufferU16 ( void * hBoard , unsigned int uSampleCount ); +fcns.name{fcnNum}='AlazarAllocBufferU16'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint16Ptr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarFreeBufferU16 ( void * hBoard , unsigned short * pBuffer ); +fcns.name{fcnNum}='AlazarFreeBufferU16'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint16Ptr'};fcnNum=fcnNum+1; +structs.s_BoardDef.packing=8; +structs.s_BoardDef.members=struct('RecordCount', 'uint32', 'RecLength', 'uint32', 'PreDepth', 'uint32', 'ClockSource', 'uint32', 'ClockEdge', 'uint32', 'SampleRate', 'uint32', 'CouplingChanA', 'uint32', 'InputRangeChanA', 'uint32', 'InputImpedChanA', 'uint32', 'CouplingChanB', 'uint32', 'InputRangeChanB', 'uint32', 'InputImpedChanB', 'uint32', 'TriEngOperation', 'uint32', 'TriggerEngine1', 'uint32', 'TrigEngSource1', 'uint32', 'TrigEngSlope1', 'uint32', 'TrigEngLevel1', 'uint32', 'TriggerEngine2', 'uint32', 'TrigEngSource2', 'uint32', 'TrigEngSlope2', 'uint32', 'TrigEngLevel2', 'uint32'); +structs.s_HEADER2.packing=8; +structs.s_HEADER2.members=struct('TimeStampLowPart', 'uint32'); +structs.s_ALAZAR_HEADER.packing=8; +% structs.s_ALAZAR_HEADER.members=struct('hdr0', 'error', 'hdr1', 'error', 'hdr2', 's_HEADER2', 'hdr3', 'error'); +structs.s_OVERLAPPED.packing=8; +structs.s_OVERLAPPED.members=struct('Internal', 'uint32', 'InternalHigh', 'uint32', 'Offset', 'uint32', 'OffsetHigh', 'uint32', 'hEvent', 'voidPtr'); +enuminfo.MSILS=struct('KINDEPENDENT',0,'KSLAVE',1,'KMASTER',2,'KLASTSLAVE',3); +enuminfo.BoardTypes=struct('ATS_NONE',0,'ATS850',1,'ATS310',2,'ATS330',3,'ATS855',4,'ATS315',5,'ATS335',6,'ATS460',7,'ATS860',8,'ATS660',9,'ATS665',10,'ATS9462',11,'ATS9434',12,'ATS9870',13,'ATS9350',14,'ATS9325',15,'ATS9440',16,'ATS9410',17,'ATS9351',18,'ATS9310',19,'ATS9461',20,'ATS9850',21,'ATS9625',22,'ATG6500',23,'ATS9626',24,'ATS9360',25,'ATS_LAST',26); +methodinfo=fcns; \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarInclude_pcwin32.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarInclude_pcwin32.m new file mode 100644 index 0000000..1025abf --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarInclude_pcwin32.m @@ -0,0 +1,219 @@ +function [methodinfo,structs,enuminfo,ThunkLibName]=AlazarInclude_pcwin32() +%ALAZARINCLUDE Create structures to define interfaces found in 'AlazarApi'. + +%This function was generated by loadlibrary.m parser version 1.1.6.29 on Tue Jan 29 14:27:14 2013 +%perl options:'AlazarApi.i -outfile=AlazarInclude.m' +ival={cell(1,0)}; % change 0 to the actual number of functions to preallocate the data. +structs=[];enuminfo=[];fcnNum=1; +fcns=struct('name',ival,'calltype',ival,'LHS',ival,'RHS',ival,'alias',ival); +ThunkLibName=[]; +% unsigned int AlazarGetOEMFPGAName ( int opcodeID , char * FullPath , unsigned long * error ); +fcns.name{fcnNum}='AlazarGetOEMFPGAName'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'int32', 'cstring', 'ulongPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarOEMSetWorkingDirectory ( char * wDir , unsigned long * error ); +fcns.name{fcnNum}='AlazarOEMSetWorkingDirectory'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'cstring', 'ulongPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarOEMGetWorkingDirectory ( char * wDir , unsigned long * error ); +fcns.name{fcnNum}='AlazarOEMGetWorkingDirectory'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'cstring', 'ulongPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarParseFPGAName ( const char * FullName , char * Name , unsigned int * Type , unsigned int * MemSize , unsigned int * MajVer , unsigned int * MinVer , unsigned int * MajRev , unsigned int * MinRev , unsigned int * error ); +fcns.name{fcnNum}='AlazarParseFPGAName'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'cstring', 'cstring', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarOEMDownLoadFPGA ( void * h , char * FileName , unsigned int * RetValue ); +fcns.name{fcnNum}='AlazarOEMDownLoadFPGA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarDownLoadFPGA ( void * h , char * FileName , unsigned int * RetValue ); +fcns.name{fcnNum}='AlazarDownLoadFPGA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarReadWriteTest ( void * h , unsigned int * Buffer , unsigned int SizeToWrite , unsigned int SizeToRead ); +fcns.name{fcnNum}='AlazarReadWriteTest'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32Ptr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarMemoryTest ( void * h , unsigned int * errors ); +fcns.name{fcnNum}='AlazarMemoryTest'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarBusyFlag ( void * h , int * BusyFlag ); +fcns.name{fcnNum}='AlazarBusyFlag'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'int32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarTriggeredFlag ( void * h , int * TriggeredFlag ); +fcns.name{fcnNum}='AlazarTriggeredFlag'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'int32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarBoardsFound (); +fcns.name{fcnNum}='AlazarBoardsFound'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1; +% void * AlazarOpen ( char * BoardNameID ); +fcns.name{fcnNum}='AlazarOpen'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'cstring'};fcnNum=fcnNum+1; +% void AlazarClose ( void * h ); +fcns.name{fcnNum}='AlazarClose'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}=[]; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% MSILS AlazarGetBoardKind ( void * h ); +fcns.name{fcnNum}='AlazarGetBoardKind'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='MSILS'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetCPLDVersion ( void * h , unsigned char * Major , unsigned char * Minor ); +fcns.name{fcnNum}='AlazarGetCPLDVersion'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetChannelInfo ( void * h , unsigned int * MemSize , unsigned char * SampleSize ); +fcns.name{fcnNum}='AlazarGetChannelInfo'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetSDKVersion ( unsigned char * Major , unsigned char * Minor , unsigned char * Revision ); +fcns.name{fcnNum}='AlazarGetSDKVersion'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint8Ptr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetDriverVersion ( unsigned char * Major , unsigned char * Minor , unsigned char * Revision ); +fcns.name{fcnNum}='AlazarGetDriverVersion'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint8Ptr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarInputControl ( void * h , unsigned char Channel , unsigned int Coupling , unsigned int InputRange , unsigned int Impedance ); +fcns.name{fcnNum}='AlazarInputControl'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetPosition ( void * h , unsigned char Channel , int PMPercent , unsigned int InputRange ); +fcns.name{fcnNum}='AlazarSetPosition'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'int32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetExternalTrigger ( void * h , unsigned int Coupling , unsigned int Range ); +fcns.name{fcnNum}='AlazarSetExternalTrigger'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerDelay ( void * h , unsigned int Delay ); +fcns.name{fcnNum}='AlazarSetTriggerDelay'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerTimeOut ( void * h , unsigned int to_ns ); +fcns.name{fcnNum}='AlazarSetTriggerTimeOut'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarTriggerTimedOut ( void * h ); +fcns.name{fcnNum}='AlazarTriggerTimedOut'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetTriggerAddress ( void * h , unsigned int Record , unsigned int * TriggerAddress , unsigned int * TimeStampHighPart , unsigned int * TimeStampLowPart ); +fcns.name{fcnNum}='AlazarGetTriggerAddress'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerOperation ( void * h , unsigned int TriggerOperation , unsigned int TriggerEngine1 , unsigned int Source1 , unsigned int Slope1 , unsigned int Level1 , unsigned int TriggerEngine2 , unsigned int Source2 , unsigned int Slope2 , unsigned int Level2 ); +fcns.name{fcnNum}='AlazarSetTriggerOperation'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetTriggerTimestamp ( void * h , unsigned int Record , U64 * Timestamp_samples ); +fcns.name{fcnNum}='AlazarGetTriggerTimestamp'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerOperationForScanning ( void * h , unsigned int slope , unsigned int level , unsigned int options ); +fcns.name{fcnNum}='AlazarSetTriggerOperationForScanning'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarAbortCapture ( void * h ); +fcns.name{fcnNum}='AlazarAbortCapture'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarForceTrigger ( void * h ); +fcns.name{fcnNum}='AlazarForceTrigger'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarForceTriggerEnable ( void * h ); +fcns.name{fcnNum}='AlazarForceTriggerEnable'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarStartCapture ( void * h ); +fcns.name{fcnNum}='AlazarStartCapture'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarCaptureMode ( void * h , unsigned int Mode ); +fcns.name{fcnNum}='AlazarCaptureMode'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarStreamCapture ( void * h , void * Buffer , unsigned int BufferSize , unsigned int DeviceOption , unsigned int ChannelSelect , unsigned int * error ); +fcns.name{fcnNum}='AlazarStreamCapture'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarHyperDisp ( void * h , void * Buffer , unsigned int BufferSize , unsigned char * ViewBuffer , unsigned int ViewBufferSize , unsigned int NumOfPixels , unsigned int Option , unsigned int ChannelSelect , unsigned int Record , long TransferOffset , unsigned int * error ); +fcns.name{fcnNum}='AlazarHyperDisp'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint8Ptr', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'long', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarFastPRRCapture ( void * h , void * Buffer , unsigned int BufferSize , unsigned int DeviceOption , unsigned int ChannelSelect , unsigned int * error ); +fcns.name{fcnNum}='AlazarFastPRRCapture'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarBusy ( void * h ); +fcns.name{fcnNum}='AlazarBusy'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarTriggered ( void * h ); +fcns.name{fcnNum}='AlazarTriggered'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetStatus ( void * h ); +fcns.name{fcnNum}='AlazarGetStatus'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarDetectMultipleRecord ( void * h ); +fcns.name{fcnNum}='AlazarDetectMultipleRecord'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarSetRecordCount ( void * h , unsigned int Count ); +fcns.name{fcnNum}='AlazarSetRecordCount'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetRecordSize ( void * h , unsigned int PreSize , unsigned int PostSize ); +fcns.name{fcnNum}='AlazarSetRecordSize'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetCaptureClock ( void * h , unsigned int Source , unsigned int Rate , unsigned int Edge , unsigned int Decimation ); +fcns.name{fcnNum}='AlazarSetCaptureClock'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetExternalClockLevel ( void * h , float percent ); +fcns.name{fcnNum}='AlazarSetExternalClockLevel'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'single'};fcnNum=fcnNum+1; +% unsigned int AlazarSetClockSwitchOver ( void * hBoard , unsigned int uMode , unsigned int uDummyClockOnTime_ns , unsigned int uReserved ); +fcns.name{fcnNum}='AlazarSetClockSwitchOver'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarRead ( void * h , unsigned int Channel , void * Buffer , int ElementSize , long Record , long TransferOffset , unsigned int TransferLength ); +fcns.name{fcnNum}='AlazarRead'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr', 'int32', 'long', 'long', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetParameter ( void * h , unsigned char Channel , unsigned int Parameter , long Value ); +fcns.name{fcnNum}='AlazarSetParameter'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'long'};fcnNum=fcnNum+1; +% unsigned int AlazarSetParameterUL ( void * h , unsigned char Channel , unsigned int Parameter , unsigned int Value ); +fcns.name{fcnNum}='AlazarSetParameterUL'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetParameter ( void * h , unsigned char Channel , unsigned int Parameter , long * RetValue ); +fcns.name{fcnNum}='AlazarGetParameter'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'longPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetParameterUL ( void * h , unsigned char Channel , unsigned int Parameter , unsigned int * RetValue ); +fcns.name{fcnNum}='AlazarGetParameterUL'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% void * AlazarGetSystemHandle ( unsigned int sid ); +fcns.name{fcnNum}='AlazarGetSystemHandle'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarNumOfSystems (); +fcns.name{fcnNum}='AlazarNumOfSystems'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1; +% unsigned int AlazarBoardsInSystemBySystemID ( unsigned int sid ); +fcns.name{fcnNum}='AlazarBoardsInSystemBySystemID'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarBoardsInSystemByHandle ( void * systemHandle ); +fcns.name{fcnNum}='AlazarBoardsInSystemByHandle'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% void * AlazarGetBoardBySystemID ( unsigned int sid , unsigned int brdNum ); +fcns.name{fcnNum}='AlazarGetBoardBySystemID'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'uint32', 'uint32'};fcnNum=fcnNum+1; +% void * AlazarGetBoardBySystemHandle ( void * systemHandle , unsigned int brdNum ); +fcns.name{fcnNum}='AlazarGetBoardBySystemHandle'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetLED ( void * h , unsigned int state ); +fcns.name{fcnNum}='AlazarSetLED'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarQueryCapability ( void * h , unsigned int request , unsigned int value , unsigned int * retValue ); +fcns.name{fcnNum}='AlazarQueryCapability'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarMaxSglTransfer ( ALAZAR_BOARDTYPES bt ); +fcns.name{fcnNum}='AlazarMaxSglTransfer'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'BoardTypes'};fcnNum=fcnNum+1; +% unsigned int AlazarGetMaxRecordsCapable ( void * h , unsigned int RecordLength , unsigned int * num ); +fcns.name{fcnNum}='AlazarGetMaxRecordsCapable'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetWhoTriggeredBySystemHandle ( void * systemHandle , unsigned int brdNum , unsigned int recNum ); +fcns.name{fcnNum}='AlazarGetWhoTriggeredBySystemHandle'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetWhoTriggeredBySystemID ( unsigned int sid , unsigned int brdNum , unsigned int recNum ); +fcns.name{fcnNum}='AlazarGetWhoTriggeredBySystemID'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetBWLimit ( void * h , unsigned int Channel , unsigned int enable ); +fcns.name{fcnNum}='AlazarSetBWLimit'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSleepDevice ( void * h , unsigned int state ); +fcns.name{fcnNum}='AlazarSleepDevice'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarStartAutoDMA ( void * h , void * Buffer1 , unsigned int UseHeader , unsigned int ChannelSelect , long TransferOffset , unsigned int TransferLength , long RecordsPerBuffer , long RecordCount , int * error , unsigned int r1 , unsigned int r2 , unsigned int * r3 , unsigned int * r4 ); +fcns.name{fcnNum}='AlazarStartAutoDMA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32', 'long', 'uint32', 'long', 'long', 'int32Ptr', 'uint32', 'uint32', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetNextAutoDMABuffer ( void * h , void * Buffer1 , void * Buffer2 , long * WhichOne , long * RecordsTransfered , int * error , unsigned int r1 , unsigned int r2 , long * TriggersOccurred , unsigned int * r4 ); +fcns.name{fcnNum}='AlazarGetNextAutoDMABuffer'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'voidPtr', 'longPtr', 'longPtr', 'int32Ptr', 'uint32', 'uint32', 'longPtr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetNextBuffer ( void * h , void * Buffer1 , void * Buffer2 , long * WhichOne , long * RecordsTransfered , int * error , unsigned int r1 , unsigned int r2 , long * TriggersOccurred , unsigned int * r4 ); +fcns.name{fcnNum}='AlazarGetNextBuffer'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'voidPtr', 'longPtr', 'longPtr', 'int32Ptr', 'uint32', 'uint32', 'longPtr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarCloseAUTODma ( void * h ); +fcns.name{fcnNum}='AlazarCloseAUTODma'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarAbortAutoDMA ( void * h , void * Buffer , int * error , unsigned int r1 , unsigned int r2 , unsigned int * r3 , unsigned int * r4 ); +fcns.name{fcnNum}='AlazarAbortAutoDMA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'int32Ptr', 'uint32', 'uint32', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetAutoDMAHeaderValue ( void * h , unsigned int Channel , void * DataBuffer , unsigned int Record , unsigned int Parameter , int * error ); +fcns.name{fcnNum}='AlazarGetAutoDMAHeaderValue'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr', 'uint32', 'uint32', 'int32Ptr'};fcnNum=fcnNum+1; +% float AlazarGetAutoDMAHeaderTimeStamp ( void * h , unsigned int Channel , void * DataBuffer , unsigned int Record , int * error ); +fcns.name{fcnNum}='AlazarGetAutoDMAHeaderTimeStamp'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='single'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr', 'uint32', 'int32Ptr'};fcnNum=fcnNum+1; +% void * AlazarGetAutoDMAPtr ( void * h , unsigned int DataOrHeader , unsigned int Channel , void * DataBuffer , unsigned int Record , int * error ); +fcns.name{fcnNum}='AlazarGetAutoDMAPtr'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'voidPtr', 'uint32', 'int32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarWaitForBufferReady ( void * h , long tms ); +fcns.name{fcnNum}='AlazarWaitForBufferReady'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'long'};fcnNum=fcnNum+1; +% unsigned int AlazarEvents ( void * h , unsigned int enable ); +fcns.name{fcnNum}='AlazarEvents'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarBeforeAsyncRead ( void * hBoard , unsigned int uChannelSelect , long lTransferOffset , unsigned int uSamplesPerRecord , unsigned int uRecordsPerBuffer , unsigned int uRecordsPerAcquisition , unsigned int uFlags ); +fcns.name{fcnNum}='AlazarBeforeAsyncRead'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'long', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarAsyncRead ( void * hBoard , void * pBuffer , unsigned int BytesToRead , OVERLAPPED * pOverlapped ); +fcns.name{fcnNum}='AlazarAsyncRead'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 's_OVERLAPPEDPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarAbortAsyncRead ( void * hBoard ); +fcns.name{fcnNum}='AlazarAbortAsyncRead'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarPostAsyncBuffer ( void * hDevice , void * pBuffer , unsigned int uBufferLength_bytes ); +fcns.name{fcnNum}='AlazarPostAsyncBuffer'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarWaitAsyncBufferComplete ( void * hDevice , void * pBuffer , unsigned int uTimeout_ms ); +fcns.name{fcnNum}='AlazarWaitAsyncBufferComplete'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarWaitNextAsyncBufferComplete ( void * hDevice , void * pBuffer , unsigned int uBufferLength_bytes , unsigned int uTimeout_ms ); +fcns.name{fcnNum}='AlazarWaitNextAsyncBufferComplete'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarCreateStreamFileA ( void * hDevice , const char * pszFilePath ); +fcns.name{fcnNum}='AlazarCreateStreamFileA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring'};fcnNum=fcnNum+1; +% unsigned int AlazarCreateStreamFileW ( void * hDevice , const WCHAR * pszFilePath ); +fcns.name{fcnNum}='AlazarCreateStreamFileW'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint16Ptr'};fcnNum=fcnNum+1; +% long AlazarFlushAutoDMA ( void * h ); +fcns.name{fcnNum}='AlazarFlushAutoDMA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='long'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% void AlazarStopAutoDMA ( void * h ); +fcns.name{fcnNum}='AlazarStopAutoDMA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}=[]; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarResetTimeStamp ( void * h , unsigned int resetFlag ); +fcns.name{fcnNum}='AlazarResetTimeStamp'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarReadRegister ( void * hDevice , unsigned int offset , unsigned int * retVal , unsigned int pswrd ); +fcns.name{fcnNum}='AlazarReadRegister'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarWriteRegister ( void * hDevice , unsigned int offset , unsigned int Val , unsigned int pswrd ); +fcns.name{fcnNum}='AlazarWriteRegister'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarDACSetting ( void * h , unsigned int SetGet , unsigned int OriginalOrModified , unsigned char Channel , unsigned int DACNAME , unsigned int Coupling , unsigned int InputRange , unsigned int Impedance , unsigned int * getVal , unsigned int setVal , unsigned int * error ); +fcns.name{fcnNum}='AlazarDACSetting'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint8', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32Ptr', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarConfigureAuxIO ( void * hDevice , unsigned int uMode , unsigned int uParameter ); +fcns.name{fcnNum}='AlazarConfigureAuxIO'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% const char * AlazarErrorToText ( unsigned int code ); +fcns.name{fcnNum}='AlazarErrorToText'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='cstring'; fcns.RHS{fcnNum}={'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarConfigureSampleSkipping ( void * hBoard , unsigned int uMode , unsigned int uSampleClocksPerRecord , unsigned short * pwClockSkipMask ); +fcns.name{fcnNum}='AlazarConfigureSampleSkipping'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint16Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorRegisterRead ( void * hDevice , unsigned int offset , unsigned int * pValue ); +fcns.name{fcnNum}='AlazarCoprocessorRegisterRead'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorRegisterWrite ( void * hDevice , unsigned int offset , unsigned int value ); +fcns.name{fcnNum}='AlazarCoprocessorRegisterWrite'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorDownloadA ( void * hBoard , char * pszFileName , unsigned int uOptions ); +fcns.name{fcnNum}='AlazarCoprocessorDownloadA'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorDownloadW ( void * hBoard , WCHAR * pszFileName , unsigned int uOptions ); +fcns.name{fcnNum}='AlazarCoprocessorDownloadW'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint16Ptr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetBoardRevision ( void * hBoard , unsigned char * Major , unsigned char * Minor ); +fcns.name{fcnNum}='AlazarGetBoardRevision'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarConfigureRecordAverage ( void * hBoard , unsigned int uMode , unsigned int uSamplesPerRecord , unsigned int uRecordsPerAverage , unsigned int uOptions ); +fcns.name{fcnNum}='AlazarConfigureRecordAverage'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned char * AlazarAllocBufferU8 ( void * hBoard , unsigned int uSampleCount ); +fcns.name{fcnNum}='AlazarAllocBufferU8'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint8Ptr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarFreeBufferU8 ( void * hBoard , unsigned char * pBuffer ); +fcns.name{fcnNum}='AlazarFreeBufferU8'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned short * AlazarAllocBufferU16 ( void * hBoard , unsigned int uSampleCount ); +fcns.name{fcnNum}='AlazarAllocBufferU16'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint16Ptr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarFreeBufferU16 ( void * hBoard , unsigned short * pBuffer ); +fcns.name{fcnNum}='AlazarFreeBufferU16'; fcns.calltype{fcnNum}='cdecl'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint16Ptr'};fcnNum=fcnNum+1; +structs.s_BoardDef.members=struct('RecordCount', 'uint32', 'RecLength', 'uint32', 'PreDepth', 'uint32', 'ClockSource', 'uint32', 'ClockEdge', 'uint32', 'SampleRate', 'uint32', 'CouplingChanA', 'uint32', 'InputRangeChanA', 'uint32', 'InputImpedChanA', 'uint32', 'CouplingChanB', 'uint32', 'InputRangeChanB', 'uint32', 'InputImpedChanB', 'uint32', 'TriEngOperation', 'uint32', 'TriggerEngine1', 'uint32', 'TrigEngSource1', 'uint32', 'TrigEngSlope1', 'uint32', 'TrigEngLevel1', 'uint32', 'TriggerEngine2', 'uint32', 'TrigEngSource2', 'uint32', 'TrigEngSlope2', 'uint32', 'TrigEngLevel2', 'uint32'); +structs.s_HEADER2.members=struct('TimeStampLowPart', 'uint32'); +% structs.s_ALAZAR_HEADER.members=struct('hdr0', 'error', 'hdr1', 'error', 'hdr2', 's_HEADER2', 'hdr3', 'error'); +structs.s_OVERLAPPED.packing=1; +structs.s_OVERLAPPED.members=struct('Internal', 'ulong', 'InternalHigh', 'ulong', 'Offset', 'ulong', 'OffsetHigh', 'ulong', 'hEvent', 'voidPtr'); +enuminfo.MSILS=struct('KINDEPENDENT',0,'KSLAVE',1,'KMASTER',2,'KLASTSLAVE',3); +enuminfo.BoardTypes=struct('ATS_NONE',0,'ATS850',1,'ATS310',2,'ATS330',3,'ATS855',4,'ATS315',5,'ATS335',6,'ATS460',7,'ATS860',8,'ATS660',9,'ATS665',10,'ATS9462',11,'ATS9434',12,'ATS9870',13,'ATS9350',14,'ATS9325',15,'ATS9440',16,'ATS9410',17,'ATS9351',18,'ATS9310',19,'ATS9461',20,'ATS9850',21,'ATS9625',22,'ATG6500',23,'ATS9626',24,'ATS9360',25,'ATS_LAST',26); +methodinfo=fcns; \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarInclude_pcwin64.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarInclude_pcwin64.m new file mode 100644 index 0000000..d7fd0fc --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/AlazarInclude_pcwin64.m @@ -0,0 +1,216 @@ +function [methodinfo,structs,enuminfo,ThunkLibName]=AlazarInclude_pcwin64() +%ALAZARINCLUDE Create structures to define interfaces found in 'AlazarApi'. + +%This function was generated by loadlibrary.m parser version 1.1.6.29 on Wed Jan 30 15:36:43 2013 +%perl options:'AlazarApi.i -outfile=AlazarInclude.m -thunkfile=ATSApi_thunk_pcwin64.c' +ival={cell(1,0)}; % change 0 to the actual number of functions to preallocate the data. +structs=[];enuminfo=[];fcnNum=1; +fcns=struct('name',ival,'calltype',ival,'LHS',ival,'RHS',ival,'alias',ival,'thunkname', ival); +MfilePath=fileparts(mfilename('fullpath')); +ThunkLibName=fullfile(MfilePath,'ATSApi_thunk_pcwin64'); +% unsigned int AlazarGetOEMFPGAName ( int opcodeID , char * FullPath , unsigned long * error ); +fcns.thunkname{fcnNum}='uint32int32cstringvoidPtrThunk';fcns.name{fcnNum}='AlazarGetOEMFPGAName'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'int32', 'cstring', 'ulongPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarOEMSetWorkingDirectory ( char * wDir , unsigned long * error ); +fcns.thunkname{fcnNum}='uint32cstringvoidPtrThunk';fcns.name{fcnNum}='AlazarOEMSetWorkingDirectory'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'cstring', 'ulongPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarOEMGetWorkingDirectory ( char * wDir , unsigned long * error ); +fcns.thunkname{fcnNum}='uint32cstringvoidPtrThunk';fcns.name{fcnNum}='AlazarOEMGetWorkingDirectory'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'cstring', 'ulongPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarParseFPGAName ( const char * FullName , char * Name , unsigned int * Type , unsigned int * MemSize , unsigned int * MajVer , unsigned int * MinVer , unsigned int * MajRev , unsigned int * MinRev , unsigned int * error ); +fcns.thunkname{fcnNum}='uint32cstringcstringvoidPtrvoidPtrvoidPtrvoidPtrvoidPtrvoidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarParseFPGAName'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'cstring', 'cstring', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarOEMDownLoadFPGA ( void * h , char * FileName , unsigned int * RetValue ); +fcns.thunkname{fcnNum}='uint32voidPtrcstringvoidPtrThunk';fcns.name{fcnNum}='AlazarOEMDownLoadFPGA'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarDownLoadFPGA ( void * h , char * FileName , unsigned int * RetValue ); +fcns.thunkname{fcnNum}='uint32voidPtrcstringvoidPtrThunk';fcns.name{fcnNum}='AlazarDownLoadFPGA'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarReadWriteTest ( void * h , unsigned int * Buffer , unsigned int SizeToWrite , unsigned int SizeToRead ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtruint32uint32Thunk';fcns.name{fcnNum}='AlazarReadWriteTest'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32Ptr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarMemoryTest ( void * h , unsigned int * errors ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarMemoryTest'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarBusyFlag ( void * h , int * BusyFlag ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarBusyFlag'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'int32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarTriggeredFlag ( void * h , int * TriggeredFlag ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarTriggeredFlag'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'int32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarBoardsFound (); +fcns.thunkname{fcnNum}='uint32Thunk';fcns.name{fcnNum}='AlazarBoardsFound'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1; +% void * AlazarOpen ( char * BoardNameID ); +fcns.thunkname{fcnNum}='voidPtrcstringThunk';fcns.name{fcnNum}='AlazarOpen'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'cstring'};fcnNum=fcnNum+1; +% void AlazarClose ( void * h ); +fcns.thunkname{fcnNum}='voidvoidPtrThunk';fcns.name{fcnNum}='AlazarClose'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}=[]; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% MSILS AlazarGetBoardKind ( void * h ); +fcns.thunkname{fcnNum}='MSILSvoidPtrThunk';fcns.name{fcnNum}='AlazarGetBoardKind'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='MSILS'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetCPLDVersion ( void * h , unsigned char * Major , unsigned char * Minor ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarGetCPLDVersion'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetChannelInfo ( void * h , unsigned int * MemSize , unsigned char * SampleSize ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarGetChannelInfo'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetSDKVersion ( unsigned char * Major , unsigned char * Minor , unsigned char * Revision ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarGetSDKVersion'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint8Ptr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetDriverVersion ( unsigned char * Major , unsigned char * Minor , unsigned char * Revision ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarGetDriverVersion'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint8Ptr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarInputControl ( void * h , unsigned char Channel , unsigned int Coupling , unsigned int InputRange , unsigned int Impedance ); +fcns.thunkname{fcnNum}='uint32voidPtruint8uint32uint32uint32Thunk';fcns.name{fcnNum}='AlazarInputControl'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetPosition ( void * h , unsigned char Channel , int PMPercent , unsigned int InputRange ); +fcns.thunkname{fcnNum}='uint32voidPtruint8int32uint32Thunk';fcns.name{fcnNum}='AlazarSetPosition'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'int32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetExternalTrigger ( void * h , unsigned int Coupling , unsigned int Range ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32Thunk';fcns.name{fcnNum}='AlazarSetExternalTrigger'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerDelay ( void * h , unsigned int Delay ); +fcns.thunkname{fcnNum}='uint32voidPtruint32Thunk';fcns.name{fcnNum}='AlazarSetTriggerDelay'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerTimeOut ( void * h , unsigned int to_ns ); +fcns.thunkname{fcnNum}='uint32voidPtruint32Thunk';fcns.name{fcnNum}='AlazarSetTriggerTimeOut'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarTriggerTimedOut ( void * h ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarTriggerTimedOut'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetTriggerAddress ( void * h , unsigned int Record , unsigned int * TriggerAddress , unsigned int * TimeStampHighPart , unsigned int * TimeStampLowPart ); +fcns.thunkname{fcnNum}='uint32voidPtruint32voidPtrvoidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarGetTriggerAddress'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerOperation ( void * h , unsigned int TriggerOperation , unsigned int TriggerEngine1 , unsigned int Source1 , unsigned int Slope1 , unsigned int Level1 , unsigned int TriggerEngine2 , unsigned int Source2 , unsigned int Slope2 , unsigned int Level2 ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32uint32uint32uint32uint32uint32uint32uint32Thunk';fcns.name{fcnNum}='AlazarSetTriggerOperation'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetTriggerOperationForScanning ( void * h , unsigned int slope , unsigned int level , unsigned int options ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32uint32Thunk';fcns.name{fcnNum}='AlazarSetTriggerOperationForScanning'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarAbortCapture ( void * h ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarAbortCapture'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarForceTrigger ( void * h ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarForceTrigger'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarForceTriggerEnable ( void * h ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarForceTriggerEnable'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarStartCapture ( void * h ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarStartCapture'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarCaptureMode ( void * h , unsigned int Mode ); +fcns.thunkname{fcnNum}='uint32voidPtruint32Thunk';fcns.name{fcnNum}='AlazarCaptureMode'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarStreamCapture ( void * h , void * Buffer , unsigned int BufferSize , unsigned int DeviceOption , unsigned int ChannelSelect , unsigned int * error ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtruint32uint32uint32voidPtrThunk';fcns.name{fcnNum}='AlazarStreamCapture'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarHyperDisp ( void * h , void * Buffer , unsigned int BufferSize , unsigned char * ViewBuffer , unsigned int ViewBufferSize , unsigned int NumOfPixels , unsigned int Option , unsigned int ChannelSelect , unsigned int Record , long TransferOffset , unsigned int * error ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtruint32voidPtruint32uint32uint32uint32uint32longvoidPtrThunk';fcns.name{fcnNum}='AlazarHyperDisp'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint8Ptr', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32', 'long', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarFastPRRCapture ( void * h , void * Buffer , unsigned int BufferSize , unsigned int DeviceOption , unsigned int ChannelSelect , unsigned int * error ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtruint32uint32uint32voidPtrThunk';fcns.name{fcnNum}='AlazarFastPRRCapture'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarBusy ( void * h ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarBusy'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarTriggered ( void * h ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarTriggered'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetStatus ( void * h ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarGetStatus'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarDetectMultipleRecord ( void * h ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarDetectMultipleRecord'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarSetRecordCount ( void * h , unsigned int Count ); +fcns.thunkname{fcnNum}='uint32voidPtruint32Thunk';fcns.name{fcnNum}='AlazarSetRecordCount'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetRecordSize ( void * h , unsigned int PreSize , unsigned int PostSize ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32Thunk';fcns.name{fcnNum}='AlazarSetRecordSize'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetCaptureClock ( void * h , unsigned int Source , unsigned int Rate , unsigned int Edge , unsigned int Decimation ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32uint32uint32Thunk';fcns.name{fcnNum}='AlazarSetCaptureClock'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetExternalClockLevel ( void * h , float percent ); +fcns.thunkname{fcnNum}='uint32voidPtrfloatThunk';fcns.name{fcnNum}='AlazarSetExternalClockLevel'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'single'};fcnNum=fcnNum+1; +% unsigned int AlazarSetClockSwitchOver ( void * hBoard , unsigned int uMode , unsigned int uDummyClockOnTime_ns , unsigned int uReserved ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32uint32Thunk';fcns.name{fcnNum}='AlazarSetClockSwitchOver'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarRead ( void * h , unsigned int Channel , void * Buffer , int ElementSize , long Record , long TransferOffset , unsigned int TransferLength ); +fcns.thunkname{fcnNum}='uint32voidPtruint32voidPtrint32longlonguint32Thunk';fcns.name{fcnNum}='AlazarRead'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr', 'int32', 'long', 'long', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetParameter ( void * h , unsigned char Channel , unsigned int Parameter , long Value ); +fcns.thunkname{fcnNum}='uint32voidPtruint8uint32longThunk';fcns.name{fcnNum}='AlazarSetParameter'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'long'};fcnNum=fcnNum+1; +% unsigned int AlazarSetParameterUL ( void * h , unsigned char Channel , unsigned int Parameter , unsigned int Value ); +fcns.thunkname{fcnNum}='uint32voidPtruint8uint32uint32Thunk';fcns.name{fcnNum}='AlazarSetParameterUL'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetParameter ( void * h , unsigned char Channel , unsigned int Parameter , long * RetValue ); +fcns.thunkname{fcnNum}='uint32voidPtruint8uint32voidPtrThunk';fcns.name{fcnNum}='AlazarGetParameter'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'longPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetParameterUL ( void * h , unsigned char Channel , unsigned int Parameter , unsigned int * RetValue ); +fcns.thunkname{fcnNum}='uint32voidPtruint8uint32voidPtrThunk';fcns.name{fcnNum}='AlazarGetParameterUL'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% void * AlazarGetSystemHandle ( unsigned int sid ); +fcns.thunkname{fcnNum}='voidPtruint32Thunk';fcns.name{fcnNum}='AlazarGetSystemHandle'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarNumOfSystems (); +fcns.thunkname{fcnNum}='uint32Thunk';fcns.name{fcnNum}='AlazarNumOfSystems'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}=[];fcnNum=fcnNum+1; +% unsigned int AlazarBoardsInSystemBySystemID ( unsigned int sid ); +fcns.thunkname{fcnNum}='uint32uint32Thunk';fcns.name{fcnNum}='AlazarBoardsInSystemBySystemID'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarBoardsInSystemByHandle ( void * systemHandle ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarBoardsInSystemByHandle'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% void * AlazarGetBoardBySystemID ( unsigned int sid , unsigned int brdNum ); +fcns.thunkname{fcnNum}='voidPtruint32uint32Thunk';fcns.name{fcnNum}='AlazarGetBoardBySystemID'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'uint32', 'uint32'};fcnNum=fcnNum+1; +% void * AlazarGetBoardBySystemHandle ( void * systemHandle , unsigned int brdNum ); +fcns.thunkname{fcnNum}='voidPtrvoidPtruint32Thunk';fcns.name{fcnNum}='AlazarGetBoardBySystemHandle'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetLED ( void * h , unsigned int state ); +fcns.thunkname{fcnNum}='uint32voidPtruint32Thunk';fcns.name{fcnNum}='AlazarSetLED'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarQueryCapability ( void * h , unsigned int request , unsigned int value , unsigned int * retValue ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32voidPtrThunk';fcns.name{fcnNum}='AlazarQueryCapability'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarMaxSglTransfer ( ALAZAR_BOARDTYPES bt ); +fcns.thunkname{fcnNum}='uint32ALAZAR_BOARDTYPESThunk';fcns.name{fcnNum}='AlazarMaxSglTransfer'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'BoardTypes'};fcnNum=fcnNum+1; +% unsigned int AlazarGetMaxRecordsCapable ( void * h , unsigned int RecordLength , unsigned int * num ); +fcns.thunkname{fcnNum}='uint32voidPtruint32voidPtrThunk';fcns.name{fcnNum}='AlazarGetMaxRecordsCapable'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetWhoTriggeredBySystemHandle ( void * systemHandle , unsigned int brdNum , unsigned int recNum ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32Thunk';fcns.name{fcnNum}='AlazarGetWhoTriggeredBySystemHandle'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetWhoTriggeredBySystemID ( unsigned int sid , unsigned int brdNum , unsigned int recNum ); +fcns.thunkname{fcnNum}='uint32uint32uint32uint32Thunk';fcns.name{fcnNum}='AlazarGetWhoTriggeredBySystemID'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSetBWLimit ( void * h , unsigned int Channel , unsigned int enable ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32Thunk';fcns.name{fcnNum}='AlazarSetBWLimit'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarSleepDevice ( void * h , unsigned int state ); +fcns.thunkname{fcnNum}='uint32voidPtruint32Thunk';fcns.name{fcnNum}='AlazarSleepDevice'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarStartAutoDMA ( void * h , void * Buffer1 , unsigned int UseHeader , unsigned int ChannelSelect , long TransferOffset , unsigned int TransferLength , long RecordsPerBuffer , long RecordCount , int * error , unsigned int r1 , unsigned int r2 , unsigned int * r3 , unsigned int * r4 ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtruint32uint32longuint32longlongvoidPtruint32uint32voidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarStartAutoDMA'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32', 'long', 'uint32', 'long', 'long', 'int32Ptr', 'uint32', 'uint32', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetNextAutoDMABuffer ( void * h , void * Buffer1 , void * Buffer2 , long * WhichOne , long * RecordsTransfered , int * error , unsigned int r1 , unsigned int r2 , long * TriggersOccurred , unsigned int * r4 ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrvoidPtrvoidPtrvoidPtrvoidPtruint32uint32voidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarGetNextAutoDMABuffer'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'voidPtr', 'longPtr', 'longPtr', 'int32Ptr', 'uint32', 'uint32', 'longPtr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetNextBuffer ( void * h , void * Buffer1 , void * Buffer2 , long * WhichOne , long * RecordsTransfered , int * error , unsigned int r1 , unsigned int r2 , long * TriggersOccurred , unsigned int * r4 ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrvoidPtrvoidPtrvoidPtrvoidPtruint32uint32voidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarGetNextBuffer'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'voidPtr', 'longPtr', 'longPtr', 'int32Ptr', 'uint32', 'uint32', 'longPtr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarCloseAUTODma ( void * h ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarCloseAUTODma'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarAbortAutoDMA ( void * h , void * Buffer , int * error , unsigned int r1 , unsigned int r2 , unsigned int * r3 , unsigned int * r4 ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrvoidPtruint32uint32voidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarAbortAutoDMA'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'int32Ptr', 'uint32', 'uint32', 'uint32Ptr', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarGetAutoDMAHeaderValue ( void * h , unsigned int Channel , void * DataBuffer , unsigned int Record , unsigned int Parameter , int * error ); +fcns.thunkname{fcnNum}='uint32voidPtruint32voidPtruint32uint32voidPtrThunk';fcns.name{fcnNum}='AlazarGetAutoDMAHeaderValue'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr', 'uint32', 'uint32', 'int32Ptr'};fcnNum=fcnNum+1; +% float AlazarGetAutoDMAHeaderTimeStamp ( void * h , unsigned int Channel , void * DataBuffer , unsigned int Record , int * error ); +fcns.thunkname{fcnNum}='floatvoidPtruint32voidPtruint32voidPtrThunk';fcns.name{fcnNum}='AlazarGetAutoDMAHeaderTimeStamp'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='single'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'voidPtr', 'uint32', 'int32Ptr'};fcnNum=fcnNum+1; +% void * AlazarGetAutoDMAPtr ( void * h , unsigned int DataOrHeader , unsigned int Channel , void * DataBuffer , unsigned int Record , int * error ); +fcns.thunkname{fcnNum}='voidPtrvoidPtruint32uint32voidPtruint32voidPtrThunk';fcns.name{fcnNum}='AlazarGetAutoDMAPtr'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='voidPtr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'voidPtr', 'uint32', 'int32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarWaitForBufferReady ( void * h , long tms ); +fcns.thunkname{fcnNum}='uint32voidPtrlongThunk';fcns.name{fcnNum}='AlazarWaitForBufferReady'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'long'};fcnNum=fcnNum+1; +% unsigned int AlazarEvents ( void * h , unsigned int enable ); +fcns.thunkname{fcnNum}='uint32voidPtruint32Thunk';fcns.name{fcnNum}='AlazarEvents'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarBeforeAsyncRead ( void * hBoard , unsigned int uChannelSelect , long lTransferOffset , unsigned int uSamplesPerRecord , unsigned int uRecordsPerBuffer , unsigned int uRecordsPerAcquisition , unsigned int uFlags ); +fcns.thunkname{fcnNum}='uint32voidPtruint32longuint32uint32uint32uint32Thunk';fcns.name{fcnNum}='AlazarBeforeAsyncRead'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'long', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarAsyncRead ( void * hBoard , void * pBuffer , unsigned int BytesToRead , OVERLAPPED * pOverlapped ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtruint32voidPtrThunk';fcns.name{fcnNum}='AlazarAsyncRead'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarAbortAsyncRead ( void * hBoard ); +fcns.thunkname{fcnNum}='uint32voidPtrThunk';fcns.name{fcnNum}='AlazarAbortAsyncRead'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarPostAsyncBuffer ( void * hDevice , void * pBuffer , unsigned int uBufferLength_bytes ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtruint32Thunk';fcns.name{fcnNum}='AlazarPostAsyncBuffer'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarWaitAsyncBufferComplete ( void * hDevice , void * pBuffer , unsigned int uTimeout_ms ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtruint32Thunk';fcns.name{fcnNum}='AlazarWaitAsyncBufferComplete'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarWaitNextAsyncBufferComplete ( void * hDevice , void * pBuffer , unsigned int uBufferLength_bytes , unsigned int uTimeout_ms ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtruint32uint32Thunk';fcns.name{fcnNum}='AlazarWaitNextAsyncBufferComplete'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarCreateStreamFileA ( void * hDevice , const char * pszFilePath ); +fcns.thunkname{fcnNum}='uint32voidPtrcstringThunk';fcns.name{fcnNum}='AlazarCreateStreamFileA'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring'};fcnNum=fcnNum+1; +% unsigned int AlazarCreateStreamFileW ( void * hDevice , const WCHAR * pszFilePath ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarCreateStreamFileW'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint16Ptr'};fcnNum=fcnNum+1; +% long AlazarFlushAutoDMA ( void * h ); +fcns.thunkname{fcnNum}='longvoidPtrThunk';fcns.name{fcnNum}='AlazarFlushAutoDMA'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='long'; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% void AlazarStopAutoDMA ( void * h ); +fcns.thunkname{fcnNum}='voidvoidPtrThunk';fcns.name{fcnNum}='AlazarStopAutoDMA'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}=[]; fcns.RHS{fcnNum}={'voidPtr'};fcnNum=fcnNum+1; +% unsigned int AlazarResetTimeStamp ( void * h , unsigned int resetFlag ); +fcns.thunkname{fcnNum}='uint32voidPtruint32Thunk';fcns.name{fcnNum}='AlazarResetTimeStamp'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarReadRegister ( void * hDevice , unsigned int offset , unsigned int * retVal , unsigned int pswrd ); +fcns.thunkname{fcnNum}='uint32voidPtruint32voidPtruint32Thunk';fcns.name{fcnNum}='AlazarReadRegister'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarWriteRegister ( void * hDevice , unsigned int offset , unsigned int Val , unsigned int pswrd ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32uint32Thunk';fcns.name{fcnNum}='AlazarWriteRegister'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarDACSetting ( void * h , unsigned int SetGet , unsigned int OriginalOrModified , unsigned char Channel , unsigned int DACNAME , unsigned int Coupling , unsigned int InputRange , unsigned int Impedance , unsigned int * getVal , unsigned int setVal , unsigned int * error ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32uint8uint32uint32uint32uint32voidPtruint32voidPtrThunk';fcns.name{fcnNum}='AlazarDACSetting'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint8', 'uint32', 'uint32', 'uint32', 'uint32', 'uint32Ptr', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarConfigureAuxIO ( void * hDevice , unsigned int uMode , unsigned int uParameter ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32Thunk';fcns.name{fcnNum}='AlazarConfigureAuxIO'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% const char * AlazarErrorToText ( unsigned int code ); +fcns.thunkname{fcnNum}='cstringuint32Thunk';fcns.name{fcnNum}='AlazarErrorToText'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='cstring'; fcns.RHS{fcnNum}={'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarConfigureSampleSkipping ( void * hBoard , unsigned int uMode , unsigned int uSampleClocksPerRecord , unsigned short * pwClockSkipMask ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32voidPtrThunk';fcns.name{fcnNum}='AlazarConfigureSampleSkipping'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint16Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorRegisterRead ( void * hDevice , unsigned int offset , unsigned int * pValue ); +fcns.thunkname{fcnNum}='uint32voidPtruint32voidPtrThunk';fcns.name{fcnNum}='AlazarCoprocessorRegisterRead'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorRegisterWrite ( void * hDevice , unsigned int offset , unsigned int value ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32Thunk';fcns.name{fcnNum}='AlazarCoprocessorRegisterWrite'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorDownloadA ( void * hBoard , char * pszFileName , unsigned int uOptions ); +fcns.thunkname{fcnNum}='uint32voidPtrcstringuint32Thunk';fcns.name{fcnNum}='AlazarCoprocessorDownloadA'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'cstring', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarCoprocessorDownloadW ( void * hBoard , WCHAR * pszFileName , unsigned int uOptions ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtruint32Thunk';fcns.name{fcnNum}='AlazarCoprocessorDownloadW'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint16Ptr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarGetBoardRevision ( void * hBoard , unsigned char * Major , unsigned char * Minor ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarGetBoardRevision'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8Ptr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned int AlazarConfigureRecordAverage ( void * hBoard , unsigned int uMode , unsigned int uSamplesPerRecord , unsigned int uRecordsPerAverage , unsigned int uOptions ); +fcns.thunkname{fcnNum}='uint32voidPtruint32uint32uint32uint32Thunk';fcns.name{fcnNum}='AlazarConfigureRecordAverage'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint32', 'uint32', 'uint32', 'uint32'};fcnNum=fcnNum+1; +% unsigned char * AlazarAllocBufferU8 ( void * hBoard , unsigned int uSampleCount ); +fcns.thunkname{fcnNum}='voidPtrvoidPtruint32Thunk';fcns.name{fcnNum}='AlazarAllocBufferU8'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint8Ptr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarFreeBufferU8 ( void * hBoard , unsigned char * pBuffer ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarFreeBufferU8'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint8Ptr'};fcnNum=fcnNum+1; +% unsigned short * AlazarAllocBufferU16 ( void * hBoard , unsigned int uSampleCount ); +fcns.thunkname{fcnNum}='voidPtrvoidPtruint32Thunk';fcns.name{fcnNum}='AlazarAllocBufferU16'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint16Ptr'; fcns.RHS{fcnNum}={'voidPtr', 'uint32'};fcnNum=fcnNum+1; +% unsigned int AlazarFreeBufferU16 ( void * hBoard , unsigned short * pBuffer ); +fcns.thunkname{fcnNum}='uint32voidPtrvoidPtrThunk';fcns.name{fcnNum}='AlazarFreeBufferU16'; fcns.calltype{fcnNum}='Thunk'; fcns.LHS{fcnNum}='uint32'; fcns.RHS{fcnNum}={'voidPtr', 'uint16Ptr'};fcnNum=fcnNum+1; +structs.s_BoardDef.members=struct('RecordCount', 'uint32', 'RecLength', 'uint32', 'PreDepth', 'uint32', 'ClockSource', 'uint32', 'ClockEdge', 'uint32', 'SampleRate', 'uint32', 'CouplingChanA', 'uint32', 'InputRangeChanA', 'uint32', 'InputImpedChanA', 'uint32', 'CouplingChanB', 'uint32', 'InputRangeChanB', 'uint32', 'InputImpedChanB', 'uint32', 'TriEngOperation', 'uint32', 'TriggerEngine1', 'uint32', 'TrigEngSource1', 'uint32', 'TrigEngSlope1', 'uint32', 'TrigEngLevel1', 'uint32', 'TriggerEngine2', 'uint32', 'TrigEngSource2', 'uint32', 'TrigEngSlope2', 'uint32', 'TrigEngLevel2', 'uint32'); +structs.s_HEADER2.members=struct('TimeStampLowPart', 'uint32'); +% structs.s_ALAZAR_HEADER.members=struct('hdr0', 'error', 'hdr1', 'error', 'hdr2', 's_HEADER2', 'hdr3', 'error'); +enuminfo.BoardTypes=struct('ATS_NONE',0,'ATS850',1,'ATS310',2,'ATS330',3,'ATS855',4,'ATS315',5,'ATS335',6,'ATS460',7,'ATS860',8,'ATS660',9,'ATS665',10,'ATS9462',11,'ATS9434',12,'ATS9870',13,'ATS9350',14,'ATS9325',15,'ATS9440',16,'ATS9410',17,'ATS9351',18,'ATS9310',19,'ATS9461',20,'ATS9850',21,'ATS9625',22,'ATG6500',23,'ATS9626',24,'ATS9360',25,'ATS_LAST',26); +enuminfo.MSILS=struct('KINDEPENDENT',0,'KSLAVE',1,'KMASTER',2,'KLASTSLAVE',3); +methodinfo=fcns; \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/FetchData.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/FetchData.m new file mode 100644 index 0000000..388ba36 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/FetchData.m @@ -0,0 +1,288 @@ +function VoltSignal = FetchData(obj) +% fetch data from digitizer buffer +% at each trigger event, aquire a data segament record_ln long and +% returns num_records data segament. +% VoltSignal is 1 by num_record*record_ln array if only one channel is enabled, +% 2 by num_records*record_ln if both channnels are enabled, the first row is the +% voltage signal data of the first channel, the second row, the second +% channel. +% VoltSignal(1,:) chnl 1 +% VoltSignal(2,:) chnl 2 + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + +persistent ApiSuccess; +persistent ADMA_FIFO_ONLY_STREAMING; +persistent ADMA_EXTERNAL_STARTCAPTURE; +persistent ADMA_NPT; +persistent ApiWaitTimeout; +ApiSuccess = int32(512); +ApiWaitTimeout = int32(579); +ADMA_FIFO_ONLY_STREAMING = hex2dec('00000800'); +ADMA_EXTERNAL_STARTCAPTURE = hex2dec('00000001'); +ADMA_NPT = hex2dec('00000200'); + + +%%%%%%%%%%%%%%%%%%%%%%%%%% +if obj.clocksource == 2; % external + scode = obj.samplerate_codes(end); +else + scode = obj.samplerate_codes(obj.smplrate==obj.samplerate_options); +end +if obj.clocksource == 2; % external + retCode = ... + calllib('ATSApi', 'AlazarSetCaptureClock', ... + obj.deviceobj, ... % HANDLE -- board handle + 2, ... % U32 -- clock source id + scode,... % U32 -- sample rate id + 0, ... % U32 -- clock edge id + 0 ... % U32 -- clock decimation + ); +elseif obj.clocksource == 1; % internal + retCode = ... + calllib('ATSApi', 'AlazarSetCaptureClock', ... + obj.deviceobj, ... % HANDLE -- board handle + 1, ... % U32 -- clock source id + scode,... % U32 -- sample rate id + 0, ... % U32 -- clock edge id + 0 ... % U32 -- clock decimation + ); +end +if retCode ~= int32(512) + error('Error: AlazarSetCaptureClock failed -- %s\n', AlazarATS.errorToText(retCode)); +end +%%%%%%%%%%%%%%%%%%%%%%%%%% + +% buffer timeout +% This is the amount of time to wait for for each buffer to be filled +bufferTimeout_ms = 300000; +% number of records per channel per DMA buffer +% obj.num_records = 2000; + +% which channels to capture (A, B, or both) +% channelMask = CHANNEL_A + CHANNEL_B; +% channelMask = CHANNEL_A; +if obj.chnl1enabled && obj.chnl2enabled + channelMask = 3; +elseif obj.chnl1enabled + channelMask = 1; +elseif obj.chnl2enabled + channelMask = 2; +end + +% Calculate the number of enabled channels from the channel mask +channelCount = 0; +channelsPerBoard = 2; +for channel = 0:channelsPerBoard - 1 + channelId = 2^channel; + if bitand(channelId, channelMask) + channelCount = channelCount + 1; + end +end +if (channelCount < 1) || (channelCount > channelsPerBoard) + error('Error: Invalid channel mask %08X\n', channelMask); +end + +% Get the sample and memory size +[retCode, obj.deviceobj, maxSamplesPerRecord, bitsPerSample] = calllib('ATSApi', 'AlazarGetChannelInfo', obj.deviceobj, 0, 0); +if retCode ~= ApiSuccess + error('Error: AlazarGetChannelInfo failed -- %s\n', AlazarATS.errorToText(retCode)); +end + +preTriggerSamples = 0; +postTriggerSamples = obj.record_ln; +samplesPerRecord = preTriggerSamples + postTriggerSamples; +if (maxSamplesPerRecord > 0) && (samplesPerRecord > maxSamplesPerRecord) + error('Error: Too many samples per record %u max %u\n', samplesPerRecord, maxSamplesPerRecord); +end + +% except in acquiring very larg data set, we need to do multiple +% acquisitions to fill the amount of data required, +% in most applications, one acquisition is enough, so here we fix +% buffersPerAcquisition = 1, and we can always call FetchData() +% multiple times for large acquisitions, so fix buffersPerAcquisition to 1 +% is not a problem. +% total number of buffers to capture +buffersPerAcquisition = 1; +% Calculate the size of each buffer in bytes +bytesPerSample = floor((double(bitsPerSample) + 7) / 8); +samplesPerBuffer = samplesPerRecord * obj.num_records * channelCount; +bytesPerBuffer = bytesPerSample * samplesPerBuffer; + +% TODO: Select the number of DMA buffers to allocate. +% The number of DMA buffers must be greater than 2 to allow a board to DMA into +% one buffer while, at the same time, your application processes another buffer. +bufferCount = uint32(16); + +% Create an array of DMA buffers +buffers = cell(1, bufferCount); +for j = 1 : bufferCount + pbuffer = calllib('ATSApi', 'AlazarAllocBufferU16', obj.deviceobj, samplesPerBuffer); + if pbuffer == 0 + error('Error: AlazarAllocBufferU16 %u samples failed\n', samplesPerBuffer); + end + buffers(1, j) = { pbuffer }; +end + + +% Set the record size +retCode = calllib('ATSApi', 'AlazarSetRecordSize', obj.deviceobj, preTriggerSamples, postTriggerSamples); +if retCode ~= ApiSuccess + error('Error: AlazarBeforeAsyncRead failed -- %s\n', AlazarATS.errorToText(retCode)); +end +% Data Acquisition + +% TODO: Select AutoDMA flags as required +% ADMA_NPT - Acquire multiple records with no-pretrigger samples +% ADMA_EXTERNAL_STARTCAPTURE - call AlazarStartCapture to begin the acquisition +% ADMA_FIFO_ONLY_STREAMING - disable on-board memory +admaFlags = ADMA_EXTERNAL_STARTCAPTURE + ADMA_NPT + ADMA_FIFO_ONLY_STREAMING; + +% Configure the board to make an AutoDMA acquisition +recordsPerAcquisition = buffersPerAcquisition * obj.num_records; +retCode = calllib('ATSApi', 'AlazarBeforeAsyncRead', obj.deviceobj, channelMask, -int32(preTriggerSamples), samplesPerRecord, obj.num_records, recordsPerAcquisition, admaFlags); +if retCode ~= ApiSuccess + error('Error: AlazarBeforeAsyncRead failed -- %s\n', AlazarATS.errorToText(retCode)); +end + +% Post the buffers to the board +for bufferIndex = 1 : bufferCount + pbuffer = buffers{1, bufferIndex}; + retCode = calllib('ATSApi', 'AlazarPostAsyncBuffer', obj.deviceobj, pbuffer, bytesPerBuffer); + if retCode ~= ApiSuccess + error('Error: AlazarPostAsyncBuffer failed -- %s\n', AlazarATS.errorToText(retCode)); + end +end + +% Arm the board system to wait for triggers +retCode = calllib('ATSApi', 'AlazarStartCapture', obj.deviceobj); +if retCode ~= ApiSuccess + error('Error: AlazarStartCapture failed -- %s\n', AlazarATS.errorToText(retCode)); +end + + +rawdata = cell(1,bufferCount); + +% Wait for sufficient data to arrive to fill a buffer, process the buffer, +% and repeat until the acquisition is complete +buffersCompleted = 0; +captureDone = false; +success = false; + +while ~captureDone + + bufferIndex = mod(buffersCompleted, bufferCount) + 1; + pbuffer = buffers{1, bufferIndex}; + + % Wait for the first available buffer to be filled by the board + [retCode, obj.deviceobj, bufferOut] = ... + calllib('ATSApi', 'AlazarWaitAsyncBufferComplete', obj.deviceobj, pbuffer, bufferTimeout_ms); + if retCode == ApiSuccess + % This buffer is full + bufferFull = true; + captureDone = false; + elseif retCode == ApiWaitTimeout + % The wait timeout expired before this buffer was filled. + % The board may not be triggering, or the timeout period may be too short. + bufferFull = false; + captureDone = true; + error('Error: AlazarWaitAsyncBufferComplete timeout -- Verify trigger!\n'); + else + % The acquisition failed + bufferFull = false; + captureDone = true; + error('Error: AlazarWaitAsyncBufferComplete failed -- %s\n', AlazarATS.errorToText(retCode)); + end + + if bufferFull + % TODO: Process sample data in this buffer. + % + % NOTE: + % While you are processing this buffer, the board is already + % filling the next available DMA buffer. + % + % You must finish processing this buffer before the board fills + % all of its available DMA buffers and on-board memory. + % + % Records are arranged in the buffer as follows: + % R0A, R1A, R2A ... RnA, R0B, R1B, R2B ... + % + % Samples values are arranged contiguously in each record. + % A 12-bit sample code is stored in the most significant bits of each 16-bit sample value. + % + % Sample codes are unsigned by default where: + % - 0x000 represents a negative full scale input signal; + % - 0x800 represents a 0V signal; + % - 0xfff represents a positive full scale input signal. + + setdatatype(bufferOut, 'uint16Ptr', 1, samplesPerBuffer); + + + + % temperory store the data into cell + rawdata{1,bufferIndex} = bufferOut.Value; + + % Make the buffer available to be filled again by the board + retCode = calllib('ATSApi', 'AlazarPostAsyncBuffer', obj.deviceobj, pbuffer, bytesPerBuffer); + if retCode ~= ApiSuccess + captureDone = true; + error('Error: AlazarPostAsyncBuffer failed -- %s\n', AlazarATS.errorToText(retCode)); + end + + % Update progress + buffersCompleted = buffersCompleted + 1; + if buffersCompleted >= buffersPerAcquisition + captureDone = true; + success = true; + end + + end % if bufferFull + +end % while ~captureDone + +if channelMask == 3; + finalrawdata = zeros(1,2*obj.record_ln*obj.num_records*buffersPerAcquisition); + for ig = 1:buffersPerAcquisition; + finalrawdata(((ig-1)*2*obj.record_ln*obj.num_records+1):(2*ig*obj.record_ln*obj.num_records)) = rawdata{1,ig}; + end + finalrawdataA = finalrawdata(1:2:end); + finalrawdataB = finalrawdata(2:2:end); +elseif channelMask == 1; + finalrawdataA = zeros(1,obj.record_ln*obj.num_records*buffersPerAcquisition); + finalrawdataB = zeros(1,obj.record_ln*obj.num_records*buffersPerAcquisition); + for ig = 1:buffersPerAcquisition; + finalrawdataA(((ig-1)*obj.record_ln*obj.num_records+1):(ig*obj.record_ln*obj.num_records)) = rawdata{1,ig}; + end +elseif channelMask == 2; + finalrawdataA = zeros(1,obj.record_ln*obj.num_records*buffersPerAcquisition); + finalrawdataB = zeros(1,obj.record_ln*obj.num_records*buffersPerAcquisition); + for ig = 1:buffersPerAcquisition; + finalrawdataB(((ig-1)*obj.record_ln*obj.num_records+1):(ig*obj.record_ln*obj.num_records)) = rawdata{1,ig}; + end +end + +voltA=obj.chnl1range*(double(finalrawdataA/16)-ones(1,length(finalrawdataA))*(2048))/2048; +voltB=obj.chnl2range*(double(finalrawdataB/16)-ones(1,length(finalrawdataB))*(2048))/2048; + +VoltSignal = [voltA;voltB]; + +%% Abort the acquisition + +retCode = calllib('ATSApi', 'AlazarAbortAsyncRead', obj.deviceobj); +if retCode ~= ApiSuccess + error('Error: AlazarAbortAsyncRead failed -- %s\n', AlazarATS.errorToText(retCode)); +end + +% Release the buffers +for bufferIndex = 1:bufferCount + pbuffer = buffers{1, bufferIndex}; + retCode = calllib('ATSApi', 'AlazarFreeBufferU16', obj.deviceobj, pbuffer); + if retCode ~= ApiSuccess + error('Error: AlazarFreeBufferU16 failed -- %s\n', AlazarATS.errorToText(retCode)); + end +end + + + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/GetInstance.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/GetInstance.m new file mode 100644 index 0000000..3df8e6f --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/GetInstance.m @@ -0,0 +1,53 @@ +function obj = GetInstance(name,BoardGroupID,BoardID) + % if called without input arguments, the first valid instance is + % returned, if 'name' is not empty, the instance that matches 'name' + % is returned if exits, if not exit, a new instance is created(in this + % case all input arguments should be specified) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + persistent objlst; + if isempty(objlst) + if nargin == 0 + error('AlazarATS:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + elseif nargin < 2 + BoardGroupID = 1; + BoardID = 1; + end + obj = AlazarATS(name,BoardGroupID,BoardID); + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of delete objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 + error('AlazarATS:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + elseif nargin < 2 + BoardGroupID = 1; + BoardID = 1; + end + obj = AlazarATS(name,BoardGroupID, BoardID); + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/LoadLib.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/LoadLib.m new file mode 100644 index 0000000..f838ab6 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/LoadLib.m @@ -0,0 +1,50 @@ +function [result] = LoadLib() +% Load ATSApi.dll, the AlazarTech driver shared library + +%--------------------------------------------------------------------------- +% +% Copyright (c) 2008-2013 AlazarTech, Inc. +% +% AlazarTech, Inc. licenses this software under specific terms and +% conditions. Use of any of the software or derivatives thereof in any +% product without an AlazarTech digitizer board is strictly prohibited. +% +% AlazarTech, Inc. provides this software AS IS, WITHOUT ANY WARRANTY, +% EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF +% MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. AlazarTech makes no +% guarantee or representations regarding the use of, or the results of the +% use of, the software and documentation in terms of correctness, accuracy, +% reliability, currentness, or otherwise; and you rely on the software, +% documentation and results solely at your own risk. +% +% IN NO EVENT SHALL ALAZARTECH BE LIABLE FOR ANY LOSS OF USE, LOSS OF +% BUSINESS, LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL +% DAMAGES OF ANY KIND. IN NO EVENT SHALL ALAZARTECH%S TOTAL LIABILITY EXCEED +% THE SUM PAID TO ALAZARTECH FOR THE PRODUCT LICENSED HEREUNDER. +% +%--------------------------------------------------------------------------- + +% set default return code to indicate failure +result = false; + +% Load driver library +if ~libisloaded('ATSApi') + if strcmpi(computer('arch'), 'win64') + % Use protofile for 64-bit MATLAB + loadlibrary('ATSApi.dll',@AlazarATS.AlazarInclude_pcwin64) + elseif sscanf(version('-release'), '%d') >= 2009 + % Use protofile for 32-bit MATLAB 2009 and later + loadlibrary('ATSApi.dll',@AlazarATS.AlazarInclude_pcwin32) + else + % Use protofile for 32-bit versions of MATLAB ealier than 2009 + loadlibrary('ATSApi.dll',@AlazarATS.AlazarInclude) + end + if libisloaded('ATSApi') + result = true; + end +else + % The driver is aready loaded + result = true; +end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/boardTypeIdToText.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/boardTypeIdToText.m new file mode 100644 index 0000000..110b25e --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/boardTypeIdToText.m @@ -0,0 +1,79 @@ +function [text] = boardTypeIdToText(boardType) +% Convert board type id to text + +%--------------------------------------------------------------------------- +% +% Copyright (c) 2008-2013 AlazarTech, Inc. +% +% AlazarTech, Inc. licenses this software under specific terms and +% conditions. Use of any of the software or derivatives thereof in any +% product without an AlazarTech digitizer board is strictly prohibited. +% +% AlazarTech, Inc. provides this software AS IS, WITHOUT ANY WARRANTY, +% EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF +% MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. AlazarTech makes no +% guarantee or representations regarding the use of, or the results of the +% use of, the software and documentation in terms of correctness, accuracy, +% reliability, currentness, or otherwise; and you rely on the software, +% documentation and results solely at your own risk. +% +% IN NO EVENT SHALL ALAZARTECH BE LIABLE FOR ANY LOSS OF USE, LOSS OF +% BUSINESS, LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL +% DAMAGES OF ANY KIND. IN NO EVENT SHALL ALAZARTECH%S TOTAL LIABILITY EXCEED +% THE SUM PAID TO ALAZARTECH FOR THE PRODUCT LICENSED HEREUNDER. +% +%--------------------------------------------------------------------------- + +%call mfile with library definitions +AlazarDefs + +switch boardType +case ATS850 + text = 'ATS850'; +case ATS310 + text = 'ATS310'; +case ATS330 + text = 'ATS330'; +case ATS855 + text = 'ATS855'; +case ATS315 + text = 'ATS315'; +case ATS335 + text = 'ATS335'; +case ATS460 + text = 'ATS460'; +case ATS860 + text = 'ATS860'; +case ATS660 + text = 'ATS660'; +case ATS9461 + text = 'ATS9461'; +case ATS9462 + text = 'ATS9462'; +case ATS9850 + text = 'ATS9850'; +case ATS9870 + text = 'ATS9870'; +case ATS9310 + text = 'ATS9310'; +case ATS9325 + text = 'ATS9325'; +case ATS9350 + text = 'ATS9350'; +case ATS9351 + text = 'ATS9351'; +case ATS9410 + text = 'ATS9410'; +case ATS9440 + text = 'ATS9440'; +case ATS9360 + text = 'ATS9360'; +case ATS9625 + text = 'ATS9625'; +case ATS9626 + text = 'ATS9626'; +otherwise + text = '?'; +end + +end diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/errorToText.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/errorToText.m new file mode 100644 index 0000000..36d9105 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/errorToText.m @@ -0,0 +1,30 @@ +function [text] = errorToText(errorCode) +% Convert an error number to a string + +%--------------------------------------------------------------------------- +% +% Copyright (c) 2008-2013 AlazarTech, Inc. +% +% AlazarTech, Inc. licenses this software under specific terms and +% conditions. Use of any of the software or derivatives thereof in any +% product without an AlazarTech digitizer board is strictly prohibited. +% +% AlazarTech, Inc. provides this software AS IS, WITHOUT ANY WARRANTY, +% EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF +% MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. AlazarTech makes no +% guarantee or representations regarding the use of, or the results of the +% use of, the software and documentation in terms of correctness, accuracy, +% reliability, currentness, or otherwise; and you rely on the software, +% documentation and results solely at your own risk. +% +% IN NO EVENT SHALL ALAZARTECH BE LIABLE FOR ANY LOSS OF USE, LOSS OF +% BUSINESS, LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL +% DAMAGES OF ANY KIND. IN NO EVENT SHALL ALAZARTECH%S TOTAL LIABILITY EXCEED +% THE SUM PAID TO ALAZARTECH FOR THE PRODUCT LICENSED HEREUNDER. +% +%--------------------------------------------------------------------------- + +errorText = calllib('ATSApi', 'AlazarErrorToText', errorCode); +text = sprintf('%s (%d)', errorText, errorCode); + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@AlazarATS/inputRangeIdToVolts.m b/+qes/+hwdriver/+sync/_todo/@AlazarATS/inputRangeIdToVolts.m new file mode 100644 index 0000000..3c361e5 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@AlazarATS/inputRangeIdToVolts.m @@ -0,0 +1,79 @@ +function [inputRangeVolts] = inputRangeIdToVolts(inputRangeId) +% Convert input range identifier to volts + +%--------------------------------------------------------------------------- +% +% Copyright (c) 2008-2013 AlazarTech, Inc. +% +% AlazarTech, Inc. licenses this software under specific terms and +% conditions. Use of any of the software or derivatives thereof in any +% product without an AlazarTech digitizer board is strictly prohibited. +% +% AlazarTech, Inc. provides this software AS IS, WITHOUT ANY WARRANTY, +% EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY WARRANTY OF +% MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. AlazarTech makes no +% guarantee or representations regarding the use of, or the results of the +% use of, the software and documentation in terms of correctness, accuracy, +% reliability, currentness, or otherwise; and you rely on the software, +% documentation and results solely at your own risk. +% +% IN NO EVENT SHALL ALAZARTECH BE LIABLE FOR ANY LOSS OF USE, LOSS OF +% BUSINESS, LOSS OF PROFITS, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL +% DAMAGES OF ANY KIND. IN NO EVENT SHALL ALAZARTECH%S TOTAL LIABILITY EXCEED +% THE SUM PAID TO ALAZARTECH FOR THE PRODUCT LICENSED HEREUNDER. +% +%--------------------------------------------------------------------------- + +%call mfile with library definitions +AlazarDefs + +switch inputRangeId +case INPUT_RANGE_PM_20_MV + inputRangeVolts = 0.02; +case INPUT_RANGE_PM_40_MV + inputRangeVolts = 0.04; +case INPUT_RANGE_PM_50_MV + inputRangeVolts = 0.05; +case INPUT_RANGE_PM_80_MV + inputRangeVolts = 0.08; +case INPUT_RANGE_PM_100_MV + inputRangeVolts = 0.1; +case INPUT_RANGE_PM_200_MV + inputRangeVolts = 0.2; +case INPUT_RANGE_PM_400_MV + inputRangeVolts = 0.4; +case INPUT_RANGE_PM_500_MV + inputRangeVolts = 0.5; +case INPUT_RANGE_PM_800_MV + inputRangeVolts = 0.8; +case INPUT_RANGE_PM_1_V + inputRangeVolts = 1; +case INPUT_RANGE_PM_2_V + inputRangeVolts = 2; +case INPUT_RANGE_PM_4_V + inputRangeVolts = 4; +case INPUT_RANGE_PM_5_V + inputRangeVolts = 5; +case INPUT_RANGE_PM_8_V + inputRangeVolts = 8; +case INPUT_RANGE_PM_10_V + inputRangeVolts = 10; +case INPUT_RANGE_PM_20_V + inputRangeVolts = 20; +case INPUT_RANGE_PM_40_V + inputRangeVolts = 40; +case INPUT_RANGE_PM_16_V + inputRangeVolts = 16; +case INPUT_RANGE_PM_1_V_25 + inputRangeVolts = 1.25; +case INPUT_RANGE_PM_2_V_5 + inputRangeVolts = 2.5; +case INPUT_RANGE_PM_125_MV + inputRangeVolts = 0.125; +case INPUT_RANGE_PM_250_MV + inputRangeVolts = 0.250; +otherwise + inputRangeVolts = 0; +end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/DCSource.m b/+qes/+hwdriver/+sync/_todo/@DCSource/DCSource.m new file mode 100644 index 0000000..4584397 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/DCSource.m @@ -0,0 +1,122 @@ +classdef DCSource < Instrument + % dc current or voltage source driver. + % basic properties and functions of a dc source, for extensive + % properties and functions, use class DCSource_e. + % adcmt 6166: 6161-compatible mode must be set to ON (set by using the instrument front panel) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties + dcval % dc value + % maximun dc output value, the smallest range for this value is selected. + % if empty, instrument will be set to auto range if possible. + max + on % true/false, output on/off + % set to the target dc output value directly or tune to it slowly + % while setting a new dc value. default: tune + tune@logical scalar = true + end + properties % (SetAccess = immutable) + % safty limits, dcvals out of safty limits are rejected. + limits + end + methods (Access = private,Hidden = true) + function obj = DCSource(name,interfaceobj,drivertype) + if isempty(interfaceobj) + error('DCSource:InvalidInput',... + 'Input ''%s'' can not be empty!',... + 'interfaceobj'); + end + if nargin < 3 + drivertype = []; + end + obj = obj@Instrument(name,interfaceobj,drivertype); + if nargin > 3 + obj.intinfo = intinfo; + end + ErrMsg = obj.InitializeInstr(); + if ~isempty(ErrMsg) + error('DCSource:InstSetError',[obj.name, ': %s'], ErrMsg); + end + end + [varargout] = InitializeInstr(obj) + SetRange(obj,val) + SetDCVal(obj,val) + SetOnOff(obj,OnOrOff) + onstatus = GetOnOff(obj) + dcval = GetDCVal(obj) + SetAgilent_33120(obj,val) + SetAdcmt_6166I(obj,val) + SetAdcmt_6166V(obj,val) + SetYokogawa_7651I(obj,val) + SetYokogawa_7651V(obj,val) + end + methods (Static) + obj = GetInstance(name,interfaceobj,drivertype) + end + methods + function set.dcval(obj,val) + if isempty(val) || ~isnumeric(val) || ~isreal(val) + error('DCSource:InvalidInput',... + [obj.name, ': Invalid input ''%s''!'],... + 'val'); + end + if ~isempty(obj.limits) &&... + (val(1) < obj.limits(1) || val(1) > obj.limits(2)) + warning('DCSource:InvalidInput',[obj.name, ': DC value out of safty limits!']); + return; + end + if length(val) > 1 % to be compatible with the old version. + obj.tune = true; + val = val(1); + end + SetDCVal(obj,val); + obj.dcval = val; + end + function dcval = get.dcval(obj) + dcval = GetDCVal(obj); + end + function set.max(obj,val) + if ~isnumeric(val) || val <= 0 + error('DCSource:SetRange', 'max dcval should be a positive number.'); + end + ErrMsg = SetRange(obj,val); + if ~isempty(Msg) + error('DCSource:SetRange', ErrMsg); + end + obj.max = val; + end + function set.on(obj,val) + if isempty(val) + error('DCSource:SetOnOff', 'on must be a bolean.'); + end + if ~islogical(val) + if val == 0 || val == 1 + val = logical(val); + else + error('DCSource:SetOnOff', 'on must be a bolean.'); + end + end + obj.SetOnOff(val); + obj.on = val; + end + function val = get.on(obj) + val = GetOnOff(obj); + end + function On(obj) + % set on, this method is introduced for functional + % programming. + obj.on = true; + end + function Off(obj) + % set off, this method is introduced for functional + % programming. + obj.on = false; + end + function delete(obj) +% Off(obj); % close dc output might change the working point, +% better not close at object deletion! + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/GetDCVal.m b/+qes/+hwdriver/+sync/_todo/@DCSource/GetDCVal.m new file mode 100644 index 0000000..5cb7bb7 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/GetDCVal.m @@ -0,0 +1,27 @@ +function dcval = GetDCVal(obj) + % query dc value from instrument + % adcmt 6166: 6161-compatible mode must be set to ON (set by using the instrument front panel) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + try + switch TYP + case {'agilent33120','hp33120'} + flushinput(obj.interfaceobj); % query dose not flush input butter(R2013b) + dcval = str2double(query(obj.interfaceobj,'VOLTage:OFFset?')); + case {'adcmt6166i','adcmt6166v','adcmt6161i','adcmt6161v'} + flushinput(obj.interfaceobj); % query dose not flush input butter(R2013b) + CurrentOutputStr = query(obj.interfaceobj,'SRC?'); % format: 'SOI+d.ddddddE-d' or 'SOV+d.ddddddE-d' + dcval = str2double(CurrentOutputStr(4:end)); + case {'yokogawa7651i','yokogawa7651v'} + flushinput(obj.interfaceobj); % query dose not flush input butter(R2013b) + dcval = str2double(query(obj.interfaceobj,'SA?')); + otherwise + error('DCSource:GetDCVal', ['Unsupported instrument: ',TYP]); + end + catch + error('DCSource:GetDCVal', 'Query instrument failed.'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/GetInstance.m b/+qes/+hwdriver/+sync/_todo/@DCSource/GetInstance.m new file mode 100644 index 0000000..d3fcfcf --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/GetInstance.m @@ -0,0 +1,55 @@ +function obj = GetInstance(name,interfaceobj,drivertype) + % if called without input arguments, the first valid instance is + % returned, if 'name' is not empty, the instance that matches 'name' + % is returned if exits, if not exit, a new instance is created(in this + % case all input arguments should be specified) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + persistent objlst; + if isempty(objlst) + if nargin == 0 || isempty(name) + error('DCSource:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + end + if nargin > 2 + obj = DCSource(name,interfaceobj,drivertype); + else + obj = DCSource(name,interfaceobj); + end + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of delete objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 || isempty(name) + error('DCSource:GetInstanceError',... + 'No existing instance, all input paramenter should be specified!'); + end + if nargin > 2 + obj = DCSource(name,interfaceobj,drivertype); + else + obj = DCSource(name,interfaceobj); + end + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/GetOnOff.m b/+qes/+hwdriver/+sync/_todo/@DCSource/GetOnOff.m new file mode 100644 index 0000000..3c7d35a --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/GetOnOff.m @@ -0,0 +1,31 @@ +function On = GetOnOff(obj) + % query instrument output status + % adcmt 6166: 6161-compatible mode must be set to ON (set by using the instrument front panel) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + try + switch TYP + case {'agilent33120','hp33120'} + error('this part is not finished.'); + % todo + case {'adcmt6166i','adcmt6166v','adcmt6161i','adcmt6161v'} + flushinput(obj.interfaceobj); % query dose not flush input butter(R2013b) + str = query(obj.interfaceobj,'OPR?'); % operate + if strcmp(str(1:3),'OPR') + On = true; + else + On = false; + end + case {'yokogawa7651i','yokogawa7651v'} + error('this part is not finished.'); + % todo + otherwise + error('DCSource:SetOnOff', ['Unsupported instrument: ',TYP]); + end + catch + error('DCSource:SetOnOff', 'Query instrument failed.'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/InitializeInstr.m b/+qes/+hwdriver/+sync/_todo/@DCSource/InitializeInstr.m new file mode 100644 index 0000000..762109c --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/InitializeInstr.m @@ -0,0 +1,43 @@ +function [varargout] = InitializeInstr(obj) + % Initialize instrument + % adcmt 6166: 6161-compatible mode must be set to ON (set by using the instrument front panel) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + ErrMsg = ''; + TYP = lower(obj.drivertype); + try + switch TYP + case {'agilent33120','hp33120'} + % todo + obj.limits = [-30, 30]; + case {'adcmt6166i','adcmt6161i'} % as current source + fprintf(obj.interfaceobj,'IF'); % set to current source mode + fprintf(obj.interfaceobj,'SIRX'); % set to auto range. + fprintf(obj.interfaceobj,'LMV3.0E+1'); % set votage safety limit to 30V max + fprintf(obj.interfaceobj,'LMI1.25E-1'); % set current safety limit to 125mA max + obj.limits = [-125e-3, 125e-3]; + case {'adcmt6166v','adcmt61661'} % as voltage source + fprintf(obj.interfaceobj,'VF'); % set to voltage source mode + fprintf(obj.interfaceobj,'SVRX'); % set to auto range. + % fprintf(DCSource,'V5'); % set to range 10V. + fprintf(obj.interfaceobj,'LMV3.0E+1'); % set votage safety limit to 30V max + fprintf(obj.interfaceobj,'LMI1.25E-1'); % set current safety limit to 125mA max + obj.limits = [-30, 30]; + case {'yokogawa7651i'} % as current source + fprintf(obj.interfaceobj,'F5'); % set to current source mode + fprintf(obj.interfaceobj,'R5'); % R4/R5/R6: 1mA/10mA/100mA range, adjust to suit you application + obj.limits = [-100e-3, 100e-3]; + case {'yokogawa7651v'} % as voltage source + fprintf(obj.interfaceobj,'F1'); % set to voltage source mode + fprintf(obj.interfaceobj,'R5'); % R2/R3/R4/R5/R6: 10mA/100mA/1V/10V/30V range, adjust to suit you application + obj.limits = [-30, 30]; + otherwise + ErrMsg = ['Unsupported instrument: ',TYP]; + end + catch + ErrMsg = 'Failed at initializing instrument!'; + end + varargout{1} = ErrMsg; +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/SetAdcmt_6166I.m b/+qes/+hwdriver/+sync/_todo/@DCSource/SetAdcmt_6166I.m new file mode 100644 index 0000000..29a82cf --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/SetAdcmt_6166I.m @@ -0,0 +1,36 @@ +function SetAdcmt_6166I(obj,val) +% adcmt 6166: 6161-compatible mode must be set to ON (set by using the instrument front panel) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if isempty(obj.tune) || ~obj.tune % round is automatic in ADCMT_6166 + fprintf(obj.interfaceobj,['SOI', num2str(val(1),'%6e')]); + else % tune to target output value + % query current output value + CurrentOutputStr = query(obj.interfaceobj,'SRC?'); % format: 'SOI+d.ddddddE-d' or 'SOV+d.ddddddE-d' + CurrentOutput = str2double(CurrentOutputStr(4:end)); + if isnan(CurrentOutput) + error('dcsource:InstrumentError',... + [obj.idstr, ': Failed at instrument query!']); + end + if CurrentOutput == val(1) + return; + end + temp = CurrentOutput:... + sign(val(1)-CurrentOutput)*5e-5:... + val(1); + if temp(end) ~= val(1); + OutputValue = [temp, val(1)]; + else + OutputValue = temp; + end + for ii = 1:length(OutputValue) + fprintf(obj.interfaceobj,['SOI', num2str(OutputValue(ii),'%6e')]); % A + if ii == 1 + obj.on=1; + end + pause(0.2); % 40 seconds from 0 to 10mA + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/SetAdcmt_6166V.m b/+qes/+hwdriver/+sync/_todo/@DCSource/SetAdcmt_6166V.m new file mode 100644 index 0000000..132946e --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/SetAdcmt_6166V.m @@ -0,0 +1,37 @@ +function SetAdcmt_6166V(obj,val) +% adcmt 6166: 6161-compatible mode must be set to ON (set by using the instrument front panel) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if isempty(obj.tune) || ~obj.tune % round is automatic in ADCMT_6166 + fprintf(obj.interfaceobj,['SOV', num2str(val(1),'%6e')]); + else % tune to target output value + % query current output value + fprintf(obj.interfaceobj,'SRC?'); + CurrentOutputStr=fscanf(obj.interfaceobj); % format: 'SOI+d.ddddddE-d' or 'SOV+d.ddddddE-d' + CurrentOutput = str2double(CurrentOutputStr(4:end)); + if isnan(CurrentOutput) + error('dcsource:InstrumentError',... + [obj.idstr, ': Failed at instrument query!']); + end + if CurrentOutput == val(1) + return; + end + temp = CurrentOutput:... + sign(val(1)-CurrentOutput)*5e-2:... + val(1); + if temp(end) ~= val(1); + OutputValue = [temp, val(1)]; + else + OutputValue = temp; + end + for ii = 1:length(OutputValue) + fprintf(obj.interfaceobj,['SOV', num2str(OutputValue(ii),'%6e')]); % A + if ii == 1 + obj.On(); + end + pause(0.2); + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/SetAgilent_33120.m b/+qes/+hwdriver/+sync/_todo/@DCSource/SetAgilent_33120.m new file mode 100644 index 0000000..63e084c --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/SetAgilent_33120.m @@ -0,0 +1,49 @@ +function SetAgilent_33120(obj,val) +% adcmt 6166: 6161-compatible mode must be set to ON (set by using the instrument front panel) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if isempty(obj.tune) || ~obj.tune + OutputValue = 5e-5*round(val(1)/5e-5); + % round to HP33120 minimum dc output change step:5e-5 volt + % notes: for HP33120, the set value is the real voltage a + % 50 Ohm load will get, if the load resistance is much larger + % than 50 Ohm, the real voltage the load get will be + % approximately two time the set value. + fprintf(obj.interfaceobj,['APPL:DC DEF,DEF,',num2str(OutputValue),'V']); + else % tune to target output value + % query current output value + fprintf(obj.interfaceobj,'VOLTage:OFFset?'); + CurrentOutput = str2double(fscanf(obj.interfaceobj)); + if isnan(CurrentOutput) + error('dcsource:InstrumentError',... + [obj.idstr, ': Failed at instrument query!']); + end + if CurrentOutput == val(1) + return; + end + temp = CurrentOutput:... + sign(val(1)-CurrentOutput)*0.05:... + val(1); + if temp(end) ~= val(1); + OutputValue = [temp, val(1)]; + else + OutputValue = temp; + end + OutputValue = 5e-5*round(OutputValue/5e-5); +% disp(''); +% disp('Setting dc output, please wait...'); + for ii = 1:length(OutputValue) + % round to HP33120 minimum dc output change step:5e-5 volt + % notes: for HP33120, the set value is the real voltage a + % 50 Ohm load will get, if the load resistance is much larger + % than 50 Ohm, the real voltage the load get will be + % approximately two time the set value. + fprintf(DCSource,['APPL:DC DEF,DEF,',num2str(OutputValue(ii)),'V']); + pause(0.2); % 40 seconds from 0 to 10V + end +% disp('Done!'); +% disp(''); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/SetDCVal.m b/+qes/+hwdriver/+sync/_todo/@DCSource/SetDCVal.m new file mode 100644 index 0000000..68995c9 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/SetDCVal.m @@ -0,0 +1,27 @@ +function SetDCVal(obj,val) + % set instrument dc output value + % adcmt 6166: 6161-compatible mode must be set to ON (set by using the instrument front panel) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + try + switch TYP + case {'agilent33120','hp33120'} % as voltage source + SetAgilent_33120(obj,val); + case {'adcmt6166i','adcmt6161i'} % as current source + SetAdcmt_6166I(obj,val); + case {'adcmt6166v','adcmt6161v'} % as current source + SetAdcmt_6166V(obj,val); + case {'yokogawa7651i'} % as current source + SetYokogawa_7651I(obj,val); + case {'yokogawa7651v'} % as current source + SetYokogawa_7651V(obj,val); + otherwise + error('DCSource:SetDCVal', ['Unsupported instrument: ',TYP]); + end + catch + error('DCSource:SetDCVal', 'Setting instrument failed.'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/SetOnOff.m b/+qes/+hwdriver/+sync/_todo/@DCSource/SetOnOff.m new file mode 100644 index 0000000..d27eaa6 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/SetOnOff.m @@ -0,0 +1,34 @@ +function SetOnOff(obj,On) + % set instrument output to on or off + % adcmt 6166: 6161-compatible mode must be set to ON (set by using the instrument front panel) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + try + switch TYP + case {'agilent33120','hp33120'} + error('this part is not finished.'); + % todo + case {'adcmt6166i','adcmt6166v','adcmt6161i','adcmt6161v'} + if On + fprintf(obj.interfaceobj,'OPR'); % operate + else + fprintf(obj.interfaceobj,'SBY'); % standby + end + case {'yokogawa7651i','yokogawa7651v'} + if On + fprintf(obj.interfaceobj,'O1'); + fprintf(obj.interfaceobj,'E'); + else + fprintf(obj.interfaceobj,'O0'); + fprintf(obj.interfaceobj,'E'); + end + otherwise + error('DCSource:SetOnOff', ['Unsupported instrument: ',TYP]); + end + catch + error('DCSource:SetOnOff', 'Setting instrument failed.'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/SetRange.m b/+qes/+hwdriver/+sync/_todo/@DCSource/SetRange.m new file mode 100644 index 0000000..d85eb22 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/SetRange.m @@ -0,0 +1,73 @@ +function SetRange(obj, val) + % Set range + % adcmt 6166: 6161-compatible mode must be set to ON (set by using the instrument front panel) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + try + switch TYP + case {'agilent33120','hp33120'} + % todo + case {'adcmt6166i','adcmt6161i'} % as current source + if isempty(val) + fprintf(obj.interfaceobj,'SIRX'); % set to auto range. + elseif val(1) <= 1e-3 + fprintf(obj.interfaceobj,'I1'); + elseif val(1) <= 10e-3 + fprintf(obj.interfaceobj,'I2'); + elseif val(1) <= 100e-3 + fprintf(obj.interfaceobj,'I3'); + else + error('DCSource:SetRange', 'max dcval too large, no suitable range.'); + end + case {'adcmt6166v','adcmt 61661v'} % as voltage source + if isempty(val) + fprintf(obj.interfaceobj,'SVRX'); % set to auto range. + elseif val(1) <= 1 + fprintf(obj.interfaceobj,'V4'); + elseif val(1) <= 10 + fprintf(obj.interfaceobj,'V5'); + elseif val(1) <= 100 + fprintf(obj.interfaceobj,'V6'); + elseif val(1) <= 1000 + fprintf(obj.interfaceobj,'V7'); + else + error('DCSource:SetRange', 'max dcval too large, no suitable range.'); + end + case {'yokogawa7651i'} % as current source + if isempty(val) + fprintf(obj.interfaceobj,'R6'); % yokogawa7651 dose not support auto range, select the max range + elseif val(1) <= 1e-3 + fprintf(obj.interfaceobj,'R4'); + elseif val(1) <= 10e-3 + fprintf(obj.interfaceobj,'R5'); + elseif val(1) <= 100e-3 + fprintf(obj.interfaceobj,'R6'); + else + error('DCSource:SetRange', 'max dcval too large, no suitable range.'); + end + case {'yokogawa7651v'} % as voltage source + if isempty(val) + fprintf(obj.interfaceobj,'R6'); % yokogawa7651 dose not support auto range, select the max range + elseif val(1) <= 100-3 + fprintf(obj.interfaceobj,'R2'); + elseif val(1) <= 100e-3 + fprintf(obj.interfaceobj,'R3'); + elseif val(1) <= 1 + fprintf(obj.interfaceobj,'R4'); + elseif val(1) <= 10 + fprintf(obj.interfaceobj,'R5'); + elseif val(1) <= 30 + fprintf(obj.interfaceobj,'R6'); + else + error('DCSource:SetRange', 'max dcval too large, no suitable range.'); + end + otherwise + error('DCSource:SetRange', ['Unsupported instrument: ',TYP]); + end + catch + error('DCSource:SetRange', 'Setting instrument failed.'); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/SetYokogawa_7651I.m b/+qes/+hwdriver/+sync/_todo/@DCSource/SetYokogawa_7651I.m new file mode 100644 index 0000000..1e0bdf1 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/SetYokogawa_7651I.m @@ -0,0 +1,39 @@ +function SetYokogawa_7651I(obj,val) +% + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if isempty(val) + return; + end + if isempty(obj.tune) || ~obj.tune % round is automatic in ADCMT_6166 + fprintf(obj.interfaceobj,['SA', num2str(val(1),'%0.6E')]); + else % tune to target output value + % query current output value + fprintf(obj.interfaceobj,'SA?'); + CurrentOutput = str2double(fscanf(obj.interfaceobj)); + if isnan(CurrentOutput) + error('dcsource:InstrumentError',... + [obj.idstr, ': Failed at instrument query!']); + end + if CurrentOutput == val(1) + return; + end + temp = CurrentOutput:... + sign(val(1)-CurrentOutput)*5e-5:... + val(1); + if temp(end) ~= val(1); + OutputValue = [temp, val(1)]; + else + OutputValue = temp; + end + for ii = 1:length(OutputValue) + fprintf(obj.interfaceobj,['SA', num2str(OutputValue(ii),'%0.6E')]); + if ii == 1 + obj.on = true; + end + pause(0.2); + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@DCSource/SetYokogawa_7651V.m b/+qes/+hwdriver/+sync/_todo/@DCSource/SetYokogawa_7651V.m new file mode 100644 index 0000000..d57c781 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@DCSource/SetYokogawa_7651V.m @@ -0,0 +1,36 @@ +function SetYokogawa_7651V(obj,val) +% + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if isempty(obj.tune) || ~obj.tune % round is automatic in ADCMT_6166 + fprintf(obj.interfaceobj,['SA', num2str(val(1),'%0.6E')]); + else % tune to target output value + % query current output value + fprintf(obj.interfaceobj,'SA?'); + CurrentOutput = str2double(fscanf(obj.interfaceobj)); + if isnan(CurrentOutput) + error('dcsource:InstrumentError',... + [obj.idstr, ': Failed at instrument query!']); + end + if CurrentOutput == val(1) + return; + end + temp = CurrentOutput:... + sign(val(1)-CurrentOutput)*5e-2:... + val(1); + if temp(end) ~= val(1); + OutputValue = [temp, val(1)]; + else + OutputValue = temp; + end + for ii = 1:length(OutputValue) + fprintf(obj.interfaceobj,['SA', num2str(OutputValue(ii),'%0.6E')]); + if ii == 1 + obj.on = true; + end + pause(0.2); + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/Config.m b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/Config.m new file mode 100644 index 0000000..17d31e2 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/Config.m @@ -0,0 +1,75 @@ +function Config(obj) + % Config digitizer + + % USB-5132 Vpp: 0.04/0.1/0.2/0.4/1/2/4/10/20/40 + % Impedance: 50/1000000 (in unit of ohm) + % Slope: 0/1 falling/Rising edge + % TriggerCoupling 0/1/2/3 AC/DC/HF Reject/LF Reject/AC+HF Reject + % Channel source/Channel list: '0', '1','0,1','VAL_PFI_1' + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + + if isempty(obj.smplrate) || isempty(obj.chnl1range) || isempty(obj.chnl2range) + error('NIDAQUSB5132:Config', 'some properties are not set!'); + end + + % Configure measurement type + % 0/1 normal/dynamic sampling rate + configuration = get(obj.deviceobj, 'configuration'); + invoke(configuration, 'configureacquisition',0); + + % Configure vertical settings: + % Configurationfunctionsvertical = get(obj.deviceobj, 'Configurationfunctionsvertical'); + % invoke(Configurationfunctionsvertical, 'configurevertical',... + % ChannelList, Range, Offset, Coupling, ProbeAttenuation, Enabled); + Configurationfunctionsvertical = get(obj.deviceobj, 'Configurationfunctionsvertical'); + if obj.chnl1enabled + invoke(Configurationfunctionsvertical, 'configurevertical',... + '0', obj.chnl1range, obj.chnl1offset,1, 1, 1); + else + invoke(Configurationfunctionsvertical, 'configurevertical',... + '0', obj.chnl1range, obj.chnl1offset,1, 1, 0); + end + Configurationfunctionsvertical = get(obj.deviceobj, 'Configurationfunctionsvertical'); + if obj.chnl2enabled + invoke(Configurationfunctionsvertical, 'configurevertical',... + '1',obj.chnl2range, obj.chnl2offset, 1, 1, 1); + else + invoke(Configurationfunctionsvertical, 'configurevertical',... + '1',obj.chnl2range, obj.chnl2offset, 1, 1, 0); + end + + % Configure horizontal settings: + % Configurationfunctionshorizontal = get(obj.deviceobj, 'Configurationfunctionshorizontal'); + % invoke(Configurationfunctionshorizontal, 'configurehorizontaltiming',... + % MinSampleRate, MinNumPts, RefPosition, NumRecords, EnforceRealtime); + % RefPosition: 0-100, percentage of pretrigger data points + % that are stored, a 0% reference position means that you have + % the actual record length points stored after the trigger occurs, + % while 100% reference position means that all the samples are stored before the trigger. + % USB-5132 dose not support multirecords acquisition, NumRecords = 1 always. + Configurationfunctionshorizontal = get(obj.deviceobj, 'Configurationfunctionshorizontal'); + invoke(Configurationfunctionshorizontal, 'configurehorizontaltiming',... + obj.smplrate, 1, 0, 1, 1); + + % set trigger + % invoke(Configurationfunctionstrigger, 'configuretriggeredge',... + % TriggerSource, Level, Slope, TriggerCoupling,, Holdoff, Delay); % edge + % Trigger holdoff is an adjustable period of time during which the + % digitizer cannot trigger, to guarantee a minimum time between two Reference Triggers. + % Model USB5132 dose not support Trigger holdoff + % invoke(Configurationfunctionstrigger, 'configuretriggersoftware',Holdoff, Delay); %software + % ... + Configurationfunctionstrigger = get(obj.deviceobj,'Configurationfunctionstrigger'); + if obj.workmode == 2 % acquire data in trigger mode + invoke(Configurationfunctionstrigger, 'configuretriggerdigital',... + 'VAL_PFI_1', obj.triggerlevel, 0, 0); % digital +% invoke(Configurationfunctionstrigger, 'configuretriggeredge',... +% 'VAL_PFI_1', obj.triggerlevel, 1, 0,0,0); % edge + elseif obj.workmode == 1 % continues + invoke(Configurationfunctionstrigger, 'configuretriggersoftware', 0, 0); + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/FetchData.m b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/FetchData.m new file mode 100644 index 0000000..188efb8 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/FetchData.m @@ -0,0 +1,56 @@ +function VoltSignal = FetchData(obj) + % fetch data from digitizer buffer WHEN DATA IS READY + % VoltSignal is 1 by numsamples array if only one channel is enabled, + % 2 by numsamples if both channnels are enabled, the first row is the + % voltage signal data of the first channel, the second row, the second + % channel. + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if ~obj.running + error('NIDAQUSB5132:FetchError',... + 'data acquisition not started, there is no data to fetch in digitizer buffer, use method Run to start a data acquisition before fetching data!'); + end + if ~obj.chnl1enabled && ~obj.chnl2enabled + error('NIDAQUSB5132:FetchError', 'both chanels are disabled!'); + end + if obj.chnl1enabled && ~obj.chnl2enabled + SignalChannel = '0'; + WaveformArray = zeros(1, obj.numsamples); + WfmInfo = [struct]; + elseif ~obj.chnl1enabled && obj.chnl2enabled + SignalChannel = '1'; + WaveformArray = zeros(1, obj.numsamples); + WfmInfo = [struct]; + else + SignalChannel = '0,1'; + WaveformArray = zeros(1, 2*obj.numsamples); + WfmInfo = [struct struct]; + end + + cnt = 0; + while cnt < 3000 + Points_Done = obj.acquisition.Points_Done; + if Points_Done >= obj.numsamples + break; + end + pause(0.02); % todo: use timer + cnt = cnt + 1; + end + if cnt >= 3000 + error('NIDAQUSB5132:FetchTimeout','Fetch data timeout!'); + end + + [WaveformArray , WfmInfo] = invoke(obj.acquisition, 'fetchbinary8',SignalChannel, obj.timeout, obj.numsamples, WaveformArray, WfmInfo); + + if obj.chnl1enabled && ~obj.chnl2enabled + VoltSignal = WaveformArray(1:obj.numsamples)*WfmInfo.gain + WfmInfo.Offset; + elseif ~obj.chnl1enabled && obj.chnl2enabled + VoltSignal = WaveformArray(1:obj.numsamples)*WfmInfo.gain + WfmInfo.Offset; + else + VoltSignal = [WaveformArray(1:obj.numsamples)*WfmInfo(1).gain + WfmInfo(1).Offset;... + WaveformArray(obj.numsamples+1:2*obj.numsamples)*WfmInfo(2).gain + WfmInfo(2).Offset]; + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/GetInstance.m b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/GetInstance.m new file mode 100644 index 0000000..08c8333 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/GetInstance.m @@ -0,0 +1,47 @@ +function obj = GetInstance(name,deviceobj) + % if called without input arguments, the first valid instance is + % returned, if 'name' is not empty, the instance that matches 'name' + % is returned if exits, if not exit, a new instance is created(in this + % case all input arguments should be specified) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + persistent objlst; + if isempty(objlst) + if nargin == 0 || isempty(name) || isempty(deviceobj) + error('NIDAQUSB5132:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + end + obj = NIDAQUSB5132(name, deviceobj); + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of delete objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 || isempty(name) || isempty(deviceobj) + error('NIDAQUSB5132:GetInstanceError',... + 'No existing instance, all input paramenter should be specified!'); + end + obj = NIDAQUSB5132(name, deviceobj); + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/NIDAQUSB5132.m b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/NIDAQUSB5132.m new file mode 100644 index 0000000..ca21765 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/NIDAQUSB5132.m @@ -0,0 +1,117 @@ +classdef (Sealed = true) NIDAQUSB5132 < Hardware + % dirver for NI DAQ-5132 Digitizer + % driver based. + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties + smplrate % Hz, sampling rate + workmode = 1; % 1/2, continues(default)/triggered + timeout = 30; % seconds, default:30 seconds. + + chnl1enabled@logical scalar = true; % logical, channel 1 enabled or not + chnl1range % V, channel 1 Vpp, USB-5132 Vpp: 0.04/0.1/0.2/0.4/1/2/4/10/20/40 + chnl1offset = 0; % V, channel 1 Offset + + chnl2enabled@logical scalar = true; % logical, channel 2 enabled or not + chnl2range % V, channel 2 Vpp, USB-5132 Vpp: 0.04/0.1/0.2/0.4/1/2/4/10/20/40 V + chnl2offset = 0; % V, channel 2 Offset + + numsamples % number of data points to fetch for each data acquisition + end + properties (SetAccess = private) + running@logical scalar = false; + end + properties (Constant = true, Hidden = true, GetAccess = private) + triggerlevel = 0.2; % Volts + trigposslop = true; % true/false, tirgger slop positive or negative + end + properties (Hidden = true, SetAccess = private, GetAccess = private) + deviceobj + acquisition + end + methods (Access = private) + function obj = NIDAQUSB5132(name, deviceobj) + % NIDAQUSB5132 deviceobj is created by icdevice: + % deviceobj = icdevice('niscope.mdd', 'DAQ::Dev1', 'optionstring','simulate=false'); + % niscope.mdd is the driver, see doc for details. + if ~ischar(name) + error('NIDAQUSB5132:InvalidInputType',... + 'Input ''%s'' must be a character string!',... + 'name'); + end + obj = obj@Hardware(name); + if ~isa(deviceobj,'icdevice') || ~isvalid(deviceobj) + error('NIDAQUSB5132:InvalidInput', 'deviceobj should be a valid icdevice object!'); + end + obj.deviceobj = deviceobj; + if strcmp(obj.deviceobj.Status,'closed') + connect(obj.deviceobj); + end + end + end + methods (Static) + obj = GetInstance(name,deviceobj) + end + methods + function set.smplrate(obj,val) + val = round(val); + if isempty(val) || val <=0 + error('NIDAQUSB5132:InvalidInput','smplrate should be a positive integer!'); + end + if val > 50e6 + error('NIDAQUSB5132:InvalidInput','smplrate out of range!'); + end + obj.smplrate = val; + end + function set.workmode(obj,val) + if val ~=1 && val ~= 2 + error('NIDAQUSB5132:InvalidInput','available workmodes 1/2 continues/trigger!'); + end + obj.workmode = val; + end + function set.numsamples(obj,val) + val = round(val); + if isempty(val) || val <=0 + error('NIDAQUSB5132:InvalidInput','numsamples should be a positive integer!'); + end + obj.numsamples = val; + end + Config(obj) + Run(obj) + VoltSignal = FetchData(obj) + function Stop(obj) + % Stop acquisition + if isempty(obj.acquisition) + return; + end + invoke(obj.acquisition, 'abort'); + obj.acquisition = []; + obj.running = false; + end + function Reset(obj) + % Reset divice object, do this incase of unable to connect + % error + obj.Stop(); + if strcmp(obj.deviceobj.Status,'open') + disconnect(obj.deviceobj); + end + connect(obj.deviceobj); + obj.Config(); + end + function bol = eq(obj1,obj2) + bol = false; + if strcmp(obj1.name, obj2.name) + bol = true; + end + end + function delete(obj) + obj.Stop(); + if strcmp(obj.deviceobj.Status,'open') + disconnect(obj.deviceobj); + end + end + end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/Run.m b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/Run.m new file mode 100644 index 0000000..839cff7 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/Run.m @@ -0,0 +1,39 @@ +function Run(obj) + % Start an acquisition + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + if obj.running + return; + end + + obj.acquisition = get(obj.deviceobj, 'Acquisition'); + % Fetch_Relative_To 477 Fetches relative to the first pretrigger point requested with + % Fetch_Relative_To 481 Fetch data at the last sample acquired. + % Fetch_Relative_To 482 Fetch data starting at the first point sampled by the digitizer + % Fetch_Relative_To 483 Fetch at the first posttrigger sample + % Fetch_Relative_To 388 The read pointer is set to zero when a new acquisition is initiated. + % After every fetch the read pointer is incremented to be the sample after the last sample retrieved. + % Therefore, you can repeatedly fetch relative to the read pointer for a continuous acquisition program. + if obj.workmode == 2 % triggered mode +% obj.acquisition.Fetch_Relative_To = 388; +% obj.acquisition.Fetch_Relative_To = 483; +% obj.acquisition.Fetch_Offset = 0; + elseif obj.workmode == 1 % continues mode, should always fetch the latest data! + % set the position to start fetching within one record to: + % NISCOPE_VAL_READ_POINTER (388)¡ªThe read pointer is set to zero when a new acquisition is initiated. + % After every fetch the read pointer is incremented to be the sample after the last sample retrieved. + % Therefore, you can repeatedly fetch relative to the read pointer for a continuous acquisition program. + % Indispensible enven if only one fetch is needed. + if isempty(obj.numsamples) + error('NIDAQUSB5132:RunError', 'numsample points not set!'); + end + obj.acquisition.Fetch_Relative_To = 481; % the last sample acquired + obj.acquisition.Fetch_Offset = -obj.numsamples; + end + % initiate acquisition + invoke(obj.acquisition, 'initiateacquisition'); + obj.running = true; +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/niScope.mdd b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/niScope.mdd new file mode 100644 index 0000000..1c90e3b --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@NIDAQUSB5132/niScope.mdd @@ -0,0 +1,14661 @@ + + + 2.42 + niScope + MATLAB IVI-C + IVIInstrument + National Instruments Corp. + NI Digitizers + 1.0 + + + + + + function init(obj) +% This function is called after the object is created. +% OBJ is the device object. +% End of function definition - DO NOT EDIT + + + + MCode + function init(obj) +% This function is called after the object is connected. +% OBJ is the device object. +% End of function definition - DO NOT EDIT + + + + MCode + function cleanup(obj) +% This function is called before the object is disconnected. +% OBJ is the device object. +% End of function definition - DO NOT EDIT + + + + + parent + + + 1 + + + + + + + initwithoptions + parent + Base + MCode + + function [InstrumentHandle] = initwithoptions(obj, ResourceName, IDQuery, ResetDevice, OptionString) + +libname = get(obj, 'DriverName'); +session = get(obj, 'Interface'); +ResourceName = [double(ResourceName) 0]; +OptionString = [double(OptionString) 0]; +InstrumentHandle = libpointer('uint32Ptr', 0); + +status = calllib(libname, 'niScope_InitWithOptions', ResourceName, IDQuery, ResetDevice, OptionString, InstrumentHandle); + +InstrumentHandle = double(InstrumentHandle.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_InitWithOptions</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_InitWithOptions </h1> +<H2>C Function Prototype</H2> +<p class="syntax">ViStatus niScope_InitWithOptions (ViRsrc +resourceName, ViBoolean IDQuery, ViBoolean resetDevice, ViString optionString, +ViSession* newVi);</p> +<h2 class="purpose">Purpose</h2> +<P class = "Body">Performs the following initialization actions:</P> +<UL> + <LI>Creates a new IVI instrument driver and optionally sets the initial state + of the following session properties: Range Check, Cache, Simulate, Record + Value Coercions </li> + <LI>Opens a session to the specified device using the interface and address + you specify for the <strong>resourceName</strong> </li> + <LI>Resets the digitizer to a known state if <strong>resetDevice</strong> is set + to <span class="Monospace">VI_TRUE</span> </li> + <LI>Queries the instrument ID and verifies that it is valid for this + instrument driver if the <strong>IDQuery</strong> is set to <span class="Monospace">VI_TRUE</span></li> + <LI>Returns an instrument handle that you use to identify the instrument in + all subsequent instrument driver function calls </LI></UL> + +</body> +</html> + + + + + Acquisition + + + 1 + + + + + + Acquisition_Type + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250101); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250101 ,propertyValue); + + + Double + enum + + 1001.0 + 1002.0 + 0.0 + + + + never + "Specifies how the digitizer acquires data and fills the waveform record. + " + + + Binary_Sample_Width + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150005); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150005 ,propertyValue); + + + Double + none + + + never + "Indicates the bit width of the binary data in the acquired waveform. Useful for determining which Binary Fetch function to use. Compare to NISCOPE_ATTR_RESOLUTION. +To configure the device to store samples with a lower resolution that the native, set this attribute to the desired binary width. +This can be useful for streaming at faster speeds at the cost of resolution. The least significant bits will be lost with this configuration. + +Valid Values: 8, 16, 32 + " + + + Data_Transfer_Block_Size + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150316); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150316 ,propertyValue); + + + Double + none + + + never + "Specifies the maximum number of samples to transfer at one time from the device to host memory.Increasing this number should result in better fetching performance because the driver does not need to restart the transfers as often.However, increasing this number may also increase the amount of page-locked memory required from the system. + " + + + Enable_RIS_in_Auto_Setup + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150106); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150106, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Indicates whether the digitizer should use RIS sample rates when searching for a frequency in autosetup. + +Valid Values: +VI_TRUE (1) - Use RIS sample rates in autosetup +VI_FALSE (0) - Do not use RIS sample rates in autosetup + " + + + Fetch_Backlog + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150084); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Returns the number of samples (NISCOPE_ATTR_POINTS_DONE) that have been acquired but not fetched for the record specified by NISCOPE_ATTR_FETCH_RECORD_NUMBER. + " + + + Fetch_Meas_Number_of_Samples + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150081); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150081 ,propertyValue); + + + Double + none + + + never + "Number of samples to fetch when performing a measurement. Use -1 to fetch the actual record length. +Default Value: -1 + " + + + Fetch_Number_of_Records + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150080); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150080 ,propertyValue); + + + Double + none + + + never + "Number of records to fetch. Use -1 to fetch all configured records. +Default Value: -1 + " + + + Fetch_Offset + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150078); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150078 ,propertyValue); + + + Double + none + + + never + "Offset in samples to start fetching data within each record. The offset is applied relative to NISCOPE_ATTR_FETCH_RELATIVE_TO.The offset can be positive or negative. + +Default Value: 0 + " + + + Fetch_Record_Number + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150079); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150079 ,propertyValue); + + + Double + none + + + never + "Zero-based index of the first record to fetch. Use NISCOPE_FETCH_NUM_RECORDS to set the number of records to fetch. + +Default Value: 0. + " + + + Fetch_Relative_To + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150077); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150077 ,propertyValue); + + + Double + enum + + 388.0 + 481.0 + 477.0 + 482.0 + 483.0 + + + + never + "Position to start fetching within one record. +Default Value: NISCOPE_VAL_PRETRIGGER + " + + + Points_Done + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150082); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Actual number of samples acquired in the record specified by NISCOPE_ATTR_FETCH_RECORD_NUMBER from the NISCOPE_ATTR_FETCH_RELATIVE_TO and NISCOPE_ATTR_FETCH_OFFSET attributes. + " + + + Records_Done + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150083); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Specifies the number of records that have been completely acquired. + " + + + Resolution + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150102); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Indicates the bit width of valid data (as opposed to padding bits) in the acquired waveform. Compare to NISCOPE_ATTR_BINARY_SAMPLE_WIDTH. + " + + + Sample_Mode + Acquisition + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250106); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + enum + + 1.0 + 0.0 + + + + always + "Indicates the sample mode the digitizer is currently using. + " + + + + + abort + Acquisition + Base + MCode + + function abort(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_Abort', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_Abort</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_Abort</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_Abort (ViSession vi);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Aborts an acquisition and returns the digitizer to the Idle state. Call this function if the digitizer times out waiting for a trigger. +</p> +</body> +</html> + + + acquisitionstatus + Acquisition + Base + MCode + + function [AcquisitionStatus] = acquisitionstatus(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +AcquisitionStatus = libpointer('int32Ptr', 0); + +status = calllib(libname, 'niScope_AcquisitionStatus', session, AcquisitionStatus); + +AcquisitionStatus = double(AcquisitionStatus.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_AcquisitionStatus</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_AcquisitionStatus +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_AcquisitionStatus (ViSession vi, ViInt32* status);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Returns status information about the acquisition to the <strong>status</strong> output parameter. +</p> +</body> +</html> + + + commit + Acquisition + Base + MCode + + function commit(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_Commit', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_Commit</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_Commit</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_Commit (ViSession vi); </p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Commits to hardware all the parameter settings associated with the task. +Use this function if you want a parameter change to be immediately reflected in +the hardware. This function is not supported for Traditional NI-DAQ (Legacy) devices.</p> + +</body> +</html> + + + fetch + Acquisition + Base + MCode + + function [Wfm, WfmInfo] = fetch(obj, ChannelList, Timeout, NumSamples, Wfm, WfmInfo) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Wfm = libpointer('doublePtr', Wfm); +WfmInfo = libstruct('niScope_wfmInfo', WfmInfo); + +status = calllib(libname, 'niScope_Fetch', session, ChannelList, Timeout, NumSamples, Wfm, WfmInfo); + +Wfm = double(Wfm.Value); +WfmInfo = WfmInfo; + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_Fetch</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_Fetch</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_Fetch (ViSession vi, ViConstString channelList, ViReal64 timeout, ViInt32 numSamples, ViReal64* wfm, struct niScope_wfmInfo* wfmInfo);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Returns the waveform from a previously initiated acquisition that the digitizer acquires for the specified channel. This function returns scaled voltage waveforms. +</p> +<p class="Body">This function may return multiple waveforms depending on the number of channels, the acquisition type, and the number of records you specify. </p> + + +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Notes</strong>&nbsp;&nbsp;You can use <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_Read.html')">niScope_Read</a> instead of this function. niScope_Read starts an acquisition on all enabled channels, +waits for the acquisition to complete, and returns the waveform for the specified channel. +<p class="Body"> +Some functionality, such as time stamping, is not supported in all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features Supported by Device</a> for more information.</p> </td></tr></table> + + + +</body> +</html> + + + fetchbinary16 + Acquisition + Base + MCode + + function [Wfm, WfmInfo] = fetchbinary16(obj, ChannelList, Timeout, NumSamples, Wfm, WfmInfo) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Wfm = libpointer('int16Ptr', Wfm); +WfmInfo = libstruct('niScope_wfmInfo', WfmInfo); + +status = calllib(libname, 'niScope_FetchBinary16', session, ChannelList, Timeout, NumSamples, Wfm, WfmInfo); + +Wfm = double(Wfm.Value); +WfmInfo = WfmInfo; + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_FetchBinary16</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_FetchBinary16</h1> + + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_FetchBinary16 (ViSession vi, ViConstString channelList, ViReal64 timeout, ViInt32 numSamples, ViInt16* wfm, struct niScope_wfmInfo* wfmInfo);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Retrieves data from a previously initiated acquisition and returns binary 16-bit waveforms. +This function may return multiple waveforms depending on the number of channels, the acquisition type, +and the number of records you specify. +</p> + + + + +<p class="Body">Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Using_Fetch_Functions.html')">Using Fetch Functions</a> for more information on using this function. +</p> +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;Some functionality, such as time stamping, is not supported in all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features Supported by Device</a> for more information. </td></tr></table> + + +</body> +</html> + + + fetchbinary32 + Acquisition + Base + MCode + + function [Wfm, WfmInfo] = fetchbinary32(obj, ChannelList, Timeout, NumSamples, Wfm, WfmInfo) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Wfm = libpointer('int32Ptr', Wfm); +WfmInfo = libstruct('niScope_wfmInfo', WfmInfo); + +status = calllib(libname, 'niScope_FetchBinary32', session, ChannelList, Timeout, NumSamples, Wfm, WfmInfo); + +Wfm = double(Wfm.Value); +WfmInfo = WfmInfo; + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_FetchBinary32</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_FetchBinary32 +</h1> + + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_FetchBinary32 (ViSession vi, ViConstString channelList, ViReal64 timeout, ViInt32 numSamples, ViInt32* wfm, struct niScope_wfmInfo* wfmInfo);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Retrieves data from a previously initiated acquisition and returns binary 32-bit waveforms. This function may return multiple waveforms depending on the number of channels, the acquisition type, and the number of records you specify. +</p> + + + + +<p class="Body">Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Using_Fetch_Functions.html')">Using Fetch Functions</a> for more information on using this function. +</p> +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;Some functionality, such as time stamping, is not supported in all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')"> +Features Supported by Device</a> for more information. </td></tr></table> + + +</body> +</html> + + + fetchbinary8 + Acquisition + Base + MCode + + function [Wfm, WfmInfo] = fetchbinary8(obj, ChannelList, Timeout, NumSamples, Wfm, WfmInfo) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Wfm = libpointer('int8Ptr', Wfm); +WfmInfo = libstruct('niScope_wfmInfo', WfmInfo); + +status = calllib(libname, 'niScope_FetchBinary8', session, ChannelList, Timeout, NumSamples, Wfm, WfmInfo); + +Wfm = double(Wfm.Value); +WfmInfo = WfmInfo; + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_FetchBinary8</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_FetchBinary8</h1> + + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_FetchBinary8 (ViSession vi, ViConstString channelList, ViReal64 timeout, ViInt32 numSamples, ViInt8* wfm, struct niScope_wfmInfo* wfmInfo);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Retrieves data from a previously initiated acquisition and returns binary 8-bit waveforms. This function may return multiple waveforms depending on the number of channels, the acquisition type, and the number of records you specify. +</p> + + +<p class="Body">Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Using_Fetch_Functions.html')">Using Fetch Functions</a> for more information on using this function. +</p> +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;Some functionality, such as time stamping, is not supported in all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')"> +Features Supported by Device</a> for more information. </td></tr></table> + + +</body> +</html> + + + fetchcomplex + Acquisition + Base + MCode + + function [Wfm, WfmInfo] = fetchcomplex(obj, ChannelList, Timeout, NumSamples, Wfm, WfmInfo) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Wfm = libstruct('NIComplexNumber', Wfm); +WfmInfo = libstruct('niScope_wfmInfo', WfmInfo); + +status = calllib(libname, 'niScope_FetchComplex', session, ChannelList, Timeout, NumSamples, Wfm, WfmInfo); + +Wfm = Wfm; +WfmInfo = WfmInfo; + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_FetchComplex</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_FetchComplex</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax"> niScope_FetchComplex ( +ViSession vi, +ViConstString channelList, +ViReal64 timeout, +ViInt32 numSamples, +NIComplexNumber* wfm, +struct niScope_wfmInfo* wfmInfo);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body"> +Retrieves data that the digitizer has acquired from a previously initiated acquisition and returns a one-dimensional array of complex, scaled waveforms. + +</body> +</html> + + + fetchcomplexbinary16 + Acquisition + Base + MCode + + function [Wfm, WfmInfo] = fetchcomplexbinary16(obj, ChannelList, Timeout, NumSamples, Wfm, WfmInfo) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Wfm = libstruct('NIComplexI16', Wfm); +WfmInfo = libstruct('niScope_wfmInfo', WfmInfo); + +status = calllib(libname, 'niScope_FetchComplexBinary16', session, ChannelList, Timeout, NumSamples, Wfm, WfmInfo); + +Wfm = Wfm; +WfmInfo = WfmInfo; + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_FetchComplexBinary16</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_FetchComplexBinary16</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax"> niScope_FetchComplexBinary16 ( +ViSession vi, +ViConstString channelList, +ViReal64 timeout, +ViInt32 numSamples, +NIComplexI16* wfm, +Struct niScope_wfmInfo* wfmInfo);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body"> +Retrieves data from single channels and records. Returns a one-dimensional array of complex binary 16-bit waveforms. + + + +</body> +</html> + + + getnormalizationcoefficients + Acquisition + Base + MCode + + function [numberOfCoefficientSets] = getnormalizationcoefficients(obj, channelList, arraySize, coefficientInfo) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +channelList = [double(channelList) 0]; +numberOfCoefficientSets = libpointer('int32Ptr', 0); + +status = calllib(libname, 'niScope_GetNormalizationCoefficients', session, channelList, arraySize, coefficientInfo, numberOfCoefficientSets); + +numberOfCoefficientSets = double(numberOfCoefficientSets.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetNormalizationCoefficients</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetNormalizationCoefficients</h1> + + + +<p class="syntax">ViStatus _VI_FUNC niScope_GetNormalizationCoefficients (ViSession vi, + ViConstString channelList, + ViInt32 bufferSize, + struct niScope_coefficientInfo coefficientInfo[], + ViInt32* numberOfCoefficientSets); + + + </p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body"> Returns coefficients that can be used to convert binary data to normalized and calibrated data. + </p> + + +<p class="Body"> + Refer to +<a href="Digitizers.chm::/scaling_and_norm_binary_data.html"> +Scaling and Normalization of Binary Data</a> for more information about how to use this function.</p> + +</body> +</html> + + + getscalingcoefficients + Acquisition + Base + MCode + + function [numberOfCoefficientSets] = getscalingcoefficients(obj, channelList, arraySize, coefficientInfo) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +channelList = [double(channelList) 0]; +numberOfCoefficientSets = libpointer('int32Ptr', 0); + +status = calllib(libname, 'niScope_GetScalingCoefficients', session, channelList, arraySize, coefficientInfo, numberOfCoefficientSets); + +numberOfCoefficientSets = double(numberOfCoefficientSets.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetScalingCoefficients</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetScalingCoefficients</h1> + + + +<p class="syntax">ViStatus _VI_FUNC niScope_GetScalingCoefficients (ViSession vi, + ViConstString channelList, + ViInt32 bufferSize, + struct niScope_coefficientInfo coefficientInfo[], + ViInt32* numberOfCoefficientSets);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body"> Returns coefficients that can be used to scale binary data to volts.</p> + + +<p class="Body"> + Refer to +<a href="Digitizers.chm::/scaling_and_norm_binary_data.html"> +Scaling and Normalization of Binary Data</a> for more information about how to use this function.</p> + +</body> +</html> + + + initiateacquisition + Acquisition + Base + MCode + + function initiateacquisition(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_InitiateAcquisition', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_InitiateAcquisition</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_InitiateAcquisition</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_InitiateAcquisition (ViSession vi);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Initiates a waveform acquisition. +</p> +<p class="Body">After calling this function, the digitizer leaves the Idle state and waits for a trigger. +The digitizer acquires a waveform for each channel you enable with <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureVertical.html')"><span class="Monospace">niScope_ConfigureVertical</span></a>. +</p> + +</body> +</html> + + + read + Acquisition + Base + MCode + + function [Wfm, WfmInfo] = read(obj, ChannelList, Timeout, NumSamples, Wfm, WfmInfo) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Wfm = libpointer('doublePtr', Wfm); +WfmInfo = libstruct('niScope_wfmInfo', WfmInfo); + +status = calllib(libname, 'niScope_Read', session, ChannelList, Timeout, NumSamples, Wfm, WfmInfo); + +Wfm = double(Wfm.Value); +WfmInfo = WfmInfo; + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_Read</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_Read</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_Read (ViSession vi, ViConstString channelList, ViReal64 timeout, ViInt32 numSamples, ViReal64* wfm, struct niScope_wfmInfo* wfmInfo);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Initiates an acquisition, waits for it to complete, and retrieves the data. The process is similar to calling <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_InitiateAcquisition.html')"><span class="Monospace">niScope_InitiateAcquisition</span></a>, +<a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_AcquisitionStatus.html')"><span class="Monospace">niScope_AcquisitionStatus</span></a>, and +<a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_Fetch.html')"><span class="Monospace">niScope_Fetch</span></a>. The only difference is that with <span class="Monospace">niScope_Read</span>, you enable all channels specified with <strong>channelList</strong> before the acquisition; in the other method, you enable the channels with <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureVertical.html')"><span class="Monospace">niScope_ConfigureVertical</span></a>. +</p> +<p class="Body">This function may return multiple waveforms depending on the number of channels, the acquisition type, and the number of records you specify. +</p> +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;Some functionality is not supported in all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')"> +Features Supported by Device</a> for more information. </td></tr></table> + + +</body> +</html> + + + + + AcquisitionAdvanced + + + 1 + + + + + + Maximum_Bandwidth + AcquisitionAdvanced + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150321); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150321 , propertyValue); + + + Double + none + + + never + "This property specifies the maximum bandwidth that the device is allowed to consume. + " + + + Preferred_Packet_Size + AcquisitionAdvanced + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150322); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150322 ,propertyValue); + + + Double + none + + + never + "This property specifies the size of (read request|memory write) data payload. Due to alignment of the data buffers, the hardware may not always generate a packet of this size. + " + + + + + + Calibration + + + 1 + + + + + + + calselfcalibrate + Calibration + Base + MCode + + function calselfcalibrate(obj, ChannelList, Option) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_CalSelfCalibrate', session, ChannelList, Option); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_CalSelfCalibrate</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_CalSelfCalibrate</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_CalSelfCalibrate (ViSession sessionHandle, ViConstString channelList, ViInt32 option);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Self-calibrates most NI digitizers, including all SMC-based devices and most Traditional NI-DAQ (Legacy) devices. +To verify that your digitizer supports self-calibration, +refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features Supported by Device</a>. +</p> + +<p class="Body">For SMC-based digitizers, if the self-calibration is performed successfully in a regular session, the +calibration constants are +immediately stored in the self-calibration area of the EEPROM. If the self-calibration is performed in an external +calibration session, the +calibration constants take effect immediately for the duration of the session. However, they are not stored in +the EEPROM until <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_CalEnd.html')"><span class="Monospace">niScope_CalEnd</span></a> is called with <strong>action</strong> set to +<span class="Monospace">NISCOPE_VAL_ACTION_STORE</span> and no errors occur.</p> + + + +</body> +</html> + + + + + Clocking + + + 1 + + + + + + Exported_Sample_Clock_Output_Terminal + Clocking + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150091, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150091 , propertyValue); + + + String + enum + + + + + + + + + + + + + + + + + never + "Exports the sample clock to a specified terminal. " + + + Input_Clock_Source + Clocking + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150002, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150002 , propertyValue); + + + String + enum + + + + + + + + + + + + + never + "Specifies the input source for the PLL reference clock (the 1 MHz to 20 MHz clock on the NI 5122, the 10 MHz clock for the NI 5112/5620/5621/5911) to which the digitizer will be phase-locked; for the NI 5102, this is the source of the board clock. + " + + + Output_Clock_Source + Clocking + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150003, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150003 , propertyValue); + + + String + enum + + + + + + + + + + + never + "Specifies the output source for the 10 MHz clock to which another digitizer's sample clock can be phased-locked. + " + + + PLL_Locked + Clocking + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151303); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151303, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "If TRUE, the PLL has remained locked to the external reference clock since it was last checked. If FALSE, the PLL has become unlocked from the external reference clock since it was last checked. + " + + + Reference_Clock_Rate + Clocking + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150090); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150090 , propertyValue); + + + Double + none + + + never + "If NISCOPE_ATTR_INPUT_CLOCK_SOURCE is an external source, this attribute specifies the frequency of the input, or reference clock, to which the internal sample clock timebase is synchronized. The frequency is in hertz. + " + + + Sample_Clock_Timebase_Divisor + Clocking + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150089); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150089 ,propertyValue); + + + Double + none + + + never + "If NISCOPE_ATTR_SAMP_CLK_TIMEBASE_SRC is an external source, specifies the ratio between the sample clock timebase rate and the actual sample rate, which can be slower. + " + + + Sample_Clock_Timebase_Rate + Clocking + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150088); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150088 , propertyValue); + + + Double + none + + + never + "If NISCOPE_ATTR_SAMP_CLK_TIMEBASE_SRC is an external source, specifies the frequency in hertz of the external clock used as the timebase source. + " + + + Sample_Clock_Timebase_Source + Clocking + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150087, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150087 , propertyValue); + + + String + enum + + + + + + + + + + never + "Specifies the source of the sample clock timebase, which is the timebase used to control waveform sampling. The actual sample rate may be the timebase itself or a divided version of the timebase, depending on the NISCOPE_ATTR_MIN_SAMPLE_RATE (for internal sources) or the NISCOPE_ATTR_SAMP_CLK_TIMEBASE_DIV (for external sources). + " + + + Sync_Pulse_Source + Clocking + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150007, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150007 , propertyValue); + + + String + enum + + + + + + + + + + + + + + + never + "For the NI 5102, specifies the line on which the sample clock is sent or received. For the NI 5112/5620/5621/5911, specifies the line on which the one-time sync pulse is sent or received. This line should be the same for all devices to be synchronized. + " + + + + + + ClockingAdvanced + + + 1 + + + + + + Oscillator_Phase_DAC_Value + ClockingAdvanced + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150105); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150105 ,propertyValue); + + + Double + none + + + never + "Gets or sets the binary phase DAC value that controls the delay added to the Phase Locked Loop (PLL) of the sample clock. Note-if this value is set, sample clock adjust and TClk will not be able to do any sub-sample adjustment of the timebase sample clock. + " + + + + + + Configuration + + + 1 + + + + + + + autosetup + Configuration + Base + MCode + + function autosetup(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_AutoSetup', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_AutoSetup</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_AutoSetup</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_AutoSetup (ViSession vi);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Automatically configures the instrument. + When you call this function, the digitizer senses the input signal and automatically +configures many of the instrument settings. If a signal is detected on a channel, the driver chooses the smallest available vertical range that is larger than the signal range. For example, if the signal is a 1.2&nbsp;V<sub>pk-pk</sub> +sine wave, and the device supports 1&nbsp;V and 2&nbsp;V vertical ranges, the driver will choose the 2&nbsp;V + vertical range for that channel.</p> + + <p class ="body"> + If no signal is found on any analog input channel, a warning is returned, and all channels are enabled. A channel is considered to have a signal present if the signal is at least 10% of the smallest vertical range available for that channel. +</p> +<p class="Body">The following settings are changed: +</p> +<table class="Borderless"> +<tr><td colspan="2"><strong>General</strong></td></tr> +<tr><td>Acquisition mode</td><td>Normal</td></tr> +<tr><td>Reference clock</td><td>Internal</td></tr> +<tr><td colspan="2"><strong>Vertical</strong> +</td></tr> +<tr><td>Vertical coupling</td><td>AC (DC for NI&nbsp;5621)</td></tr> +<tr><td>Vertical bandwidth&nbsp;&nbsp;&nbsp;</td><td>Full</td></tr> +<tr><td>Vertical range</td><td>Changed by auto setup</td></tr> +<tr><td>Vertical offset</td><td>0 V</td></tr> +<tr><td>Probe attenuation</td><td>Unchanged by auto setup</td></tr> +<tr><td>Input impedance</td><td>Unchanged by auto setup</td></tr> +<tr><td colspan="2"><strong>Horizontal</strong> +</td></tr> +<tr><td>Sample rate</td><td>Changed by auto setup</td></tr> +<tr><td>Min record length</td><td>Changed by auto setup</td></tr> +<tr><td>Enforce realtime</td><td>True</td></tr> +<tr><td>Number of Records</td><td>Changed to 1</td></tr> +<tr><td colspan="2"><strong>Triggering</strong> +</td></tr> +<tr><td>Trigger type</td><td>Edge if signal present, otherwise immediate</td></tr> +<tr><td>Trigger channel</td><td>Lowest numbered channel with a signal present</td></tr> +<tr><td>Trigger slope</td><td>Positive</td></tr> +<tr><td>Trigger coupling</td><td>DC</td></tr> +<tr><td>Reference position</td><td>50%</td></tr> +<tr><td>Trigger level</td><td>50% of signal on trigger channel</td></tr> +<tr><td>Trigger delay</td><td>0</td></tr> +<tr><td>Trigger holdoff</td><td>0</td></tr> +<tr><td>Trigger output</td><td>None</td></tr></table> + + +</body> +</html> + + + configureacquisition + Configuration + Base + MCode + + function configureacquisition(obj, AcquisitionType) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ConfigureAcquisition', session, AcquisitionType); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureAcquisition</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureAcquisition +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureAcquisition(ViSession vi, ViInt32 acquisitionType);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Configures how the digitizer acquires data and fills the waveform record.</p> + +</body> +</html> + + + + + ConfigurationFunctionsActualValues + + + 1 + + + + + + + actualmeaswfmsize + ConfigurationFunctionsActualValues + Base + MCode + + function [MeasWaveformSize] = actualmeaswfmsize(obj, ArrayMeasFunction) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +MeasWaveformSize = libpointer('int32Ptr', 0); + +status = calllib(libname, 'niScope_ActualMeasWfmSize', session, ArrayMeasFunction, MeasWaveformSize); + +MeasWaveformSize = double(MeasWaveformSize.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ActualMeasWfmSize</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ActualMeasWfmSize +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ActualMeasWfmSize(ViSession vi, ViInt32 arrayMeasFunction, ViInt32* measWfmSize);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Returns the total available size of an array measurement acquisition. +</p> +</body> +</html> + + + actualnumwfms + ConfigurationFunctionsActualValues + Base + MCode + + function [NumWfms] = actualnumwfms(obj, ChannelList) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +NumWfms = libpointer('int32Ptr', 0); + +status = calllib(libname, 'niScope_ActualNumWfms', session, ChannelList, NumWfms); + +NumWfms = double(NumWfms.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ActualNumWfms</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ActualNumWfms</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ActualNumWfms (ViSession vi, ViConstString channelList, ViInt32* numWfms);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Helps you to declare appropriately sized waveforms. NI-SCOPE handles the channel list parsing for you. +</p> +</body> +</html> + + + actualrecordlength + ConfigurationFunctionsActualValues + Base + MCode + + function [RecordLength] = actualrecordlength(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +RecordLength = libpointer('int32Ptr', 0); + +status = calllib(libname, 'niScope_ActualRecordLength', session, RecordLength); + +RecordLength = double(RecordLength.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ActualRecordLength</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ActualRecordLength +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ActualRecordLength (ViSession vi, ViInt32* recordLength);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Returns the actual number of points the digitizer acquires for each channel. After configuring the digitizer for an acquisition, call this function to determine the size of the waveforms that the digitizer acquires. The value is equal to or greater than the minimum number of points specified in any of the Configure Horizontal functions.</p> + + + +</body> +</html> + + + samplemode + ConfigurationFunctionsActualValues + Base + MCode + + function [SampleMode] = samplemode(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +SampleMode = libpointer('int32Ptr', 0); + +status = calllib(libname, 'niScope_SampleMode', session, SampleMode); + +SampleMode = double(SampleMode.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_SampleMode</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_SampleMode +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_SampleMode (ViSession vi, ViInt32* sampleMode);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Returns the sample mode the digitizer is currently using. +</p> + +</body> +</html> + + + samplerate + ConfigurationFunctionsActualValues + Base + MCode + + function [SampleRate] = samplerate(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +SampleRate = libpointer('doublePtr', 0); + +status = calllib(libname, 'niScope_SampleRate', session, SampleRate); + +SampleRate = double(SampleRate.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_SampleRate</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_SampleRate</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_SampleRate (ViSession vi, ViReal64* actualSampleRate);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Returns the effective sample rate, in samples per second, of the acquired waveform using the current configuration. +Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Horizontal_Parameters.html')">Coercions of Horizontal Parameters</a> for more information about sample rate coercion.</p> + +</body> +</html> + + + + + ConfigurationFunctionsHorizontal + + + 1 + + + + + + + configurehorizontaltiming + ConfigurationFunctionsHorizontal + Base + MCode + + function configurehorizontaltiming(obj, MinSampleRate, MinNumPts, RefPosition, NumRecords, EnforceRealtime) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ConfigureHorizontalTiming', session, MinSampleRate, MinNumPts, RefPosition, NumRecords, EnforceRealtime); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ConfigureHorizontalTiming</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureHorizontalTiming</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureHorizontalTiming (ViSession vi, ViReal64 minSampleRate, ViInt32 minNumPts, ViReal64 refPosition, ViInt32 numRecords, ViBoolean enforceRealtime);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Configures the common properties of the horizontal subsystem for a multirecord acquisition in terms of minimum sample rate. +</p> +</body> +</html> + + + + + ConfigurationFunctionsOnboardSignalProcessing + + + 1 + + + + + + + configureequalizationfiltercoefficients + ConfigurationFunctionsOnboardSignalProcessing + Base + MCode + + function configureequalizationfiltercoefficients(obj, ChannelList, NumberOfCoefficients, Coefficients) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_ConfigureEqualizationFilterCoefficients', session, ChannelList, NumberOfCoefficients, Coefficients); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureEqualizationFilterCoefficients</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureEqualizationFilterCoefficients +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus _VI_FUNC niScope_ConfigureEqualizationFilterCoefficients (ViSession vi, + ViConstString channel, + ViInt32 numberOfCoefficients, + ViReal64* coefficients); +</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Configures the custom coefficients for the equalization FIR filter on the device. +This filter is designed to compensate the input signal for artifacts introduced to the signal outside + of the digitizer. Because this filter is a generic FIR filter, any coefficients are valid. + Coefficient values should be between +1 and &#8211;1.</p> + +</body> +</html> + + + getfrequencyresponse + ConfigurationFunctionsOnboardSignalProcessing + Base + MCode + + function [numberOfFrequencies] = getfrequencyresponse(obj, channel, bufferSize, frequencies, amplitudes, phases) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +channel = [double(channel) 0]; +numberOfFrequencies = libpointer('int32Ptr', 0); + +status = calllib(libname, 'niScope_GetFrequencyResponse', session, channel, bufferSize, frequencies, amplitudes, phases, numberOfFrequencies); + +numberOfFrequencies = double(numberOfFrequencies.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetFrequencyResponse</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetFrequencyResponse</h1> + + + +<p class="syntax">ViStatus _VI_FUNC niScope_GetFrequencyResponse (ViSession vi, + ViConstString channelName, + ViInt32 bufferSize, + ViReal64 frequencies[], + ViReal64 amplitudes[], + ViReal64 phases[], + ViInt32* numberOfFrequencies);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Gets the frequency response of the digitizer for the current configurations of the channel attributes. Not all digitizers support this function. + </p> + +</body> +</html> + + + + + ConfigurationFunctionsSetGetCheckAttributeCheckAttribute + + + 1 + + + + + + + checkattributeviboolean + ConfigurationFunctionsSetGetCheckAttributeCheckAttribute + Base + MCode + + function checkattributeviboolean(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_CheckAttributeViBoolean', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_CheckAttributeViBoolean</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_CheckAttributeViBoolean +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_CheckAttributeViBoolean (ViSession vi, ViConstString channelList, ViAttr attributeID, ViBoolean value);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Verifies the validity of a value you specify for a ViBoolean attribute. +</p> +</body> +</html> + + + checkattributeviint32 + ConfigurationFunctionsSetGetCheckAttributeCheckAttribute + Base + MCode + + function checkattributeviint32(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_CheckAttributeViInt32', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_CheckAttributeViInt32</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_CheckAttributeViInt32 +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_CheckAttributeViInt32 (ViSession vi, ViConstString channelList, ViAttr attributeID, ViInt32 value);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Verifies the validity of a value you specify for a ViInt32 attribute. +</p> +</body> +</html> + + + checkattributeviint64 + ConfigurationFunctionsSetGetCheckAttributeCheckAttribute + Base + MCode + + function checkattributeviint64(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_CheckAttributeViInt64', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_CheckAttributeViInt32</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_CheckAttributeViInt32 +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_CheckAttributeViInt32 (ViSession vi, ViConstString channelList, ViAttr attributeID, ViInt32 value);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Verifies the validity of a value you specify for a ViInt32 attribute. +</p> +</body> +</html> + + + checkattributevireal64 + ConfigurationFunctionsSetGetCheckAttributeCheckAttribute + Base + MCode + + function checkattributevireal64(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_CheckAttributeViReal64', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_CheckAttributeViReal64</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_CheckAttributeViReal64</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_CheckAttributeViReal64 (ViSession vi, ViConstString channelList, ViAttr attributeID, ViReal64 value);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Verifies the validity of a value you specify for a ViReal64 attribute. +</p> +</body> +</html> + + + checkattributevisession + ConfigurationFunctionsSetGetCheckAttributeCheckAttribute + Base + MCode + + function checkattributevisession(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_CheckAttributeViSession', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_CheckAttributeViSession</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_CheckAttributeViSession</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_CheckAttributeViSession (ViSession vi, ViConstString channelList, ViAttr attributeID, ViSession value);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Verifies the validity of a value you specify for a ViSession attribute.</p> + +</body> +</html> + + + checkattributevistring + ConfigurationFunctionsSetGetCheckAttributeCheckAttribute + Base + MCode + + function checkattributevistring(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Value = [double(Value) 0]; + +status = calllib(libname, 'niScope_CheckAttributeViString', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_CheckAttributeViString</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_CheckAttributeViString +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_CheckAttributeViString (ViSession vi, ViConstString channelList, ViAttr attributeID, ViConstString value);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Verifies the validity of a value you specify for a ViString attribute. +</p> +</body> +</html> + + + + + ConfigurationFunctionsSetGetCheckAttributeGetAttribute + + + 1 + + + + + + + getattributeviboolean + ConfigurationFunctionsSetGetCheckAttributeGetAttribute + Base + MCode + + function [Value] = getattributeviboolean(obj, ChannelList, AttributeID) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Value = libpointer('uint16Ptr', 0); + +status = calllib(libname, 'niScope_GetAttributeViBoolean', session, ChannelList, AttributeID, Value); + +Value = double(Value.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetAttributeViBoolean</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetAttributeViBoolean +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax"> +ViStatus niScope_GetAttributeViBoolean (ViSession vi, ViConstString channelList, ViAttr attributeID, ViBoolean* value);</p> + +<h2 class="purpose">Purpose</h2> +<p class="Body">Queries the value of a ViBoolean attribute. You can use this function to get the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid. +</li> +</ul> + +</body> +</html> + + + getattributeviint32 + ConfigurationFunctionsSetGetCheckAttributeGetAttribute + Base + MCode + + function [Value] = getattributeviint32(obj, ChannelList, AttributeID) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Value = libpointer('int32Ptr', 0); + +status = calllib(libname, 'niScope_GetAttributeViInt32', session, ChannelList, AttributeID, Value); + +Value = double(Value.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetAttributeViInt32</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetAttributeViInt32</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_GetAttributeViInt32 (ViSession vi, ViConstString channelList, ViAttr attributeID, ViInt32* value);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Queries the value of a ViInt32 attribute. You can use this function to + get the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an + instrument state, this function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid. +</li> +</ul> + +</body> +</html> + + + getattributeviint64 + ConfigurationFunctionsSetGetCheckAttributeGetAttribute + Base + MCode + + function [Value] = getattributeviint64(obj, ChannelList, AttributeID) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Value = libpointer('int64Ptr', 0); + +status = calllib(libname, 'niScope_GetAttributeViInt64', session, ChannelList, AttributeID, Value); + +Value = double(Value.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetAttributeViInt32</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetAttributeViInt32</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_GetAttributeViInt32 (ViSession vi, ViConstString channelList, ViAttr attributeID, ViInt32* value);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Queries the value of a ViInt32 attribute. You can use this function to + get the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an + instrument state, this function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid. +</li> +</ul> + +</body> +</html> + + + getattributevireal64 + ConfigurationFunctionsSetGetCheckAttributeGetAttribute + Base + MCode + + function [Value] = getattributevireal64(obj, ChannelList, AttributeID) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Value = libpointer('doublePtr', 0); + +status = calllib(libname, 'niScope_GetAttributeViReal64', session, ChannelList, AttributeID, Value); + +Value = double(Value.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetAttributeViReal64</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetAttributeViReal64 +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_GetAttributeViReal64 (ViSession vi, ViConstString channelList, ViAttr attributeID, ViReal64* value);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Queries the value of a ViReal64 attribute. You can use this function to get + the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, + this function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid. +</li> +</ul> + +</body> +</html> + + + getattributevisession + ConfigurationFunctionsSetGetCheckAttributeGetAttribute + Base + MCode + + function [Value] = getattributevisession(obj, ChannelList, AttributeID) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Value = libpointer('uint32Ptr', 0); + +status = calllib(libname, 'niScope_GetAttributeViSession', session, ChannelList, AttributeID, Value); + +Value = double(Value.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_GetAttributeViSession</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetAttributeViSession</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_GetAttributeViSession (ViSession vi, ViConstString channelList, ViAttr attributeID, ViSession* value);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Queries the value of a ViSession attribute. You can use this function to get the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid. +</li> +</ul> + +</body> +</html> + + + getattributevistring + ConfigurationFunctionsSetGetCheckAttributeGetAttribute + Base + MCode + + function [Value] = getattributevistring(obj, ChannelList, AttributeID, BufSize) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Value = libpointer('int8Ptr', repmat(10, 1, 512)); + +status = calllib(libname, 'niScope_GetAttributeViString', session, ChannelList, AttributeID, BufSize, Value); + +Value = strtrim(char(Value.Value)); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetAttributeViString</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetAttributeViString</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_GetAttributeViString (ViSession vi, ViConstString channelList, ViAttr attributeID, ViInt32 bufSize, ViChar value[]);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Queries the value of a ViString attribute. You can use this function to get the +values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this +function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid. +</li> +</ul> + +<p class="Body">You must provide a ViChar array to serve as a buffer for the value. You pass the +number of bytes in the buffer as the <strong>bufSize</strong>. If the current value of the attribute, +including the terminating NUL byte, is larger than the size you indicate in the <strong>bufSize</strong>, +the function copies (<strong>bufSize</strong> &#8211; 1) bytes into the buffer, places an ASCII NUL byte at the end of +the buffer, and returns the <strong>bufSize</strong> you must pass to get the entire value. For example, if the value +is 123456 and the <strong>bufSize</strong> is 4, the +function places 123 into the buffer and returns 7. If you want to +call this function just to get the required buffer size, you can pass 0 for the +<strong>bufSize</strong> and <span class="Monospace">VI_NULL</span> for the <strong>value</strong>. + +</p> +</body> +</html> + + + + + ConfigurationFunctionsSetGetCheckAttributeSetAttribute + + + 1 + + + + + + + setattributeviboolean + ConfigurationFunctionsSetGetCheckAttributeSetAttribute + Base + MCode + + function setattributeviboolean(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_SetAttributeViBoolean', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_SetAttributeViBoolean</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_SetAttributeViBoolean +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_SetAttributeViBoolean (ViSession vi, ViConstString channelList, ViAttr attributeID, ViBoolean value);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Sets the value of a ViBoolean attribute. This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid or is different than the value you specify. +</li> +</ul> + +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;NI-SCOPE contains high-level functions that set most of the instrument attributes. Use the high-level driver functions as much as possible because they handle order dependencies and multithread locking for you. In addition, the high-level functions perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the SetAttribute functions, the functions check the instrument status after each call. Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O. </td></tr></table> + + +</body> +</html> + + + setattributeviint32 + ConfigurationFunctionsSetGetCheckAttributeSetAttribute + Base + MCode + + function setattributeviint32(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_SetAttributeViInt32', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_SetAttributeViInt32</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_SetAttributeViInt32 +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_SetAttributeViInt32 (ViSession vi, ViConstString channelList, ViAttr attributeID, ViInt32 value);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Sets the value of a ViInt32 attribute. This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid or is different than the value you specify. +</li> +</ul> + +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;NI-SCOPE contains high-level functions that set most of the instrument attributes. Use the high-level functions as much as possible because they handle order dependencies and multithread locking for you. In addition, high-level functions perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute functions, the functions check the instrument status after each call. Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O. </td></tr></table> + + + +</body> +</html> + + + setattributeviint64 + ConfigurationFunctionsSetGetCheckAttributeSetAttribute + Base + MCode + + function setattributeviint64(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_SetAttributeViInt64', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_SetAttributeViInt32</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_SetAttributeViInt32 +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_SetAttributeViInt32 (ViSession vi, ViConstString channelList, ViAttr attributeID, ViInt32 value);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Sets the value of a ViInt32 attribute. This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid or is different than the value you specify. +</li> +</ul> + +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;NI-SCOPE contains high-level functions that set most of the instrument attributes. Use the high-level functions as much as possible because they handle order dependencies and multithread locking for you. In addition, high-level functions perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute functions, the functions check the instrument status after each call. Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O. </td></tr></table> + + + +</body> +</html> + + + setattributevireal64 + ConfigurationFunctionsSetGetCheckAttributeSetAttribute + Base + MCode + + function setattributevireal64(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_SetAttributeViReal64', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_SetAttributeViReal64</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_SetAttributeViReal64 +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_SetAttributeViReal64 (ViSession vi, ViConstString channelList, ViAttr attributeID, ViReal64 value);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Sets the value of a ViReal64 attribute. This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid or is different than the value you specify. +</li> +</ul> + +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;NI-SCOPE contains high-level functions that set most of the instrument attributes. Use the high-level driver functions as much as possible because they handle order dependencies and multithread locking for you. In addition, the high-level functions perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute functions, the functions check the instrument status after each call. Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O. </td></tr></table> + + + +</body> +</html> + + + setattributevisession + ConfigurationFunctionsSetGetCheckAttributeSetAttribute + Base + MCode + + function setattributevisession(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_SetAttributeViSession', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_SetAttributeViSession</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_SetAttributeViSession</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_SetAttributeViSession (ViSession vi, ViConstString channelList, ViAttr attributeID, ViSession value);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Sets the value of a ViSession attribute. This is a low-level function that you can use to set the values of instrument-specific attributes and inherent IVI attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid or is different than the value you specify. +</li> +</ul> + +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;NI-SCOPE contains high-level functions that set most of the instrument attributes. Use the high-level driver functions as much as possible because they handle order dependencies and multithread locking for you. In addition, the high-level functions perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the Set Attribute functions, the functions check the instrument status after each call. Also, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O. </td></tr></table> + + +</body> +</html> + + + setattributevistring + ConfigurationFunctionsSetGetCheckAttributeSetAttribute + Base + MCode + + function setattributevistring(obj, ChannelList, AttributeID, Value) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Value = [double(Value) 0]; + +status = calllib(libname, 'niScope_SetAttributeViString', session, ChannelList, AttributeID, Value); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_SetAttributeViString</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_SetAttributeViString +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_SetAttributeViString (ViSession vi, ViConstString channelList, ViAttr attributeID, ViConstString value);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Sets the value of a ViString attribute. +</p> +<p class="Body">This is a low-level function that you can use to set the values of +instrument-specific attributes and inherent IVI attributes. +If the attribute represents an instrument state, this function performs instrument I/O in +the following cases: +</p> +<ul> + +<li>State caching is disabled for the entire session or for the particular attribute. +</li> +<li>State caching is enabled and the currently cached value is invalid or is different than the value you specify. +</li> +</ul> + +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note +</strong>&nbsp;&nbsp;NI-SCOPE contains high-level functions that set most of the instrument +attributes. Use the high-level driver functions as much as possible because they handle +order dependencies and multithread locking for you. In addition, the high-level functions +perform status checking only after setting all of the attributes. In contrast, when you set +multiple attributes using the SetAttribute functions, the functions check the instrument +status after each call. Also, when state caching is enabled, the high-level functions that +configure multiple attributes perform instrument I/O only for the attributes whose value you +change. Thus, you can safely call the high-level functions without the penalty of redundant +instrument I/O. </td></tr></table> + +</body> +</html> + + + + + ConfigurationFunctionsSynchronization + + + 1 + + + + + + + adjustsampleclockrelativedelay + ConfigurationFunctionsSynchronization + Base + MCode + + function adjustsampleclockrelativedelay(obj, Delay) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_AdjustSampleClockRelativeDelay', session, Delay); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_AdjustSampleClockRelativeDelay</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_AdjustSampleClockRelativeDelay</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_AdjustSampleClockRelativeDelay(ViSession +vi, ViReal64 delay);</p> + +<h2 class="purpose">Purpose</h2> +<p class="Body">Configures the relative sample clock delay (in seconds) when using the internal clock. Each time this function is called, the sample clock is delayed from the reference clock by the specified amount of time.</p> + +</body> +</html> + + + configureclock + ConfigurationFunctionsSynchronization + Base + MCode + + function configureclock(obj, InputClockSource, OutputClockSource, ClockSyncPulseSource, MasterEnabled) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +InputClockSource = [double(InputClockSource) 0]; +OutputClockSource = [double(OutputClockSource) 0]; +ClockSyncPulseSource = [double(ClockSyncPulseSource) 0]; + +status = calllib(libname, 'niScope_ConfigureClock', session, InputClockSource, OutputClockSource, ClockSyncPulseSource, MasterEnabled); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureClock</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureClock</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureClock (ViSession vi, ViConstString inputClockSource, ViConstString outputClockSource, ViConstString clockSyncPulseSource, ViBoolean masterEnabled);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Configures the attributes for synchronizing the digitizer to a reference or sending the digitizer's reference clock output to be used as a synchronizing clock for other digitizers.</p> +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp;Some features are not supported by all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features Supported by Device</a> for more information.</td></tr></table> + +</body> +</html> + + + configuretriggeroutput + ConfigurationFunctionsSynchronization + Base + MCode + + function configuretriggeroutput(obj, TriggerEvent, TriggerOutput) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +TriggerOutput = [double(TriggerOutput) 0]; + +status = calllib(libname, 'niScope_ConfigureTriggerOutput', session, TriggerEvent, TriggerOutput); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureTriggerOutput</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTriggerOutput +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureTriggerOutput (ViSession vi, ViInt32 triggerEvent, ViConstString triggerOutput);</p> + + +<h2 class="purpose">Purpose</h2> +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp;This function is obsolete. Consider using <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ExportSignal.html')"><span class="Monospace">niScope_ExportSignal</span></a> instead.</td></tr></table> + +<p class="Body">Configures the digitizer to generate a signal pulse that other digitizers can detect when configured for digital triggering. </p> + + +<p class="Body"> +For Traditional NI-DAQ devices, exported signals are still present in the route after the session is closed. +You must clear the route before closing the session, or call <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_reset.html')"><span class="Monospace">niScope_reset</span></a>.</p> + +<p class = "body"> + To clear the route, call this function again and route NISCOPE_VAL_NONE + to the line that you had exported. + +For example, if you originally called this function with the trigger event NISCOPE_VAL_STOP_TRIGGER_EVENT + routed to the trigger output NISCOPE_VAL_RTSI_0, +you would call this function again with NISCOPE_VAL_NONE routed to +NISCOPE_VAL_RTSI_0 to clear the route.</P> + +</body> +</html> + + + exportsignal + ConfigurationFunctionsSynchronization + Base + MCode + + function exportsignal(obj, Signal, SignalIdentifier, OutputTerminal) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +SignalIdentifier = [double(SignalIdentifier) 0]; +OutputTerminal = [double(OutputTerminal) 0]; + +status = calllib(libname, 'niScope_ExportSignal', session, Signal, SignalIdentifier, OutputTerminal); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ExportSignal</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ExportSignal</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ExportSignal (ViSession vi, + ViInt32 signal, + ViConstString signalIdentifier, + ViConstString outputTerminal);</p> + + +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp;This function replaces <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureTriggerOutput.html')"><span class="Monospace">niScope_ConfigureTriggerOutput</span></a>. +</td></tr></table> +<p class="Body">Configures the digitizer to generate a signal that other devices can detect +when configured for digital triggering or sharing clocks. The <strong>signal</strong> parameter +specifies what condition causes the digitizer to generate the signal. +The <strong>outputTerminal</strong> parameter specifies where to send the signal on the hardware +(such as a PFI connector or RTSI line).</p> + + <p class ="Body">In cases where multiple instances of a particular signal exist, use the <strong>signalIdentifier</strong> input to specify + which instance to control. For normal signals, only one instance exists and you should leave + this parameter set to the empty string. You can call this function multiple times and set each available line + to a different signal.</p> +<p class ="Body"> To unprogram a specific line on device, call this function with +the signal you no longer want to export and +set <strong>outputTerminal</strong> to <span class="Monospace">NISCOPE_VAL_NONE</span>.</p> + + +</body> +</html> + + + + + ConfigurationFunctionsTrigger + + + 1 + + + + + + + configuretriggerdigital + ConfigurationFunctionsTrigger + Base + MCode + + function configuretriggerdigital(obj, TriggerSource, Slope, Holdoff, Delay) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +TriggerSource = [double(TriggerSource) 0]; + +status = calllib(libname, 'niScope_ConfigureTriggerDigital', session, TriggerSource, Slope, Holdoff, Delay); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ConfigureTriggerDigital</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTriggerDigital</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureTriggerDigital (ViSession vi, ViConstString triggerSource, ViInt32 slope, ViReal64 holdoff, ViReal64 delay);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Configures the common properties of a digital trigger. +</p> + + +<p class="Body"> + +When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_ACQ_ARM_SOURCE.html')"><span class="Monospace">NISCOPE_ATTR_ACQ_ARM_SOURCE</span></a> (Start Trigger Source) attribute. The default is immediate. Upon receiving the start trigger the digitizer begins sampling pretrigger points. After the digitizer finishes sampling pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a function such as this one. Upon receiving the reference trigger the digitizer finishes the acquisition after completing posttrigger sampling. With each Configure Trigger function, you specify configuration parameters such as the trigger source and the amount of trigger delay. +</p> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Notes</strong>&nbsp;&nbsp;For multirecord acquisitions, all records after the first record are started by using the Advance Trigger Source. The default is immediate. + +<p class="Body">You can adjust the amount of pre-trigger and post-trigger +samples using the reference position parameter on the <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureHorizontalTiming.html')"><span class="Monospace">niScope_ConfigureHorizontalTiming</span></a> function. +The default is half of the record length.</p> + + +<p class="Body">Some features are not supported by all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features +Supported by Device</a> for more information.</p> +</td></tr></table> + + + + +</body> +</html> + + + configuretriggeredge + ConfigurationFunctionsTrigger + Base + MCode + + function configuretriggeredge(obj, TriggerSource, Level, Slope, TriggerCoupling, Holdoff, Delay) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +TriggerSource = [double(TriggerSource) 0]; + +status = calllib(libname, 'niScope_ConfigureTriggerEdge', session, TriggerSource, Level, Slope, TriggerCoupling, Holdoff, Delay); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ConfigureTriggerEdge</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTriggerEdge +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureTriggerEdge (ViSession vi, ViConstString triggerSource, ViReal64 level, ViInt32 slope, ViInt32 triggerCoupling, ViReal64 holdoff, ViReal64 delay);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Configures common properties for analog edge triggering. +</p> + + + +<p class="Body"> + +When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_ACQ_ARM_SOURCE.html')"><span class="Monospace">NISCOPE_ATTR_ACQ_ARM_SOURCE</span></a> (Start Trigger Source) attribute. The default is immediate. Upon receiving the start trigger the digitizer begins sampling pretrigger points. After the digitizer finishes sampling pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a function such as this one. Upon receiving the reference trigger the digitizer finishes the acquisition after completing posttrigger sampling. With each Configure Trigger function, you specify configuration parameters such as the trigger source and the amount of trigger delay. +</p> +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td> +<strong>Note</strong>&nbsp;&nbsp;Some features are not supported by all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features Supported by Device</a> for more information. </td></tr></table> + +</body> +</html> + + + configuretriggerhysteresis + ConfigurationFunctionsTrigger + Base + MCode + + function configuretriggerhysteresis(obj, TriggerSource, Level, Hysteresis, Slope, TriggerCoupling, Holdoff, Delay) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +TriggerSource = [double(TriggerSource) 0]; + +status = calllib(libname, 'niScope_ConfigureTriggerHysteresis', session, TriggerSource, Level, Hysteresis, Slope, TriggerCoupling, Holdoff, Delay); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ConfigureTriggerHysteresis</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTriggerHysteresis</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureTriggerHysteresis (ViSession vi, ViConstString triggerSource, ViReal64 level, ViReal64 hysteresis, ViInt32 slope, ViInt32 triggerCoupling, ViReal64 holdoff, ViReal64 delay);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Configures common properties for analog hysteresis triggering. This kind of trigger specifies an additional value, specified in the <strong>hysteresis</strong> parameter, that a signal must pass through before a trigger can occur. This additional value acts as a kind of buffer zone that keeps noise from triggering an acquisition. +</p> + + +<p class="Body"> + +When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_ACQ_ARM_SOURCE.html')"><span class="Monospace">NISCOPE_ATTR_ACQ_ARM_SOURCE</span> (Start Trigger Source)</a>. The default is immediate. Upon receiving the start trigger the digitizer begins sampling pretrigger points. After the digitizer finishes sampling pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a function such as this one. Upon receiving the reference trigger the digitizer finishes the acquisition after completing posttrigger sampling. With each Configure Trigger function, you specify configuration parameters such as the trigger source and the amount of trigger delay. +</p> +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td> +<strong>Note</strong>&nbsp;&nbsp;Some features are not supported by all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features Supported by Device</a> for more information. </td></tr></table> + + + +</body> +</html> + + + configuretriggerimmediate + ConfigurationFunctionsTrigger + Base + MCode + + function configuretriggerimmediate(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ConfigureTriggerImmediate', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ConfigureTriggerImmediate</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTriggerImmediate +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureTriggerImmediate (ViSession vi);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Configures common properties for immediate triggering. Immediate triggering means the digitizer triggers itself. +</p> + + +<p class="Body">When you initiate an acquisition, the digitizer waits for a trigger. You specify the type of trigger that the digitizer waits for with a Configure Trigger function, such as <span class="Monospace">niScope_ConfigureTriggerImmediate</span>. +</p> +</body> +</html> + + + configuretriggersoftware + ConfigurationFunctionsTrigger + Base + MCode + + function configuretriggersoftware(obj, Holdoff, Delay) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ConfigureTriggerSoftware', session, Holdoff, Delay); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ConfigureTriggerSoftware</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTriggerSoftware +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureTriggerSoftware (ViSession vi, ViReal64 holdoff, ViReal64 delay);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Configures common properties for software triggering. +</p> + + + + +<p class="Body"> + +When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the +<a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_ACQ_ARM_SOURCE.html')"><span class="Monospace">NISCOPE_ATTR_ACQ_ARM_SOURCE</span></a> +(Start Trigger Source) attribute. The default is immediate. Upon receiving the start trigger +the digitizer begins sampling pretrigger points. After the digitizer finishes sampling +pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a +function such as this one. Upon receiving the reference trigger the digitizer finishes the +acquisition after completing posttrigger sampling. With each Configure Trigger function, you +specify configuration parameters such as the trigger source and the amount of trigger delay. </P> +<p class="Body"> +To trigger the acquisition, use <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_SendSoftwareTriggerEdge.html')"><span class="Monospace">niScope_SendSoftwareTriggerEdge</span></a>. +</p> +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp; +Some features are not supported by all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features Supported by Device</a> for more information. </td></tr></table> + +</body> +</html> + + + configuretriggervideo + ConfigurationFunctionsTrigger + Base + MCode + + function configuretriggervideo(obj, TriggerSource, EnableDCRestore, SignalFormat, Event, LineNumber, Polarity, TriggerCoupling, Holdoff, Delay) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +TriggerSource = [double(TriggerSource) 0]; + +status = calllib(libname, 'niScope_ConfigureTriggerVideo', session, TriggerSource, EnableDCRestore, SignalFormat, Event, LineNumber, Polarity, TriggerCoupling, Holdoff, Delay); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ConfigureTriggerVideo</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTriggerVideo</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureTriggerVideo (ViSession vi, ViConstString triggerSource, + ViBoolean enableDCRestore, + ViInt32 signalFormat, + ViInt32 event, + ViInt32 lineNumber, + ViInt32 polarity, + ViInt32 triggerCoupling, + ViReal64 holdoff, + ViReal64 delay); +</p> + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Configures the common properties for video triggering, including the signal format, TV event, line number, polarity, and enable DC restore. A video trigger occurs when the digitizer finds a valid video signal sync. +</p> + + + + +<p class="Body"> + +When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_ACQ_ARM_SOURCE.html')"><span class="Monospace">NISCOPE_ATTR_ACQ_ARM_SOURCE</span></a> (Start Trigger Source) attribute. The default is immediate. Upon receiving the start trigger the digitizer begins sampling pretrigger points. After the digitizer finishes sampling pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a function such as this one. Upon receiving the reference trigger the digitizer finishes the acquisition after completing posttrigger sampling. With each Configure Trigger function, you specify configuration parameters such as the trigger source and the amount of trigger delay. +</p> +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td> +<strong>Note</strong>&nbsp;&nbsp;Some features are not supported by all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features Supported by Device</a> for more information. </td></tr></table> + + + +</body> +</html> + + + configuretriggerwindow + ConfigurationFunctionsTrigger + Base + MCode + + function configuretriggerwindow(obj, TriggerSource, LowLevel, HighLevel, WindowMode, TriggerCoupling, Holdoff, Delay) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +TriggerSource = [double(TriggerSource) 0]; + +status = calllib(libname, 'niScope_ConfigureTriggerWindow', session, TriggerSource, LowLevel, HighLevel, WindowMode, TriggerCoupling, Holdoff, Delay); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ConfigureTriggerWindow</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTriggerWindow</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureTriggerWindow (ViSession vi, ViConstString triggerSource, ViReal64 lowLevel, ViReal64 highLevel, ViInt32 windowMode, ViInt32 triggerCoupling, ViReal64 holdoff, ViReal64 delay);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Configures common properties for analog window triggering. A window trigger occurs when a signal enters or leaves a window you specify with the <strong>high level</strong> or <strong>low level</strong> parameters. +</p> + + +<p class="Body"> + +When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the +<a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_ACQ_ARM_SOURCE.html')"><span class="Monospace">NISCOPE_ATTR_ACQ_ARM_SOURCE</span></a> +(Start Trigger Source) attribute. The default is immediate. Upon receiving the start trigger +the digitizer begins sampling pretrigger points. After the digitizer finishes sampling +pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a +function such as this one. Upon receiving the reference trigger the digitizer finishes the +acquisition after completing posttrigger sampling. With each Configure Trigger function, you +specify configuration parameters such as the trigger source and the amount of trigger delay. </P> +<p class="Body"> +To trigger the acquisition, use <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_SendSoftwareTriggerEdge.html')"><span class="Monospace">niScope_SendSoftwareTriggerEdge</span></a>. +</p> + +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp; +Some features are not supported by all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features +Supported by Device</a> for more information. </td></tr></table> + + + + +</body> +</html> + + + sendsoftwaretriggeredge + ConfigurationFunctionsTrigger + Base + MCode + + function sendsoftwaretriggeredge(obj, WhichTrigger) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_SendSoftwareTriggerEdge', session, WhichTrigger); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_SendSoftwareTriggerEdge</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_SendSoftwareTriggerEdge</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_SendSoftwareTriggerEdge (ViSession vi, + ViInt32 whichTrigger);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Sends the selected trigger to the digitizer. Call this function if you +called <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureTriggerSoftware.html')"><span class="Monospace">niScope_ConfigureTriggerSoftware</span></a> + when you want the Reference trigger to occur. You can also call this function to override a misused edge, digital, + or hysteresis trigger. If you have configured +<a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_ACQ_ARM_SOURCE.html')"><span class="Monospace">NISCOPE_ATTR_ACQ_ARM_SOURCE</span></a>, <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_ARM_REF_TRIG_SRC.html')"> +<span class="Monospace">NISCOPE_ATTR_ARM_REF_TRIG_SRC</span></a>, or <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_ADV_TRIG_SRC.html')"><span class="Monospace">NISCOPE_ATTR_ADV_TRIG_SRC</span></a>, call + this function when you want to send the corresponding trigger to the digitizer. +</p> +</body> +</html> + + + + + ConfigurationFunctionsVertical + + + 1 + + + + + + + configurechancharacteristics + ConfigurationFunctionsVertical + Base + MCode + + function configurechancharacteristics(obj, ChannelList, InputImpedance, MaxInputFrequency) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_ConfigureChanCharacteristics', session, ChannelList, InputImpedance, MaxInputFrequency); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureChanCharacteristics</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureChanCharacteristics +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureChanCharacteristics (ViSession vi, ViConstString channelList, ViReal64 inputImpedance, ViReal64 maxInputFrequency);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Configures the attributes that control the electrical characteristics of the channel&#8212;the input impedance and the bandwidth.</p> + +</body> +</html> + + + configurevertical + ConfigurationFunctionsVertical + Base + MCode + + function configurevertical(obj, ChannelList, Range, Offset, Coupling, ProbeAttenuation, Enabled) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_ConfigureVertical', session, ChannelList, Range, Offset, Coupling, ProbeAttenuation, Enabled); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureVertical</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureVertical</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ConfigureVertical (ViSession vi, ViConstString channelList, ViReal64 range, ViReal64 offset, ViInt32 coupling, ViReal64 probeAttenuation, ViBoolean enabled);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Configures the most commonly configured attributes of the digitizer vertical subsystem, such as the range, offset, coupling, probe attenuation, and the channel.</p> + +</body> +</html> + + + + + Device + + + 1 + + + + + + Serial_Number + Device + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150104, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "Returns the serial number of the device. + " + + + Temperature + Device + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150086); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Returns the temperature of the device in degrees Celsius from the onboard sensor. + " + + + + + + DeviceSpecificIFDigitizer5620and5621 + + + 1 + + + + + + Delay_Before_Initiate + DeviceSpecificIFDigitizer5620and5621 + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1151304); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1151304 , propertyValue); + + + Double + none + + + never + "Specifies the delay in seconds that is used by niScope_InitiateAcquisition to allow additional delay between programming of the vertical range, trigger level, DDC, and the start of the acquisition. This attribute is only supported for the NI 5112 and the NI 5620/5621. + " + + + Enable_Dither + DeviceSpecificIFDigitizer5620and5621 + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151300); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151300, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Set to VI_TRUE to enable the analog dither on the NI 5620/5621. +Default Value: VI_FALSE + " + + + Fetch_Interleaved_Data + DeviceSpecificIFDigitizer5620and5621 + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150072); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150072, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Set to VI_TRUE to retrieve one array with alternating values on the NI 5620/5621. For example, this attribute can be used to retrieve a single array with I and Q interleaved instead of two separate arrays. If set to VI_TRUE, the resulting array will be twice the size of the actual record length. + " + + + + + + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + + + 1 + + + + + + AGC_Average_Control + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151047); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151047 ,propertyValue); + + + Double + none + + + never + "Averages the AGC values. + +Valid Values: +0 - Mean +1 - Median +Default Value: 0 + " + + + AGC_Loop_Gain_0_Exponent + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151042); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151042 ,propertyValue); + + + Double + none + + + never + "Along with NISCOPE_ATTR_DDC_AGC_LOOP_GAIN_0_MANTISSA, sets the loop gain for the AGC. +Default Value: 0 + " + + + AGC_Loop_Gain_0_Mantissa + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151043); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151043 ,propertyValue); + + + Double + none + + + never + "Along with NISCOPE_ATTR_DDC_AGC_LOOP_GAIN_0_EXPONENT, sets the loop gain for the AGC. +Default Value: 0 + " + + + AGC_Loop_Gain_1_Exponent + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151044); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151044 ,propertyValue); + + + Double + none + + + never + "Along with NISCOPE_ATTR_DDC_AGC_LOOP_GAIN_1_MANTISSA, sets the loop gain for the AGC. +Default Value: 0 + " + + + AGC_Loop_Gain_1_Mantissa + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151045); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151045 ,propertyValue); + + + Double + none + + + never + "Along with NISCOPE_ATTR_DDC_AGC_LOOP_GAIN_1_EXPONENT, sets the loop gain for the AGC. +Default Value: 0 + " + + + AGC_Lower_Gain_Limit + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1151041); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1151041 , propertyValue); + + + Double + none + + + never + "Sets the minimum gain and maximum signal levels in the AGC. +Default Value: 6.020600 + " + + + AGC_Threshold + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151046); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151046 ,propertyValue); + + + Double + none + + + never + "Sets the gain error in the AGC. +Default Value: 0x034D +" + + + AGC_Upper_Gain_Limit + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1151040); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1151040 , propertyValue); + + + Double + none + + + never + "Sets the maximum gain and minimum signal levels in the AGC. +Default Value: 6.020600 + " + + + AOUT_Parallel_Output_Source + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151070); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151070 ,propertyValue); + + + Double + none + + + never + "Specifies the source for the AOUT parallel output from the DDC. + +Valid Values: +NISCOPE_VAL_I_DATA (0) +NISCOPE_VAL_MAGNITUDE_DATA (1) +NISCOPE_VAL_FREQ_DATA (2) +Default Value: I Data + " + + + BOUT_Parallel_Output_Source + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151071); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151071 ,propertyValue); + + + Double + none + + + never + "Specifies the source for the BOUT parallel output from the DDC. + +Valid Values: +NISCOPE_VAL_MAGNITUDE_DATA (1) +NISCOPE_VAL_Q_DATA (3) +NISCOPE_VAL_PHASE_DATA (4) +Default Value: Q Data + " + + + Carrier_NCO_Center_Frequency + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1151000); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1151000 , propertyValue); + + + Double + none + + + never + "Specifies the Carrier NCO Center Frequency. The coerced value can be read back.. +Default Value: 15.0e6 + " + + + Carrier_Phase_Offset + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1151001); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1151001 , propertyValue); + + + Double + none + + + never + "Specifies the Carrier Phase Offset. The coerced value can be read back. +Default Value: 0.0 + " + + + CIC_Decimation + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151010); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151010 ,propertyValue); + + + Double + none + + + never + "Controls the decimation in the CIC filter. The CIC filter reduces the sample rate of a wideband signal to a rate that other filters in the DDC can process. +Default Value: 4 + " + + + CIC_Shift_Gain + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151011); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151011 ,propertyValue); + + + Double + none + + + never + "Controls the shift gain at the input to the CIC filter. The CIC filter reduces the sample rate of a wideband signal to a rate that other filters in the DDC can process. +Default Value: 0 + " + + + Combined_Decimation + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151301); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Returns the combined DDC decimation. + " + + + Coordinate_Converter_Input + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151073); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151073 ,propertyValue); + + + Double + none + + + never + "Selects the source for the input to the coordinate converter, either the HB filter or the programmable FIR. + +Valid Values: +0 - Resampler HB1 - Programmable FIRDefault Value: 1 " + + + Discr_Enable + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151020); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151020, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Set this to VI_TRUE to enable the frequency discriminator. +Default Value: VI_FALSE + " + + + Discriminator_Delay + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151025); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151025 ,propertyValue); + + + Double + none + + + never + "Sets the number of delays in the discriminator, from 1 to 8. +Default Value: 1 + " + + + Discriminator_FIR_Decimation + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151021); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151021 ,propertyValue); + + + Double + none + + + never + "Sets the amount of decimation, from 1 to 8. +Default Value: 1 + " + + + Discriminator_FIR_Input_Source + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151026); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151026 ,propertyValue); + + + Double + enum + + 1.0 + 0.0 + 2.0 + + + + never + "Sets the discriminator FIR input source to phase, magnitude, or resampler. +Default Value: Phase " + + + Discriminator_FIR_Symmetry + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151022); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151022 ,propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Sets the discriminator FIR symmetry to symmetric or asymmetric. +Default Value: Symmetric + " + + + Discriminator_FIR_Symmetry_Type + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151023); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151023 ,propertyValue); + + + Double + enum + + 0.0 + 1.0 + + + + never + "Sets the discriminator FIR symmetry type to even or odd. +Default Value: Even + " + + + Discriminator_FIR_Taps + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151024); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151024 ,propertyValue); + + + Double + none + + + never + "Sets the discriminator FIR number of taps. + +Valid Values: +1 to 63. +Default Value: 1 + " + + + Discriminator_Phase_Multiplier + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151027); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151027 ,propertyValue); + + + Double + none + + + never + "Programs the coordinate converter to multiply the phase output by 1, 2, 4, or 8. Multiplying the phase output removes phase modulation before the frequency is measured. +Default Value: 0 " + + + Enable_DDC + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151003); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151003, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Set this to VI_FALSE to disable programming of the DDC. +Default Value: VI_TRUE + " + + + Halfband_Filter_1_Enable + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151051); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151051, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables halfband filter 1. +Default Value: VI_TRUE + " + + + Halfband_Filter_2_Enable + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151052); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151052, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables halfband filter 2. +Default Value: VI_FALSE + " + + + Halfband_Filter_3_Enable + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151053); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151053, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables halfband filter 3. +Default Value: VI_FALSE + " + + + Halfband_Filter_4_Enable + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151054); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151054, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables halfband filter 4. +Default Value: VI_FALSE + " + + + Halfband_Filter_5_Enable + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151055); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151055, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables halfband filter 5. +Default Value: VI_FALSE + " + + + Halfband_Filter_Bypass + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151050); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151050, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables or bypasses the halfband filters. If set to VI_TRUE, halfband filters are bypassed. +Default Value: VI_TRUE + " + + + Prog_FIR_Filter_Decimation + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151030); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151030 ,propertyValue); + + + Double + none + + + never + "Specifies the programmable FIR filter decimation. +Default Value: 1 + " + + + Prog_FIR_Filter_Real_Complex + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151034); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151034 ,propertyValue); + + + Double + none + + + never + "Sets either a complex filter or a dual real filter. + +Valid Values: +NISCOPE_VAL_REAL (0) +NISCOPE_VAL_COMPLEX (1) +Default Value: Real + " + + + Prog_FIR_Filter_Symmetry + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151031); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151031 ,propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Sets either a symmetric or asymmetric filter. + +Valid Values: +NISCOPE_VAL_SYMMETRIC (0) +NISCOPE_VAL_ASYMMETRIC (1) +Default Value: Symmetric + " + + + Prog_FIR_Filter_Symmetry_Type + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151032); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151032 ,propertyValue); + + + Double + enum + + 0.0 + 1.0 + + + + never + "Sets either even or odd symmetry. + +Valid Values: +NISCOPE_VAL_EVEN (0) +NISCOPE_VAL_ODD (1) +Default Value: Even + " + + + Prog_FIR_Filter_Taps + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151033); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151033 ,propertyValue); + + + Double + none + + + never + "Number of taps in the FIR filter, from 1 to 255. +Default Value: 1 + " + + + Q_Input_to_Coord_Converter + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151074); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151074 ,propertyValue); + + + Double + none + + + never + "Either enables or zeros out the Q input to coordinate converter. +Default Value: I and Q + " + + + Resampler_Bypass + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151127); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151127, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Either enables or bypasses the resampler filter in the DDC. Set to VI_TRUE to bypass the resampling filter section. +Default Value: VI_TRUE + " + + + Resampler_Filter_Mode + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151126); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151126 ,propertyValue); + + + Double + none + + + never + "Selects the resampling filter mode. + +Valid Values: +1 - Resampler Enabled2 - HB 1 Enabled3 - Resampler and HB 16 - Both HB Filters7 - Resampler and Both HB FiltersDefault Value: 1 + " + + + Resampler_NCO_Divide + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151129); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151129 ,propertyValue); + + + Double + none + + + never + "Divides down the Resampler NCO output by the value loaded into the register plus one. +Default Value: 2 + " + + + Resampler_Output_Pulse_Delay + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151128); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151128 ,propertyValue); + + + Double + none + + + never + "Programs the delay between output samples when interpolating. These outputs can be delayed from 2 to 255 clocks. +Default Value: 16 + " + + + Resampler_Reference_Divide + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151130); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151130 ,propertyValue); + + + Double + none + + + never + "Divides down the reference clock by the value loaded into the register plus one. Load with a value that is one less than the desired period. +Default Value: 2 + " + + + Serial_Dac_Cal_Voltage + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1151302); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1151302 , propertyValue); + + + Double + none + + + never + "Voltage of the DAC that controls the oscillator, used for external calibration. + " + + + Syncout_CLK_Select + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151080); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151080 ,propertyValue); + + + Double + none + + + never + "Source for Syncout CLK. + +Valid Values: +0 - CLKIN +1 - PROCCLK +Default Value: CLKIN + " + + + Test_Mode_Sin_Cos + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151072); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151072, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables the special test mode where the carrier NCO outputs are set to 0x7FFF. +Default Value: VI_FALSE + " + + + Timing_NCO_Center_Freq + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151124); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151124 ,propertyValue); + + + Double + none + + + never + "Controls the frequency of the timing NCO. Specifies the timing NCO center frequency in binary format: +N = (Fout / Fresampler) X 2^32 +where Fout is the output frequency and Fresampler is the resampled frequency. +The value is transfered to the Active Register during the next initiate acquisition operation. +Default Value: 0x80000000 + " + + + Timing_NCO_Clear_Phase_Accum + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151121); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151121, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "If set to FALSE, enables the accumulator in the timing NCO. If set to TRUE, zeros out feedback in the accumulator. +Default Value: VI_FALSE + " + + + Timing_NCO_Enable_Offset_Freq + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151122); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151122, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "If set to TRUE, enables offset frequency in the timing NCO. If set to FALSE, applies no offset frequency. +Default Value: VI_FALSE + " + + + Timing_NCO_Freq_Offset_Bits + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151123); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151123 ,propertyValue); + + + Double + none + + + never + "Specifies the number of offset bits in the timing NCO. + +Valid Values: +0 - 8 bits +1 - 16 bits +2 - 24 bits +3 - 32 bits +Default Value: 8 bits " + + + Timing_NCO_Phase_Accum_Load_on_Update + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1151120); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1151120, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "When TRUE, updates the timing NCO frequency to zero the feedback of the phase accumulator as well as update the phase and frequency. +Default Value: VI_TRUE + " + + + Timing_NCO_Phase_Offset + DeviceSpecificIFDigitizer5620and5621AdvancedDDCAttributes + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1151125); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1151125 ,propertyValue); + + + Double + none + + + never + "Offsets the phase of the timing NCO in binary format. The value is transfered to the Active Register during the next initiate acquisition operation. +Default Value: 0 + " + + + + + + Horizontal + + + 1 + + + + + + Acquisition_Start_Time + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250109); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250109 , propertyValue); + + + Double + none + + + never + "Specifies the length of time from the trigger event to the first point in the waveform record in seconds. If the value is positive, the first point in the waveform record occurs after the trigger event (same as specifying NISCOPE_ATTR_TRIGGER_DELAY_TIME). If the value is negative, the first point in the waveform record occurs before the trigger event (same as specifying NISCOPE_ATTR_HORZ_RECORD_REF_POSITION). + " + + + Actual_Record_Length + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250008); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Returns the actual number of points the digitizer acquires for each channel. The value is equal to or greater than the minimum number of points you specify with NISCOPE_ATTR_HORZ_MIN_NUM_PTS. +Allocate a ViReal64 array of this size or greater to pass as the WaveformArray parameter of the Read and Fetch functions. This attribute is only valid after a call to the one of the Configure Horizontal functions. + The value is equal to or greater than the minimum number of points you specify in one of the niScope_ConfigureHorizontal functions. + " + + + Actual_Sample_Rate + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250010); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Returns the effective sample rate using the current configuration. The units are samples per second. This attribute is only valid after a call to the one of the Configure Horizontal functions. + +Units: Hertz (Samples / Second) + " + + + Adjust_Samples + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150085); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150085, propertyValue); + + + Double + none + + + never + "When set to true and the digitizer is set to master, the number of pretrigger samples and total samples are adjusted to be able to synchronize a master and slave 5102. + " + + + Enable_Records_Memory + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150068); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150068, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Indicates whether more records can be configured with niScope_ConfigureHorizontalTiming than fit in the onboard memory. If this attribute is set to VI_TRUE, it is necessary to fetch records while the acquisition is in progress. Eventually, some of the records will be overwritten. An error is returned from the fetch function if you attempt to fetch a record that has been overwritten. + " + + + Enable_TDC + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150096); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150096, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "This attribute controls whether the TDC is used to compute an accurate trigger. + " + + + Enable_Time_Interleaved_Sampling + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150128); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150128, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies whether the digitizer acquires the waveform using multiple ADCs for the channel enabling a higher maximum real-time sampling rate. + +Valid Values: +VI_TRUE (1) - Use multiple interleaved ADCs on this channel +VI_FALSE (0) - Use only this channel's ADC to acquire data for this channel + " + + + Enforce_Realtime + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150004); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150004, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Indicates whether the digitizer enforces real-time measurements or allows equivalent-time measurements. + " + + + Min_Number_of_Points + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250009); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250009 ,propertyValue); + + + Double + none + + + never + "Specifies the minimum number of points you require in the waveform record for each channel. NI-SCOPE uses the value you specify to configure the record length that the digitizer uses for waveform acquisition. NISCOPE_ATTR_HORZ_RECORD_LENGTH returns the actual record length. + +Valid Values: 1 - available onboard memory + " + + + Min_Sample_Rate + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150009); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150009 , propertyValue); + + + Double + none + + + never + "Specify the sampling rate for the acquisition in Samples per second. + +Valid Values: +The combination of sampling rate and min record length must allow the digitizer to sample at a valid sampling rate for the acquisition type specified in niScope_ConfigureAcquisition and not require more memory than the onboard memory module allows. + " + + + Number_of_Records + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150001); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150001 ,propertyValue); + + + Double + none + + + never + "Specifies the number of records to acquire. Can be used for multi-record acquisition and single-record acquisitions. Setting this to 1 indicates a single-record acquisition. + " + + + Poll_Interval + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150100); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150100 ,propertyValue); + + + Double + none + + + never + "Specifies the poll interval in milliseconds to use during RIS acquisitions to check whether the acquisition is complete. + " + + + Reference_Position + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250011); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250011 , propertyValue); + + + Double + none + + + never + "Specifies the position of the Reference Event in the waveform record. When the digitizer detects a trigger, it waits the length of time the NISCOPE_ATTR_TRIGGER_DELAY_TIME attribute specifies. The event that occurs when the delay time elapses is the Reference Event. The Reference Event is relative to the start of the record and is a percentage of the record length. For example, the value 50.0 corresponds to the center of the waveform record and 0.0 corresponds to the first element in the waveform record. + +Valid Values: 0.0 - 100.0 + " + + + RIS_Method + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150071); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150071 ,propertyValue); + + + Double + enum + + 5.0 + 3.0 + 1.0 + 2.0 + + + + never + "Specifies the algorithm for random-interleaved sampling, which is used if the sample rate exceeds the value of NISCOPE_ATTR_MAX_REAL_TIME_SAMPLING_RATE. + " + + + RIS_Num_Avg + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150070); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150070 ,propertyValue); + + + Double + none + + + never + "The number of averages for each bin in an RIS acquisition. The number of averages times the oversampling factor is the minimum number of real-time acquisitions necessary to reconstruct the RIS waveform. Averaging is useful in RIS because the trigger times are not evenly spaced, so adjacent points in the reconstructed waveform not be accurately spaced. By averaging, the errors in both time and voltage are smoothed. + " + + + Time_Per_Record + Horizontal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250007); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250007 , propertyValue); + + + Double + none + + + never + "Specifies the length of time that corresponds to the record length. + +Units: Seconds + " + + + + + + InherentIVIAttributesAdvancedSessionInformation + + + 1 + + + + + + Driver_Setup + InherentIVIAttributesAdvancedSessionInformation + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050007, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "This attribute indicates the Driver Setup string that the user specified when initializing the driver. + +Some cases exist where the end-user must specify instrument driver options at initialization. An example of this is specifying a particular instrument model from among a family of instruments that the driver supports. This is useful when using simulation. The end-user can specify driver-specific options through the DriverSetup keyword in the optionsString parameter in niScope_InitWithOptions, or through the IVI Configuration Utility. + +If the user does not specify a Driver Setup string, this attribute returns an empty string. + " + + + Logical_Name + InherentIVIAttributesAdvancedSessionInformation + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050305, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "A string containing the logical name you specified when opening the current IVI session. You can pass a logical name to niScope_Init or niScope_InitWithOptions. The IVI Configuration utility must contain an entry for the logical name. The logical name entry refers to a virtual instrument section in the IVI Configuration file. The virtual instrument section specifies a physical device and initial user options. + " + + + Resource_Descriptor + InherentIVIAttributesAdvancedSessionInformation + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050304, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "Indicates the resource descriptor the driver uses to identify the physical device. If you initialize the driver with a logical name, this attribute contains the resource descriptor that corresponds to the entry in the IVI Configuration utility. +If you initialize the instrument driver with the resource descriptor, this attribute contains that value.You can pass a logical name to niScope_Init or niScope_InitWithOptions. The IVI Configuration utility must contain an entry for the logical name. The logical name entry refers to a virtual instrument section in the IVI Configuration file. The virtual instrument section specifies a physical device and initial user options. + " + + + + + + InherentIVIAttributesDriverCapabilities + + + 1 + + + + + + Group_Capabilities + InherentIVIAttributesDriverCapabilities + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050401, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "A string that contains a comma-separated list of class extension groups that this driver implements. + " + + + Number_of_Channels + InherentIVIAttributesDriverCapabilities + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1050203); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Indicates the number of channels that the specific instrument driver supports. + For channel-based properties, the IVI engine maintains a separate cache value for each channel. + " + + + Supported_Models + InherentIVIAttributesDriverCapabilities + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050327, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "A string that contains a comma-separated list of the instrument model numbers supported by this driver. + " + + + + + + InherentIVIAttributesDriverIdentificationandVersion + + + 1 + + + + + + Class_Specification_Major_Version + InherentIVIAttributesDriverIdentificationandVersion + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1050515); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "The major version number of the class specification with which this driver is compliant. + " + + + Class_Specification_Minor_Version + InherentIVIAttributesDriverIdentificationandVersion + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1050516); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "The minor version number of the class specification with which this driver is compliant. + " + + + Specific_Driver_Description + InherentIVIAttributesDriverIdentificationandVersion + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050514, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "A string that contains a brief description of the specific driver + " + + + Specific_Driver_Prefix + InherentIVIAttributesDriverIdentificationandVersion + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050302, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "A string that contains the prefix for the instrument driver. The name of each user-callable function in this driver starts with this prefix. + " + + + Specific_Driver_Revision + InherentIVIAttributesDriverIdentificationandVersion + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050551, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "A string that contains additional version information about this instrument driver. + " + + + Specific_Driver_Vendor + InherentIVIAttributesDriverIdentificationandVersion + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050513, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "A string that contains the name of the vendor that supplies this driver. + " + + + + + + InherentIVIAttributesInstrumentIdentification + + + 1 + + + + + + Firmware_Revision + InherentIVIAttributesInstrumentIdentification + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050510, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "A string that contains the firmware revision information for the instrument you are currently using. + " + + + Manufacturer + InherentIVIAttributesInstrumentIdentification + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050511, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "A string that contains the name of the instrument manufacturer. + " + + + Model + InherentIVIAttributesInstrumentIdentification + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1050512, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + String + none + + + always + "A string that contains the model number of the current instrument. + " + + + + + + InherentIVIAttributesUserOptions + + + 1 + + + + + + Cache + InherentIVIAttributesUserOptions + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1050004); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1050004, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies whether to cache the value of attributes. When caching is enabled, the instrument driver keeps track of the current instrument settings and avoids sending redundant commands to the instrument. Thus, you can significantly increase execution speed. + The instrument driver can choose to always cache or to never cache particular attributes regardless of the setting of this attribute. + The default value is VI_TRUE. Use niScope_InitWithOptions to override this value. + " + + + Interchange_Check + InherentIVIAttributesUserOptions + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1050021); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1050021, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "NI-SCOPE does not generate interchange warnings and therefore ignores this attribute. + " + + + Query_Instrument_Status + InherentIVIAttributesUserOptions + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1050003); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1050003, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies whether the instrument driver queries the instrument status after each operation. Querying the instrument status is very useful for debugging. After you validate your program, you can set this attribute to VI_FALSE to disable status checking and maximize performance + The instrument driver can choose to ignore status checking for particular attributes regardless of the setting of this attribute. + The default value is VI_TRUE. Use the niScope_InitWithOptions function to override this value. + " + + + Range_Check + InherentIVIAttributesUserOptions + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1050002); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1050002, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies whether to validate attribute values and function parameters. If enabled, the instrument driver validates the parameters values that you pass to driver functions. Range checking parameters is very useful for debugging. After you validate your program, you can set this attribute to VI_FALSE to disable range checking and maximize performance. + The default value is VI_TRUE. Use the niScope_InitWithOptions function to override this value. + " + + + Record_Value_Coercions + InherentIVIAttributesUserOptions + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1050006); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1050006, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies whether the IVI engine keeps a list of the value coercions it makes for ViInt32 and ViReal64 attributes. You call Ivi_GetNextCoercionInfo to extract and delete the oldest coercion record from the list. + The default value is VI_FALSE. Use the niScope_InitWithOptions function to override this value. + " + + + Simulate + InherentIVIAttributesUserOptions + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1050005); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1050005, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies whether or not to simulate instrument driver I/O operations. If simulation is enabled, instrument driver functions perform range checking and call Ivi_GetAttribute and Ivi_SetAttribute functions, but they do not perform instrument I/O. For output parameters that represent instrument data, the instrument driver functions return calculated values. + The default value is VI_FALSE. Use the niScope_InitWithOptions function to override this value. + " + + + + + + InstrumentCapabilities + + + 1 + + + + + + Maximum_Real_Time_Sample_Rate + InstrumentCapabilities + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150073); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Returns the maximum real time sample rate in Hz. + " + + + Maximum_RIS_Rate + InstrumentCapabilities + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150074); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Returns the maximum sample rate in RIS mode in Hz. + " + + + Memory_Size + InstrumentCapabilities + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150069); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "Returns the total combined amount of onboard memory for all channels in bytes. + " + + + + + + IVIComplianceObsolete + + + 1 + + + + + + + errorquery + IVIComplianceObsolete + Base + MCode + + function [ErrCode, ErrMessage] = errorquery(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ErrCode = libpointer('int32Ptr', 0); +ErrMessage = libpointer('int8Ptr', repmat(10, 1, 512)); + +status = calllib(libname, 'niScope_error_query', session, ErrCode, ErrMessage); + +ErrCode = double(ErrCode.Value); +ErrMessage = strtrim(char(ErrMessage.Value)); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_error_query</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_error_query</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_error_query&nbsp;(ViSession&nbsp;vi, ViInt32*&nbsp;errCode, ViChar[]&nbsp;errMessage);</p> +<h2 class="purpose">Purpose</h2> + + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; + +This function is included for compliance with the IviScope Class Specification. +</td></tr></table> +<p class = "Body">Reads an error code and message from the error queue. National Instruments digitizers do not contain an error queue. Errors are reported as they occur. Therefore, this function does not detect errors.</p> +</body> +</html> + + + getchannelname + IVIComplianceObsolete + Base + MCode + + function [ChannelString] = getchannelname(obj, Index, BufferSize) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelString = libpointer('int8Ptr', repmat(10, 1, 512)); + +status = calllib(libname, 'niScope_GetChannelName', session, Index, BufferSize, ChannelString); + +ChannelString = strtrim(char(ChannelString.Value)); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetChannelName</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetChannelName</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_GetChannelName&nbsp;(ViSession&nbsp;vi, ViInt32&nbsp;index, ViInt32&nbsp;bufferSize, ViChar[]&nbsp;channelString);</p> +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; + +This function is included for compliance with the IviScope Class Specification.</td></tr></table> +<p class = "Body">Returns the channel string that is in the channel table at an index you specify. Not applicable to National Instruments digitizers.</p> +</body> +</html> + + + geterror + IVIComplianceObsolete + Base + MCode + + function [ErrorCode, Description] = geterror(obj, BufferSize) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ErrorCode = libpointer('int32Ptr', 0); +Description = libpointer('int8Ptr', repmat(10, 1, 512)); + +status = calllib(libname, 'niScope_GetError', session, ErrorCode, BufferSize, Description); + +ErrorCode = double(ErrorCode.Value); +Description = strtrim(char(Description.Value)); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetError</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetError</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_GetError&nbsp;(ViSession&nbsp;vi, ViStatus*&nbsp;errorCode, ViInt32&nbsp;bufferSize, ViChar[]&nbsp;description);</p> +<h2 class="purpose">Purpose</h2><table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; +This function is included for compliance with the IviScope Class Specification. + +</td></tr></table> + + +<p class="Body"> + +Reads an error code and message from the error queue. National Instruments digitizers do not contain an error queue. Errors are reported as they occur. Therefore, this function does not detect errors.</p> +</body> +</html> + + + + + IVIComplianceObsoleteAcquisition + + + 1 + + + + + + + fetchwaveform + IVIComplianceObsoleteAcquisition + Base + MCode + + function [Waveform, ActualPoints, InitialX, XIncrement] = fetchwaveform(obj, Channel, WaveformSize, Waveform) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +Channel = [double(Channel) 0]; +Waveform = libpointer('doublePtr', Waveform); +ActualPoints = libpointer('int32Ptr', 0); +InitialX = libpointer('doublePtr', 0); +XIncrement = libpointer('doublePtr', 0); + +status = calllib(libname, 'niScope_FetchWaveform', session, Channel, WaveformSize, Waveform, ActualPoints, InitialX, XIncrement); + +Waveform = double(Waveform.Value); +ActualPoints = double(ActualPoints.Value); +InitialX = double(InitialX.Value); +XIncrement = double(XIncrement.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_FetchWaveform</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_FetchWaveform</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_FetchWaveform&nbsp;(ViSession&nbsp;vi, ViConstString&nbsp;channel, ViInt32&nbsp;waveformSize, ViReal64[]&nbsp;waveform, ViInt32*&nbsp;actualPoints, ViReal64*&nbsp;initialX, ViReal64*&nbsp;xIncrement);</p> +<h2 class="purpose">Purpose</h2> + + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp;This function is included for compliance with the IviScope Class Specification.</td></tr></table> + + + + +<p class = "Body">Returns the waveform from a previously initiated acquisition that the digitizer acquires for the channel you specify. </p> <p class = "Body"><a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_InitiateAcquisition.html')"><span class="Monospace">niScope_InitiateAcquisition</span></a> starts an acquisition on the channels that you enable with <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureVertical.html')"><span class="Monospace">niScope_ConfigureVertical</span></a>. The digitizer acquires waveforms for the enabled channels concurrently. You use <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_AcquisitionStatus.html')"><span class="Monospace">niScope_AcquisitionStatus</span></a> to determine when the acquisition is complete. You must call this function separately for each enabled channel to obtain the waveforms.</p> <p class = "Body">You can call <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ReadWaveform.html')"><span class="Monospace">niScope_ReadWaveform</span></a> instead of <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_InitiateAcquisition.html')"><span class="Monospace">niScope_InitiateAcquisition</span></a>. <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ReadWaveform.html')"><span class="Monospace">niScope_ReadWaveform</span></a> starts an acquisition on all enabled channels, waits for the acquisition to complete, and returns the waveform for the channel you specify. Call this function to obtain the waveforms for each of the remaining channels.</p> +</body> +</html> + + + isinvalidwfmelement + IVIComplianceObsoleteAcquisition + Base + MCode + + function [IsInvalid] = isinvalidwfmelement(obj, ElementValue) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +IsInvalid = libpointer('uint16Ptr', 0); + +status = calllib(libname, 'niScope_IsInvalidWfmElement', session, ElementValue, IsInvalid); + +IsInvalid = double(IsInvalid.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_IsInvalidWfmElement</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_IsInvalidWfmElement</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_IsInvalidWfmElement&nbsp;(ViSession&nbsp;vi, ViReal64&nbsp;elementValue, ViBoolean*&nbsp;isInvalid);</p> +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; + +This function is included for compliance with the IviScope Class Specification.</td></tr></table><p class = "Body">Determines whether a value you pass from the waveform array is invalid. After the read and fetch waveform functions execute, each element in the waveform array contains either a voltage or a value indicating that the instrument could not sample a voltage.</p> +</body> +</html> + + + readwaveform + IVIComplianceObsoleteAcquisition + Base + MCode + + function [Waveform, ActualPoints, InitialX, XIncrement] = readwaveform(obj, Channel, WaveformSize, MaxTime, Waveform) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +Channel = [double(Channel) 0]; +Waveform = libpointer('doublePtr', Waveform); +ActualPoints = libpointer('int32Ptr', 0); +InitialX = libpointer('doublePtr', 0); +XIncrement = libpointer('doublePtr', 0); + +status = calllib(libname, 'niScope_ReadWaveform', session, Channel, WaveformSize, MaxTime, Waveform, ActualPoints, InitialX, XIncrement); + +Waveform = double(Waveform.Value); +ActualPoints = double(ActualPoints.Value); +InitialX = double(InitialX.Value); +XIncrement = double(XIncrement.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ReadWaveform</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ReadWaveform</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ReadWaveform&nbsp;(ViSession&nbsp;vi, ViConstString&nbsp;channel, ViInt32&nbsp;waveformSize, ViInt32&nbsp;maxtime, ViReal64[]&nbsp;waveform, ViInt32*&nbsp;actualPoints, ViReal64*&nbsp;initialX, ViReal64*&nbsp;xIncrement);</p> +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; + +This function is included for compliance with the IviScope Class Specification.</td></tr></table><p class = "Body">Initiates an acquisition on the channels that you enable with <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureVertical.html')"><span class="Monospace">niScope_ConfigureVertical</span></a>. This function then waits for the acquisition to complete and returns the waveform for the channel you specify. Call <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_FetchWaveform.html')"><span class="Monospace">niScope_FetchWaveform</span></a> to obtain the waveforms for each of the remaining enabled channels without initiating another acquisition.</p> <p class = "Body">Use <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ActualRecordLength.html')"><span class="Monospace">niScope_ActualRecordLength</span></a> to determine the required size for the <strong>waveform</strong> array.</p> +</body> +</html> + + + + + IVIComplianceObsoleteCoercionInfo + + + 1 + + + + + + + getnextcoercionrecord + IVIComplianceObsoleteCoercionInfo + Base + MCode + + function [Record] = getnextcoercionrecord(obj, BufferSize) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +Record = libpointer('int8Ptr', repmat(10, 1, 512)); + +status = calllib(libname, 'niScope_GetNextCoercionRecord', session, BufferSize, Record); + +Record = strtrim(char(Record.Value)); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetNextCoercionRecord</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetNextCoercionRecord</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_GetNextCoercionRecord&nbsp;(ViSession&nbsp;vi, ViInt32&nbsp;bufferSize, ViChar[]&nbsp;record);</p> +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; + +This function is included for compliance with the IviScope Class Specification.</td></tr></table><p class = "Body">Returns the coercion information associated with the IVI session. This function retrieves and clears the oldest instance in which the instrument driver coerced a value you specified to another value.</p> <p class = "Body">If you set <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_RECORD_COERCIONS.html')"><span class="Monospace">NISCOPE_ATTR_RECORD_COERCIONS</span></a> to +<span class="Monospace"><span class="Monospace">VI_TRUE</span></span>, NI-SCOPE keeps a list of all coercions it makes on ViInt32 or ViReal64 + values that you pass to instrument driver functions. Use this function to retrieve information from that + list.</p> +</body> +</html> + + + + + IVIComplianceObsoleteHorizontal + + + 1 + + + + + + + configureacquisitionrecord + IVIComplianceObsoleteHorizontal + Base + MCode + + function configureacquisitionrecord(obj, TimeperRecord, MinNumPoints, AcquisitionStartTime) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ConfigureAcquisitionRecord', session, TimeperRecord, MinNumPoints, AcquisitionStartTime); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureAcquisitionRecord</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureAcquisitionRecord</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ConfigureAcquisitionRecord&nbsp;(ViSession&nbsp;vi, ViReal64&nbsp;timeperRecord, ViInt32&nbsp;minNumPoints, ViReal64&nbsp;acquisitionStartTime);</p> +<h2 class="purpose">Purpose</h2> +<p class="Body">This function is included for compliance with the IviScope Class Specification.</p><p class = "Body">Configures the most commonly configured attributes of the instrument acquisition subsystem.</p> +</body> +</html> + + + + + IVIComplianceObsoleteInterchangeabilityInfo + + + 1 + + + + + + + clearinterchangewarnings + IVIComplianceObsoleteInterchangeabilityInfo + Base + MCode + + function clearinterchangewarnings(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ClearInterchangeWarnings', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ClearInterchangeWarnings</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ClearInterchangeWarnings</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ClearInterchangeWarnings&nbsp;(ViSession&nbsp;vi);</p> +<h2 class="purpose">Purpose</h2> + + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; + +This function is included for compliance with the IviScope Class Specification.</td></tr></table> + + + + + +<p class = "Body">Clears the list of current interchange warnings.</p> +</body> +</html> + + + getnextinterchangewarning + IVIComplianceObsoleteInterchangeabilityInfo + Base + MCode + + function [InterchangeWarning] = getnextinterchangewarning(obj, BufferSize) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +InterchangeWarning = libpointer('int8Ptr', repmat(10, 1, 512)); + +status = calllib(libname, 'niScope_GetNextInterchangeWarning', session, BufferSize, InterchangeWarning); + +InterchangeWarning = strtrim(char(InterchangeWarning.Value)); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetNextInterchangeWarning</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetNextInterchangeWarning</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_GetNextInterchangeWarning&nbsp;(ViSession&nbsp;vi, ViInt32&nbsp;bufferSize, ViChar[]&nbsp;interchangeWarning);</p> +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; +This function is included for compliance with the IviScope Class Specification.</td></tr></table><p class = "Body">Returns the interchangeability warnings associated with the IVI session. It retrieves and clears the oldest instance in which the class driver recorded an interchangeability warning. Interchangeability warnings indicate that using your +application with a different instrument might cause different behavior. </p> + +<p class="Body"> +Use this function to retrieve interchangeability warnings. The driver performs interchangeability checking +when <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_INTERCHANGE_CHECK.html')"><span class="Monospace">NISCOPE_ATTR_INTERCHANGE_CHECK</span></a> is set to + +<span class="Monospace">VI_TRUE</span>. The function returns an empty string in the <strong>interchangeWarning</strong> parameter if no +interchangeability warnings remain for the session.</p><p class="Body">In general, the instrument driver generates interchangeability warnings when an attribute that affects the behavior of the instrument is in a state that you did not specify.</p> +</body> +</html> + + + resetinterchangecheck + IVIComplianceObsoleteInterchangeabilityInfo + Base + MCode + + function resetinterchangecheck(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ResetInterchangeCheck', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ResetInterchangeCheck</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ResetInterchangeCheck</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ResetInterchangeCheck&nbsp;(ViSession&nbsp;vi);</p> +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; + +This function is included for compliance with the IviScope Class Specification.</td></tr></table> + +<p class = "Body">When developing a complex test system that consists of multiple test modules, it is generally a good idea to design the test modules so that they can run in any order. To do so requires ensuring that each test module completely configures the state of each instrument it uses.</p> + <p class = "Body">If a particular test module does not completely configure the state of an instrument, the state of the instrument depends on the configuration from a previously executed test module. <br>If you execute the test modules in a different order, the behavior of the instrument and therefore the entire test module is likely to change.</p> <p class = "Body">This change in behavior is generally instrument-specific and represents an interchangeability problem. You can use this function to test for such cases. After you call this function, the interchangeability checking algorithms in the specific driver ignore all previous configuration operations. <br>By calling this function at the beginning of a test module, you can determine whether the test module has dependencies on the operation of previously executed test modules. </p><p class = "Body">This function does not clear the interchangeability warnings from the list of previously recorded interchangeability warnings. If you want to guarantee that <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_GetNextInterchangeWarning.html')"><span class="Monospace">niScope_GetNextInterchangeWarning</span></a> only returns those interchangeability warnings that are generated after calling this function, you must clear the list of interchangeability warnings.</p> <p class = "Body">You can clear the interchangeability warnings list by repeatedly calling <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_GetNextInterchangeWarning.html')"><span class="Monospace">niScope_GetNextInterchangeWarning</span></a> until no more interchangeability warnings are returned. If you are not interested in the content of those warnings, you can call <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ClearInterchangeWarnings.html')"><span class="Monospace">niScope_ClearInterchangeWarnings</span></a>.</p> +</body> +</html> + + + + + IVIComplianceObsoleteMeasurement + + + 1 + + + + + + + configurereflevels + IVIComplianceObsoleteMeasurement + Base + MCode + + function configurereflevels(obj, Low, Mid, High) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ConfigureRefLevels', session, Low, Mid, High); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureRefLevels</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureRefLevels</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ConfigureRefLevels&nbsp;(ViSession&nbsp;vi, ViReal64&nbsp;low, ViReal64&nbsp;mid, ViReal64&nbsp;high);</p> +<h2 class="purpose">Purpose</h2> +<p class="Body">This function is included for compliance with the IviScope Class Specification.</p><p class = "Body">Configures the reference levels for all channels of the digitizer. The levels may be set on a per channel basis by setting <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_HIGH_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_HIGH_REF_LEVEL</span></a>, +<a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_LOW_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_LOW_REF_LEVEL</span> +</a>, and <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_MID_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_MID_REF_LEVEL</span>.</a> </p> +<p class = "Body">This function configures the reference levels for waveform measurements. +Call this function before calling <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_FetchMeasurement.html')"><span class="Monospace">niScope_FetchMeasurement</span></a> to take a rise time, fall time, width negative, width positive, duty cycle negative, or duty cycle positive measurement.</p> +</body> +</html> + + + fetchwaveformmeasurement + IVIComplianceObsoleteMeasurement + Base + MCode + + function [Measurement] = fetchwaveformmeasurement(obj, Channel, MeasFunction) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +Channel = [double(Channel) 0]; +Measurement = libpointer('doublePtr', 0); + +status = calllib(libname, 'niScope_FetchWaveformMeasurement', session, Channel, MeasFunction, Measurement); + +Measurement = double(Measurement.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_FetchWaveformMeasurement</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_FetchWaveformMeasurement</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_FetchWaveformMeasurement&nbsp;(ViSession&nbsp;vi, ViConstString&nbsp;channel, ViInt32&nbsp;measFunction, ViReal64*&nbsp;measurement);</p> +<h2 class="purpose">Purpose</h2> + + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Notes</strong>&nbsp;&nbsp;This function is included for compliance with the IviScope Class Specification. + +<p class ="Body"> + + You can use <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ReadWaveformMeasurement.html')"><span class="Monospace">niScope_ReadWaveformMeasurement</span></a> +instead of this function. <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ReadWaveformMeasurement.html')"><span class="Monospace">niScope_ReadWaveformMeasurement</span></a> starts an acquisition on all +enabled channels, waits for the acquisition to complete, obtains a waveform measurement on the specified +channel, and returns the waveform for the specified channel. Call this function separately to obtain any +other waveform measurements on a specific channel.</p></td></tr></table> + + + + +<p class = "Body">Configure the appropriate reference +levels before calling this function. You can configure the low, mid, and high references by setting the +following attributes:</p> <p class = "Body"><a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_HIGH_REF.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_HIGH_REF</span></a> <br><a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_LOW_REF.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_LOW_REF</span></a> <br><a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_MID_REF.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_MID_REF</span></a></p> +</body> +</html> + + + readwaveformmeasurement + IVIComplianceObsoleteMeasurement + Base + MCode + + function [Measurement] = readwaveformmeasurement(obj, Channel, MeasFunction, MaxTime) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +Channel = [double(Channel) 0]; +Measurement = libpointer('doublePtr', 0); + +status = calllib(libname, 'niScope_ReadWaveformMeasurement', session, Channel, MeasFunction, MaxTime, Measurement); + +Measurement = double(Measurement.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ReadWaveformMeasurement</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ReadWaveformMeasurement</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ReadWaveformMeasurement&nbsp;(ViSession&nbsp;vi, ViConstString&nbsp;channel, ViInt32&nbsp;measFunction, ViInt32&nbsp;maxTime, ViReal64*&nbsp;measurement);</p> +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; + +This function is included for compliance with the IviScope Class Specification.</td></tr></table> +<p class = "Body">Initiates a new waveform acquisition and returns a specified waveform measurement from a specific channel.</p> <p class = "Body">This function initiates an acquisition on the channels that you enable with the <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureVertical.html')"><span class="Monospace">niScope_ConfigureVertical</span></a> function. It then waits for the acquisition to complete, obtains a waveform measurement on the channel you specify, and returns the measurement value. You specify a particular measurement type, such as rise time, frequency, or voltage peak-to-peak. </p><p class = "Body">You can call the <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_FetchWaveformMeasurement.html')"><span class="Monospace">niScope_FetchWaveformMeasurement</span></a> function separately to obtain any other waveform measurement on a specific channel without initiating another acquisition. </p><p class = "Body">You must configure the appropriate reference levels before calling this function. Configure the low, mid, and high references by calling <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureRefLevels.html')"><span class="Monospace">niScope_ConfigureRefLevels</span></a> or by setting the following attributes:</p> <p class = "Body"><a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_HIGH_REF.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_HIGH_REF</span></a> <br><a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_LOW_REF.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_LOW_REF</span></a> <br><a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_MID_REF.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_MID_REF</span></a></p> +</body> +</html> + + + + + IVIComplianceObsoleteTrigger + + + 1 + + + + + + + configureedgetriggersource + IVIComplianceObsoleteTrigger + Base + MCode + + function configureedgetriggersource(obj, Source, Level, Slope) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +Source = [double(Source) 0]; + +status = calllib(libname, 'niScope_ConfigureEdgeTriggerSource', session, Source, Level, Slope); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureEdgeTriggerSource</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureEdgeTriggerSource</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ConfigureEdgeTriggerSource&nbsp;(ViSession&nbsp;vi, ViConstString&nbsp;source, ViReal64&nbsp;level, ViInt32&nbsp;slope);</p> +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; + +This function is included for compliance with the IviScope Class Specification.</td></tr></table> +<p class = "Body">Sets the edge triggering attributes. An edge trigger occurs when the trigger signal specified with the source parameter passes through the voltage threshold specified with the +level parameter and has the slope specified with the slope parameter.</p><p class = "Body">This function affects instrument behavior only if the triggerType is <span class="Monospace">NISCOPE_VAL_EDGE</span>. Set the trigger type and trigger coupling before calling this function.</p><p class = "Body">If the trigger source is one of the analog input channels, you must configure the vertical range, vertical offset, vertical coupling, probe attenuation, and the maximum input frequency before calling this function.</p> +</body> +</html> + + + configuretrigger + IVIComplianceObsoleteTrigger + Base + MCode + + function configuretrigger(obj, TriggerType, Holdoff) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ConfigureTrigger', session, TriggerType, Holdoff); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureTrigger</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTrigger</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ConfigureTrigger&nbsp;(ViSession&nbsp;vi, ViInt32&nbsp;triggerType, ViReal64&nbsp;holdoff);</p> +<h2 class="purpose">Purpose</h2><table class="Borderless"> +<tr> +<td class="Icon"><img src="note.gif" alt="Note"></td> +<td><strong>Note</strong>&nbsp;&nbsp; +This function is included for compliance with the IviScope Class Specification.</td> +</tr> +</table> + + + +<p class = "Body">Configures the common attributes of the trigger subsystem.</p><p class = "Body">When you use <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ReadWaveform.html')"><span class="Monospace">niScope_ReadWaveform</span></a>, the instrument waits for a trigger. You specify the type of trigger for which the instrument waits with the Trigger Type parameter.</p><p class = "Body">If the instrument requires multiple waveform acquisitions to build a complete waveform, it waits for the length of time you specify with the <strong>holdoff</strong> parameter to elapse since the previous trigger. The instrument then waits for the next trigger.</p> +</body> +</html> + + + configuretriggercoupling + IVIComplianceObsoleteTrigger + Base + MCode + + function configuretriggercoupling(obj, Coupling) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ConfigureTriggerCoupling', session, Coupling); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureTriggerCoupling</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTriggerCoupling</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ConfigureTriggerCoupling&nbsp;(ViSession&nbsp;vi, ViInt32&nbsp;coupling);</p> +<h2 class="purpose">Purpose</h2> +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp;This function is included for compliance with the IviScope Class Specification.</td></tr></table><p class = "Body">Sets the trigger coupling attribute.</p> +</body> +</html> + + + configuretvtriggerlinenumber + IVIComplianceObsoleteTrigger + Base + MCode + + function configuretvtriggerlinenumber(obj, LineNumber) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ConfigureTVTriggerLineNumber', session, LineNumber); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureTVTriggerLineNumber</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTVTriggerLineNumber</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ConfigureTVTriggerLineNumber&nbsp;(ViSession&nbsp;vi, ViInt32&nbsp;lineNumber);</p> +<h2 class="purpose">Purpose</h2> +<p class="Body">This function is included for compliance with the IviScope Class Specification.</p><p class = "Body">Configures the TV line upon which the instrument triggers. The line number is absolute and not relative to the field of the TV signal.</p><p class = "Body">This function affects instrument behavior only if the trigger type is set to <span class="Monospace">NISCOPE_VAL_TV_TRIGGER</span> and the TV trigger event is set to <span class="Monospace">NISCOPE_VAL_TV_EVENT_LINE_NUMBER</span>. Call <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureTVTriggerSource.html')"><span class="Monospace">niScope_ConfigureTVTriggerSource</span></a> to set the TV trigger event before calling this function.</p> +</body> +</html> + + + configuretvtriggersource + IVIComplianceObsoleteTrigger + Base + MCode + + function configuretvtriggersource(obj, Source, SignalFormat, Event, Polarity) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +Source = [double(Source) 0]; + +status = calllib(libname, 'niScope_ConfigureTVTriggerSource', session, Source, SignalFormat, Event, Polarity); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureTVTriggerSource</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureTVTriggerSource</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ConfigureTVTriggerSource&nbsp;(ViSession&nbsp;vi, ViConstString&nbsp;source, ViInt32&nbsp;signalFormat, ViInt32&nbsp;event, ViInt32&nbsp;polarity);</p> +<h2 class="purpose">Purpose</h2> + + + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp;This function is included for compliance with the IviScope Class Specification.</td></tr></table> +<p class = "Body">Configures the instrument for TV triggering. It configures the TV signal format, the event, and the signal polarity.</p><p class = "Body">This function affects instrument behavior +only if the trigger type is <span class="Monospace">NISCOPE_VAL_TV_TRIGGER</span>. Set the trigger type +and trigger coupling before calling this function.</p> +</body> +</html> + + + sendswtrigger + IVIComplianceObsoleteTrigger + Base + MCode + + function sendswtrigger(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_SendSWTrigger', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_SendSWTrigger</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_SendSWTrigger</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_SendSWTrigger&nbsp;(ViSession&nbsp;vi);</p> +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; + +This function is included for compliance with the IviScope Class Specification. Consider using <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_SendSoftwareTriggerEdge.html')"> +<span class="Monospace">niScope_SendSoftwareTriggerEdge</span></a> instead.</td></tr></table> + + +<p class = "Body">Sends a +command to trigger the digitizer. Call this function after you call <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ConfigureTriggerSoftware.html')"><span class="Monospace">niScope_ConfigureTriggerSoftware</span></a>.</p> +</body> +</html> + + + + + IVIComplianceObsoleteVertical + + + 1 + + + + + + + configurechannel + IVIComplianceObsoleteVertical + Base + MCode + + function configurechannel(obj, Channel, Range, Offset, Coupling, ProbeAttenuation, Enabled) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +Channel = [double(Channel) 0]; + +status = calllib(libname, 'niScope_ConfigureChannel', session, Channel, Range, Offset, Coupling, ProbeAttenuation, Enabled); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ConfigureChannel</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ConfigureChannel</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ConfigureChannel&nbsp;(ViSession&nbsp;vi, ViConstString&nbsp;channel, ViReal64&nbsp;range, ViReal64&nbsp;offset, ViInt32&nbsp;coupling, ViReal64&nbsp;probeAttenuation, ViBoolean&nbsp;enabled);</p> +<h2 class="purpose">Purpose</h2> +<p class="Body">This function is included for compliance with the IviScope Class Specification.</p><p class = "Body">Configures the most commonly configured attributes of the instrument's channel subsystem.</p> +</body> +</html> + + + + + Measurement + + + 1 + + + + + + + addwaveformprocessing + Measurement + Base + MCode + + function addwaveformprocessing(obj, ChannelList, MeasFunction) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_AddWaveformProcessing', session, ChannelList, MeasFunction); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_AddWaveformProcessing</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_AddWaveformProcessing</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_AddWaveformProcessing (ViSession vi, ViConstString channelList, ViInt32 measFunction);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Adds one measurement to the list of processing steps that are completed before the measurement. The processing is added on a per channel basis, and the processing measurements are completed in the same order they are registered. All measurement library parameters&#8212;the attributes starting with <span class="Monospace">NISCOPE_ATTR_MEAS</span>&#8212;are cached at the time of registering the processing, and this set of parameters is used during the processing step. The processing measurements are streamed, so the result of the first processing step is used as the input for the next step. The processing is done before any other measurements. +</p> + + +</body> +</html> + + + clearwaveformmeasurementstats + Measurement + Base + MCode + + function clearwaveformmeasurementstats(obj, ChannelList, ClearableMeasurementFunction) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_ClearWaveformMeasurementStats', session, ChannelList, ClearableMeasurementFunction); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ClearWaveformMeasurementStats</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ClearWaveformMeasurementStats +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ClearWaveformMeasurementStats (ViSession vi, ViConstString channelList, ViInt32 clearableMeasurementFunction);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Clears the waveform stats on the channel and measurement you specify. If you want +to clear all of the measurements, use <span class="Monospace">NISCOPE_VAL_ALL_MEASUREMENTS</span> in the +<strong>clearableMeasurementFunction</strong> parameter. +</p> +<p class="Body">Every time a measurement is called, the statistics information is updated, including the min, max, mean, standard deviation, and number of updates. This information is fetched with <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_FetchMeasurementStats.html')"><span class="Monospace">niScope_FetchMeasurementStats</span></a>. The multi-acquisition array measurements are also cleared with this function. +</p> + +</body> +</html> + + + clearwaveformprocessing + Measurement + Base + MCode + + function clearwaveformprocessing(obj, ChannelList) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; + +status = calllib(libname, 'niScope_ClearWaveformProcessing', session, ChannelList); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ClearWaveformProcessing</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ClearWaveformProcessing</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ClearWaveformProcessing (ViSession vi, ViConstString channelList);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Clears the list of processing steps assigned to the given channel. The processing is added using the <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_AddWaveformProcessing.html')"><span class="Monospace">niScope_AddWaveformProcessing</span></a> function, where the processing steps are completed in the same order in which they are registered. The processing measurements are streamed, so the result of the first processing step is used as the input for the next step. The processing is also done before any other measurements. +</p> + +</body> +</html> + + + fetcharraymeasurement + Measurement + Base + MCode + + function [MeasWfm, WfmInfo] = fetcharraymeasurement(obj, ChannelList, Timeout, ArrayMeasFunction, MeasWfmSize, MeasWfm, WfmInfo) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +MeasWfm = libpointer('doublePtr', MeasWfm); +WfmInfo = libstruct('niScope_wfmInfo', WfmInfo); + +status = calllib(libname, 'niScope_FetchArrayMeasurement', session, ChannelList, Timeout, ArrayMeasFunction, MeasWfmSize, MeasWfm, WfmInfo); + +MeasWfm = double(MeasWfm.Value); +WfmInfo = WfmInfo; + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_FetchArrayMeasurement</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +<script src="web.js" type="text/javascript"></script> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_FetchArrayMeasurement</h1> + + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_FetchArrayMeasurement (ViSession vi, ViConstString channelList, ViReal64 timeout, ViInt32 arrayMeasFunction, ViInt32 measWfmSize, ViReal64* measWfm, struct niScope_wfmInfo* wfmInfo);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Obtains a waveform from the digitizer and returns the specified measurement array. This function may return multiple waveforms depending on the number of channels, the acquisition type, and the number of records you specify. +</p> + + + + +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;Some functionality, such as time stamping, is not supported in all digitizers. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Features_Supported_Main.html')">Features Supported by Device</a> for more information. </td></tr></table> + + + +</body> +</html> + + + fetchmeasurement + Measurement + Base + MCode + + function [Result] = fetchmeasurement(obj, ChannelList, Timeout, ScalarMeasFunction, Result) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Result = libpointer('doublePtr', Result); + +status = calllib(libname, 'niScope_FetchMeasurement', session, ChannelList, Timeout, ScalarMeasFunction, Result); + +Result = double(Result.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_FetchMeasurement</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_FetchMeasurement</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_FetchMeasurement (ViSession vi, ViConstString channelList, ViReal64 timeout, ViInt32 scalarMeasFunction, ViReal64* result);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Fetches a waveform from the digitizer and performs the specified waveform measurement. + +Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Using_Fetch_Functions.html')">Using Fetch Functions</a> for more information. </p> + +<p class="Body">Many of the measurements use the low, mid, and high reference levels. You configure the low, mid, and high references by using <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_LOW_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_LOW_REF_LEVEL</span></A>, <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_MID_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_MID_REF_LEVEL</span></A>, and <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_HIGH_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_HIGH_REF_LEVEL</span></A> to set each channel differently. </p> +</body> +</html> + + + fetchmeasurementstats + Measurement + Base + MCode + + function [Result, Mean, Stdev, Min, Max, NumInStats] = fetchmeasurementstats(obj, ChannelList, Timeout, ScalarMeasFunction, Result, Mean, Stdev, Min, Max, NumInStats) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Result = libpointer('doublePtr', Result); +Mean = libpointer('doublePtr', Mean); +Stdev = libpointer('doublePtr', Stdev); +Min = libpointer('doublePtr', Min); +Max = libpointer('doublePtr', Max); +NumInStats = libpointer('int32Ptr', NumInStats); + +status = calllib(libname, 'niScope_FetchMeasurementStats', session, ChannelList, Timeout, ScalarMeasFunction, Result, Mean, Stdev, Min, Max, NumInStats); + +Result = double(Result.Value); +Mean = double(Mean.Value); +Stdev = double(Stdev.Value); +Min = double(Min.Value); +Max = double(Max.Value); +NumInStats = double(NumInStats.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_FetchMeasurementStats</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_FetchMeasurementStats</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_FetchMeasurementStats (ViSession vi, ViConstString channelList, ViReal64 timeout, ViInt32 scalarMeasFunction, ViReal64* result, ViReal64* mean, ViReal64* stdev, ViReal64* min, ViReal64* max, ViInt32*numInStats);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Obtains a waveform measurement and returns the measurement value. This function may return multiple statistical results depending on the number of channels, the acquisition type, and the number of records you specify. +</p> + + +<p class="Body">You specify a particular measurement type, such as rise time, frequency, or voltage peak-to-peak. The waveform on which the digitizer calculates the waveform measurement is from an acquisition that you previously initiated. The statistics for the specified measurement function are returned, where the statistics are updated once every acquisition when the specified measurement is fetched by any of the Fetch Measurement functions. If a Fetch Measurement function has not been called, this function fetches the data on which to perform the measurement. The statistics are cleared by calling <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_ClearWaveformMeasurementStats.html')"><span class="Monospace">niScope_ClearWaveformMeasurementStats</span></a>. Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Using_Fetch_Functions.html')">Using Fetch Functions</a> for more information on incorporating fetch functions in your application. +</p> +<p class="Body">Many of the measurements use the low, mid, and high reference levels. You configure the low, mid, and high references with <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_LOW_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_LOW_REF_LEVEL</span></A>, <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_MID_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_MID_REF_LEVEL</span></A>, and <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_HIGH_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_HIGH_REF_LEVEL</span></A> to set each channel differently. </p> + +</body> +</html> + + + readmeasurement + Measurement + Base + MCode + + function [Result] = readmeasurement(obj, ChannelList, Timeout, ScalarMeasFunction, Result) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ChannelList = [double(ChannelList) 0]; +Result = libpointer('doublePtr', Result); + +status = calllib(libname, 'niScope_ReadMeasurement', session, ChannelList, Timeout, ScalarMeasFunction, Result); + +Result = double(Result.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title> niScope_ReadMeasurement</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ReadMeasurement</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus_VI_FUNC niScope_ReadMeasurement (ViSession vi, + ViConstString channelList, + ViReal64 timeout, + ViInt32 scalarMeasFunction, + ViReal64* result); + </p> + + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Initiates an acquisition, waits for it to complete, and performs the specified waveform measurement for a single channel and record or for multiple channels and records.</p> + + +<p class="Body">Refer to <a href="javascript:LaunchHelp('Digitizers.chm::/Using_Fetch_Functions.html')">Using Fetch Functions</a> for more information. </p> + +<p class="Body">Many of the measurements use the low, mid, and high reference levels. You configure the low, mid, and high references by using +<a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_LOW_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_LOW_REF_LEVEL</span></A>, +<a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_MID_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_MID_REF_LEVEL</span></A>, +and <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviNISCOPE_ATTR_MEAS_CHAN_HIGH_REF_LEVEL.html')"><span class="Monospace">NISCOPE_ATTR_MEAS_CHAN_HIGH_REF_LEVEL</span></A> to set each channel differently.</p> + +</body> +</html> + + + + + OnboardSignalProcesingDDC + + + 1 + + + + + + Data_Processing_Mode + OnboardSignalProcesingDDC + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150304); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150304 ,propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "The way in which data is processed by the DDC block. + +Valid Values: +Real (0) +Complex (1) + +Default Value: Complex + " + + + DDC_Center_Frequency + OnboardSignalProcesingDDC + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150303); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150303 , propertyValue); + + + Double + none + + + never + "The frequency at which the DDC block frequency translates the input data. + +Default Value: 10 MHz + " + + + DDC_Enabled + OnboardSignalProcesingDDC + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150300); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150300, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables/disables the Digital Down Converter (DDC) block of the digitizer. When the DDC block is disabled, all DDC-related properties are disabled and have no effect on the acquired signal. +Default Value: VI_FALSE + " + + + Fetch_Interleaved_IQ_Data + OnboardSignalProcesingDDC + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150311); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150311, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables/disables interleaving of the I and Q data. When disabled, the traditional niScope_Fetch() functions will return the I waveform for each acquisition followed by the Q waveform. When enabled, the I and Q data are interleaved into a single waveform. In the interleaving case, you must allocate twice as many elements in the array as number of samples being fetched (since each sample contains an I and a Q component). + +Default Value: VI_TRUE + " + + + Frequency_Translation_Enabled + OnboardSignalProcesingDDC + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150302); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150302, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables/disables frequency translating the data around the user-selected center frequency down to baseband. + +Default Value: VI_TRUE + " + + + Q_Source + OnboardSignalProcesingDDC + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150310, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150310 , propertyValue); + + + String + none + + + never + "Indicates the channel that is the input of the Q path of the DDC. +Default Value: The channel that the attribute is configured off of. + " + + + + + + OnboardSignalProcesingDDCIQSignalAdjustmentsFrequencyTranslationPhase + + + 1 + + + + + + Frequency_Translation_Phase_I + OnboardSignalProcesingDDCIQSignalAdjustmentsFrequencyTranslationPhase + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150305); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150305 , propertyValue); + + + Double + none + + + never + "The I center frequency phase in degrees at the first point of the acquisition. +Default Value: 0 + " + + + Frequency_Translation_Phase_Q + OnboardSignalProcesingDDCIQSignalAdjustmentsFrequencyTranslationPhase + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150306); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150306 , propertyValue); + + + Double + none + + + never + "The Q center frequency phase in degrees at the first point of the acquisition. Usethis attribute only when NISCOPE_ATTR_DDC_DATA_PROCESSING_MODE is set to Complex. +Default Value: 90 + " + + + + + + OnboardSignalProcesingEqualization + + + 1 + + + + + + Equalization_Filter_Enabled + OnboardSignalProcesingEqualization + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150313); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150313, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables the onboard signal processing FIR block. This block is connected directly to the input signal. This filter is designed to compensate the input signal for artifacts introduced to the signal outside of the digitizer. However, since this is a generic FIR filter any coefficients are valid. Coefficients should be between +1 and -1 in value. " + + + Equalization_Num_Coefficients + OnboardSignalProcesingEqualization + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150312); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150312 ,propertyValue); + + + Double + none + + + never + "Returns the number of coefficients that the FIR filter can accept. This filter is designed to compensate the input signal for artifacts introduced to the signal outside of the digitizer. However, since this is a generic FIR filter any coefficients are valid. Coefficients should be between +1 and -1 in value. " + + + + + + OnboardSignalProcesingFractionalResample + + + 1 + + + + + + Fractional_Resample_Enabled + OnboardSignalProcesingFractionalResample + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150320); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150320, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables the onboard signal processing block that resamples the input waveform to the user desired sample rate. The default value is FALSE. " + + + Overflow_Error_Reporting + OnboardSignalProcesingFractionalResample + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150309); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150309 ,propertyValue); + + + Double + enum + + 0.0 + 1.0 + 2.0 + + + + never + "Configures error reporting when the DDC block detects an overflow in any of its stages. Overflows lead to clipping of the waveform. + +Valid Values: +Warning (0) +Error (1) +Disabled (2) + +Default Value: Warning + " + + + + + + PeertoPeer + + + 1 + + + + + + Channels_to_Stream + PeertoPeer + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150339, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150339 , propertyValue); + + + String + none + + + never + "Specifies which channels are written to a peer-to-peer endpoint. If multiple channels are specified, the channels are interleaved by sample. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + +Default Value: 0 + " + + + Endpoint_Overflow + PeertoPeer + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150344); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150344, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Returns TRUE if the endpoint FIFO has overflowed. Reset the endpoint to clear the overflow condition. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + " + + + Endpoint_Size + PeertoPeer + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150342); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150342 ,propertyValue); + + + Double + none + + + never + "Returns the size in samples of the peer-to-peer endpoint. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + " + + + FIFO_Endpoint_Count + PeertoPeer + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150345); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150345 ,propertyValue); + + + Double + none + + + never + "Returns the number of FIFO-based peer-to-peer endpoints this device supports. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + " + + + Most_Samples_Available_In_Endpoint + PeertoPeer + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150341); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150341 ,propertyValue); + + + Double + none + + + never + "Returns the most number of samples available to stream from a peer-to-peer endpoint since the last time this attribute was read. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + " + + + Onboard_Memory_Enabled + PeertoPeer + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150354); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150354, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies whether the digitizer writes data to onboard memory when a peer-to-peer endpoint is enabled. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + +Default Value: VI_FALSE + " + + + P2P_Enabled + PeertoPeer + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150338); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150338, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies whether the digitizer writes data to the peer-to-peer endpoint. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + +Default Value: VI_FALSE + " + + + Samples_Available_In_Endpoint + PeertoPeer + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150328); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150328 ,propertyValue); + + + Double + none + + + never + "Returns the current number of samples available to stream from a peer-to-peer endpoint. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + " + + + Samples_Transferred + PeertoPeer + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint64',RepCapIdentifier, 1150340); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint64',RepCapIdentifier, 1150340 ,propertyValue); + + + Double + none + + + never + "Returns the number of samples transferred through the peer-to-peer endpoint since it was last reset. + + "NOTE:Thisattributecanbeusedonlywithhigh-speeddigitizersthatsupportpeer-to-peerstreaming." + + + + + + PeertoPeerAdvanced + + + 1 + + + + + + Advanced_Attributes_Enabled + PeertoPeerAdvanced + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 0); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 0, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables/disables the advanced attributes for a peer-to-peer endpoint. These attributes cannot be used if an endpoint is being configured by NI-P2P, or a resource reservation error will occur. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + +Default Value: VI_FALSE + " + + + + + + PeertoPeerAdvancedAdvancedConfiguration + + + 1 + + + + + + Data_Transfer_Permission_Address + PeertoPeerAdvancedAdvancedConfiguration + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint64',RepCapIdentifier, 1150329); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint64',RepCapIdentifier, 1150329 ,propertyValue); + + + Double + none + + + never + "Returns the address of a hardware register used to grant permisison for the peer-to-peer endpoint to write data to another peer.. The type of this address is determined by the NISCOPE_ATTR_P2P_DATA_TRANS_PERMISSION_ADDR_TYPE attribute. Permission is granted in bytes and the register is additive. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + " + + + Data_Transfer_Permission_Address_Type + PeertoPeerAdvancedAdvancedConfiguration + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150330); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150330 ,propertyValue); + + + Double + enum + + 0.0 + 1.0 + + + + never + "Specifies the type of address returned from the NISCOPE_ATTR_P2P_DATA_TRANS_PERMISSION_ADDR attribute. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + +Valid Values: +Physical (0) +Virtual (1) + +Default Value: Virtual + " + + + Destination_Window_Address + PeertoPeerAdvancedAdvancedConfiguration + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint64',RepCapIdentifier, 1150331); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint64',RepCapIdentifier, 1150331 ,propertyValue); + + + Double + none + + + never + "Specifies the destination for data written by the peer-to-peer endpoint. The type of this address is specified by the NISCOPE_ATTR_P2P_DESTINATION_WINDOW_ADDR_TYPE attribute. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + +Valid Values: A valid, non-NULL physical or virtual address. + " + + + Destination_Window_Address_Type + PeertoPeerAdvancedAdvancedConfiguration + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150332); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150332 ,propertyValue); + + + Double + enum + + 0.0 + 1.0 + + + + never + "Specifies the type of the NISCOPE_ATTR_P2P_DESTINATION_WINDOW_ADDR attribute. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + +Valid Values: +Physical (0) +Virtual (1) + +Default Value: Virtual + " + + + Destination_Window_Size + PeertoPeerAdvancedAdvancedConfiguration + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint64',RepCapIdentifier, 1150333); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint64',RepCapIdentifier, 1150333 ,propertyValue); + + + Double + none + + + never + "Specifies the size, in bytes, of the destination window determined by the NISCOPE_ATTR_P2P_DESTINATION_WINDOW_ADDRESS and the NISCOPE_ATTR_P2P_DESTINATION_WINDOW_ADDRESS_TYPE attributes. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + +Valid Values: Any non-NULL value. + " + + + + + + PeertoPeerAdvancedAdvancedStatusNotification + + + 1 + + + + + + Message_Push_Address + PeertoPeerAdvancedAdvancedStatusNotification + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint64',RepCapIdentifier, 1150335); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint64',RepCapIdentifier, 1150335 ,propertyValue); + + + Double + none + + + never + "Specifies the address to Push Message push Value to on the event specified by the NISCOPE_ATTR_P2P_NOTIFY_PUSH_MESSAGE_ON attribute. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + " + + + Message_Push_Address_Type + PeertoPeerAdvancedAdvancedStatusNotification + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150336); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150336 ,propertyValue); + + + Double + enum + + 0.0 + 1.0 + + + + never + "Specifies the type of the NISCOPE_ATTR_P2P_NOTIFY_MESSAGE_PUSH_ADDR attribute. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + +Valid Values: +Physical (0) +Virtual (1) + +Default Value: Virtual + " + + + Message_Push_Value + PeertoPeerAdvancedAdvancedStatusNotification + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint64',RepCapIdentifier, 1150337); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint64',RepCapIdentifier, 1150337 ,propertyValue); + + + Double + none + + + never + "Specifies the value to be pushed to the NISCOPE_ATTR_P2P_NOTIFY_MESSAGE_PUSH_ADDR attribute on the event specified by the NISCOPE_ATTR_MESSAGE_PUSH_ON attribute. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. +" + + + Push_Message_On + PeertoPeerAdvancedAdvancedStatusNotification + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150334); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150334 ,propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies the event to push the NISCOPE_ATTR_P2P_NOTIFY_MESSAGE_PUSH_VALUE attribute to the NISCOPE_ATTR_P2P_NOTIFY_MESSAGE_PUSH_ADDR attribute. Setting this attribute to NISCOPE_VAL_NOTIFY_DONE pushes the message when the acquisition has completed. +NOTE: This attribute can be used only with high-speed digitizers that support peer-to-peer streaming. + +Valid Values: +Never (0) +Done (1) + +Default Value: Done + " + + + + + + Synchronization + + + 1 + + + + + + Master_Enable + Synchronization + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150008); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150008, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies whether you want the device to be a master or a slave. The master typically originates the trigger signal and clock sync pulse. For a standalone device, set this attribute to VI_FALSE. + " + + + + + + Synchronization5VoltSignal + + + 1 + + + + + + Output_Terminal + Synchronization5VoltSignal + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150129, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150129 , propertyValue); + + + String + enum + + + + + + + + + + + + + + + + never + "Specifies the destination for the 5 Volt signal. + +Consult your device documentation for a specific list of valid destinations. + " + + + + + + SynchronizationArmReferenceTrigger + + + 1 + + + + + + Source + SynchronizationArmReferenceTrigger + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150095, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150095 , propertyValue); + + + String + enum + + + + + + + + + + + + + + + + + never + "Specifies the source the digitizer monitors for an arm reference trigger. When the arm reference trigger is received, the digitizer begins looking for a reference (stop) trigger from the user-configured trigger source. + " + + + + + + SynchronizationStartTriggerAcqArm + + + 1 + + + + + + Record_Arm_Source + SynchronizationStartTriggerAcqArm + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150065, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150065 , propertyValue); + + + String + enum + + + + + + + + + + + + + + + + never + "Specifies the record arm source. + " + + + + + + SynchronizationTriggerCalibrationDelay + + + 1 + + + + + + Slave_Trigger_Delay + SynchronizationTriggerCalibrationDelay + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150046); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150046 , propertyValue); + + + Double + none + + + never + "Specifies the delay for the trigger from the master to the slave in seconds. This value adjusts the initial X value of the slave devices to correct for the propagation delay between the master trigger output and slave trigger input. + " + + + Trigger_from_PFI_Delay + SynchronizationTriggerCalibrationDelay + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150052); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "This is a factory-programmed value that specifies the delay for the PFI lines to the trigger input in seconds. By itself, this attribute has no effect on the acquired data. However, depending on how the trigger lines are routed between the master and slave devices, you can use this value as a starting point to set NISCOPE_ATTR_SLAVE_TRIGGER_DELAY. + " + + + Trigger_from_RTSI_Delay + SynchronizationTriggerCalibrationDelay + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150051); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "This is a factory-programmed value that specifies the delay for the RTSI bus to the trigger input in seconds. By itself, this attribute has no effect on the acquired data. However, depending on how the trigger lines are routed between the master and slave devices, you can use this value as a starting point to set NISCOPE_ATTR_SLAVE_TRIGGER_DELAY. + " + + + Trigger_from_Star_Delay + SynchronizationTriggerCalibrationDelay + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150050); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "This is a factory-programmed value that specifies the delay for PXI Star Trigger line to the trigger input in seconds. By itself, this attribute has no effect on the acquired data. However, depending on how the trigger lines are routed between the master and slave devices, you can use this value as a starting point to set NISCOPE_ATTR_SLAVE_TRIGGER_DELAY. + " + + + Trigger_to_PFI_Delay + SynchronizationTriggerCalibrationDelay + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150049); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "This is a factory-programmed value that specifies the delay for the trigger to the PFI lines in seconds. By itself, this attribute has no effect on the acquired data. However, depending on how the trigger lines are routed between the master and slave devices, you can use this value as a starting point to set NISCOPE_ATTR_SLAVE_TRIGGER_DELAY. + " + + + Trigger_to_RTSI_Delay + SynchronizationTriggerCalibrationDelay + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150048); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "This is a factory-programmed value that specifies the delay for the trigger to the RTSI bus in seconds. By itself, this attribute has no effect on the acquired data. However, depending on how the trigger lines are routed between the master and slave devices, you can use this value as a starting point to set NISCOPE_ATTR_SLAVE_TRIGGER_DELAY. + " + + + Trigger_to_Star_Delay + SynchronizationTriggerCalibrationDelay + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150047); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. + + + + Double + none + + + always + "This is a factory-programmed value that specifies the delay for the trigger to the PXI Star Trigger line in seconds. By itself, this attribute has no effect on the acquired data. However, depending on how the trigger lines are routed between the master and slave devices, you can use this value as a starting point to set NISCOPE_ATTR_SLAVE_TRIGGER_DELAY. + " + + + + + + Triggering + + + 1 + + + + + + Auto_Triggered + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150278); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150278, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies if the last acquisition was auto triggered. You can use the Auto Triggered attribute to find out if the last acquisition was triggered. + + + + Start_To_Ref_Trigger_Holdoff + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150103); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150103 , propertyValue); + + + Double + none + + + never + "Pass the length of time you want the digitizer to wait after it starts acquiring data until the digitizer enables the trigger system to detect a reference (stop) trigger. + +Units: Seconds + +Valid Values: 0.0 - 171.8 + " + + + Trigger_Coupling + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250014); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250014 ,propertyValue); + + + Double + enum + + 1001.0 + 2.0 + 1.0 + 0.0 + 3.0 + + + + never + "Specifies how the digitizer couples the trigger source. This attribute affects instrument operation only when NISCOPE_ATTR_TRIGGER_TYPE is set to NISCOPE_VAL_EDGE_TRIGGER, NISCOPE_VAL_HYSTERESIS_TRIGGER, or NISCOPE_VAL_WINDOW_TRIGGER. + " + + + Trigger_Delay + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250015); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250015 , propertyValue); + + + Double + none + + + never + "Specifies the trigger delay time in seconds. The trigger delay time is the length of time the digitizer waits after it receives the trigger. The event that occurs when the trigger delay elapses is the Reference Event. +Valid Values: 0.0 - 171.8 + " + + + Trigger_Holdoff + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250016); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250016 , propertyValue); + + + Double + none + + + never + "Specifies the length of time (in seconds) the digitizer waits after detecting a trigger before enabling the trigger subsystem to detect another trigger. This attribute affects instrument operation only when the digitizer requires multiple acquisitions to build a complete waveform. The digitizer requires multiple waveform acquisitions when it uses equivalent-time sampling or when the digitizer is configured for a multi-record acquisition through a call to niScope_ConfigureHorizontalTiming. + +Valid Values: 0.0 - 171.8 + " + + + Trigger_Hysteresis + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150006); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150006 , propertyValue); + + + Double + none + + + never + "Specifies the size of the hysteresis window on either side of the trigger level. The digitizer triggers when the trigger signal passes through the threshold you specify with the Trigger Level parameter, has the slope you specify with the Trigger Slope parameter, and passes through the hysteresis window that you specify with this parameter. + +Valid Values: +Min Value: 0 +Max Value: + For positive trigger slope: + Hysteresis - trigger level >= -(vertical range/2) + vertical offset + For negative trigger slope: + Hysteresis + trigger level <= vertical range/2 + vertical offset + " + + + Trigger_Impedance + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150075); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150075 , propertyValue); + + + Double + none + + + never + "Specifies the input impedance for the external analog trigger channel in Ohms. + +Valid Values: +50 - 50 ohms +1000000 - 1 mega ohm + " + + + Trigger_Level + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250017); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250017 , propertyValue); + + + Double + none + + + never + "Specifies the voltage threshold for the trigger subsystem. The units are volts. This attribute affects instrument behavior only when the NISCOPE_ATTR_TRIGGER_TYPE is set to NISCOPE_VAL_EDGE_TRIGGER, NISCOPE_VAL_HYSTERESIS_TRIGGER, or NISCOPE_VAL_WINDOW_TRIGGER. + +Valid Values: +The values of the range and offset parameters in niScope_ConfigureVertical determine the valid range for the trigger level on the channel you use as the Trigger Source. The value you pass for this parameter must meet the following conditions: Trigger Level <= Vertical Range/2 + Vertical Offset and Vertical Range >= (-Vertical Range/2) + Vertical Offset + " + + + Trigger_Modifier + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250102); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250102 ,propertyValue); + + + Double + enum + + 1.0 + 2.0 + + + + never + "Configures the device to automatically complete an acquisition if a trigger has not been received. + +Valid Values: +None (1) - Normal triggering +Auto Trigger (2) - Auto trigger acquisition if no trigger arrives + " + + + Trigger_Output_Terminal + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150098, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150098 , propertyValue); + + + String + enum + + + + + + + + + + + + + + + + never + "Specifies the destination export for the reference (stop) trigger. + +Consult your device documentation for a specific list of valid destinations. + " + + + Trigger_Slope + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250018); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250018 ,propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies if a rising or a falling edge triggers the digitizer. This attribute affects instrument operation only when NISCOPE_ATTR_TRIGGER_TYPE is set to NISCOPE_VAL_EDGE_TRIGGER, NISCOPE_VAL_HYSTERESIS_TRIGGER, or NISCOPE_VAL_WINDOW_TRIGGER. + " + + + Trigger_Source + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1250013, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1250013 , propertyValue); + + + String + enum + + + + + + + + + + + + + + + + + + + never + "Specifies the source the digitizer monitors for the trigger event. + " + + + Trigger_Type + Triggering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250012); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250012 ,propertyValue); + + + Double + enum + + 1004.0 + 1001.0 + 5.0 + 1002.0 + 1003.0 + 1.0 + 6.0 + + + + never + "Specifies the type of trigger to use. + " + + + + + + TriggeringOnboardSignalProcesing + + + 1 + + + + + + Ref_Trig_Min_Quiet_Time + TriggeringOnboardSignalProcesing + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150315); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150315 , propertyValue); + + + Double + none + + + never + "The amount of time the trigger circuit must not detect a signal above the trigger level before the trigger is armed. This attribute is useful for triggering at the beginning and not in the middle of signal bursts. + " + + + Ref_Trigger_Dectector_Location + TriggeringOnboardSignalProcesing + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150314); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150314 ,propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Indicates which analog compare circuitry to use on the device. + " + + + + + + TriggeringTriggerVideoTV + + + 1 + + + + + + Enable_DC_Restore + TriggeringTriggerVideoTV + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150093); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150093, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Restores the video-triggered data retrieved by the digitizer to the video signal's zero reference point. + +Valid Values: +VI_TRUE - Enable DC restore +VI_FALSE - Disable DC restore + " + + + Video_Line_Number + TriggeringTriggerVideoTV + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250206); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250206 ,propertyValue); + + + Double + none + + + never + "Specifies the line on which to trigger, if NISCOPE_ATTR_TV_TRIGGER_EVENT is set to line number. The valid ranges of the attribute depend on the signal format selected. M-NTSC has a valid range of 1 to 525. B/G-PAL, SECAM, 576i, and 576p have a valid range of 1 to 625. 720p has a valid range of 1 to 750. 1080i and 1080p have a valid range of 1125. + " + + + Video_Polarity + TriggeringTriggerVideoTV + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250204); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250204 ,propertyValue); + + + Double + enum + + 1.0 + 2.0 + + + + never + "Specifies whether the video signal sync is positive or negative. + " + + + Video_Signal_Format + TriggeringTriggerVideoTV + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250201); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250201 ,propertyValue); + + + Double + enum + + 1041.0 + 1032.0 + 1042.0 + 1016.0 + 2.0 + 3.0 + 1025.0 + 1.0 + 1015.0 + 1045.0 + 1011.0 + 1020.0 + 1040.0 + 1001.0 + 1031.0 + 1010.0 + 1033.0 + + + + never + "Specifies the type of video signal, such as NTSC, PAL, or SECAM. + " + + + Video_Trigger_Event + TriggeringTriggerVideoTV + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250205); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250205 ,propertyValue); + + + Double + enum + + 4.0 + 2.0 + 1.0 + 5.0 + 3.0 + + + + never + "Specifies the condition in the video signal that causes the digitizer to trigger. + " + + + + + + TriggeringTriggerWindow + + + 1 + + + + + + High_Window_Level + TriggeringTriggerWindow + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150014); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150014 , propertyValue); + + + Double + none + + + never + "Pass the upper voltage threshold you want the digitizer to use for window triggering. + +The digitizer triggers when the trigger signal enters or leaves the window you specify with NISCOPE_ATTR_TRIGGER_WINDOW_LOW_LEVEL and NISCOPE_ATTR_TRIGGER_WINDOW_HIGH_LEVEL + +Valid Values: +The values of the Vertical Range and Vertical Offset parameters in niScope_ConfigureVertical determine the valid range for the High Window Level on the channel you use as the Trigger Source parameter in niScope_ConfigureTriggerSource. The value you pass for this parameter must meet the following conditions. + +High Trigger Level <= Vertical Range/2 + Vertical Offset +High Trigger Level >= (-Vertical Range/2) + Vertical Offset +High Trigger Level > Low Trigger Level + " + + + Low_Window_Level + TriggeringTriggerWindow + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150013); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150013 , propertyValue); + + + Double + none + + + never + "Pass the lower voltage threshold you want the digitizer to use for window triggering. + +The digitizer triggers when the trigger signal enters or leaves the window you specify with NISCOPE_ATTR_TRIGGER_WINDOW_LOW_LEVEL and NISCOPE_ATTR_TRIGGER_WINDOW_HIGH_LEVEL. + +Units: Volts + +Valid Values: +The values of the Vertical Range and Vertical Offset parameters in niScope_ConfigureVertical determine the valid range for the Low Window Level on the channel you use as the Trigger Source parameter in niScope_ConfigureTriggerSource. The value you pass for this parameter must meet the following conditions. + +Low Trigger Level <= Vertical Range/2 + Vertical Offset +Low Trigger Level >= (-Vertical Range/2) + Vertical Offset +Low Trigger Level < High Trigger Level + " + + + Window_Mode + TriggeringTriggerWindow + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150012); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150012 ,propertyValue); + + + Double + enum + + 0.0 + 1.0 + + + + never + "Specifies whether you want a trigger to occur when the signal enters or leaves the window specified by NISCOPE_ATTR_TRIGGER_WINDOW_LOW_LEVEL, or NISCOPE_ATTR_TRIGGER_WINDOW_HIGH_LEVEL. + " + + + + + + Utility + + + 1 + + + + + + + disable + Utility + Base + MCode + + function disable(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_Disable', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_Disable</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_Disable</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_Disable (ViSession vi);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Aborts any current operation, opens data channel relays, and releases RTSI and PFI lines. +</p> +</body> +</html> + + + isdeviceready + Utility + Base + MCode + + function [DeviceReady] = isdeviceready(obj, ResourceName, ChannelList) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ResourceName = [double(ResourceName) 0]; +ChannelList = [double(ChannelList) 0]; +DeviceReady = libpointer('uint16Ptr', 0); + +status = calllib(libname, 'niScope_IsDeviceReady', ResourceName, ChannelList, DeviceReady); + +DeviceReady = double(DeviceReady.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_IsDeviceReady</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_IsDeviceReady</h1> + +<h2>C Function Prototype</h2> +<p class="syntax"> + +ViStatus niScope_IsDeviceReady +(ViRsrc resourceName, + ViConstString channelList, +ViBoolean* deviceReady);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body"> Call this function to determine whether the +device is ready for use or the device is still undergoing initialization. + + </p> + + + + +</body> +</html> + + + probecompensationsignalstart + Utility + Base + MCode + + function probecompensationsignalstart(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ProbeCompensationSignalStart', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ProbeCompensationSignalStart</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ProbeCompensationSignalStart</h1> +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ProbeCompensationSignalStart (ViSession vi);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Starts the 1&nbsp;kHz square wave output on PFI&nbsp;1 for probe compensation. +</p> +</body> +</html> + + + probecompensationsignalstop + Utility + Base + MCode + + function probecompensationsignalstop(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ProbeCompensationSignalStop', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ProbeCompensationSignalStop</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ProbeCompensationSignalStop</h1> +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ProbeCompensationSignalStop (ViSession vi);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Stops the 1&nbsp;kHz square wave output on PFI&nbsp;1 for probe compensation.</p> + +</body> +</html> + + + reset + Utility + Base + MCode + + function reset(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_reset', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_reset</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_reset</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_reset (ViSession vi);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Resets the digitizer to its <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviAttribute_Defaults.html')">default state</a>. </p> + +</body> +</html> + + + resetdevice + Utility + Base + MCode + + function resetdevice(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ResetDevice', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ResetDevice</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ResetDevice</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_ResetDevice (ViSession vi);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Performs a hard reset of the device. Acquisition stops, all routes are released, RTSI and PFI lines are +tristated, hardware is configured to its default state, and all session attributes are reset to their default state. + +</p> +</body> +</html> + + + resetwithdefaults + Utility + Base + MCode + + function resetwithdefaults(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ResetWithDefaults', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_ResetWithDefaults</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_ResetWithDefaults</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_Reset_With_Defaults (ViSession vi);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Performs a software reset of the device, returning it to the default state and applying any initial default settings from the IVI Configuration Store. +</p> +</body> +</html> + + + revisionquery + Utility + Base + MCode + + function [DriverRevision, FirmwareRevision] = revisionquery(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +DriverRevision = libpointer('int8Ptr', repmat(10, 1, 512)); +FirmwareRevision = libpointer('int8Ptr', repmat(10, 1, 512)); + +status = calllib(libname, 'niScope_revision_query', session, DriverRevision, FirmwareRevision); + +DriverRevision = strtrim(char(DriverRevision.Value)); +FirmwareRevision = strtrim(char(FirmwareRevision.Value)); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_revision_query</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_revision_query</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_revision_query (ViSession vi, + ViChar driverRev[IVI_MAX_MESSAGE_BUF_SIZE], + ViChar instrRev[IVI_MAX_MESSAGE_BUF_SIZE]);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Returns the revision numbers of the instrument driver and instrument firmware. </p> + +</body> +</html> + + + selftest + Utility + Base + MCode + + function [SelfTestResult, SelfTestMessage] = selftest(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +SelfTestResult = libpointer('int16Ptr', 0); +SelfTestMessage = libpointer('int8Ptr', repmat(10, 1, 512)); + +status = calllib(libname, 'niScope_self_test', session, SelfTestResult, SelfTestMessage); + +SelfTestResult = double(SelfTestResult.Value); +SelfTestMessage = strtrim(char(SelfTestMessage.Value)); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_self_test</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_self_test</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_self_test (ViSession vi, ViInt16* selfTestResult, ViChar selfTestMessage[IVI_MAX_MESSAGE_BUF_SIZE]);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Runs the instrument self-test routine and returns the test result(s). </p> + +</body> +</html> + + + + + UtilityFunctionsErrorHandling + + + 1 + + + + + + + clearerror + UtilityFunctionsErrorHandling + Base + MCode + + function clearerror(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); + +status = calllib(libname, 'niScope_ClearError', session); + + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> + +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<link rel="stylesheet" type="text/css" href="styles.css"> +<title>niScope_ClearError</title> +</head> +<body><h1 class="function">niScope_ClearError</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus&nbsp;niScope_ClearError&nbsp;(ViSession&nbsp;vi);</p> +<h2 class="purpose">Purpose</h2> + +<table class="Borderless-Wide"> +<tr> +<td class="Icon"><img src="note.gif"></td> +<td> +<strong>Note</strong>&nbsp;&nbsp; +This function is included for compliance with the IviScope Class Specification.</td></tr></table><p class = "Body">Clears the error information for the current execution thread and the IVI session you specify. If you pass <span class="Monospace">VI_NULL</span> for the Instrument Handle parameter, this function clears the error information only for the current execution thread.</p> +</body> +</html> + + + errorhandler + UtilityFunctionsErrorHandling + Base + MCode + + function [ErrorSource, ErrorDescription] = errorhandler(obj, ErrorCode) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ErrorSource = libpointer('int8Ptr', repmat(10, 1, 512)); +ErrorDescription = libpointer('int8Ptr', repmat(10, 1, 512)); + +status = calllib(libname, 'niScope_errorHandler', session, ErrorCode, ErrorSource, ErrorDescription); + +ErrorSource = strtrim(char(ErrorSource.Value)); +ErrorDescription = strtrim(char(ErrorDescription.Value)); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_errorHandler</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_errorHandler +</h1> + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_errorHandler (ViSession vi, + ViInt32 errorCode, + ViChar errorSource[MAX_FUNCTION_NAME_SIZE], + ViChar errorDescription[MAX_ERROR_DESCRIPTION]);</p> + + +<h2 class="purpose">Purpose</h2> + + +<p class="Body">Takes the error code returned by NI-SCOPE functions and returns the interpretation as a user-readable string. +</p> +<table class="Borderless"><tr><td class="Icon"><img src="note.gif"></td><td><strong>Note</strong>&nbsp;&nbsp;You can pass <span class="Monospace">VI_NULL</span> as the instrument handle, which is useful to interpret errors after <span class="Monospace">niScope_init</span> has failed.</td></tr></table> + + + +</body> +</html> + + + geterrormessage + UtilityFunctionsErrorHandling + Base + MCode + + function [ErrorMessage] = geterrormessage(obj, ErrorCode, Buffer_Size) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +ErrorMessage = libpointer('int8Ptr', repmat(10, 1, 512)); + +status = calllib(libname, 'niScope_GetErrorMessage', session, ErrorCode, Buffer_Size, ErrorMessage); + +ErrorMessage = strtrim(char(ErrorMessage.Value)); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_GetErrorMessage</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_GetErrorMessage</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_GetErrorMessage (ViSession vi, + ViStatus errorCode, + ViInt32 bufferSize, + ViChar errorMessage[]);</p> + +<h2 class="purpose">Purpose</h2> + + +<p class ="body"> +Returns the error code from an NI-SCOPE function as a user-readable string. Use VI_NULL as the default instrument handle. </p> + <p class ="body"> +You must call this function twice. For the first call, set <strong>bufferSize</strong> to 0 to prevent the function from populating the error message. Instead, the function returns the size of the error string. Use the returned size to create a buffer, then call the function again, passing in the new buffer and setting <strong>bufferSize</strong> equal to the size that was returned in the first function call. +<p class="Body"> +</p> + + +</body> +</html> + + + + + UtilityFunctionsLocking + + + 1 + + + + + + + locksession + UtilityFunctionsLocking + Base + MCode + + function [CallerHasLock] = locksession(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +CallerHasLock = libpointer('uint16Ptr', 0); + +status = calllib(libname, 'niScope_LockSession', session, CallerHasLock); + +CallerHasLock = double(CallerHasLock.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_LockSession</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_LockSession +</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax"> +ViStatus niScope_LockSession (ViSession vi, ViBoolean* callerHasLock);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Obtains a multithread lock on the instrument session. Before doing so, it waits until all other execution threads have released their locks on the instrument session. Other threads might have obtained a lock on this session in the following ways: +</p> +<ul> + +<li>Your application called niScope_LockSession +</li> +<li>A call to the instrument driver locked the session +</li> +<li>A call to the IVI engine locked the session +</li> +</ul> + +<p class="Body">After your call to <span class="Monospace">niScope_LockSession</span> returns successfully, no other threads can access the instrument session until you call <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_UnlockSession.html')"><span class="Monospace">niScope_UnlockSession</span></a>. Use niScope_LockSession and niScope_UnlockSession around a sequence of calls to instrument driver functions if you require that the instrument retain its settings through the end of the sequence. +</p> +<p class="Body">You can safely make nested calls to <span class="Monospace">niScope_LockSession</span> within the same thread. To completely unlock the session, you must balance each call to <span class="Monospace">niScope_LockSession</span> with a call to <span class="Monospace">niScope_UnlockSession</span>. If, however, you use the <strong>callerHasLock</strong> in all calls to <span class="Monospace">niScope_LockSession</span> and <span class="Monospace">niScope_UnlockSession</span> within a function, the IVI Library locks the session only once within the function regardless of the number of calls you make to <span class="Monospace">niScope_LockSession</span>. This allows you to call <span class="Monospace">niScope_UnlockSession</span> just once at the end of the function. +</p> + +</body> +</html> + + + unlocksession + UtilityFunctionsLocking + Base + MCode + + function [CallerHasLock] = unlocksession(obj) + +libname = get(get(obj, 'Parent'), 'DriverName'); +session = get(get(obj, 'Parent'), 'Interface'); +CallerHasLock = libpointer('uint16Ptr', 0); + +status = calllib(libname, 'niScope_UnlockSession', session, CallerHasLock); + +CallerHasLock = double(CallerHasLock.Value); + +if (status < 0) + privateErrorHandling( libname, 'niScope', session, status); +end + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<head> +<script type="text/javascript" src="launchhelp.js"></script> +<script type="text/javascript" src="pdf.js"></script> +<title>niScope_UnlockSession</title> +<link rel="STYLESHEET" type="print/css" href="print.css"> +<link rel="STYLESHEET" type="text/css" href="styles.css"> +</head> +<body bgcolor="#ffffff"><h1 class="function">niScope_UnlockSession</h1> + + +<h2>C Function Prototype</h2> +<p class="syntax">ViStatus niScope_UnlockSession (ViSession vi, ViBoolean* callerHasLock);</p> + +<h2 class="purpose">Purpose</h2> + +<p class="Body">Releases a lock that you acquired on an instrument session using <a href="javascript:LaunchMergedHelp('Digitizers.chm','scopeFunc.chm','cviniScope_LockSession.html')"><span class="Monospace">niScope LockSession</span></a>. +</p> +</body> +</html> + + + + + Vertical + + + 1 + + + + + + Channel_Enabled + Vertical + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1250005); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1250005, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Specifies whether the digitizer acquires a waveform for the channel. + +Valid Values: +VI_TRUE (1) - Acquire data on this channel +VI_FALSE (0) - Don't acquire data on this channel + " + + + Channel_Terminal_Configuration + Vertical + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150107); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150107 ,propertyValue); + + + Double + enum + + 1.0 + 2.0 + 0.0 + + + + never + "Specifies the terminal configuration for the channel. + " + + + Input_Impedance + Vertical + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250103); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250103 , propertyValue); + + + Double + enum + + 1000000.0 + 50.0 + 75.0 + + + + never + "Specifies the input impedance for the channel in Ohms. + " + + + Maximum_Input_Frequency + Vertical + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250006); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250006 , propertyValue); + + + Double + none + + + never + "Specifies the bandwidth of the channel. Express this value as the frequency at which the input circuitry attenuates the input signal by 3 dB. The units are hertz. + +Defined Values: +NISCOPE_VAL_BANDWIDTH_FULL (-1.0) +NISCOPE_VAL_BANDWIDTH_DEVICE_DEFAULT (0.0) +NISCOPE_VAL_20MHZ_BANDWIDTH (20000000.0) +NISCOPE_VAL_100MHZ_BANDWIDTH (100000000.0) +NISCOPE_VAL_20MHZ_MAX_INPUT_FREQUENCY (20000000.0) +NISCOPE_VAL_100MHZ_MAX_INPUT_FREQUENCY (100000000.0) +Refer to the NI High-Speed Digitizers Help for a list of bandwidths supported for each device. + " + + + Probe_Attenuation + Vertical + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250004); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250004 , propertyValue); + + + Double + none + + + never + "Specifies the probe attenuation for the input channel. For example, for a 10:1 probe, set this attribute to 10.0. + +Valid Values: +Any positive real number. Typical values are 1, 10, and 100. + " + + + Vertical_Coupling + Vertical + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1250003); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1250003 ,propertyValue); + + + Double + enum + + 1.0 + 2.0 + 0.0 + + + + never + "Specifies how the digitizer couples the input signal for the channel. When input coupling changes, the input stage takes a finite amount of time to settle. + " + + + Vertical_Offset + Vertical + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250002); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250002 , propertyValue); + + + Double + none + + + never + "Specifies the location of the center of the range. The value is with respect to ground and is in volts. For example, to acquire a sine wave that spans between 0.0 and 10.0 V, set this attribute to 5.0 V. +Note This attribute is not supported by all digitizers.Refer to the NI High-Speed Digitizers Help for a list of vertical offsets supported for each device. + " + + + Vertical_Range + Vertical + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1250001); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1250001 , propertyValue); + + + Double + none + + + never + "Specifies the absolute value of the input range for a channel in volts. For example, to acquire a sine wave that spans between -5 and +5 V, set this attribute to 10.0 V. +Refer to the NI High-Speed Digitizers Help for a list of supported vertical ranges for each device. If the specified range is not supported by a device, the value is coerced up to the next valid range. + " + + + + + + VerticalAdvanced + + + 1 + + + + + + Bandpass_Filter_Enabled + VerticalAdvanced + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150318); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150318, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables the bandpass filter on the specificed channel. The default value is FALSE. + " + + + Digital_Gain + VerticalAdvanced + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150307); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150307 , propertyValue); + + + Double + none + + + never + "Applies gain to the specified channel in hardware before any onboard processing. + +Valid Values: +-1.5 to 1.5 + " + + + Digital_Offset + VerticalAdvanced + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150308); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150308 , propertyValue); + + + Double + none + + + never + "Applies offset to the specified channel in hardware before any onboard processing. + +Valid Values: +-1.5 to 1.5 V + " + + + Dither_Enabled + VerticalAdvanced + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviboolean',RepCapIdentifier, 1150319); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviboolean',RepCapIdentifier, 1150319, propertyValue); + + + Double + enum + + 1.0 + 0.0 + + + + never + "Enables or Disables the analog dither on the device. The default value is FALSE. + +Using dither can improve the spectral performance of the device by reducing the effects of quantization. However, adding dither increases the power level to the ADC, so you may need to either decrease the signal level or increase your vertical range. + " + + + Flex_FIR_Antialias_Filter_Type + VerticalAdvanced + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150271); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150271 ,propertyValue); + + + Double + enum + + 3.0 + 2.0 + 1.0 + 0.0 + + + + never + "The NI 5922 flexible-resolution digitizer uses an onboard FIR lowpass antialias filter. +Use this attribute to select from several types of filters to achieve desired filtering characteristics. + " + + + + + + WaveformMeasurements + + + 1 + + + + + + Array_Gain + WaveformMeasurements + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150043); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150043 , propertyValue); + + + Double + none + + + never + "Every element of an array is multiplied by this scalar value during the Array Gain measurement. Refer to NISCOPE_VAL_ARRAY_GAIN for more information. + +Default: 1.0" + + + Array_Offset + WaveformMeasurements + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150044); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150044 , propertyValue); + + + Double + none + + + never + "Every element of an array is added to this scalar value during the Array Offset measurement. Refer to NISCOPE_VAL_ARRAY_OFFSET for more information. + +Default: 0.0" + + + Hysteresis_Percent + WaveformMeasurements + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150019); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150019 , propertyValue); + + + Double + none + + + never + "Digital hysteresis that is used in several of the scalar waveform measurements. This attribute specifies the percentage of the full-scale vertical range for the hysteresis window size. + +Default: 2%" + + + Last_Acquisition_Histogram_Size + WaveformMeasurements + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150020); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150020 ,propertyValue); + + + Double + none + + + never + "Specifies the size (that is, the number of bins) in the last acquisition histogram. This histogram is used to determine several scalar measurements, most importantly voltage low and voltage high. + +Default: 256" + + + Other_Channel + WaveformMeasurements + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevistring',RepCapIdentifier, 1150018, 512); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevistring',RepCapIdentifier, 1150018 , propertyValue); + + + String + none + + + never + "Specifies the second channel for two-channel measurements, such as NISCOPE_VAL_ADD_CHANNELS. If processing steps are registered with this channel, the processing is done before the waveform is used in a two-channel measurement. + +Default: '0'" + + + + + + WaveformMeasurementsDigitalFiltering + + + 1 + + + + + + Filter_Center_Frequency + WaveformMeasurementsDigitalFiltering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150032); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150032 , propertyValue); + + + Double + none + + + never + "The center frequency in hertz for filters of type bandpass and bandstop. The width of the filter is specified by NISCOPE_ATTR_MEAS_FILTER_WIDTH, where the cutoff frequencies are the center �width. + +Default: 1.0e6 Hz" + + + Filter_Cutoff_Frequency + WaveformMeasurementsDigitalFiltering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150031); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150031 , propertyValue); + + + Double + none + + + never + "Specifies the cutoff frequency in hertz for filters of type lowpass and highpass. The cutoff frequency definition varies depending on the filter. + +Default: 1.0e6 Hz" + + + Filter_Order + WaveformMeasurementsDigitalFiltering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150036); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150036 ,propertyValue); + + + Double + none + + + never + "Specifies the order of an IIR filter. All positive integers are valid. + +Default: 2" + + + Filter_Ripple + WaveformMeasurementsDigitalFiltering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150033); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150033 , propertyValue); + + + Double + none + + + never + "Specifies the amount of ripple in the passband in units of decibels (positive values). Used only for Chebyshev filters. The more ripple allowed gives a sharper cutoff for a given filter order. + +Default: 0.1 dB" + + + Filter_Taps + WaveformMeasurementsDigitalFiltering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150037); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150037 ,propertyValue); + + + Double + none + + + never + "Defines the number of taps (coefficients) for an FIR filter. + +Default: 25" + + + Filter_Transient_Waveform_Percent + WaveformMeasurementsDigitalFiltering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150034); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150034 , propertyValue); + + + Double + none + + + never + "The percentage (0 - 100%) of the IIR filtered waveform to eliminate from the beginning of the waveform. This allows eliminating the transient portion of the waveform that is undefined due to the assumptions necessary at the boundary condition. + +Default: 20.0%" + + + Filter_Type + WaveformMeasurementsDigitalFiltering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150035); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150035 ,propertyValue); + + + Double + none + + + never + "Specifies the type of filter, for both IIR and FIR filters. The allowed values are the following: +� NISCOPE_VAL_MEAS_LOWPASS +� NISCOPE_VAL_MEAS_HIGHPASS +� NISCOPE_VAL_MEAS_BANDPASS +� NISCOPE_VAL_MEAS_BANDSTOP + +Default: NISCOPE_VAL_MEAS_LOWPASS" + + + Filter_Width + WaveformMeasurementsDigitalFiltering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150041); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150041 , propertyValue); + + + Double + none + + + never + "Specifies the width of bandpass and bandstop type filters in hertz. The cutoff frequencies occur at NISCOPE_ATTR_MEAS_FILTER_CENTER_FREQ �one-half width. + +Default: 1.0e3 Hz" + + + FIR_Filter_Window + WaveformMeasurementsDigitalFiltering + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150042); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150042 ,propertyValue); + + + Double + none + + + never + "Specifies the FIR window type. The possible choices are: +NISCOPE_VAL_NONE +NISCOPE_VAL_HANNING_WINDOW +NISCOPE_VAL_HAMMING_WINDOW +NISCOPE_VAL_TRIANGLE_WINDOW +NISCOPE_VAL_FLAT_TOP_WINDOW +NISCOPE_VAL_BLACKMAN_WINDOW +The symmetric windows are applied to the FIR filter coefficients to limit passband ripple in FIR filters. + +Default: NISCOPE_VAL_NONE" + + + + + + WaveformMeasurementsInterpolation + + + 1 + + + + + + Interpolation_Sampling_Factor + WaveformMeasurementsInterpolation + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150030); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150030 , propertyValue); + + + Double + none + + + never + "The new number of points for polynomial interpolation is the sampling factor times the input number of points. For example, if you acquire 1,000 points with the digitizer and set this attribute to 2.5, calling niScope_FetchWaveformMeasurementArray with the NISCOPE_VAL_POLYNOMIAL_INTERPOLATION measurement resamples the waveform to 2,500 points. + +Default: 2.0" + + + Polynomial_Interpolation_Order + WaveformMeasurementsInterpolation + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150029); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150029 ,propertyValue); + + + Double + none + + + never + "Specifies the polynomial order used for the polynomial interpolation measurement. For example, an order of 1 is linear interpolation whereas an order of 2 specifies parabolic interpolation. Any positive integer is valid. + +Default: 1" + + + + + + WaveformMeasurementsMultiAcquisitionTimeHistograms + + + 1 + + + + + + Time_Histogram_High_Time + WaveformMeasurementsMultiAcquisitionTimeHistograms + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150028); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150028 , propertyValue); + + + Double + none + + + never + "Specifies the highest time value included in the multiple acquisition time histogram. The units are always seconds. + +Default: 5.0e-4 seconds" + + + Time_Histogram_High_Volts + WaveformMeasurementsMultiAcquisitionTimeHistograms + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150026); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150026 , propertyValue); + + + Double + none + + + never + "Specifies the highest voltage value included in the multiple-acquisition time histogram. The units are always volts. + +Default: 10.0 V" + + + Time_Histogram_Low_Time + WaveformMeasurementsMultiAcquisitionTimeHistograms + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150027); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150027 , propertyValue); + + + Double + none + + + never + "Specifies the lowest time value included in the multiple-acquisition time histogram. The units are always seconds. + +Default: -5.0e-4 seconds" + + + Time_Histogram_Low_Volts + WaveformMeasurementsMultiAcquisitionTimeHistograms + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150025); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150025 , propertyValue); + + + Double + none + + + never + "Specifies the lowest voltage value included in the multiple acquisition time histogram. The units are always volts. + +Default: -10.0 V" + + + Time_Histogram_Size + WaveformMeasurementsMultiAcquisitionTimeHistograms + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150024); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150024 ,propertyValue); + + + Double + none + + + never + "Determines the multiple acquisition voltage histogram size. The size is set during the first call to a time histogram measurement after clearing the measurement history with niScope_ClearWaveformMeasurementStats. + +Default: 256" + + + + + + WaveformMeasurementsMultiAcquisitionVoltageHistograms + + + 1 + + + + + + Voltage_Histogram_High_Volts + WaveformMeasurementsMultiAcquisitionVoltageHistograms + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150023); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150023 , propertyValue); + + + Double + none + + + never + "Specifies the highest voltage value included in the multiple acquisition voltage histogram. The units are always volts. + +Default: 10.0 V" + + + Voltage_Histogram_Low_Volts + WaveformMeasurementsMultiAcquisitionVoltageHistograms + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150022); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150022 , propertyValue); + + + Double + none + + + never + "Specifies the lowest voltage value included in the multiple-acquisition voltage histogram. The units are always volts. + +Default: -10.0 V" + + + Voltage_Histogram_Size + WaveformMeasurementsMultiAcquisitionVoltageHistograms + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150021); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150021 ,propertyValue); + + + Double + none + + + never + "Determines the multiple acquisition voltage histogram size. The size is set the first time a voltage histogram measurement is called after clearing the measurement history with the function niScope_ClearWaveformMeasurementStats. + +Default: 256" + + + + + + WaveformMeasurementsReferenceLevels + + + 1 + + + + + + High_Reference_Level + WaveformMeasurementsReferenceLevels + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150040); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150040 , propertyValue); + + + Double + none + + + never + "Stores the high reference level used in many scalar measurements. Different channels may have different reference levels. Do not use the IVI-defined, nonchannel-based attributes such as NISCOPE_ATTR_MEAS_HIGH_REF if you use this attribute to set various channels to different values. + +Default: 90%" + + + Low_Reference_Level + WaveformMeasurementsReferenceLevels + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150038); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150038 , propertyValue); + + + Double + none + + + never + "Stores the low reference level used in many scalar measurements. Different channels may have different reference levels. Do not use the IVI-defined, nonchannel-based attributes such as NISCOPE_ATTR_MEAS_LOW_REF if you use this attribute to set various channels to different values. + +Default: 10%" + + + Mid_Reference_Level + WaveformMeasurementsReferenceLevels + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributevireal64',RepCapIdentifier, 1150039); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributevireal64',RepCapIdentifier, 1150039 , propertyValue); + + + Double + none + + + never + "Stores the mid reference level used in many scalar measurements. Different channels may have different reference levels. Do not use the IVI-defined, nonchannel-based attributes such as NISCOPE_ATTR_MEAS_MID_REF if you use this attribute to set various channels to different values. + +Default: 50%" + + + Percentage_Method + WaveformMeasurementsReferenceLevels + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150045); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150045 ,propertyValue); + + + Double + none + + + never + "Specifies the method used to map percentage reference units to voltages for the reference. Possible values are: +NISCOPE_VAL_MEAS_LOW_HIGH +NISCOPE_VAL_MEAS_MIN_MAX +NISCOPE_VAL_MEAS_BASE_TOP + +Default: NISCOPE_VAL_MEAS_BASE_TOP" + + + Reference_Level_Units + WaveformMeasurementsReferenceLevels + Base + MCode + + function propertyValue = getProperty(obj, propertyName) +% Return a property value. +% This function is called to return the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeGetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +propertyValue = invoke (attributeaccessors, 'getattributeviint32',RepCapIdentifier, 1150016); + function set(obj, propertyName, propertyValue) +% Set a property value. +% This function is called to set the device or group object property +% value. If the property is a group property, OBJ is the group object. If +% the property is a base device property, OBJ is the device object. +deviceobj = get(obj, 'Parent'); +attributeaccessors = get(deviceobj, 'ConfigurationFunctionsSetGetCheckAttributeSetAttribute'); +RepCapIdentifier = get(deviceobj, 'RepCapIdentifier'); +RepCapIdentifier = [double(RepCapIdentifier) 0]; +invoke (attributeaccessors, 'setattributeviint32',RepCapIdentifier, 1150016 ,propertyValue); + + + Double + none + + + never + "Specifies the units of the reference levels. + +NISCOPE_VAL_MEAS_VOLTAGE--Specifies that the reference levels are given in units of volts +NISCOPE_VAL_MEAS_PERCENTAGE--Percentage units, where the measurements voltage low and voltage high represent 0% and 100%, respectively. + +Default: NISCOPE_VAL_MEAS_PERCENTAGE" + + + + + + \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@Oscilloscope/GetInstance.m b/+qes/+hwdriver/+sync/_todo/@Oscilloscope/GetInstance.m new file mode 100644 index 0000000..469392b --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@Oscilloscope/GetInstance.m @@ -0,0 +1,55 @@ +function obj = GetInstance(name,interfaceobj,drivertype) + % if called without input arguments, the first valid instance is + % returned, if 'name' is not empty, the instance that matches 'name' + % is returned if exits, if not exit, a new instance is created(in this + % case all input arguments should be specified) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + persistent objlst; + if isempty(objlst) + if nargin == 0 || isempty(name) + error('Oscilloscope:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + end + if nargin > 2 + obj = Oscilloscope(name,interfaceobj,drivertype); + else + obj = Oscilloscope(name,interfaceobj); + end + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of deleted objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 || isempty(name) + error('Oscilloscope:GetInstanceError',... + 'No existing instance, all input paramenter should be specified!'); + end + if nargin > 2 + obj = Oscilloscope(name,interfaceobj,drivertype); + else + obj = Oscilloscope(name,interfaceobj); + end + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@Oscilloscope/InitializeInstr.m b/+qes/+hwdriver/+sync/_todo/@Oscilloscope/InitializeInstr.m new file mode 100644 index 0000000..36e4af7 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@Oscilloscope/InitializeInstr.m @@ -0,0 +1,32 @@ +function [varargout] = InitializeInstr(obj) + % Initialize instrument + % + +% Copyright 2016 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + ErrMsg = ''; + try + switch TYP + case {'tekdpo7000'} + obj.timeout = 120; % seconds + if strcmp(obj.interfaceobj.Status,'open') + fclose(obj.interfaceobj); + end + obj.interfaceobj.Timeout=120; + obj.interfaceobj.InputBufferSize = 20000000; % bytes, should be enough for most applications + if strcmp(obj.interfaceobj.Status,'closed') + fopen(obj.interfaceobj); + end + fprintf(obj.interfaceobj,'*RST'); + % set work mode to linear(default) + fprintf(obj.interfaceobj,':INITiate:IMMediate'); % trig + otherwise + ErrMsg = ['Unsupported instrument: ',TYP]; + end + catch + ErrMsg = 'Could not initialize instrument!'; + end + varargout{1} = ErrMsg; +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@Oscilloscope/Oscilloscope.m b/+qes/+hwdriver/+sync/_todo/@Oscilloscope/Oscilloscope.m new file mode 100644 index 0000000..576dc92 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@Oscilloscope/Oscilloscope.m @@ -0,0 +1,827 @@ +classdef Oscilloscope < Instrument + % Temporary Oscilloscope driver for IQ readout, basic. + % Currently support Tek DPO7040C Digital Phosphor Oscilloscope only. + +% Copyright 2016 Yarui_Zheng, Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% zhengyarui@iphy.ac.cn,mail4ywu@gmail.com/mail4ywu@icloud.com + + properties + samplerate % unit : samples per second + acqlength % record length. + acqduration % timebase duration. + horizontalscale % unit : second per division + horizontalposition % horizontalposition is from 0 to¡Ö100 and is the + % position of the trigger point on the screen + % (0 = left edge, 100 = right edge) + % POSITION=10 sets the trigger position of the waveform such that + % 10% of the display is to the left of the trigger position. + + acquisitionmode % SAMple|PEAKdetect|HIRes|AVErage|WFMDB|ENVelope + acquisitionnumavg % Average number of Average Acquisition Mode + acquisitionstopafter % RUNSTop|SEQuence for Run/Stop|Single Sequence + acquisitionstate % |OFF|ON|RUN|STOP + + + measurementgating % ON|OFF||ZOOM|CURSor + % = 0 turns off measurement gating; any other value turns on measurement + measure1 + measure2 + end + + properties %Fast Frame Group + fastframecount % frame count + fastframemaxframes % Rea Only. the maximum number of FastFrame frames + % which can be acquired at the current frame length + fastframerefsource % FastFrame Reference waveform source + fastframeselectedsource % FastFrame source waveform + fastframesequence % {FIRst|LAST} + % FastFrame single-sequence mode stop condition + % FIRstsets single sequence to stop after n frames. + % LASTsets single sequenceto stop manually. + fastframesingleframemath % {ON|OFF|1|0|true|false} + fastframesixteenbit % {ON|OFF|1|0|true|false} + fastframestate % state of FastFrame acquisition + fastframesumframe % {NONe|AVErage|ENVelope} + % summary frame mode + end + methods % Fast Frame Group + function val = get.fastframecount(obj) + pause(0.005) + val = str2double(query(obj.interfaceobj,'HORizontal:FASTframe:COUNt?')); + end + function set.fastframecount(obj,val) + pause(0.005) + fprintf(obj.interfaceobj,['HORizontal:FASTframe:COUNt ' num2str(val)]); + pause(0.005) + actualcount = str2double(query(obj.interfaceobj,'HORizontal:FASTframe:COUNt?')); + if actualcount ~= val + warning(['Oscilloscope_Temp: The actual Fast Frame count ('... + num2str(actualcount) ')is diffrent from the setting value(' ... + num2str(val) ')' ]); + end + end + function val = get.fastframemaxframes(obj) + pause(0.005) + val = str2double(query(obj.interfaceobj,'HORizontal:FASTframe:MAXFRames?')); + end + function val = get.fastframerefsource(obj) + pause(0.005) + str = query(obj.interfaceobj,'HORizontal:FASTframe:REF:SOUrce?'); + val = str(1:end-1); + end + function set.fastframerefsource(obj,val) + switch lower(val) + case {'chanel1','chanel 1','ch1'} + str = 'CH1'; + case {'chanel2','chanel 2','ch2'} + str = 'CH2'; + case {'chanel3','chanel 3','ch3'} + str = 'CH3'; + case {'chanel4','chanel 4','ch4'} + str = 'CH4'; + case {'math1','math 1','m1'} + str = 'MATH1'; + case {'math2','math 2','m2'} + str = 'MATH2'; + case {'math3','math 3','m3'} + str = 'MATH3'; + case {'math4','math 4','m4'} + str = 'MATH4'; + otherwise + error('Oscilloscope_Temp: Unknow reference source!') + end + pause(0.005) + fprintf(obj.interfaceobj,['HORizontal:FASTframe:REF:SOUrce ' str]); + end + function val = get.fastframeselectedsource(obj) + pause(0.005) + str = query(obj.interfaceobj,'HORizontal:FASTframe:SELECTED:SOUrce?'); + val = str(1:end-1); + end + function set.fastframeselectedsource(obj,val) + switch lower(val) + case {'chanel1','chanel 1','ch1'} + str = 'CH1'; + case {'chanel2','chanel 2','ch2'} + str = 'CH2'; + case {'chanel3','chanel 3','ch3'} + str = 'CH3'; + case {'chanel4','chanel 4','ch4'} + str = 'CH4'; + case {'math1','math 1','m1'} + str = 'MATH1'; + case {'math2','math 2','m2'} + str = 'MATH2'; + case {'math3','math 3','m3'} + str = 'MATH3'; + case {'math4','math 4','m4'} + str = 'MATH4'; + otherwise + error('Oscilloscope_Temp: Unknow waveform source!') + end + pause(0.005) + fprintf(obj.interfaceobj,['HORizontal:FASTframe:SELECTED:SOUrce ' str]); + end + function val = get.fastframesequence(obj) + pause(0.005) + str = query(obj.interfaceobj,'HORIZONTAL:FASTFRAME:SEQUENCE?'); + val = str(1:end-1); + end + function set.fastframesequence(obj,val) + switch lower(val) + case {'first','fir','auto'} + str = 'FIRst'; + case {'last','manual','manually'} + str = 'LAST'; + otherwise + error('Oscilloscope_Temp: Unknow single-sequence mode!') + end + pause(0.005) + fprintf(obj.interfaceobj,['HORIZONTAL:FASTFRAME:SEQUENCE ' str]); + end + function val = get.fastframesingleframemath(obj) + pause(0.005) + str = query(obj.interfaceobj,'HORizontal:FASTframe:SINGLEFramemath?'); + val = str(1:end-1); + end + function set.fastframesingleframemath(obj,val) + switch val + case {1,true} + str = 'ON'; + case {0,false} + str = 'OFF'; + otherwise + switch lower(val) + case {'0','off','false'} + str = 'OFF'; + case {'1','on','true'} + str = 'ON'; + otherwise + error('Oscilloscope_Temp: Unknow singleframemath!') + end + end + pause(0.005) + fprintf(obj.interfaceobj,['HORizontal:FASTframe:SINGLEFramemath ' str]); + end + function val = get.fastframesixteenbit(obj) + pause(0.005) + str = query(obj.interfaceobj,'HORizontal:FASTframe:SIXteenbit?'); + val = str(1:end-1); + end + function set.fastframesixteenbit(obj,val) + switch val + case {1,true} + str = 'ON'; + case {0,false} + str = 'OFF'; + otherwise + switch lower(val) + case {'0','off','false'} + str = 'OFF'; + case {'1','on','true'} + str = 'ON'; + otherwise + error('Oscilloscope_Temp: Unknow sixteenbit!') + end + end + pause(0.005) + fprintf(obj.interfaceobj,['HORizontal:FASTframe:SIXteenbit ' str]); + end + function val = get.fastframestate(obj) + pause(0.005) + str = query(obj.interfaceobj,'HORizontal:FASTframe:STATE?'); + val = str(1:end-1); + end + function set.fastframestate(obj,val) + switch val + case {1,true} + str = 'ON'; + case {0,false} + str = 'OFF'; + otherwise + switch lower(val) + case {'0','off','false'} + str = 'OFF'; + case {'1','on','true'} + str = 'ON'; + otherwise + error('Oscilloscope_Temp: Unknow fastframestate!') + end + end + pause(0.005) + fprintf(obj.interfaceobj,['HORizontal:FASTframe:STATE ' str]); + end + function val = get.fastframesumframe(obj) + pause(0.005) + str = query(obj.interfaceobj,'HORizontal:FASTframe:SUMFrame?'); + val = str(1:end-1); + end + function set.fastframesumframe(obj,val) + switch lower(val) + case {'none','off','non'} + str = 'NONe'; + case {'ave','average'} + str = 'AVErage'; + case {'envelope','env'} + str = 'ENVelope'; + otherwise + error('Oscilloscope_Temp: Unknow Sum Frame mode!') + end + fprintf(obj.interfaceobj,['HORizontal:FASTframe:SUMFrame ' str]); + end + end + + properties % Data Transfer group + dataformat % format of outgoing waveform data + % {ASCIi|FAStest|RIBinary|RPBinary|FPBinary|SRIbinary|SRPbinary|SFPbinary} + % This command is equivalent to settingWFMOutpre:ENCdg, WFMOutpre:BN_Fmt, + % and WFMOutpre:BYT_Or. Setting the DATa:ENGdg value causes the + % corresponding WFMOutpre values to be updated and vice versa. + % + % ASCIi specifiesthe ASCII representation of signed INT, FLOAT. + % If ASCII is the value, then :BN_Fmt and :BYT_Or are ignored. + % + % FAStest specifies that the data be sent in the fastest possible manner + % consistent with maintaining accuracyand is interpreted with respect to the + % first waveform specified in the DATA:SOUrce list. + % :ENCdg will always be BIN, :BYT_Or will always be LSB, but :BN_Fmt and + % :BYT_Nr will depend on thefirst DATa:SOUrce waveform. :BN_Fmt will + % be RI unless the waveform is internally stored as afloating point number, in + % which case the FP format will be used. + % + % RIBinary specifies signed integer data point representation with the most + % significant byte transferred first. + % When :BYT_Nr is 1, the range is from -128 through 127. When :BYT_Nr + % is 2, the range is from -32,768 through 32,767. When :BYT_Nr is 8, then + % the waveform being queried is set to Fast Acquisition mode. Center screen + % is 0 (zero). The upper limit is the top of the screen and the lower limit is the + % bottom of the screen. This is the default argument. + % + % RPBinary specifies the positive integer data-point representation, with the + % most significant byte transferred first. + % When :BYT_Nr is 1, the range from 0 through 255. When :BYT_Nr is 2, the + % range is from 0 to 65,535. When :BYT_Nr is 8, then the waveform being + % queried is set to Fast Acquisition mode. The center of the screen is 127. + % The upper limit is the top of the screen and the lower limit is the bottom of + % the screen. + % + % FPBinary specifies thefloating point (width = 4) data. + % The range is from ¨C3.4 ¡Á 10^38to 3.4 ¡Á 10^38. + % The center of the screen is 0. + % The upper limit is the top of the screen and the lower limit is the bottom of + % the screen. + % The FPBinaryargument is only applicable to math waveforms or ref + % waveforms saved from math waveforms. + % + % SRIbinary is the same as RIBinaryexcept that the byte order is swapped, + % meaning that the least significant byte is transferredfirst. This format is useful + % when transferring data to IBM compatible PCs. + % + % SRPbinary is the same as RPBinaryexcept that the byte order is swapped, + % meaning that the least significant byte is transferredfirst. This format is useful + % when transferring data to PCs. + % + % SFPbinary specifies floating point data in IBM PC format. The SFPbinary + % argument only works on math waveforms or ref waveforms saved from math + % waveforms. + % + % WFMOutpre Settings + % ====================================================== + % DATa:ENCdg Setting :ENCdg :BN_Fmt :BYT_Or :BYT_NR + % ASCii ASC N/A N/A 1,2,4,8 + % FAStest BIN RI/FP MSB 1,2,4 + % RIBinary BIN RI MSB 1,2,8 + % RPBinary BIN RP MSB 1,2,8 + % FPBinary BIN FP MSB 4 + % SRIbinary BIN RI LSB 1,2,8 + % SRPbinary BIN RP LSB 1,2,8 + % SFPbinary BIN FP LSB 4 + % ====================================================== + framestart % starting data frame for waveform transfers + framestop % stop data frame for waveform transfers + datasource % location of waveform data + % [<,>] + % CHselects the specified analog channel as the source. + % MATHselects the specified reference waveform as the source. + % REFselects the specified reference waveform as the source. + % DIGITALALLselects digital waveforms as the source. + datastart % starting data point for waveform transfer + datastop % last data point that will be transferred + syncsource % sets or queries if the data sync sources are on or off + wfmoutputbitnr % Number of bits per waveform point that outgoing waveforms contain + %This specification is only meaningful when WFMOutpre:ENCdgis set to BIN and + % WFMOutpre:BN_Fmt is set to either RI or RP + % number of bits per data point can be 8, 16, 32 or 64. + wfmoutputbnfmt % format of binary data for outgoing waveforms + % {RI|RP|FP} + % RI specifies signed integer data point representation. + % RP specifies positive integer datapoint representation. + % FP specifies single-precision binaryfloating point data point representation. + wfmoutputbytnr % binary field data width for the waveform. + % This specification is only meaningful + % when WFMOutpre:ENCdg is set to BIN, and WFMOutpre:BN_Fmt is set to + % either RI or RP. + wfmoutputbytor % This property sepecifies which byte of binary waveform data is transmitted first, + % during a waveform data transfer, when data points require more than one byte. + %{LSB|MSB} + % This property sepecifies which byte of binary waveform data is transmitted + % This specification only has meaning when WFMOutpre:ENCdgis set to BIN. + % LSB specifies that the least significant byte will be transmittedfirst. + % MSB specifies that the most significant byte will be transmittedfirst. + wfmoutprenrpt % number of points for theDATa:SOUrce waveform that will be transmitted in response to a CURVe? query. + wfmoutprenrfr % number of frames for theDATa:SOUrce waveform transmitted in response to aCURVe?query + wfmoutpreencdg % type of encoding for outgoing waveforms + % {ASCii|BINary} + end + methods % Data Transfer group + function val = get.dataformat(obj) + pause(0.005) + str = query(obj.interfaceobj,'DATa:ENCdg?'); + val = str(1:end-1); + end + function set.dataformat(obj,val) + switch lower(val) + case {'ascii','asci','asc'} + str = 'ASCIi'; + case {'fastest','fas'} + str = 'FAStest'; + case {'ribinary','rib'} + str = 'RIBinary'; + case {'rpbinary','rpb'} + str = 'RPBinary'; + case {'fpbinary','fpb'} + str = 'FPBinary'; + case {'sribinary','sri'} + str = 'SRIbinary'; + case {'srpbinary','srp'} + str = 'SRPbinary'; + case {'sfpbinary','sfp'} + str = 'SFPbinary'; + otherwise + error('Oscilloscope_Temp: Unknow Sum Frame mode!') + end + pause(0.005) + fprintf(obj.interfaceobj,['HORizontal:FASTframe:SUMFrame ' str]); + end + function val = get.framestart(obj) + pause(0.005) + val = str2double(query(obj.interfaceobj,'DATa:FRAMESTARt?')); + end + function set.framestart(obj,val) + pause(0.005) + fprintf(obj.interfaceobj,['DATa:FRAMESTARt ' num2str(val)]); + end + function val = get.framestop(obj) + pause(0.005) + val = str2double(query(obj.interfaceobj,'DATa:FRAMESTOP?')); + end + function set.framestop(obj,val) + pause(0.005) + fprintf(obj.interfaceobj,['DATa:FRAMESTOP ' num2str(val)]); + end + function val = get.datasource(obj) + pause(0.005) + str = query(obj.interfaceobj,'DATa:SOUrce?'); + val = str(1:end-1); + end + function set.datasource(obj,val) + val = lower(regexprep(val,' ','')); + if strcmp(val,'') + error('Oscilloscope_Temp: Data Source could not emty'); + else + sources = strsplit(val,{','}); + sourcesstr = ''; + for source = sources + switch source{1} + case {'ch1','chanel1'} + sourcestr = 'CH1'; + case {'ch2','chanel2'} + sourcestr = 'CH2'; + case {'ch3','chanel3'} + sourcestr = 'CH3'; + case {'ch4','chanel4'} + sourcestr = 'CH4'; + case {'math1'} + sourcestr = 'MATH1'; + case {'math2'} + sourcestr = 'MATH2'; + case {'math3'} + sourcestr = 'MATH3'; + case {'math4'} + sourcestr = 'MATH4'; + case {'ref1','reference1'} + sourcestr = 'REF1'; + case {'ref2','reference2'} + sourcestr = 'REF2'; + case {'ref3','reference3'} + sourcestr = 'REF3'; + case {'ref4','reference4'} + sourcestr = 'REF4'; + case {'digitalall','digital'} + sourcestr = 'DIGITALALL'; + otherwise + error('Oscilloscope_Temp: Data Source could conist of CH, MATH, REF, DIGITALALL'); + end + sourcesstr = [sourcesstr ',' sourcestr]; + end + sourcesstr = sourcesstr(2:end); + pause(0.005) + fprintf(obj.interfaceobj,['DATa:SOUrce ' sourcesstr]); + end + end + function val = get.datastart(obj) + pause(0.005) + val = str2double(query(obj.interfaceobj,'DATa:STARt?')); + end + function set.datastart(obj,val) + pause(0.005) + fprintf(obj.interfaceobj,['DATa:STARt ' num2str(val)]); + end + function val = get.datastop(obj) + pause(0.005) + val = str2double(query(obj.interfaceobj,'DATa:STOP?')); + end + function set.datastop(obj,val) + pause(0.005) + fprintf(obj.interfaceobj,['DATa:STOP ' num2str(val)]); + end + function val = get.syncsource(obj) + pause(0.005) + str = query(obj.interfaceobj,'HORizontal:FASTframe:STATE?'); + val = str(1:end-1); + end + function set.syncsource(obj,val) + switch val + case {1,true} + str = 'ON'; + case {0,false} + str = 'OFF'; + otherwise + switch lower(val) + case {'0','off','false'} + str = 'OFF'; + case {'1','on','true'} + str = 'ON'; + otherwise + error('Oscilloscope_Temp: Unknow Data Sync Sources!') + end + end + pause(0.005) + fprintf(obj.interfaceobj,['DATa:SYNCSOUrces ' str]); + end + function val = get.wfmoutputbitnr(obj) + pause(0.005) + val = str2double(query(obj.interfaceobj,'WFMOutpre:BIT_Nr?')); + end + function set.wfmoutputbitnr(obj,val) + if (val == 8)||(val == 16)||(val == 32)||(val == 64) + pause(0.005) + fprintf(obj.interfaceobj,['BIT_Nr ' num2str(val)]); + else + error('Oscilloscope_Temp: Unsupport bit number!') + end + end + function val = get.wfmoutputbnfmt(obj) + pause(0.005) + str = query(obj.interfaceobj,'WFMOutpre:BN_Fmt?'); + val = str(1:end-1); + end + function set.wfmoutputbnfmt(obj,val) + switch lower(val) + case {'ri'} + % RI specifies signed integer data point representation. + str = 'RI'; + case {'rp'} + % RPspecifies positive integer datapoint representation. + str = 'RP'; + case {'fp'} + % FPspecifies single-precision binaryfloating point data point representation + str = 'FP'; + otherwise + error('Oscilloscope_Temp: Unknow error!') + end + pause(0.005) + fprintf(obj.interfaceobj,['WFMOutpre:BN_Fmt ' str]); + end + function val = get.wfmoutputbytnr(obj) + pause(0.005) + val = str2double(query(obj.interfaceobj,'WFMOutpre:BYT_Nr?')); + end + function set.wfmoutputbytnr(obj,val) + if (val == 1)||(val == 2)||(val == 4)||(val == 8) + pause(0.005) + fprintf(obj.interfaceobj,['BYT_Nr ' num2str(val)]); + else + error('Oscilloscope_Temp: Unsupport byte number!') + end + end + function val = get.wfmoutputbytor(obj) + pause(0.01) + str = query(obj.interfaceobj,'WFMOutpre:BYT_Or?'); + val = str(1:end-1); + end + function set.wfmoutputbytor(obj,val) + switch lower(val) + case {'lsb'} + str = 'LSB'; + case {'msb'} + str = 'MSB'; + otherwise + error('Oscilloscope_Temp: Unknow error!') + end + pause(0.005) + fprintf(obj.interfaceobj,['WFMOutpre:BYT_Or ' str]); + end + function val = get.wfmoutprenrpt(obj) + pause(0.005) + val = str2double(query(obj.interfaceobj,'WFMOutpre:NR_Pt?')); + end + function val = get.wfmoutprenrfr(obj) + pause(0.005) + val = str2double(query(obj.interfaceobj,'WFMOutpre:NR_FR?')); + end + function val = get.wfmoutpreencdg(obj) + pause(0.005) + str = query(obj.interfaceobj,'WFMOutpre:ENCdg?'); + val = str(1:end-1); + end + function set.wfmoutpreencdg(obj,val) + switch lower(val) + case {'ascii','asc'} + str = 'ASCii'; + case {'binary','bin'} + str = 'BINary'; + otherwise + error('Oscilloscope_Temp: Unknow error!') + end + pause(0.005) + fprintf(obj.interfaceobj,['WFMOutpre:ENCdg ' str]); + end + function datas = getdata(obj) + datas = []; + getdatatimer = tic(); + pause(0.005) + fprintf(obj.interfaceobj,'*CLS'); + dataformatstr = lower(obj.dataformat); + wfmoutputbnfmtstr = lower(obj.wfmoutputbnfmt); + nbits = obj.wfmoutputbitnr; + wfmoutputbytorstr = obj.wfmoutputbytor; + npoints = obj.wfmoutprenrpt; + nframes = obj.wfmoutprenrfr; + pause(0.005) + fprintf(obj.interfaceobj,'CURVENext?'); + pause(0.05); + while(toc(getdatatimer) 2 + obj = SR620Timer(name,interfaceobj,drivertype); + else + obj = SR620Timer(name,interfaceobj); + end + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of delete objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 || isempty(name) + error('SR620Timer:GetInstanceError',... + 'No existing instance, all input paramenter should be specified!'); + end + if nargin > 2 + obj = SR620Timer(name,interfaceobj,drivertype); + else + obj = SR620Timer(name,interfaceobj); + end + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@SR620Timer/SR620Timer.m b/+qes/+hwdriver/+sync/_todo/@SR620Timer/SR620Timer.m new file mode 100644 index 0000000..4002168 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@SR620Timer/SR620Timer.m @@ -0,0 +1,98 @@ +classdef SR620Timer < Instrument + % dirver for Stanford Research SR620 Universal Time Interval Counter, + % used as Timer + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties + timeout = 30; % seconds, default:30 seconds. + samplesize % number of samples + avgnum = 1 % average number of each measurement, default: 1 + triglevel = 0.5; % trig/gate level, V + signallevel % signal level, V + end + methods (Access = private) + function obj = SR620Timer(name,interfaceobj,drivertype) + % drivertype is not important for SR620Timer class objects, any + % str is ok. + if isempty(interfaceobj) + error('SR620Timer:InvalidInput',... + 'Input ''%s'' can not be empty!',... + 'interfaceobj'); + end + set(interfaceobj,'Timeout',10); + set(interfaceobj,'InputBufferSize',524280); + if nargin < 3 + drivertype = []; + end + obj = obj@Instrument(name,interfaceobj,drivertype); + try + fprintf(obj.interfaceobj,'MODE 0'); + fprintf(obj.interfaceobj,'SRCE 0'); % START: A, STOP: B + fprintf(obj.interfaceobj,'ARMM 1'); + fprintf(obj.interfaceobj,['LEVL 1,',num2str(obj.triglevel,'%0.1f')]); + fprintf(obj.interfaceobj, 'AUTM 0'); + catch + error('SR620Timer:SeInstruError',[obj.name, ': %s'], 'Unable to set instrument.'); + end + end + end + methods (Static) + obj = GetInstance(name,interfaceobj,drivertype) + end + + methods + function set.timeout(obj,val) + val = round(val); + if isempty(val) || val <=0 + error('SR620Timer:InvalidInput','timeout should be a positive integer!'); + end + obj.timeout = val; + set(obj.interfaceobj,'Timeout',val); + end + function set.samplesize(obj,val) + val = round(val); + if isempty(val) || val <=0 + error('SR620Timer:InvalidInput','samplesize should be a positive integer!'); + end + obj.samplesize = val; + end + function set.avgnum(obj,val) + val = round(val); + if isempty(val) || val <=0 + error('SR620Timer:InvalidInput','avgnum should be a positive integer!'); + end + obj.avgnum = val; + fprintf(obj.interfaceobj,['SIZE ', num2str(val)]); + end + function set.triglevel(obj,val) + obj.triglevel = val; + fprintf(obj.interfaceobj,['LEVL 1,',num2str(val,'%0.2f')]); + end + function set.signallevel(obj,val) + obj.signallevel = val; + fprintf(obj.interfaceobj,['LEVL 2,',num2str(val,'%0.2f')]); + end + function SwitchingEvents = Run(obj) + if isempty(obj.samplesize) + error('SR620Timer:RunError','sample size n not set.'); + end + framemax = min(65535, obj.samplesize); + frameptr = 0; + temp = zeros(1,2*obj.samplesize); + while (frameptr < obj.samplesize) + framechunk = min(framemax, obj.samplesize - frameptr); + fprintf(obj.interfaceobj, ['BDMP ' num2str(framechunk)]); + temp(2*frameptr+1:2*frameptr+2*framechunk) = fread(obj.interfaceobj, 2*framechunk, 'uint32'); + frameptr = frameptr + framechunk; + end + fprintf(obj.interfaceobj, 'AUTM 1'); % set idle run mode to automatic + fprintf(obj.interfaceobj,['SIZE ', num2str(1)]); + SwitchingEvents =((temp(1:2:(2*obj.samplesize-1)) + ... + temp(2:2:(2*obj.samplesize))*2^32) * 2.712673611111111E-12 / 256); + end + end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@SpectrumAnalyzer/GetInstance.m b/+qes/+hwdriver/+sync/_todo/@SpectrumAnalyzer/GetInstance.m new file mode 100644 index 0000000..5b0740f --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@SpectrumAnalyzer/GetInstance.m @@ -0,0 +1,55 @@ +function obj = GetInstance(name,interfaceobj,drivertype) + % if called without input arguments, the first valid instance is + % returned, if 'name' is not empty, the instance that matches 'name' + % is returned if exits, if not exit, a new instance is created(in this + % case all input arguments should be specified) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + persistent objlst; + if isempty(objlst) + if nargin == 0 || isempty(name) + error('SpectrumAnalyzer:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + end + if nargin > 2 + obj = SpectrumAnalyzer(name,interfaceobj,drivertype); + else + obj = SpectrumAnalyzer(name,interfaceobj); + end + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of delete objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 || isempty(name) + error('SpectrumAnalyzer:GetInstanceError',... + 'No existing instance, all input paramenter should be specified!'); + end + if nargin > 2 + obj = SpectrumAnalyzer(name,interfaceobj,drivertype); + else + obj = SpectrumAnalyzer(name,interfaceobj); + end + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@SpectrumAnalyzer/InitializeInstr.m b/+qes/+hwdriver/+sync/_todo/@SpectrumAnalyzer/InitializeInstr.m new file mode 100644 index 0000000..1317dd5 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@SpectrumAnalyzer/InitializeInstr.m @@ -0,0 +1,21 @@ +function [varargout] = InitializeInstr(obj) + % Initialize instrument + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + TYP = lower(obj.drivertype); + ErrMsg = ''; + if strcmp(obj.interfaceobj.Status,'open') + fclose(obj.interfaceobj); + end + %%% Keysight Technologies, N9030B default byte order is big endian + obj.interfaceobj.InputBufferSize = 1024*1024; + obj.interfaceobj.Timeout = 30; + obj.interfaceobj.ByteOrder = 'bigEndian'; + %%% + + fopen(obj.interfaceobj); + varargout{1} = ErrMsg; +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/@SpectrumAnalyzer/SpectrumAnalyzer.m b/+qes/+hwdriver/+sync/_todo/@SpectrumAnalyzer/SpectrumAnalyzer.m new file mode 100644 index 0000000..4f975e7 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/@SpectrumAnalyzer/SpectrumAnalyzer.m @@ -0,0 +1,252 @@ +classdef SpectrumAnalyzer < Instrument + % SpectrumAnalyzer source driver, basic. + % basic properties and functions of a SpectrumAnalyzer source, for extensive + % properties and functions, use class SpectrumAnalyzer_e. + % currently only support Keysight Technologies, N9030B + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties + startfreq % Hz + stopfreq % Hz + bandwidth % Hz + reflevel = 0 % reference level, dBm + numpts % number of points + avgnum = 1 % number of averge times, set to 1 to disable average + trigmod = 1 % 1/2/3/4 for 'IMM'/'VID'/'LINE'/'EXT' + extref = 1 % 1/2 for 'INT'/'EXT' 10MHz reference + on % true/false, set/query operating status + end + + methods (Access = private) + function obj = SpectrumAnalyzer(name,interfaceobj,drivertype) + if isempty(interfaceobj) + error('SpectrumAnalyzer:InvalidInput',... + 'Input ''%s'' can not be empty!',... + 'interfaceobj'); + end + set(interfaceobj,'Timeout',10); + if nargin < 3 + drivertype = []; + end + obj = obj@Instrument(name,interfaceobj,drivertype); + ErrMsg = obj.InitializeInstr(); + if ~isempty(ErrMsg) + error('SpectrumAnalyzer:InstSetError',[obj.name, ': %s'], ErrMsg); + end + fprintf(interfaceobj,':POW:RF:ATT 0dB'); + fprintf(interfaceobj,':INIT:CONT ON'); + %%% uiinfoobj to be implemented + end + [varargout] = InitializeInstr(obj) + end + methods (Static) + obj = GetInstance(name,interfaceobj,drivertype) + end + methods + function val = avg_amp(obj) + % Gets the average amplitude of the entire trace + + % the following lines are necessary, without what one got is + % history: avg_amp returns data even if the instrument is not + % running(waiting for trigger for example). + fprintf(obj.interfaceobj,'*CLS'); + fprintf(obj.interfaceobj,'*ESE 1'); + fprintf(obj.interfaceobj,':INIT:IMM'); + fprintf(obj.interfaceobj,'*OPC'); + while ~str2double(iquery(obj.interfaceobj,'*STB?')) + pause(0.005); + end + val = str2double(iquery(obj.interfaceobj, ':TRAC:MATH:MEAN? TRACE1')); + end + function val = peak_amp(obj) + % Gets the current amplitude from the peak detector + val = num2str(iquery(obj.interfaceobj, ':CALC:MARK:Y?')); + end + function val = peak_freq(obj) + % Gets the current frequency from the peak detector + val = num2str(iquery(obj.interfaceobj, ':CALC:MARK:X?')); + end + function val = get_trace(obj) + % Gets the current amplitude from the peak detector + fprintf(obj.interfaceobj,'*CLS'); + fprintf(obj.interfaceobj,'*ESE 1'); + fprintf(obj.interfaceobj,':INIT:IMM'); + fprintf(obj.interfaceobj,'*OPC'); + while ~str2double(iquery(obj.interfaceobj,'*STB?')) + pause(0.005); + end + + fprintf(obj.interfaceobj,':FORM ASC,8'); + fprintf(obj.interfaceobj,':FORM:BORD NORM'); % big endian + resp = iquery(obj.interfaceobj,':TRAC? TRACE1'); + val = str2double(strsplit(resp,',')); + end + + function set.avgnum(obj,val) + if isempty(val) || val <= 0 || ceil(val) ~=val + error('SpectrumAnalyzer:SetAverage','average number value should be positive integer!'); + end + obj.avgnum = val; + fprintf(obj.interfaceobj,[':AVER:COUN ', num2str(val,'%0.0f')]); + if val > 1 + fprintf(obj.interfaceobj,':AVER:TYPE LOG'); % LOG/MAX/MIN/RMS + fprintf(obj.interfaceobj,':AVER ON'); + else + fprintf(obj.interfaceobj,':AVER OFF'); + end + end + function val = get.avgnum(obj) + val = str2double(iquery(obj.interfaceobj,':AVER:COUN?')); + end + + function set.startfreq(obj,val) + if isempty(val) || ~isnumeric(val) || ~isreal(val) || val <= 0 + error('SpectrumAnalyzer:SetError','Invalid frequency value.'); + end + if val < 3 || val > 8.4e9 % Keysight Technologies, N9030B + warning('SpectrumAnalyzer:OutOfLimit','Frequency value out of limits.'); + return; + end + fprintf(obj.interfaceobj,[':FREQ:STAR ', num2str(val/1e6,'%0.6f'),'MHz']); + end + function val = get.startfreq(obj) + val = str2double(iquery(obj.interfaceobj,':FREQ:STAR?')); + end + function set.stopfreq(obj,val) + if isempty(val) || ~isnumeric(val) || ~isreal(val) || val <= 0 + error('SpectrumAnalyzer:SetError','Invalid frequency value.'); + end + if val < 3 || val > 8.4e9 % Keysight Technologies, N9030B + warning('SpectrumAnalyzer:OutOfLimit','Frequency value out of limits.'); + return; + end + fprintf(obj.interfaceobj,[':FREQ:STOP ', num2str(val/1e6,'%0.6f'),'MHz']); + end + function val = get.stopfreq(obj) + val = str2double(iquery(obj.interfaceobj,':FREQ:STOP?')); + end + function set.trigmod(obj,val) + switch val + case 1 + fprintf(obj.interfaceobj,':TRIG:SOUR IMM'); + case 2 + fprintf(obj.interfaceobj,':TRIG:SOUR VID'); + case 3 + fprintf(obj.interfaceobj,':TRIG:SOUR LINE'); + case 4 + fprintf(obj.interfaceobj,':TRIG:SOUR EXT'); + otherwise + error('SpectrumAnalyzer:SetTrigMode','Invalid trig mode.') + end + end + function val = get.trigmod(obj) + resp = iquery(obj.interfaceobj,':TRIG:SOUR?'); + resp((resp == 10) | (resp == 13)) = []; + switch resp + case 'IMM' + val = 1; + case 'VID' + val = 2; + case 'LINE' + val = 3; + case {'EXT1','EXT2'} + val = 4; + otherwise + error('SpectrumAnalyzer:GetTrigModMode','query instrument failed.') + end + end + function set.extref(obj,val) + switch val + case 1 + fprintf(obj.interfaceobj,':SENS:ROSC:SOUR INT'); + case 2 + fprintf(obj.interfaceobj,':SENS:ROSC:SOUR EXT'); + otherwise + error('SpectrumAnalyzer:SetExtRefMode','Invalid trig mode.') + end + end + function val = get.extref(obj) + resp = iquery(obj.interfaceobj,':SENS:ROSC:SOUR?'); + resp((resp == 10) | (resp == 13)) = []; + switch resp + case 'INT' + val = 1; + case 'EXT' + val = 2; + otherwise + error('SpectrumAnalyzer:GetExtRefMode','query instrument failed.') + end + end + function set.reflevel(obj,val) + if isempty(val) || ~isnumeric(val) || ~isreal(val) || val < -150 || val > 30 + error('SpectrumAnalyzer:SetError','Invalid reference level value.'); + end + fprintf(obj.interfaceobj,['DISP:WIND:TRAC:Y:RLEV ', num2str(val, '%0.1f'),'dBm']); + end + function val = get.reflevel(obj) + val = str2double(iquery(obj.interfaceobj,'DISP:WIND:TRAC:Y:RLEV?')); + end + function set.bandwidth(obj,val) + if isempty(val) || ~isnumeric(val) || ~isreal(val) || val <= 0 + error('SpectrumAnalyzer:SetError','Invalid bandwith value.'); + elseif val > 8e6 % Keysight Technologies, N9030B + warning('SpectrumAnalyzer:SetError','bandwith value exceeds maximum.'); + val = 8e6; + end + fprintf(obj.interfaceobj,[':BAND ', num2str(val/1e6, '%0.6f'),'MHz']); + end + function val = get.bandwidth(obj) + val = str2double(iquery(obj.interfaceobj,':BAND?')); + end + function set.numpts(obj,val) + if isempty(val) || val <= 0 || ceil(val) ~=val + error('SpectrumAnalyzer:SetNumPts','numpts value should be positive integer!'); + end + fprintf(obj.interfaceobj,[':SWE:POIN ', num2str(val, '%0.0f')]); + end + function val = get.numpts(obj) + val = str2double(iquery(obj.interfaceobj,':SWE:POIN?')); + end + + function set.on(obj,val) + if isempty(val) + error('SpectrumAnalyzer:SetOnOff', 'value of ''on'' must be a bolean.'); + end + if ~islogical(val) + if val == 0 || val == 1 + val = logical(val); + else + error('SpectrumAnalyzer:SetOnOff', 'value of ''on'' must be a bolean.'); + end + end + if val + fprintf(obj.interfaceobj,'*CLS'); + fprintf(obj.interfaceobj,'*ESE 1'); + fprintf(obj.interfaceobj,'*OPC'); + else + error('SpectrumAnalyzer:SetOnOff', 'off not implemeted.'); + end + obj.on = val; + end + function val = get.on(obj) + if logical(str2double(iquery(obj.interfaceobj,'*OPC?'))); + val = true; + else + val = false; + end + end + function On(obj) + % set on, this method is introduced for functional + % programming. + obj.on = true; + end + function Off(obj) + % set off, this method is introduced for functional + % programming. + obj.on = false; + end + + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/AlazarATS_Client.m b/+qes/+hwdriver/+sync/_todo/AlazarATS_Client.m new file mode 100644 index 0000000..647eaad --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/AlazarATS_Client.m @@ -0,0 +1,82 @@ +classdef AlazarATS_Client < Hardware + % dirver for Alazar Tech ATS Digitizer to run on a remote Matlab, + % client + % + +% Copyright 2016 Yulin Wu, USTC +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties (SetAccess = private) + busy = false + numsamples + end + properties (SetAccess = private, GetAccess = private) + tcpipobj + end + methods + function obj = AlazarATS_Client(name,ip,port,numsamples) + obj = obj@Hardware(name); + obj.tcpipobj = mtwisted.io.async.tcpip_client(ip,port); + obj.numsamples = numsamples; + numbytes = numsamples*2*8; + obj.tcpipobj.InputBufferSize = numbytes; + obj.tcpipobj.timeout = 30; + obj.tcpipobj.BytesAvailableFcnMode = 'byte'; + obj.tcpipobj.BytesAvailableFcnCount = numbytes; + fopen(obj.tcpipobj); + end + function d = FetchData(obj) + persistent lastdeferred + function result = run_next_deferred(result,d_) + d_.callback(); + end + function result = run_next_fetch(~) + result = obj.FetchData(); + end + if obj.busy + d = mtwisted.defer.Deferred(); + d.addBoth(@run_next_fetch); + lastdeferred.addBoth(@(x)run_next_deferred(x,d)); + else + d = FetchData_(obj); + end + lastdeferred = d; + end + function Reset(obj) + obj.busy = false; + flushinput(obj.tcpipobj); + flushoutput(obj.tcpipobj); + end + function Open(obj) + fopen(obj.tcpipobj); + end + function Close(obj) + fclose(obj.tcpipobj); + end + function delete(obj) + fclose(obj.tcpipobj); + end + end + methods (Access = private, Hidden = true) + function d = FetchData_(obj) + obj.busy = true; + function result = set_busy_status(result) + obj.busy = false; + end + function result = cb1(result) + result = typecast(result,'double'); + result = reshape(result,obj.numsamples,2)'; + end + d = fread(obj.tcpipobj); + d.addBoth(@set_busy_status); + d.addCallback(@cb1); + d2 = fprintf(obj.tcpipobj,'FetchData'); + function result = cb2(result) + if ~d.called + d.errback(result); + end + end + d2.addErrback(@cb2); + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/HWUSBATT.m b/+qes/+hwdriver/+sync/_todo/HWUSBATT.m new file mode 100644 index 0000000..f945f96 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/HWUSBATT.m @@ -0,0 +1,10 @@ +function HWUSBATT(db) + +Obj=serial('com3','baudrate',9600,'parity','none','databits',8,'stopbits',1); +fopen(Obj); + +fwrite(Obj,255*16*16+db,'uint16') + +fclose(Obj); + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/HwManager.m b/+qes/+hwdriver/+sync/_todo/HwManager.m new file mode 100644 index 0000000..1a89942 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/HwManager.m @@ -0,0 +1,45 @@ +classdef HwManager < handle + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties (SetAccess = private) + % all available visa\gpib\serial instruments, eval(constructor{n}) creates the nth instrument object) + constructor = {}; + end + methods + function obj = HwManager() + obj.Refresh(); + end + function Refresh(obj) + obj.constructor = {}; + hwinfo = instrhwinfo('visa'); + adapters = hwinfo.InstalledAdaptors; + for jj = 1:length(adapters) + instr = instrhwinfo('visa', adapters{jj}); + + constructors = instr.ObjectConstructorName(:); + rmvidx = []; + for kk = 1:length(constructors) + res = regexpi(constructors{kk}, '[a-z]*\(''[a-z]+''[ ]*,[ ]*''(?[A-Z0-9:]+)''', 'names'); + if ~isempty(res) && strcmpi(res.resource(1:4),'ASRL') + % serial port, ignore + rmvidx = [rmvidx,kk]; + end + end + constructors(rmvidx) = []; + obj.constructor = [obj.constructor;constructors]; + end + hwinfo = instrhwinfo('gpib'); + adapters = hwinfo.InstalledAdaptors; + for jj = 1:length(adapters) + instr = instrhwinfo('gpib', adapters{jj}); + obj.constructor = [obj.constructor;instr.ObjectConstructorName(:)]; + end + hwinfo = instrhwinfo('serial'); + obj.constructor = [obj.constructor;hwinfo.ObjectConstructorName(:)]; + end + end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/Thumbs.db b/+qes/+hwdriver/+sync/_todo/Thumbs.db new file mode 100644 index 0000000..b83e58e Binary files /dev/null and b/+qes/+hwdriver/+sync/_todo/Thumbs.db differ diff --git a/+qes/+hwdriver/+sync/_todo/_readme.txt b/+qes/+hwdriver/+sync/_todo/_readme.txt new file mode 100644 index 0000000..4a7e4f2 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/_readme.txt @@ -0,0 +1 @@ +hardware driver and interface \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/_todo/GateAndTrigOutput.m b/+qes/+hwdriver/+sync/_todo/_todo/GateAndTrigOutput.m new file mode 100644 index 0000000..3fc9ab1 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/_todo/GateAndTrigOutput.m @@ -0,0 +1,152 @@ +function [varargout]=GateAndTrigOutput(TrigFreq,NPlsPerGate,GateSource,GateSourTyp,TrigSource,TrigSourTyp,CounterType) +% TrigFreq: kHz, measurement pulse output frequency. +% if value bigger than 500e3, it will be set to 500e3(500kHz). +% NPlsPerGate: Trig N measurement pulses in every Gate pulse. +% NPlsPerGate <= 3500, a limit set buy the maximun sampling point number +% (16000 points) of HP33120, NPlsPerGate < 200 is recomended. +% +% GateSource: Gate Source gpib object, not opened. +% TrigSource: Trigger Source gpib object, not opened. +% +% example: +% GateGpibAddr = 10; % gpib address of gate source AWG(HP/AGL33120) +% TrigGpibAddr = 20; % gpib address of trigger source AWG(HP/AGL33120) +% GateSource = gpib('ni', 0, GateGpibAddr); +% TrigSource = gpib('ni', 0, TrigGpibAddr); +% GateAndTrigOutput(8,100,GateSource,'HP/AGL33120',TrigSource,'HP/AGL33120','SR620'); + +ErrorMes = []; +switch CounterType + case {'SR620','sr620','SR_620','sr_620','SR-620','sr-620','SR 620','sr 620'} + COUNTERWAITTIME = 800e-6; % 800 micro-sec. + otherwise + ErrorMes = ['''COUNTERWAITTIME'' unknown for counter type: ',CounterType]; +end + +if isempty(ErrorMes) + UnitTime = 0.5e-6; % minimum time scale in this function (second) + MarginTime = 10e-6; % margin accounts for sync discrepancy and voltage + % sigal(Vout) delay + SingleTrigPls = [1 1 0 0]; + if NPlsPerGate > 3500 + ErrorMes = '''NPlsPerGate'' value too big!'; + else + TrigPlsSmplN = length(SingleTrigPls); + MinPlsPeriod = TrigPlsSmplN*UnitTime; + PulsePeriod = 1/(TrigFreq*1e3); % TrigFreq unit: kHz + n = round(PulsePeriod/MinPlsPeriod); + if n < 1 + n = 1; + end + PulsePeriod = n*MinPlsPeriod; % snap 'PulsePeriod' to n times 'MinPlsPeriod' + TrigPlsSmplTime = PulsePeriod/TrigPlsSmplN; + NPlsPerGate = round(NPlsPerGate); % convert to integer(if it is not) + if NPlsPerGate<1 + NPlsPerGate = 1; + end + ii = 0; + while ii < NPlsPerGate + TrigWave(TrigPlsSmplN*ii+1:TrigPlsSmplN*(ii+1)) = SingleTrigPls; + ii = ii+1; + end + MarginLF = ceil(MarginTime/TrigPlsSmplTime); + MarginLE = floor(MarginTime/TrigPlsSmplTime); + MarginF = zeros(1,MarginLF); % sync. margin + MarginE = zeros(1,MarginLE); % sync. margin + TrigWave = [MarginF, TrigWave, MarginE]; % add margin + TrigWaveL = length(TrigWave); + GateWave = ones(1,TrigWaveL); + CounterWait = zeros(1,ceil(1.2*COUNTERWAITTIME/TrigPlsSmplTime)); + TrigWave = [CounterWait,TrigWave]; + GateWave = [CounterWait,GateWave]; + L = length(GateWave); + + % for plotting +% x = 1:length(GateWave); +% x = x*TrigPlsSmplTime*1000; % micro second +% plot(x,GateWave,'r--','LineWidth',2); +% hold on; +% plot(x,TrigWave,'r-','LineWidth',2); +% hold on; +% xlabel('mS','FontSize',14); +% ylabel('A','FontSize',14); + + + GateVpp = 2; + PulseTrigVpp = 2; + GateFreq = 1/(L*TrigPlsSmplTime); + end + + %Êä³ö Gate Âö³å + if isempty(ErrorMes) + switch GateSourTyp + case {'HP/AGL33120','HP33120','AGL33120','hp/agl33120','hp33120','agl33120',... + 'HP/AGL_33120','HP_33120','AGL_33120','hp/agl_33120','hp_33120','agl_33120',... + 'HP/AGL-33120','HP-33120','AGL-33120','hp/agl-33120','hp-33120','agl-33120',... + 'HP/AGL 33120','HP 33120','AGL 33120','hp/agl 33120','hp 33120','agl 33120'} + set(GateSource,'OutputBufferSize',1000000); + set(GateSource,'ByteOrder','littleEndian'); % 10 little littleEndian + set(GateSource,'Timeout',1000); + opfstr=['FREQ ',num2str(GateFreq),' HZ']; + opvstr=['VOLT ',num2str(GateVpp),' VPP']; % ÉèÖà Vpp Öµ£¨·ü£© + offsstr=['VOLT:OFFS ',num2str(0),' V']; + wparray=floor((GateWave)*2047); + fopen(GateSource); + binblockwrite(GateSource,wparray,'int16','DATA:DAC VOLATILE,'); + fprintf(GateSource,''); + fprintf(GateSource,'DATA:COPY arbtemp,VOLATILE'); + fprintf(GateSource,opvstr); + fprintf(GateSource,offsstr); + fprintf(GateSource,opfstr); + fprintf(GateSource,'FUNC:SHAP USER'); + fprintf(GateSource,'FUNC:USER arbtemp'); + pause(0.5); + fclose(GateSource); + otherwise + ErrorMes = ['Unsupported counter gate pulse source: ',GateSourTyp]; + end + end + + %Êä³öpulseµÄTrigÂö³å + if isempty(ErrorMes) + switch TrigSourTyp + case {'HP/AGL33120','HP33120','AGL33120','hp/agl33120','hp33120','agl33120',... + 'HP/AGL_33120','HP_33120','AGL_33120','hp/agl_33120','hp_33120','agl_33120',... + 'HP/AGL-33120','HP-33120','AGL-33120','hp/agl-33120','hp-33120','agl-33120',... + 'HP/AGL 33120','HP 33120','AGL 33120','hp/agl 33120','hp 33120','agl 33120'} + set(TrigSource,'OutputBufferSize',1000000); + set(TrigSource,'ByteOrder','bigEndian'); % 10 little littleEndian + set(TrigSource,'Timeout',1000); + TrigFreq = GateFreq+0.1; + % TrigFreg Ò»¶¨Òª±È GateFreq ÉÔ΢´óÒ»µã£¬ÒÔ±£Ö¤Ã¿Ò»¸ö¡®Trig²¨ÐΡ¯ + % ÔÚÏÂÒ»¸öGateÔ´Ê䏸TrigÔ´µÄ´¥·¢µ½À´Ç°Íê³É¡£¡¯ + opfstr=['FREQ ',num2str(TrigFreq),' HZ']; + opvstr=['VOLT ',num2str(PulseTrigVpp),' VPP']; % ÉèÖà Vpp Öµ£¨·ü£© + offsstr=['VOLT:OFFS ',num2str(0),' V']; + clear wparray; + wparray=floor((TrigWave)*2047); + fopen(TrigSource); + binblockwrite(TrigSource,wparray,'int16','DATA:DAC VOLATILE,'); + fprintf(TrigSource,''); + fprintf(TrigSource,'DATA:COPY arbtemp,VOLATILE'); + fprintf(TrigSource,opvstr); + fprintf(TrigSource,offsstr); + fprintf(TrigSource,opfstr); + fprintf(TrigSource,'FUNC:SHAP USER'); + fprintf(TrigSource,'FUNC:USER arbtemp'); + % ÒÔÏÂÉèÖà Trig ΪÍⲿ Trig + fprintf(TrigSource,'BM:NCYC 1'); + fprintf(TrigSource,'BM:PHAS 0'); + fprintf(TrigSource,'TRIG:SOUR EXT'); + fprintf(TrigSource,'BM:STAT ON'); + pause(2); + fclose(TrigSource); + otherwise + ErrorMes = ['Unsupported trigger source: ',TrigSourTyp]; + end + end +end +if ~isempty(ErrorMes) + ErrorMes = ['@ ''GateAndTrigOutput''',char(13),char(10),ErrorMes]; +end +varargout{1} = ErrorMes; \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/_todo/MeasureVolt.m b/+qes/+hwdriver/+sync/_todo/_todo/MeasureVolt.m new file mode 100644 index 0000000..edacdb4 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/_todo/MeasureVolt.m @@ -0,0 +1,73 @@ +function [V, varargout] = MeasureVolt(Meter,TYP,varargin) +% +% +% Yulin Wu, Q02,IoP,CAS. mail4ywu@gmail.com +% $Revision: 1.0 $ $Date: 2014/05/27 $ + +ErrorMes = []; +try + switch TYP + case {'HP/AGL34401','HP34401','AGL34401','hp/agl34401','hp34401','agl34401',... + 'HP/AGL_34401','HP_34401','AGL_34401','hp/agl_34401','hp_34401','agl_34401',... + 'HP/AGL-34401','HP-34401','AGL-34401','hp/agl-34401','hp-34401','agl-34401',... + 'HP/AGL 34401','HP 34401','AGL 34401','hp/agl 34401','hp 34401','agl 34401'} + % code for HP/AGL34401 untested + try + if nargin > 2 % config instrument + % code to be added + else + fprintf(Meter,'MEASure:VOLTage:DC?'); + V = str2double(fscanf(Meter)); + end + catch + ErrorMes = 'Unkonwn error!'; + end + case {'Keithley2182','KEITHLEY2182','keithley2182','K2182','k2182',... + 'Keithley_2182','KEITHLEY_2182','keithley_2182','K_2182','k_2182',... + 'Keithley-2182','KEITHLEY-2182','keithley-2182','K-2182','k-2182',... + 'Keithley 2182','KEITHLEY 2182','keithley 2182','K 2182','k 2182'} + try + if nargin > 2 % config instrument + fprintf(Meter,'*RST'); % select channel 1 + fprintf(Meter,':sens:func ''volt'''); + + % fprintf(Meter,':sens:volt:rang:auto on'); % set to auto range + fprintf(Meter,':sens:volt:rang:auto off'); + fprintf(Meter,':sens:volt:rang 0.2'); % set to 10mV range + + + fprintf(Meter,':sens:volt:nplc 1'); % the integration time can be set from 0.01 PLC to 60 PLC(50 PLC for 50Hz line power). + fprintf(Meter,':sens:chan 1'); % select channel 1 + fprintf(Meter,':sens:volt:chan1:lpas off'); % Disable analog filter. By test, analog filter makes things worse, don't use it. + fprintf(Meter,':sens:volt:chan1:dfil:wind 10'); % Set window to 10%,(in %): 0 to 10. + fprintf(Meter,':sens:volt:chan1:dfil:coun 50'); % Set count to 50(each reading is a average of 50 times), 1 to 100. + fprintf(Meter,':sens:volt:chan1:dfil:tcon rep'); % Select moving average/repeat filter. + fprintf(Meter,':sens:volt:chan1:dfil:stat on'); % Enable digital filter. + pause(5); + V = 'Config instrument done.'; + else + fprintf(Meter,':sens:data:fres?'); % Request a fresh reading. + V = str2double(fscanf(Meter)); + end + catch + ErrorMes = 'Unknown error!'; + end + % code to be added; + case 'DCSource TYP 3' + ErrorMes = ['Unsupported DC source: ',TYP]; + % code to be added; + case {'EMPTY','Empty','empty'} + disp('No DC source!'); + otherwise + ErrorMes = ['Unsupported DC source: ',TYP]; + end +catch + ErrorMes = 'Unknown error!'; +end +if ~isempty(ErrorMes) + ErrorMes = ['@ ''MeasureVolt''',char(13),char(10),ErrorMes]; + V = NaN; + varargout{1} = ErrorMes; +else + varargout{1} = []; +end diff --git a/+qes/+hwdriver/+sync/_todo/_todo/TekRSA6K_AcquireIQData.m b/+qes/+hwdriver/+sync/_todo/_todo/TekRSA6K_AcquireIQData.m new file mode 100644 index 0000000..d029698 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/_todo/TekRSA6K_AcquireIQData.m @@ -0,0 +1,155 @@ +function IQData = TekRSA6K_AcquireIQData(IPAddress) +% This function returns a complex vector of the Inphase and Quadrature (IQ) +% data from the TekTronix RSA6000 series spectrum analyzer at IP Address +% specified by IPAddress +% Example: IQData = TekRSA6K_AcquireIQData('172.31.57.50') + +% Copyright 2010, MathWorks, Inc. +% 18-07-2010, VC. + +recordTime = 0.5; % time in seconds +bandwidth = 10e6; % bandwidth in Hz +centerFrequency = 503e6; % center frequency in Hz +frequencySpan = 10e6; % frequency span in Hz + +% Tek instruments use port 4000 for their Sockets connections +% We could use VISA, but using sockets means we don't need to +% install VISA software +TekPort = 4000; +maxRetries = 9; +maxDots = 20; + +% Find and close any open connections +openConnections = instrfind('Tag','TekRSA6K_AcquireIQData'); +if ~isempty(openConnections) + fclose(openConnections(:)); +end + +% Create TCPIP Object set it up and open connection +rsa = tcpip(IPAddress,TekPort); +rsa.InputBufferSize = 50e6; +rsa.Tag = 'TekRSA6K_AcquireIQData'; +rsa.Timeout = 3; % set timeout to 3 seconds +rsa.ByteOrder = 'littleEndian'; % Instrument returns data in littleEndian format +warning('off','instrument:query:unsuccessfulRead') +fopen(rsa); + +% Reset the instrument and query it +fprintf(rsa,'*RST;*CLS'); +instrumentID = query(rsa,'*IDN?'); +if isempty(instrumentID) + throw(MException('RSAIQCapture:ConnectionError','Unable to connect to instrument')); +end +disp(['Connected to: ' instrumentID]); + +% Abort any current measurement and set up for measurement +fprintf(rsa,'ABORt'); +fprintf(rsa,'TRIGger:SEQuence:STATus 0'); +fprintf(rsa,'INIT:CONT OFF'); + + +% Select the IQ Measurement and the display for it +fprintf(rsa,'DISPlay:GENeral:MEASview:NEW IQVTime'); +fprintf(rsa,'DISPlay:GENeral:MEASview:SELect IQVTime'); +fprintf(rsa,'SENSe:IQVTime:CLEar:RESults'); +fprintf(rsa,'DISPlay:IQVTime:X:SCALe:AUTO'); +fprintf(rsa,'DISPlay:IQVTime:Y:SCALe:AUTO'); +fprintf(rsa,'DISPlay:GENeral:MEASview:DELete SPECTrum'); + +% Set up parameters for measurement +fprintf(rsa,'SENSe:ACQuisition:MODE LENGTH'); +fprintf(rsa,['SENSe:ACQuisition:SEConds ' num2str(recordTime)]); +fprintf(rsa,['SENSe:ACQuisition:BANDwidth ' num2str(bandwidth)]); +fprintf(rsa,'SENSe:IQVTime:MAXTracepoints NEVerdecimate'); +fprintf(rsa,['SENSe:IQVTime:FREQuency:SPAN ' num2str(frequencySpan)]); +fprintf(rsa,['SENSe:IQVTime:FREQuency:CENTer ' num2str(centerFrequency)]); + +% Make meaurement +fprintf(rsa,'INITIATE:IMMEDIATE'); +disp('Making measurement...'); +% wait till the instrument completes making the measurement +operationComplete = query(rsa,'*OPC?'); +count = 1; +while ~isequal(str2double(operationComplete),1) + operationComplete = query(rsa,'*OPC?'); + disp(sprintf('\b.')); %#ok + count = count+1; + if isequal(mod(count,maxDots),0) + disp(sprintf('\n.')); %#ok + end +end +disp(sprintf('\b...Done!')); %#ok + +% Get number of IDs +IDDetails = query(rsa,'FETCh:RFIN:RECord:IDS?'); +IDFields = regexp(IDDetails, ',', 'split'); +count = 0; +while ~isequal(length(IDFields),2) + IDdetails = query(rsa,'FETCh:RFIN:RECord:IDS?'); + IDFields = regexp(IDDetails, ',', 'split'); + count = count + 1; + if count>maxRetries + throw(MException('RSAIQCapture:IDError', sprintf('Unable to obtain number of record ID''s from the instrument after %d tries.',count))); + end +end + +% Warn if there are more than one ID +if ~isequal(str2double(IDFields{1}),str2double(IDFields{2})) + warning(sprintf('Unexpected number of IDs in this acquisition. IDdetails: %s .\nData only being returned for first ID.',IDdetails)); %#ok +end +% Get the header. For details of the header fields, refer to page 2-488 of the PDF file: +% http://www2.tek.com/cmsreplive/marep/17272/077024902web_2010.06.21.11.36.16_17272_EN.pdf +header = query(rsa,'FETCh:RFIN:IQ:HEADer? 1'); +count = 0; +while length(header)<10 + header = query(rsa,'FETCh:RFIN:IQ:HEADer? 1'); + count = count + 1; + if count>maxRetries + throw(MException('RSAIQCapture:HeaderError',sprintf('Unable to obtain measurement header information from the instrument after %d tries.',count))); + end +end +headerField = regexp(header, ',', 'split'); + +% Display info to user so they know MATLAB is busy +disp(sprintf('Signal sampled at %d Hz. Transferring %d points to MATLAB.',str2double(headerField{2}),str2double(headerField{3}))); %#ok + +% Increase the timeout as transferring data can take time +fclose(rsa); +rsa.Timeout = 300; +fopen(rsa); + +% The firmware crashes if we try and retrieve a lot of data in one go so we +% get data from the instrument in smaller chunks +maxSafeSamples = rsa.InputBufferSize/16; % total buffer size/(2 bytes per IQ point) +maxSamples = str2double(headerField{3}); +if maxSamples <= maxSafeSamples + fprintf(rsa,['FETCh:RFIN:IQ? 1,0,' num2str(maxSamples)]); + data = binblockread(rsa,'single'); +else + remainingData = maxSamples; + startSamples = 0; + data = zeros(1,maxSamples*2); + count = 1; + while remainingData>0 + fprintf(rsa,['FETCh:RFIN:IQ? 1,' num2str(startSamples) ',' num2str(startSamples+maxSafeSamples - 1)]); + data((startSamples*2+1):(startSamples+maxSafeSamples)*2) = binblockread(rsa,'single'); + startSamples = startSamples + maxSafeSamples; + remainingData = remainingData - maxSafeSamples; + if remainingData < maxSafeSamples + maxSafeSamples = remainingData; + end + disp(sprintf('\b.')); %#ok + count = count + 1; + if isequal(mod(count,maxDots),0) + disp(sprintf('\n.')); %#ok + end + end +end +disp(sprintf('\b...Done!')); %#ok + +% clear variables to free up space +fclose(rsa); delete(rsa); clear rsa; +% generate the complex vector to return +IQData = data(1:2:end) + 1i.*data(2:2:end); +warning('on','instrument:query:unsuccessfulRead') +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/_todo/tekawg/chirp_signal.m b/+qes/+hwdriver/+sync/_todo/_todo/tekawg/chirp_signal.m new file mode 100644 index 0000000..3185ebb --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/_todo/tekawg/chirp_signal.m @@ -0,0 +1,32 @@ +function waveform = chirp_signal +% This function creates a RF chirp signal that sweeps about a +% center frequency of 1.25 GHz. The length of the sweep will +% be the product of the period and the clock. The in-phase +% (I) and the quadrature (Q) components are defined using the +% CHIRP function from MATLAB's Signal Processing Toolbox to +% generate swept frequency cosine signals. + +% Copyright 2009 - 2010 The MathWorks, Inc. + +%% Set up parameters +awgClock = 10e9; % AWG clock +centerFrequency = 1.25e9; % Center frequency +sweepPeriod = 4e-6; % Sweep period +startFrequency = -4.5e6; % Starting frequency +endFrequency = 4.5e6; % Ending frequency +waveformLength = sweepPeriod*awgClock; % Waveform length +sampleInterval = (0:waveformLength-1)/awgClock; % Sample interval +startIndex = 1; % Start index + +%% Create a sample waveform with I & Q +% In-phase component +inPhase = chirp(sampleInterval, startFrequency, sweepPeriod, ... + endFrequency, 'linear'); + +% Quadature component +quadrature = chirp(sampleInterval,startFrequency,sweepPeriod,... + endFrequency,'linear',-90); + +% Combine the I & Q components +waveform = inPhase.*cos(2*pi*centerFrequency*sampleInterval) - ... + quadrature.*sin(2*pi*centerFrequency*sampleInterval); \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/_todo/tekawg/generate_arb_waveform_Tektronix.m b/+qes/+hwdriver/+sync/_todo/_todo/tekawg/generate_arb_waveform_Tektronix.m new file mode 100644 index 0000000..cba977f --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/_todo/tekawg/generate_arb_waveform_Tektronix.m @@ -0,0 +1,59 @@ +% AWG M-Code for communicating with an instrument. +% +% This is the machine generated representation of an instrument control +% session using a device object. The instrument control session comprises +% all the steps you are likely to take when communicating with your +% instrument. These steps are: +% +% 1. Create a device object +% 2. Connect to the instrument +% 3. Configure properties +% 4. Invoke functions +% 5. Disconnect from the instrument +% +% To run the instrument control session, type the name of the M-file, +% awg, at the MATLAB command prompt. +% +% The M-file, AWG must be on your MATLAB PATH. For additional information +% on setting your MATLAB PATH, type 'help addpath' at the MATLAB command +% prompt. +% +% Example: +% awg; +% +% See also ICDEVICE. +% + +% Copyright 2009 - 2010 The MathWorks, Inc. +% Creation time: 13-Jan-2009 10:53:43 + +% Create a device object. +deviceObj = icdevice('tektronix_awg5000_7000.mdd', 'TCPIP::144.212.211.80::INSTR'); + +% Connect device object to hardware. +connect(deviceObj); + +% Execute device object function(s). +groupObj = get(deviceObj, 'Utility'); +groupObj = groupObj(1); +invoke(groupObj, 'Reset'); +groupObj = get(deviceObj, 'Arbwfm'); +groupObj = groupObj(1); +invoke(groupObj, 'SendWaveformReal', 'chirp', chirp_signal); +groupObj = get(deviceObj, 'Channel'); +groupObj = groupObj(1); +invoke(groupObj, 'putWaveform', 'ch1', 'chirp'); + +% Configure property value(s). +set(deviceObj.Control(1), 'SamplingRate', 50000000); + +% Execute device object function(s). +groupObj = get(deviceObj, 'Channel'); +groupObj = groupObj(1); +invoke(groupObj, 'putEnabled', 'ch1', 1); + +% Disconnect device object from hardware. +disconnect(deviceObj); + +% Delete object. +delete(deviceObj); diff --git a/+qes/+hwdriver/+sync/_todo/cryo/@OxfordDR400_55084/GetInstance.m b/+qes/+hwdriver/+sync/_todo/cryo/@OxfordDR400_55084/GetInstance.m new file mode 100644 index 0000000..7953241 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/cryo/@OxfordDR400_55084/GetInstance.m @@ -0,0 +1,55 @@ +function obj = GetInstance(name,interfaceobj,drivertype) + % if called without input arguments, the first valid instance is + % returned, if 'name' is not empty, the instance that matches 'name' + % is returned if exits, if not exit, a new instance is created(in this + % case all input arguments should be specified) + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + persistent objlst; + if isempty(objlst) + if nargin == 0 || isempty(name) + error('OxfordDR:GetInstanceError',... + 'No existing instance, all input paramenters should be specified!'); + end + if nargin > 2 + obj = OxfordDR400_55084(name,interfaceobj,drivertype); + else + obj = OxfordDR400_55084(name,interfaceobj); + end + objlst = obj; + else + nexistingobj = numel(objlst); + ii = 1; + while ii <= nexistingobj + if isvalid(objlst(ii)) + if nargin == 0 || isempty(name) + obj = objlst(ii); + return; + end + if strcmp(objlst(ii).name,name) % instance exit already, return the handle + obj = objlst(ii); + break; + end + else + objlst(ii) = []; % remove invalid handles(handles of delete objects) + nexistingobj = nexistingobj -1; + ii = ii - 1; + end + if ii >= nexistingobj % instance not exit, create one + if nargin == 0 || isempty(name) + error('OxfordDR:GetInstanceError',... + 'No existing instance, all input paramenter should be specified!'); + end + if nargin > 2 + obj = OxfordDR400_55084(name,interfaceobj,drivertype); + else + obj = OxfordDR400_55084(name,interfaceobj); + end + objlst(end+1) = obj; + end + ii = ii + 1; + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/cryo/@OxfordDR400_55084/OxfordDR400_55084.m b/+qes/+hwdriver/+sync/_todo/cryo/@OxfordDR400_55084/OxfordDR400_55084.m new file mode 100644 index 0000000..71dec4f --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/cryo/@OxfordDR400_55084/OxfordDR400_55084.m @@ -0,0 +1,24 @@ +classdef OxfordDR400_55084 < OxfordDR + % Oxford dilution fridge driver for + % DR400(project number 55084), Li Lu's group(Q02), IoP, CAS, China. + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + methods (Access = private,Hidden = true) + function obj = OxfordDR400_55084(name,interfaceobj,drivertype) + if nargin < 3 + drivertype = []; + end + obj = obj@OxfordDR(name,interfaceobj,drivertype); + obj.tempuidlst = {'T1','T2','T3','T4','T5','T6','T13'}; + obj.tempnamelst = {'PT1','PT2','Still','100mK','MC RuO2','MC Cernox','Magnet'}; + obj.presuidlst = {'P1','P2','P3','P4','P5','P6'}; + obj.presnamelst = {'Tank','Compressor','Still','P4','P5','OVC'}; + end + end + + methods (Static) + obj = GetInstance(name,interfaceobj,drivertype) + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/_todo/cryo/OxfordDR.m b/+qes/+hwdriver/+sync/_todo/cryo/OxfordDR.m new file mode 100644 index 0000000..3afd2f3 --- /dev/null +++ b/+qes/+hwdriver/+sync/_todo/cryo/OxfordDR.m @@ -0,0 +1,184 @@ +classdef (Abstract = true) OxfordDR < Instrument + % Oxford dilution fridge driver. + % Abstract class for all Oxford DRs, use sub class for a specific model + % to create an driver instance. + % basic properties and functions, for extensive + % properties and functions, use class OxfordDR_e. + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties + temperature % 1xN array, temperature of all temperature channels, K + tempres % 1xN array, resistance of all temperature channels, Ohm + tempchnl % cell, name of temperature channels to read/set, if empty, read/set all channels + pressure % 1xM array, presurre of all pressure channels, bar + preschnl % cell, name of preschnl channels to read or set, if empty, read/set all channels + +% ptcon +% valve % array +% compressor % + end + properties (SetAccess = private) + ptcstatus % string, pulse tube compressor status + ptcwit % pulse tube compressor cooling water inlet termperature + ptcwot % pulse tube compressor cooling water outlet termperature + end + properties (SetAccess = protected) % the following properties are model specific, to be harded coded in sub classes of specific models + tempnamelst % cell, channel names of all temperature channel UIDs + presnamelst % cell, channel names of all presurre channel UIDs + end + properties (SetAccess = protected, GetAccess = private) % the following properties are model specific, to be harded coded in sub classes of specific models + tempuidlst % cell, all temperature channel UIDs + presuidlst % cell, all presurre channel UIDs + end + methods + function obj = OxfordDR(name,interfaceobj,drivertype) + if isempty(interfaceobj) + error('OxfordDR:InvalidInput',... + 'Input ''%s'' can not be empty!',... + 'interfaceobj'); + end + if nargin < 3 + drivertype = []; + end + interfaceobj.Timeout = 2; % seconds + obj = obj@Instrument(name,interfaceobj,drivertype); + obj.active = false; % Oxford dilution fridge dose not support *IDN? query + end + end + methods + function set.tempchnl(obj,val) + if isempty(val) + obj.tempchnl = val; + return; + end + if ischar(val) + val = {val}; + end + if ~all(ismember(val,obj.tempnamelst)) + error('OxfordDR:SetError','Unrecognized channel names.'); + end + obj.tempchnl = val; + end + function set.preschnl(obj,val) + if isempty(val) + obj.preschnl = val; + return; + end + if ischar(val) + val = {val}; + end + if ~all(ismember(val,obj.presnamelst)) + error('OxfordDR:SetError','Unrecognized channel names.'); + end + obj.preschnl = val; + end + function t = get.temperature(obj) + if isempty(obj.tempchnl) + chnls = obj.tempnamelst; + else + chnls = obj.tempchnl; + end + numchnls = length(chnls); + t = NaN*ones(1,numchnls); + for ii = 1:numchnls + idx = find(strcmp(obj.tempnamelst,chnls{ii})); + try + flushinput(obj.interfaceobj); % flush input buffer is important + fprintf(obj.interfaceobj,['READ:DEV:',obj.tempuidlst{idx},':TEMP:SIG:TEMP']); + str = fscanf(obj.interfaceobj); + idx = strfind(str,':'); + t(ii) = str2double(str(idx(end)+1:end-2)); + catch + t(ii) = NaN; + end + end + end + function set.temperature(obj,val) + error('set forbidden.'); + end + function r = get.tempres(obj) + if isempty(obj.tempchnl) + chnls = obj.tempnamelst; + else + chnls = obj.tempchnl; + end + numchnls = length(chnls); + r = NaN*ones(1,numchnls); + for ii = 1:numchnls + idx = find(strcmp(obj.tempnamelst,chnls{ii})); + try + flushinput(obj.interfaceobj); % flush input buffer is important + fprintf(obj.interfaceobj,['READ:DEV:',obj.tempuidlst{idx},':TEMP:SIG:RES']); + str = fscanf(obj.interfaceobj); + idx = strfind(str,':'); + r(ii) = str2double(str(idx(end)+1:end-4)); + catch + r(ii) = NaN; + end + end + end + function set.tempres(obj,val) + error('set forbidden.'); + end + function p = get.pressure(obj) + if isempty(obj.preschnl) + chnls = obj.presnamelst; + else + chnls = obj.preschnl; + end + numchnls = length(chnls); + p = NaN*ones(1,numchnls); + for ii = 1:numchnls + idx = find(strcmp(obj.presnamelst,chnls{ii})); + try + flushinput(obj.interfaceobj); % flush input buffer is important + fprintf(obj.interfaceobj,['READ:DEV:',obj.presuidlst{idx},':PRES:SIG:PRES']); + str = fscanf(obj.interfaceobj); + idx = strfind(str,':'); + p(ii) = str2double(str(idx(end)+1:end-3)); + catch + p(ii) = NaN; + end + end + p = 1e-3*p; + end + function set.pressure(obj,val) + error('set forbidden.'); + end + function status = get.ptcstatus(obj) + try + flushinput(obj.interfaceobj); % flush input buffer is important + fprintf(obj.interfaceobj,['READ:DEV:C1:PTC:STATUS']); % assume there is only on pulse tube cooler + str = fscanf(obj.interfaceobj); + idx = strfind(str,':'); + status = str(idx(end)+1:end-1); + catch + status = NaN; + end + end + function t = get.ptcwit(obj) + try + flushinput(obj.interfaceobj); % flush input buffer is important + fprintf(obj.interfaceobj,['READ:DEV:C1:PTC:SIG:WIT']); % assume there is only on pulse tube cooler + str = fscanf(obj.interfaceobj); + idx = strfind(str,':'); + t = str2double(str(idx(end)+1:end-2)); + catch + t = NaN; + end + end + function t = get.ptcwot(obj) + try + flushinput(obj.interfaceobj); % flush input buffer is important + fprintf(obj.interfaceobj,['READ:DEV:C1:PTC:SIG:WOT']); % assume there is only on pulse tube cooler + str = fscanf(obj.interfaceobj); + idx = strfind(str,':'); + t = str2double(str(idx(end)+1:end-2)); + catch + t = NaN; + end + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/instrument.m b/+qes/+hwdriver/+sync/instrument.m new file mode 100644 index 0000000..5717330 --- /dev/null +++ b/+qes/+hwdriver/+sync/instrument.m @@ -0,0 +1,303 @@ +classdef (Abstract = true) instrument < qes.hwdriver.hardware + % base class for interface based hardware - gpib, tcpip, udp, i2c, + % bluetooth, visa etc. + % instrument classes only implement frequently used instrument + % properties and functionalities so as to provide a unified + % interface for a category of instruments. + % For example, AWG tries to implement common functionalities of all + % kinds of awgs and DACs, ignores most model specific properties + % and functionalities. To use those model specific properties and + % functionalities, develop a coustom driver class to implement + % those properties and functionalities, add it as advdriver + % property of a instrument class object. + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties (SetAccess = immutable, GetAccess = protected) + % string, driver type, this property is use to identify which driver to be used + drivertype@char + end + properties + timeout = Inf + % instrument classes only implement frequently used instrument + % properties and functionalities so as to provide a unified + % interface for a category of instruments. + % For example, AWG tries to implement common functionalities of all + % kinds of awgs and DACs, ignores most model specific properties + % and functionalities. To use those model specific properties and + % functionalities, develop a coustom driver class to implement + % those properties and functionalities, add it as advdriver + % property of a instrument class object. + advdriver + % instrument on active mode or not. On active mode, the online + % status of the instrument is constantly checked, if not online, + % the instrument tries to reconnect the instrument, if still can not + % bring the intrument online, an exception is throwed. Though + % happens very rarely, for instruments that are not currently + % running measurement tasks, it is adviced to turn then into + % non-active mode to prevent then from interrupping the running + % of measurement, because some of then might accidentally goes + % offline and could not be reconnected. + active = false; % default false; + end + properties (SetAccess = private) + % instrument interface object is open/connected/responsive or not + isopen + end + properties (SetAccess = protected, GetAccess = protected) + % any Matlab supported instrument communication interface object: + % GPIB, VISA, TCPIP, UDP, I2C, BLUETOOTH etc. + interfaceobj + end + properties (SetAccess = protected, GetAccess = private) + instronlinechecker % timer to check that the instrument stays online. + % instrument online ckeck interval,do checking every checkinterval seconds + % ckecking too frequenty might interrupt measurement if the + % communication to instruments is slow, if not sure, check this by: + % tic; obj.Test(); toc + % seconds + checkinterval = 60; + end + methods + function obj = instrument(name,interfaceobj,drivertype) + if ~isa(interfaceobj,'icinterface') && ~isa(interfaceobj,'qes.hwdriver.sync.ustcda')... + && ~isa(interfaceobj,'qes.hwdriver.sync.ustcad') && ~isa(interfaceobj,'qes.hwdriver.sync.ustcadda') + error('instrument:InvalidInputType',... + 'Input ''%s'' should be an interface object!',... + 'interfaceobj'); + end + obj = obj@qes.hwdriver.hardware(name); + obj.interfaceobj = interfaceobj; + if strcmp(obj.interfaceobj.Status,'closed') + qes.hwdriver.sync.instrument.FOpenClose(obj,true); + end + if nargin > 2 && ~isempty(drivertype) + obj.drivertype = drivertype; + else % driver type not specified by user, try to identify it by querying the instrument and lookup in the instrumentLib. + try + indstrs = strtrim(strsplit(query(obj.interfaceobj,'*IDN?'),',')); + InstruLib = qes.hwdriver.instrumentLib(); + d = InstruLib.GetDriverTyp(indstrs{1},indstrs{2}); + if isempty(d) + % unable to identify the driver type, the user has to specify it if necessary. + warning('instrument:IdentifyDriverTypeFail',... + 'Unable to identify the driver type.'); + end + obj.drivertype = d; + catch + % unable to identify the driver type, the user has to specify it if necessary. + warning('instrument:IdentifyDriverTypeFail',... + 'Unable to identify the driver type.'); + end + end + obj.instronlinechecker = timer('ExecutionMode','fixedRate','BusyMode','drop',... + 'Period',obj.checkinterval,'TimerFcn',{@qes.hwdriver.sync.instrument.checkinstronline,obj},... + 'ObjectVisibility','off'); + end + function set.timeout(obj,val) + if isempty(val) + val = Inf; + end + if ~isreal(val) || val <=0 + error('instrument:InvalidInput',... + 'timeout should be a positive number'); + end + obj.timeout = val; + end + function set.active(obj, val) + if isempty(val) || ~islogical(val) + error('instrument:SetError','active should be logical.'); + end + if isempty(obj.instronlinechecker) % during construction, obj.instronlinechecker might be empty + return; + end + if val + if strcmp(obj.instronlinechecker.Running,'off') + start(obj.instronlinechecker); + end + obj.active = true; + else + if strcmp(obj.instronlinechecker.Running,'on') + stop(obj.instronlinechecker); + end + obj.active = false; + end + end + function status = get.isopen(obj) + status = false; + if strcmp(obj.interfaceobj.Status,'closed') + return; + end + try + obj.Test(); + status = true; + catch + end + end + function set.checkinterval(obj, val) + if ~isnumeric(val) || ~(val > 0) + error('instrument:SetError','checkinterval is not a positive number.'); + end + if isempty(obj.instronlinechecker) % during construction, obj.instronlinechecker might be empty + return; + end + orig_active_status = obj.active; + obj.active = false; % stop timer if running + set(obj.instronlinechecker,'Period',val); + obj.checkinterval = val; + obj.active = orig_active_status; % restore running status + end + function Response = Test(obj) + % test instrument communication + Response = query(obj.interfaceobj,'*IDN?'); % takes about 5ms on a dc source(gpib), about 250ms on tek awg 5k(tcpip) + end + function CLS(obj) + % clear instrument status + obj.Write('*CLS'); + end + function RST(obj) + % reset instrument + obj.Write('*RST'); + end + function bol = IsValid(obj) + % check the validity of hanlde properties and the object itself + if ~isvalid(obj) + bol = false; + return; + end + bol = true; + if ~isvalid(obj.interfaceobj) + bol = false; + return; + end + end + function Write(obj,cmd) + fprintf(obj.interfaceobj,cmd); + end + function Read(obj) + fscanf(obj.interfaceobj); + end + function resp = Query(obj,cmd) + resp = iquery(obj.interfaceobj,cmd); + end + function Reconnect(obj) + % Reconnect the instrument + interfaceclass = class(obj.interfaceobj); + switch interfaceclass + case 'tcpip' + if isvalid(obj.interfaceobj) && strcmp(obj.interfaceobj.Status,'open') + qes.hwdriver.sync.instrument.FOpenClose(obj,false); + end + newinterfaceobj = tcpip(obj.interfaceobj.RemoteHost,... + obj.interfaceobj.RemotePort); + newinterfaceobj.Terminator = obj.interfaceobj.Terminator; + newinterfaceobj.Timeout = obj.interfaceobj.Timeout; + newinterfaceobj.InputBufferSize = obj.interfaceobj.InputBufferSize; + newinterfaceobj.OutputBufferSize = obj.interfaceobj.OutputBufferSize; + newinterfaceobj.ByteOrder = obj.interfaceobj.ByteOrder; + obj.interfaceobj = newinterfaceobj; + qes.hwdriver.sync.instrument.FOpenClose(obj,true); + end + end + function delete(obj) + if obj.instronlinechecker.Running + stop(obj.instronlinechecker); % stop checking first + end + delete(obj.instronlinechecker); + if strcmp(obj.interfaceobj.Status,'open') + qes.hwdriver.sync.instrument.FOpenClose(obj,false); + end + end +% function varargout = subsref(obj,S) +% % varargout = cell(1,nargout); +% switch S(1).type +% case '.' +% if numel(S) == 1 +% if nargout +% try +% varargout{:} = obj.(S(1).subs); +% catch +% kkk = 1; +% end +% else +% obj.(S(1).subs); +% end +% else +% switch S(2).type +% case '()' +% if nargout +% varargout{:} = obj.(S(1).subs)(S(2).subs{:}); +% else +% obj.(S(1).subs)(S(2).subs{:}); +% end +% case '{}' +% varargout{1} = obj.(S(1).subs){S(2).subs{:}}; +% end +% end +% case '()' +% objs = qes.qHandle.FindByProp('name',S(1).subs{1}); +% removeidx = []; +% for ii = 1:numel(objs) +% if ~isa(objs{ii},'instrument'); +% removeidx = [removeidx,ii]; +% end +% end +% objs(removeidx) = []; +% varargout{1} = objs; +% end +% end + end + methods (Static = true, Hidden = true) + function FOpenClose(varargin) + persistent objnamelist + persistent interfaceobjlist + if nargin == 0 + fclose('all'); + else + obj = varargin{1}; + open = varargin{2}; + end + try + if open + fopen(obj.interfaceobj); + else + fclose(obj.interfaceobj); + end + catch + error('instrument:UnsuccessfulOpen',... + [obj.name ': Could not open/close interface object!']); + end + [~,Locb] = ismember(obj.name,objnamelist); + if Locb + if open + interfaceobjlist(Locb) = {obj.interfaceobj}; + else + objnamelist(Locb) = []; + interfaceobjlist(Locb) = []; + end + else + objnamelist = [objnamelist,{obj.name}]; + interfaceobjlist = [interfaceobjlist,{obj.interfaceobj}]; + end + end + function checkinstronline(hObject,eventdata,obj) + if strcmp(obj.interfaceobj.Status,'closed') + try + fopen(obj.interfaceobj); + catch + warning('instrument:instrumentOffline',... + [obj.name ': instrument offline, reconnection failed!']); + end + else + try + obj.Test(); + catch + warning('instrument:instrumentOffline',... + [obj.name ': instrument offline!']); + end + end + end + end + +end \ No newline at end of file diff --git a/+qes/+hwdriver/+sync/iquery.m b/+qes/+hwdriver/+sync/iquery.m new file mode 100644 index 0000000..097a123 --- /dev/null +++ b/+qes/+hwdriver/+sync/iquery.m @@ -0,0 +1,9 @@ +function resp = iquery(interfaceobj, cmd) + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + flushinput(interfaceobj); % query dose not flush input buffer(R2013b) + resp = query(interfaceobj, cmd); +end \ No newline at end of file diff --git a/+qes/+hwdriver/hardware.m b/+qes/+hwdriver/hardware.m new file mode 100644 index 0000000..04d4a2a --- /dev/null +++ b/+qes/+hwdriver/hardware.m @@ -0,0 +1,20 @@ +classdef (Abstract = true) hardware < qes.qHandle + % base class for all hardware + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + methods + function obj = hardware(name) + if nargin == 0 || isempty(name) + error('Hardware:UnNamedError', 'name empty, hardwares object properties are looked up in settings by name, so a hardware must be given a name.'); + end + obj = obj@qes.qHandle(name); + obj.temperory = false; + end + function delete(obj) + obj.temperory = true; % remove object from registry + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/icinterface_compatible.m b/+qes/+hwdriver/icinterface_compatible.m new file mode 100644 index 0000000..e70ed83 --- /dev/null +++ b/+qes/+hwdriver/icinterface_compatible.m @@ -0,0 +1,107 @@ +classdef (Abstract = true)icinterface_compatible < handle +% a MATLAB icinterface class compatible +% this file +% usage: +% interfaceobj = qes.hwdriver.sync.ustcadda('1.0.0.200',4001); +% fopen(interfaceobj); +% ret = query(interfaceobj,'*IDN?') +% fprintf(interfaceobj,'*IDN?') +% ret = fscanf(interfaceobj) +% interfaceobj.WriteWave(...) +% interfaceobj.StartStop(...) +% ... ... +% fclose(interfaceobj) + + +% Copyright 2016 Yulin Wu, USTC +% mail4ywu@gmail.com/mail4ywu@icloud.com + properties (SetAccess = private) + timeout = 10 % seconds + end + properties (SetAccess = private) + Status = 'closed' % to be compatible with MATLAB icinterface class + isopen = false; + end + properties (SetAccess = private, GetAccess = private) + ibuffer % input buffer + obuffer % output buffer + errorstatus = false + end + + methods + function set.timeout(obj,val) + if ~(val > 0) + error('USTCADDA:InvalidValue','time out should be a positive value.'); + end + obj.timeout = val; + end + + function flushinput(obj) + obj.ibuffer = []; + end + function flushoutput(obj) + obj.obuffer = []; + end + function response = query(obj,cmd) + obj.HandleCmd(cmd); + response = obj.ibuffer; + obj.ibuffer = []; + end + function fprintf(obj,cmd) + obj.HandleCmd(cmd); + end + function response = fscanf(obj) + tic + while 1 + if ~isempty(obj.ibuffer) + response = obj.ibuffer; + obj.ibuffer = []; + return; + elseif toc >= obj.timeout + error('USTCADDA:TimeoutError','Timeout.'); + end + end + end + function fopen(obj) + obj.Open(); + end + function fclose(obj) + obj.Close(); + end + function close(obj) + obj.Close(); + end + function Open(obj) + if ~obj.isopen + obj.Status = 'open'; + obj.isopen = true; + end + end + function Close(obj) + if obj.isopen + obj.Status = 'closed'; + obj.isopen = false; + end + end + function delete(obj) + obj.Close(); + unloadlibrary(obj.driver); + end + end + methods (Access = private) + function HandleCmd(obj, cmd) + cmd = upper(cmd); + switch cmd + case '*IDN?' + obj.ibuffer = 'USTC,USTC_DA_V1'; + obj.errorstatus = false; + case {'*CLS','*RST'} + % to be implemented + obj.errorstatus = false; + otherwise + obj.ibuffer = ['Unrecognized command string: ', cmd]; + obj.errorstatus = true; + end + end + end +end \ No newline at end of file diff --git a/+qes/+hwdriver/instrumentLib.m b/+qes/+hwdriver/instrumentLib.m new file mode 100644 index 0000000..76aacf9 --- /dev/null +++ b/+qes/+hwdriver/instrumentLib.m @@ -0,0 +1,50 @@ +classdef instrumentLib + % instrumentLib provides a central place to manager instrument dirver + % type alias. + % + +% Copyright 2015 Yulin Wu, Institute of Physics, Chinese Academy of Sciences +% mail4ywu@gmail.com/mail4ywu@icloud.com + + properties (Constant = true, GetAccess = private) + % manufacturer, and driver alias, N by 2 cells, cell row represents + % a tuple of instruments that can use the same driver alias, for + % example(case insensitive): + % {'tektronix','tek'}, {'tek5k', 'awg5014b', 'awg5014c'} + % if the instrument Manufacturer is 'tektronix' or 'tek' and Model is + % any of 'tek5k', 'awg5014b', 'awg5014c', the drivertype will be + % 'tek5k' + driveralias = {{'adc corp.','adcmt'}, {'place_holder'};... + {'agilent technologies','agilent', 'keysight technologies', 'keysight'}, {'agilent_n9030b', 'n9030b'};... % spectrum analyzer N9000 series + {'agilent technologies','agilent', 'keysight technologies', 'keysight'}, ... + {'agilent_n5230c', 'n5230a', 'n5230b', 'n5230c', 'e8361a', 'e8361b', 'e8361c', 'e8362a', 'e8362b', 'e8362c', 'e8363a', 'e8363b', 'e8363c', 'e8364a', 'e8364b', 'e8364c'};... % network analyzer + {'anritsu'}, {'anritsu_mg3692c', 'mg3692c'};... % signal generate + {'hewlett-packard','hewlett packard'}, {'place_holder'};... + {'national instruments'}, {'place_holder'};... + {'stanford research systems', 'stanford research'}, {'place_holder'};... + {'tektronix','tek'}, {'tek5k', 'awg5014b', 'awg5014c'};... + {'tektronix','tek'}, {'tek7k', 'awg7012c'};... + {'ustc'}, {'ustc_da_v1'};... + } + end + methods + function drivertype = GetDriverTyp(obj,Manufacturer,Model) + % this method call by class Instrument, not meant for end user + % usage. + persistent numdrivertypes + if isempty(numdrivertypes) + numdrivertypes = size(obj.driveralias,1); + end + Manufacturer = lower(Manufacturer); + Model = lower(Model); + drivertype = []; + for ii = 1:numdrivertypes + if ismember(Manufacturer, obj.driveralias{ii,1}) &&... + ismember(Model, obj.driveralias{ii,2}) + drivertype = obj.driveralias{ii,2}{1}; + break; + end + end + end + end +end \ No newline at end of file diff --git a/+qes/+util/loadJson.m b/+qes/+util/loadJson.m new file mode 100644 index 0000000..8e6705d --- /dev/null +++ b/+qes/+util/loadJson.m @@ -0,0 +1,27 @@ +function data = loadJson(fullfilename) +% Copyright 2016 Yulin Wu, USTC +% mail4ywu@gmail.com/mail4ywu@icloud.com + + c = {}; + fid = fopen(fullfilename,'r'); + while ~feof(fid) + try + c{end+1} = fgetl(fid); + catch ME + fclose(fid); + rethrow(ME); + end + end + fclose(fid); + n = numel(c); + str = ''; + for ii = 1:n + idx = strfind(c{ii},'//'); + if ~isempty(idx) + c{ii}(idx:end) = []; + end + c{ii}(c{ii}==10 & c{ii}==13) = []; + str = [str,c{ii}]; + end + [data, ~] = qes.util.parseJson(str); +end \ No newline at end of file diff --git a/+qes/+util/loadSettings.m b/+qes/+util/loadSettings.m new file mode 100644 index 0000000..14ae3af --- /dev/null +++ b/+qes/+util/loadSettings.m @@ -0,0 +1,146 @@ +function data = loadSettings(spath, fields) +% load settings +% examples: +% s = qes.util.loadSettings('F:\program\qes_settings',{'_hardware','hwsettings1','ustcadda','ad_boards'}) +% s = qes.util.loadSettings('F:\program\qes_settings',{'_hardware','hwsettings1','ustcadda','ad_boards','ADC2'}) +% s = qes.util.loadSettings('F:\program\qes_settings',{'_hardware','hwsettings1','ustcadda','ad_boards','ADC2','records','demod_freq'}) + +% Copyright 2016 Yulin Wu, USTC +% mail4ywu@gmail.com/mail4ywu@icloud.com + + data = []; + if nargin == 1 || isempty(fields) + fields = {}; + end + if ~iscell(fields) + if ~ischar(fields) + error('loadSettings:invalidInput','fileds should be a cell array of char strings or a char string.'); + else + fields = {fields}; + end + end + if ~isdir(spath) + error('loadSettings:invalidInput','%s is not a valid directory.', spath); + end + if ~exist(spath,'dir') + error('loadSettings:NotFound','directory: %s not found.', spath); + end + numFields = numel(fields); + fileinfo = dir(spath); + numFiles = numel(fileinfo); + for ii = 1:numFiles; + if strcmp(fileinfo(ii).name,'.') || strcmp(fileinfo(ii).name,'..') + if ii == numFiles && ~isempty(fields) + error('loadSettings:notFound','no such field found in settings.'); + end + continue; + end + if isempty(fields) % load all + if fileinfo(ii).isdir + try + data.(fileinfo(ii).name) = qes.util.loadSettings(fullfile(spath,fileinfo(ii).name)); + catch + end + elseif length(fileinfo(ii).name) < 5 || ~strcmp(fileinfo(ii).name(end-2:end),'key') + continue; + else + cidx = strfind(fileinfo(ii).name(1:end-4),'@'); + nidx = strfind(fileinfo(ii).name(1:end-4),'='); + if isempty(cidx) && isempty(nidx) + fieldname = fileinfo(ii).name(1:end-4); + if isvarname(fieldname) + try + data_ = qes.util.loadJson(fullfile(spath,fileinfo(ii).name)); + if isfield(data_,fieldname) + data.(fieldname) = data_.(fieldname); + end + catch + end + end + elseif ~isempty(cidx) && cidx(end) > 1 + fieldname = fileinfo(ii).name(1:cidx(end)-1); + if isvarname(fieldname) + data.(fieldname) = fileinfo(ii).name(cidx(end)+1:end-4); + end + elseif ~isempty(nidx) && nidx(end) > 1 + fieldname = fileinfo(ii).name(1:nidx(end)-1); + if isvarname(fieldname) + dstr = strtrim(fileinfo(ii).name(nidx(end)+1:end-4)); + isboolean = false; + if ~isempty(strfind(dstr,'true')) || ~isempty(strfind(dstr,'false')) ||... + ~isempty(strfind(dstr,'True')) || ~isempty(strfind(dstr,'False')) + isboolean = true; + dstr = regexprep(dstr,'[tT]rue','1'); + dstr = regexprep(dstr,'[fF]alse','0'); + end + data_ = cellfun(@str2double,strsplit(dstr,',')); + if isboolean + data_ = logical(data_); + end + data.(fieldname) = data_; + end + end + end + else % load a specific field + data = struct(); + if fileinfo(ii).isdir && strcmp(fileinfo(ii).name,fields{1}) + fields(1) = []; + data = qes.util.loadSettings(fullfile(spath,fileinfo(ii).name),fields); + return; + end + if fileinfo(ii).isdir || length(fileinfo(ii).name) < 5 || ~strcmp(fileinfo(ii).name(end-2:end),'key') + if ii == numFiles + error('loadSettings:notFound','no such field found in settings.'); + end + continue; + end + if strcmp(fileinfo(ii).name(1:end-4),fields{1}) + jdata = qes.util.loadJson(fullfile(spath,fileinfo(ii).name)); + for jj = 1:numFields + if ~isfield(jdata,fields{jj}) + error('loadSettings:notFound','no such field found in settings.'); + end + if jj == numFields + data = jdata.(fields{jj}); + if iscell(data) && numel(data) == 1 + data = data{1}; + end + return; + else + jdata = jdata.(fields{jj}); + if iscell(jdata) && numel(jdata) == 1 + jdata = jdata{1}; + end + end + end + elseif numFields == 1 + ln_field = numel(fields{1}); + if length(fileinfo(ii).name)-3 >= ln_field &&... + strcmp(fileinfo(ii).name(1:ln_field),fields{1}) + switch fileinfo(ii).name(ln_field+1) + case '@' + data = fileinfo(ii).name(ln_field+2:end-4); + return; + case '=' + dstr = strtrim(fileinfo(ii).name(ln_field+2:end-4)); + isboolean = false; + if ~isempty(strfind(dstr,'true')) || ~isempty(strfind(dstr,'false')) ||... + ~isempty(strfind(dstr,'True')) || ~isempty(strfind(dstr,'False')) + isboolean = true; + dstr = regexprep(dstr,'[tT]rue','1'); + dstr = regexprep(dstr,'[fF]alse','0'); + end + data = cellfun(@str2double,strsplit(dstr,',')); + if isboolean + data = logical(data); + end + return; + end + end + end + end + if ii == numFiles && ~isempty(fields) + error('loadSettings:notFound','no such field found in settings.'); + end + end +end \ No newline at end of file diff --git a/+qes/+util/parseJson.m b/+qes/+util/parseJson.m new file mode 100644 index 0000000..2aaaba9 --- /dev/null +++ b/+qes/+util/parseJson.m @@ -0,0 +1,181 @@ +function [data, json] = parseJson(json) + % [DATA JSON] = PARSE_JSON(json) + % This function parses a JSON(JavaScript Object Notation) string and + % returns a cell array with the parsed data. JSON objects are converted + % to structures and JSON arrays are converted to cell arrays. + % + % Example: + % google_search = 'http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=matlab'; + % matlab_results = parse_json(urlread(google_search)); + % disp(matlab_results{1}.responseData.results{1}.titleNoFormatting) + % disp(matlab_results{1}.responseData.results{1}.visibleUrl) + +% by Joel Feenstra +% Code used from: +% http://www.mathworks.com/matlabcentral/fileexchange/20565 + + data = cell(0,1); + while ~isempty(json) + [value, json_] = parse_value(json); + data{end+1} = value; %#ok + if length(json_) == length(json) + break; + end + json = json_; + end + + % Yulin Wu + if isempty(data) + data = []; + elseif numel(data) == 1 + data = data{1}; + end +end + +function [value, json] = parse_value(json) + value = []; + if isempty(json) + return; + end + id = json(1); + json(1) = []; + json = strtrim(json); + switch lower(id) + case '"' + [value, json] = parse_string(json); + case '{' + [value, json] = parse_object(json); + case '[' + [value, json] = parse_array(json); + case 't' + value = true; + if (length(json) >= 3) + json(1:3) = []; + else + ME = MException('json:parse_value',['Invalid TRUE identifier: ' id json]); + ME.throw; + end + case 'f' + value = false; + if (length(json) >= 4) + json(1:4) = []; + else + ME = MException('json:parse_value',['Invalid FALSE identifier: ' id json]); + ME.throw; + end + case 'n' + value = []; + if (length(json) >= 3) + json(1:3) = []; + else + ME = MException('json:parse_value',['Invalid NULL identifier: ' id json]); + ME.throw; + end + otherwise + [value, json] = parse_number([id json]); % Need to put the id back on the string + end +end + +function [data, json] = parse_array(json) + data = cell(0,1); + while ~isempty(json) + if strcmp(json(1),']') % Check if the array is closed + json(1) = []; + return + end + [value, json] = parse_value(json); + if isempty(value) + ME = MException('json:parse_array',['Parsed an empty value: ' json]); + ME.throw; + end + data{end+1} = value; %#ok + while ~isempty(json) && ~isempty(regexp(json(1),'[\s,]','once')) + json(1) = []; + end + end +end + +function [data, json] = parse_object(json) + data = []; + while ~isempty(json) + id = json(1); + json(1) = []; + switch id + case '"' % Start a name/value pair + [name, value, remaining_json] = parse_name_value(json); + if isempty(name) + ME = MException('json:parse_object',['Can not have an empty name: ' json]); + ME.throw; + end + data.(name) = value; + json = remaining_json; + case '}' % End of object, so exit the function + return + otherwise % Ignore other characters + end + end +end + +function [name, value, json] = parse_name_value(json) + name = []; + value = []; + if ~isempty(json) + [name, json] = parse_string(json); + % Skip spaces and the : separator + while ~isempty(json) && ~isempty(regexp(json(1),'[\s:]','once')) + json(1) = []; + end + [value, json] = parse_value(json); + end +end + +function [string, json] = parse_string(json) + string = []; + while ~isempty(json) + letter = json(1); + json(1) = []; + switch lower(letter) + case '\' % Deal with escaped characters + if ~isempty(json) + code = json(1); + json(1) = []; + switch lower(code) + case '"' + new_char = '"'; + case '\' + new_char = '\'; + case '/' + new_char = '/'; + case {'b' 'f' 'n' 'r' 't'} + new_char = sprintf('\%c',code); + case 'u' + if length(json) >= 4 + new_char = sprintf('\\u%s',json(1:4)); + json(1:4) = []; + end + otherwise + new_char = []; + end + end + case '"' % Done with the string + return + otherwise + new_char = letter; + end + % Append the new character + string = [string new_char]; %#ok + end +end + +function [num, json] = parse_number(json) + num = []; + if ~isempty(json) + % Validate the floating point number using a regular expression + [s, e] = regexp(json,'^[\w]?[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?[\w]?','once'); + if ~isempty(s) + num_str = json(s:e); + json(s:e) = []; + num = str2double(strtrim(num_str)); + end + end +end \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6aea8f9..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -ErrorLog.txt -test.m \ No newline at end of file diff --git a/OutputTrigWave_Demo.m b/OutputTrigWave_Demo.m deleted file mode 100644 index fc862db..0000000 --- a/OutputTrigWave_Demo.m +++ /dev/null @@ -1,20 +0,0 @@ -da = USTCDAC('10.0.2.7',80); -da.Open(); -da.Init(); -da.SetIsMaster(1); -da.SetTrigSel(0); -da.StartStop(15); -data = 1:64000; -waveobj = waveform(); -seq = waveobj.generate_trig_seq(length(data),0); -num = 0; -while(1) - for k = 1:4 - da.WriteWave(k,0,[data,ones(1,16)*32768]); - da.WriteSeq(k,0,seq); - end - da.CheckStatus(); - da.SendIntTrig(); - num = num + 1; - disp(num); -end \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7f0911c --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# MatlabAPI +层次关系 +USTCADDA->(USTCDAC,USTCADC)->(USTCADCDriver,USTCDACDriver) diff --git a/ReadRegTest.m b/ReadRegTest.m new file mode 100644 index 0000000..88e252a --- /dev/null +++ b/ReadRegTest.m @@ -0,0 +1,18 @@ +%% ¶Á¼Ä´æÆ÷ +da = USTCDAC('10.0.2.2',80); +da.Open(); + +len_row = 1314; +len_col = 10; +chip = zeros(2,len_col,len_row); + +for kk = 1:len_col + for k = 1:len_row + chip(1,kk,k) = da.ReadAD9136_1(k-1); + chip(2,kk,k) = da.ReadAD9136_2(k-1); + end +% da.InitBoard(); +end + +chip = mod(chip,256); +da.Close(); diff --git a/ReadRegTestTx.m b/ReadRegTestTx.m new file mode 100644 index 0000000..d48d16c --- /dev/null +++ b/ReadRegTestTx.m @@ -0,0 +1,19 @@ +%% ¶Á¼Ä´æÆ÷ +da = USTCDAC('10.0.2.2',80); +da.Open(); + +da.set('isblock',1); + +len_row = 60; +len_col = 10; +JESDTx = zeros(len_col,len_row); + +for kk = 1:len_col + for k = 1:4:len_row + JESDTx(kk,k) = da.ReadReg(2,k-1); + JESDTx(kk,k) = da.ReadReg(3,k-1); + end +% da.InitBoard(); +end + +da.Close(); diff --git a/Test.m b/Test.m new file mode 100644 index 0000000..cc5872e --- /dev/null +++ b/Test.m @@ -0,0 +1,57 @@ +%% Éú³ÉʵÀý +da1 = USTCDAC('10.0.2.8',80); +da2 = USTCDAC('10.0.2.5',80); + +%% da1 +da1.set('ismaster',1); +da1.Open(); + +data1 = [ones(1,3200),ones(1,3200)*65535]; +seq1 = USTCADDA.GenerateTrigSeq(length(data1),0); + +da1.SetTrigCount(100); +da1.SetTrigSel(0); + +da1.WriteSeq(1,0,seq1); +da1.WriteSeq(2,0,seq1); +da1.WriteSeq(3,0,seq1); +da1.WriteSeq(4,0,seq1); + +data1 = [data1,ones(1,16)*32768]; + +da1.WriteWave(1,0,data1); +da1.WriteWave(2,0,data1); +da1.WriteWave(3,0,data1); +da1.WriteWave(4,0,data1); + +da1.StartStop(15); +da1.CheckStatus(); + +%% da2 +da2.Open(); +data2 = [ones(1,12),ones(1,12)*65535]; +seq2 = USTCADDA.GenerateTrigSeq(length(data2),0); + +da2.SetTrigSel(0); +da2.WriteSeq(0,0,seq2); +da2.WriteSeq(1,0,seq2); +da2.WriteSeq(2,0,seq2); +da2.WriteSeq(3,0,seq2); + +data2 = [data1,ones(1,16)*32768]; +da1.SetTrigSel(0); + +da2.WriteWave(0,0,data2); +da2.WriteWave(1,0,data2); +da2.WriteWave(2,0,data2); +da2.WriteWave(3,0,data2); + +da2.StartStop(15); +da2.CheckStatus(); + +%% ·¢ËÍ´¥·¢ÃüÁî +da1.SendIntTrig(); + +%% close +da1.Close() +da2.Close() \ No newline at end of file diff --git a/USTCADC.m b/USTCADC.m index 293c570..87a681d 100644 --- a/USTCADC.m +++ b/USTCADC.m @@ -2,195 +2,266 @@ % Author:GuoCheng % E-mail:fortune@mail.ustc.edu.cn % All right reserved @ GuoCheng. -% Modified: 2017.7.1 +% Modified: 2017.2.26 % Description:The class of ADC classdef USTCADC < handle properties(SetAccess = private) - netcard; % net card number - isopen; % open flag - status; % open state. + netcard_no; %ÉÏλ»úÍø¿¨ºÅ + mac = zeros(1,6); %ÉÏλ»úÍø¿¨µØÖ· + isopen; %´ò¿ª±êʶ + status; %´ò¿ª×´Ì¬ end - properties - name = ''; % ADC name - mac = '00-00-00-00-00-00'; % mac address of pc - sample_rate = 1e9; % ADC sample rate - channel_amount = 2; % ADC channel amount, I & Q. - isdemod = 0; % is run demod mode. - sample_depth = 2000; % ADC sample depth - trig_count = 100; % ADC accept trigger count - window_start = 0; % start position of demod window. - window_width = 2000; % demod window width. - demod_frequency = 100e6; % demod frequency. + properties(SetAccess = private) + name = ''; %ADCÃû×Ö + sample_rate = 1e9; %ADC²ÉÑùÂÊ£¬Î´Ê¹Óà + channel_amount = 2; %ADCͨµÀ£¬Î´Ê¹Óã¬Êµ¼ÊʹÓÃI¡¢QÁ½¸öͨµÀ¡£ + sample_depth = 2000; %ADC²ÉÑùÉî¶È + sample_count = 100; %ADCʹÄܺó²ÉÑù´ÎÊý end properties (GetAccess = private,Constant = true) driver = 'USTCADCDriver'; driverh = 'USTCADCDriver.h'; - driverdll = 'USTCADCDriver.dll'; end methods(Static = true) - function LoadLibrary() + function list = ListAdpter() + driverfilename = [USTCADC.driver,'.dll']; if(~libisloaded(USTCADC.driver)) - loadlibrary(USTCADC.driverdll,USTCADC.driverh); + loadlibrary(driverfilename,USTCADC.driverh); end - end - function info = GetDriverInformation() - USTCADC.LoadLibrary(); - str = libpointer('cstring',blanks(1024)); - [ErrorCode,info] = calllib(USTCADC.driver,'GetSoftInformation',str); - USTCADC.DispError('USTCDAC:GetDriverInformation:',ErrorCode); - end - function list = ListAdpter() - USTCADC.LoadLibrary(); list = blanks(2048); + pos = 1; str = libpointer('cstring',blanks(2048)); - [ErrorCode,info] = calllib(USTCADC.driver,'GetAdapterList',str); - if(ErrorCode == 0) - info = regexp(info,'\n', 'split');pos = 1; + [ret,info] = calllib(USTCADC.driver,'GetAdapterList',str); + if(ret == 0) + info = regexp(info,'\n', 'split'); for index = 1:length(info) info{index} = [num2str(index),' : ',info{index}]; list(pos:pos + length(info{index})) = [info{index},10]; pos = pos + length(info{index}) + 1; end - end - USTCADC.DispError('USTCADC:ListAdapter',ErrorCode); - end - function DispError(MsgID,errorcode) - if(errorcode ~= 0) - str = libpointer('cstring',blanks(1024)); - [~,info] = calllib(USTCADC.driver,'GetErrorMsg',int32(errorcode),str); - msg = ['Error code:',num2str(errorcode),' --> ',info]; - WriteErrorLog([MsgID,' ',msg]); - error(MsgID,[MsgID,' ',msg]); + else + error('USTCDAC: Get adpter list failed!'); end end end methods function obj = USTCADC(num) - obj.netcard = num; + obj.netcard_no = num; obj.isopen = false; obj.status = 'close'; + driverfilename = [obj.driver,'.dll']; + if(~libisloaded(obj.driver)) + loadlibrary(driverfilename,obj.driverh); + end end + function Open(obj) if ~obj.isopen - obj.LoadLibrary(); - ErrorCode = calllib(obj.driver,'OpenADC',int32(obj.netcard)); - obj.DispError('USTCADC:Open',ErrorCode); - obj.status = 'open'; - obj.isopen = true; + ret = calllib(obj.driver,'OpenADC',int32(obj.netcard_no)); + if(ret == 0) + obj.status = 'open'; + obj.isopen = true; + else + error('USTCADC:OpenError','Open ADC failed!'); + end obj.Init() end end - function Close(obj) - if(obj.isopen == true) - ErrorCode = calllib(obj.driver,'CloseADC'); - obj.DispError('USTCADC:Close',ErrorCode); - obj.status = 'close'; - obj.isopen = false; - end - end + function Init(obj) - obj.SetMacAddr(obj.mac); - obj.SetGain(1); + obj.SetMacAddr(obj.mac'); + obj.SetSampleDepth(obj.sample_depth); + obj.SetTrigCount(obj.sample_count); + end + + function Close(obj) + if obj.isopen + ret = calllib(obj.driver,'CloseADC'); + if(ret == 0) + obj.status = 'close'; + obj.isopen = false; + else + error('USTCADC:CloseError','Close ADC failed!'); + end + end end + function SetSampleDepth(obj,depth) - obj.sample_depth = depth; - data = [0,18,depth/256,mod(depth,256)]; - pdata = libpointer('uint8Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'SendData',int32(4),pdata); - obj.DispError('USTCADC:SetSampleDepth',ErrorCode); + if obj.isopen + data = [0,18,depth/256,mod(depth,256)]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(4),pdata); + if(ret ~= 0) + error('USTCADC:SendPacket','SetSampleDepth failed!'); + end + end end + + function ClearBuff(obj) + if obj.isopen + ret = calllib(obj.driver,'ClearBuff'); + if(ret ~= 0) + error('USTCADC:ClearBuff','ClearBuff failed!'); + end + end + end + function SetTrigCount(obj,count) - obj.trig_count = count; - data = [0,19,count/256,mod(count,256)]; - pdata = libpointer('uint8Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'SendData',int32(4),pdata); - obj.DispError('USTCADC:SetTrigCount',ErrorCode); - end - function SetMacAddr(obj,macStr) - obj.mac = macStr; - macdata = regexp(macStr,'-', 'split'); - macdata = hex2dec(macdata)'; - data = [0,17]; - data = [data,macdata]; - pdata = libpointer('uint8Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'SendData',int32(length(macdata)+2),pdata); - obj.DispError('USTCADC:SetMacAddr',ErrorCode); + if obj.isopen + data = [0,19,count/256,mod(count,256)]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(4),pdata); + if(ret ~= 0) + error('USTCADC:SendPacket','SetTrigCount failed!'); + end + end end + + function SetMacAddr(obj,mac) + if obj.isopen + data = [0,17]; + data = [data,mac]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(length(mac)+2),pdata); + if(ret ~= 0) + error('USTCADC:SendPacket','SetMacAddr failed!'); + end + end + end + function ForceTrig(obj) - data = [0,1,238,238,238,238,238,238]; - pdata = libpointer('uint8Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'SendData',int32(8),pdata); - obj.DispError('USTCADC:ForceTrig',ErrorCode); + if obj.isopen + data = [0,1,238,238,238,238,238,238]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(8),pdata); + if(ret ~= 0) + error('USTCADC:SendPacket','ForceTrig failed!'); + end + end end + function EnableADC(obj) - data = [0,3,238,238,238,238,238,238]; - pdata = libpointer('uint8Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'SendData',int32(8),pdata); - obj.DispError('USTCADC:EnableADC',ErrorCode); + if obj.isopen + data = [0,3,238,238,238,238,238,238]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(8),pdata); + if(ret ~= 0) + error('USTCADC:SendPacket','EnableADC failed!'); + end + end end + function SetMode(obj,isdemo) - obj.isdemod = isdemo; - if(isdemo == 0) - data = [1,1,17,17,17,17,17,17]; - else - data = [1,1,34,34,34,34,34,34]; - end - pdata = libpointer('uint8Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'SendData',int32(8),pdata); - obj.DispError('USTCADC:SetMode',ErrorCode); + if obj.isopen + if(isdemo == 0) + data = [1,1,17,17,17,17,17,17]; + else + data = [1,1,34,34,34,34,34,34]; + end + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(8),pdata); + if(ret ~= 0) + error('USTCADC:SendPacket','SetMode failed!'); + end + end end + function SetWindowLength(obj,length) - data = [0,20,floor(length/256),mod(length,256),0,0,0,0]; - pdata = libpointer('uint8Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'SendData',int32(8),pdata); - obj.DispError('USTCADC:SetWindowLength',ErrorCode); + if obj.isopen + data = [0,20,floor(length/256),mod(length,256),0,0,0,0]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(8),pdata); + if(ret ~= 0) + error('USTCADC:SendPacket','SetWindowLength failed!'); + end + end end + function SetWindowStart(obj,pos) - data = [0,21,floor(pos/256),mod(pos,256),0,0,0,0]; - pdata = libpointer('uint8Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'SendData',int32(8),pdata); - obj.DispError('USTCADC:SetWindowStart',ErrorCode); + if obj.isopen + data = [0,21,floor(pos/256),mod(pos,256),0,0,0,0]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(8),pdata); + if(ret ~= 0) + error('USTCADC:SendPacket','SetWindowStart failed!'); + end + end end + function SetDemoFre(obj,fre) - step = fre/1e9*65536; - data = [0,22,floor(step/256),mod(step,256),0,0,0,0]; - pdata = libpointer('uint8Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'SendData',int32(8),pdata); - obj.DispError('USTCADC:SetDemoFre',ErrorCode); - end + if obj.isopen + step = fre/1e9*65536; + data = [0,22,floor(step/256),mod(step,256),0,0,0,0]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(8),pdata); + if(ret ~= 0) + error('USTCADC:SendPacket','SetDemoFre failed!'); + end + end + end + function SetGain(obj,mode) - switch mode - case 1,code = [80,80]; - case 2,code = [0,0]; - case 3,code = [255,255]; - end - data = [0,23,code(1),code(2),0,0,0,0]; - pdata = libpointer('uint8Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'SendData',int32(8),pdata); - obj.DispError('USTCADC:SetGain',ErrorCode); + if obj.isopen + switch mode + case 1,code = [80,80]; + case 2,code = [0,0]; + case 3,code = [255,255]; + end + data = [0,23,code(1),code(2),0,0,0,0]; + pdata = libpointer('uint8Ptr', data); + [ret,~] = calllib(obj.driver,'SendData',int32(8),pdata); + if(ret ~= 0) + error('USTCADC:SendPacket','SetGain failed!'); + end + end end + function [ret,I,Q] = RecvData(obj,row,column) - if(obj.isdemod) + if obj.isopen + I = zeros(row*column,1); + Q = zeros(row*column,1); + pI = libpointer('uint8Ptr', I); + pQ = libpointer('uint8Ptr', Q); + [ret,I,Q] = calllib(obj.driver,'RecvData',int32(row*column),int32(column),pI,pQ); + end + end + + function [ret,I,Q] = RecvDemo(obj,row) + if obj.isopen IQ = zeros(2*row,1); pIQ = libpointer('int32Ptr', IQ); [ret,IQ] = calllib(obj.driver,'RecvDemo',int32(row),pIQ); if(ret == 0) I = IQ(1:2:length(IQ)); Q = IQ(2:2:length(IQ)); + else + error('USTCADC:RecvDemo','Recive demode data error!') end - else - I = zeros(row*column,1); - Q = zeros(row*column,1); - pI = libpointer('uint8Ptr', I); - pQ = libpointer('uint8Ptr', Q); - [ret,I,Q] = calllib(obj.driver,'RecvData',int32(row),int32(column),pI,pQ); - I = (reshape(I,[obj.sample_depth,obj.trig_count]))'; - Q = (reshape(Q,[obj.sample_depth,obj.trig_count]))'; - end + end + end + + function set(obj,properties,value) + switch properties + case 'mac'; + mac_str = regexp(value,'-', 'split'); + obj.mac = hex2dec(mac_str); + case 'name'; obj.name = value; + case 'sample_rate'; obj.sample_rate = value; + case 'channel_amount';obj.channel_amount = value; + end + end + + function value = get(obj,properties) + switch properties + case 'mac';value = obj.mac; + case 'name'; value = obj.name; + case 'sample_rate'; value = obj.sample_rate; + case 'channel_amount';value = obj.channel_amount; + end end end end \ No newline at end of file diff --git a/USTCADCDriver.dll b/USTCADCDriver.dll index 8d550c3..1ba5c8b 100644 Binary files a/USTCADCDriver.dll and b/USTCADCDriver.dll differ diff --git a/USTCADCDriver.h b/USTCADCDriver.h index 98550b3..39e7d34 100644 --- a/USTCADCDriver.h +++ b/USTCADCDriver.h @@ -6,14 +6,6 @@ #define DLLAPI __declspec(dllimport) #endif -#define OK 0 -#define ERR_NODATA 1 -#define ERR_NONETCARD 2 -#define ERR_WINPCAP 3 -#define ERR_CHANNEL 4 -#define ERR_HANDLE 5 -#define ERR_OTHER 100 - /* ´ò¿ªADCÉ豸£¬ÐèÒªÌṩĿµÄADCµÄMACµØÖ·£¬Ð­ÒéÀàÐÍ£¬Íø¿¨µÄÉ豸ºÅ */ DLLAPI int OpenADC(int num); /* ¹Ø±ÕADCÉ豸 */ @@ -26,8 +18,4 @@ DLLAPI int RecvData(int len,int column, unsigned char*pDataI, unsigned char *pDa DLLAPI int RecvDemo(int row,int* pData); /* ·µ»ØÍø¿¨Áбí */ DLLAPI int GetAdapterList(char*list); -/* ·µ»Ø´íÎóÐÅÏ¢ */ -DLLAPI int GetErrorMsg(int errorcode,char *strMsg); -/* »ñÈ¡°æ±¾ÐÅÏ¢ */ -DLLAPI int GetSoftInformation(char *pInformation); #endif \ No newline at end of file diff --git a/USTCADDA.m b/USTCADDA.m new file mode 100644 index 0000000..de21206 --- /dev/null +++ b/USTCADDA.m @@ -0,0 +1,341 @@ +% FileName:USTCADDA.m +% Author:GuoCheng +% E-mail:fortune@mail.ustc.edu.cn +% All right reserved @ GuoCheng. +% Modified: 2017.3.7 +% Description:The class of ADDA +classdef USTCADDA < handle + properties(SetAccess = private) + da_list = []; + ad_list = []; + da_channel_list = []; + ad_channel_list = []; + da_count = 0; + ad_count = 0; + da_master_index = 1; + end + + properties + sample_depth; %ÐèÒªÔÚRunǰÉèÖà + trig_count; %ÐèÒªÔÚRunǰÉèÖà + delay_step = 8; %δʹÓà + da_sample_rate = 2e9; %δʹÓà + ad_sample_rate = 1e9; %δʹÓà + ad_range = 1; %δʹÓà + da_taken; %daͨµÀÕ¼Óà + ad_taken; %adͨµÀÕ¼Óà + offsetCorr; %ÓÃÀ´²¹³¥²î·ÅµÄ0Æ«Öã¬Ôݲ»Ê¹Óà + end + + methods (Static = true) + function seq = GenerateTrigSeq(count,delay) + % ¶àÊä³ö8~15¸ö±£³ÖÂë + if(mod(count,8) ~= 0) + count = (floor(count/8)+1); + else + count = count/8; + end + % ¹²2¸öÐòÁÐÊý¾Ý,µ«ÊDZØÐë×é³É512bitλ¿íµÄÊý¾Ý + seq = zeros(1,16384); + %first sequence,»á²úÉú16nsÑÓʱ£¬ÓÃÓÚ´¥·¢Æô¶¯Êä³ö¡£ + function_ctrl = 64; %53-63λ + trigger_ctrl = 0; %48-55λ + counter_ctrl = 0; %32-47룬¼ÆÊ±¼ÆÊýÆ÷ + length_wave = 2; %16-31λ,Êä³ö²¨Ðγ¤¶È + address_wave = 0; %0-15²¨ÐÎÆðʼµØÖ· + for k = 1:2:4096 + seq(4*k-3) = counter_ctrl; + seq(4*k-2) = function_ctrl*256 + trigger_ctrl; + seq(4*k-1) = address_wave; + seq(4*k) = length_wave; + end + + if(delay ~= 0) + function_ctrl = 32; %53-63룬¼ÆÊ±Êä³ö¼ÓÍ£Ö¹±êʶ + counter_ctrl = delay-1;%32-47룬¼ÆÊ±¼ÆÊýÆ÷ + else + function_ctrl = 0; %±£³ÖÊä³ö + counter_ctrl = 0; + end + + trigger_ctrl = 0; %48-55λ + length_wave = count; %16-31λ,Êä³ö²¨Ðγ¤¶È + address_wave = count; %0-15²¨ÐÎÆðʼµØÖ·£¬¼Ó1ÊÇΪÁËÌø¹ý¶àÓàµÄ±£³ÖÂë + for k = 2:2:4096 + seq(4*k-3) = counter_ctrl; + seq(4*k-2) = function_ctrl*256 + trigger_ctrl; + seq(4*k-1) = address_wave; + seq(4*k) = length_wave; + end + end + + function seq = GenerateContinuousSeq(count) + seq = zeros(1,16384); + if(mod(count,8) ~= 0) + count = floor(count/8)+1; + else + count = count/8; + end + for k = 1:4096 + seq(4*k-3) = 0; + seq(4*k-2) = 0; + seq(4*k-1) = 0; + seq(4*k) = count; + end + end + end + + methods + function obj = USTCADDA() + obj.sample_depth = 2000; + obj.trig_count = 100; + end + + function Config(obj) + obj.Close(); + s = qes.util.loadSettings('qes_settings',{'hardware','hwsettings1','ustcadda'}); + % ÅäÖÃADDA + if(isfield(s,'sample_depth')) + obj.sample_depth = s.sample_depth; + end + if(isfield(s,'trigger_count')) + obj.trig_count = s.trigger_count; + end + + obj.da_count = length(s.da_boards); + obj.ad_count = length(s.ad_boards); + % ÅäÖÃDAC + for k = 1:obj.da_count + obj.da_list(k).da = USTCDAC(s.da_boards{k}.ip,s.da_boards{k}.port); + obj.da_list(k).da.set('name',s.da_boards{k}.name); + obj.da_list(k).da.set('channel_amount',s.da_boards{k}.numchnl); + obj.da_list(k).da.set('gain',[511,511,511,511]); + obj.da_list(k).da.set('offset',[0,0,0,0]); + obj.da_list(k).da.set('sample_rate',s.da_boards{k}.smplrate); + obj.da_list(k).da.set('sync_delay',s.da_boards{k}.syncdelay); + obj.da_list(k).da.set('trig_delay',s.da_boards{k}.trigdelay); + %ÉèÖÃtrig_selĬÈÏÖµ0 + obj.da_list(k).da.set('trig_sel',0); + if(isfield(s,'trigger_source')) + obj.da_list(k).da.set('trig_sel',s.trigger_source); + end + %ÉèÖÃmaster°å£¬Ä¬ÈÏֵΪµÚÒ»¸ö°å + obj.da_list(k).da.set('ismaster', 0); + if(isfield(s,'da_master') && strcmpi(s.da_boards{k}.name,s.da_master)) + obj.da_master_index = k; + end + % ³õʼ»¯Í¨µÀµÄmaskÖµ + obj.da_list(k).mask_plus = 0; %Õýmask + obj.da_list(k).mask_min = 0; %¸ºmask + end + % ÉèÖÃÖ÷°å + obj.da_list(obj.da_master_index).da.set('ismaster',1); + obj.da_list(obj.da_master_index).da.set('trig_interval',200e-6);% ÉèÖÃtrig_intervalĬÈÏÖµ200us + if(isfield(s,'trigger_interval')) + obj.da_list(obj.da_master_index).da.set('trig_interval',s.trigger_interval); + end + % Ó³ÉäͨµÀ + for k = 1:length(s.da_chnl_map); + channel = fieldnames(s.da_chnl_map{k}); + ch = channel{1}; + ch = str2double(ch(3:length(ch))); + channel_info = s.da_chnl_map{k}.(channel{1}); + channel_info = regexp(channel_info,' ', 'split'); + da_name = channel_info{1}; + channel_name = channel_info{2}; + da_index = 1; + for x = 1:length(obj.da_list) + if(strcmpi(da_name,obj.da_list(x).da.get('name'))) + da_index = x; + end + end + obj.da_channel_list(ch).index = da_index; + obj.da_channel_list(ch).ch = str2double(channel_name(3:length(channel_name))); + % Ìí¼ÓÊý¾Ý½á¹¹Ìå + obj.da_channel_list(ch).data = []; + % ÉèÖÃͨµÀ´¥·¢ºóÊä³öÑÓʱ + obj.da_channel_list(ch).delay = 0; + end + % ÅäÖÃADC,Ŀǰֻ֧³ÖÒ»¸öÍø¿¨ + for k = 1:obj.ad_count + obj.ad_list(k).ad = USTCADC(s.ad_boards{k}.netcard); + obj.ad_list(k).ad.set('sample_rate',s.ad_boards{k}.smplrate); + obj.ad_list(k).ad.set('channel_amount',s.ad_boards{k}.numchnl); + obj.ad_list(k).ad.set('mac',s.ad_boards{k}.mac); + end + % Ó³ÉäADCµÄͨµÀ + for k = 1:length(s.ad_chnl_map); + channel = fieldnames(s.ad_chnl_map{k}); + ch = channel{1}; + ch = str2double(ch(3:length(ch))); + channel_info = s.da_chnl_map{k}.(channel{1}); + channel_info = regexp(channel_info,' ', 'split'); + ad_name = channel_info{1}; + channel_name = channel_info{2}; + ad_index = 1; + for x = 1:length(obj.ad_list) + if(strcmpi(ad_name,obj.da_list(x).da.get('name'))) + ad_index = x; + end + end + obj.ad_channel_list(ch).index = ad_index; + obj.ad_channel_list(ch).ch = str2double(channel_name(3:length(channel_name))); + % Ìí¼ÓÊý¾Ý½á¹¹Ìå + obj.da_channel_list(ch).data = []; + end + end + + function Close(obj) + len = length(obj.da_list); + while(len>0) + obj.da_list(len).da.Close(); + len = len - 1; + end + len = length(obj.ad_list); + while(len>0) + obj.ad_list(len).ad.Close(); + len = len - 1; + end + end + + function Open(obj) + len = length(obj.da_list); + while(len>0) + obj.da_list(len).da.Open(); + len = len - 1; + end + len = length(obj.ad_list); + while(len>0) + obj.ad_list(len).ad.Open(); + len = len - 1; + end + end + + function [I,Q] = Run(obj,isSample) + I=0;Q=0;ret = -1; + obj.da_list(obj.da_master_index).da.SetTrigCount(obj.trig_count); + obj.ad_list(1).ad.SetTrigCount(obj.trig_count); + obj.ad_list(1).ad.SetSampleDepth(obj.sample_depth); + % Í£Ö¹³ýÁ¬Ðø²¨ÐÎÍâµÄͨµÀ£¬Æô¶¯´¥·¢Í¨µÀ + for k = 1:obj.da_count + obj.da_list(k).da.StartStop((15 - obj.da_list(k).mask_min)*16); + obj.da_list(k).da.StartStop(obj.da_list(k).mask_plus); + end + % ¼ì²éÊÇ·ñ³É¹¦Ð´ÈëÍê±Ï + for k=1:obj.da_count + isSuccessed = obj.da_list(k).da.CheckStatus(); + if(isSuccessed ~= 1) + error('USTCADDA:Run','There were some task failed!'); + end + end + % ²É¼¯Êý¾Ý + while(ret ~= 0) + obj.ad_list(1).ad.EnableADC(); + obj.da_list(obj.da_master_index).da.SendIntTrig(); + if(isSample == true) + [ret,I,Q] = obj.ad_list(1).ad.RecvData(obj.trig_count,obj.sample_depth); + else + ret = 0; + end + end + % ½«Êý¾ÝÕûÀí³É¹Ì¶¨¸ñʽ + if(isSample == true) + I = (reshape(I,[obj.sample_depth,obj.trig_count]))'; + Q = (reshape(Q,[obj.sample_depth,obj.trig_count]))'; + end + % ²¢Çå¿ÕͨµÀ¼Ç¼ + for k = 1:obj.da_count + obj.da_list(k).mask_plus = 0; + end + end + + function SendWave(obj,channel,data) + obj.da_channel_list(channel).data = data; + ch_info = obj.da_channel_list(channel); + ch_delay = obj.da_channel_list(channel).delay; + ch = ch_info.ch; + da_struct = obj.da_list(ch_info.index); + len = length(data); + % Éú³É¸ñʽ»¯µÄÐòÁÐ + seq = obj.GenerateTrigSeq(len,ch_delay); + % ·¢ËÍÐòÁÐ + da_struct.da.WriteSeq(ch,0,seq); + % ¸ñʽ»¯²¨ÐÎ,ÐèÒªÓëÐòÁÐÊý¾ÝÅäºÏÀ´ÊµÏÖ¸ñʽ + if(mod(len,8) ~= 0) + data(len+1:(floor(len/8)+2)*8) = 32768 + obj.offsetCorr(channel); + end + len = length(data); + data(len+1:len+16) = 32768 + obj.offsetCorr(channel); %16¸ö²ÉÑùµãµÄÆðʼÂë + % ·¢ËͲ¨ÐÎ + da_struct.da.WriteWave(ch,0,data); + % Ï൱ÓÚ»òÉÏÒ»¸öͨµÀ + if(mod(floor(da_struct.mask_plus/(2^(ch-1))),2) == 0) + obj.da_list(ch_info.index).mask_plus = da_struct.mask_plus + 2^(ch-1); + end + end + + function SendContinuousWave(obj,channel,voltage) + % Èç¹ûÊÇÖ±Á÷£¬ÔòÐèÒª½«ÆäÀ©´óΪ1*8Êý×é + if(length(voltage) == 1) + voltage = zeros(1,8) + voltage; + end + ch_info = obj.da_channel_list(channel); + ch = ch_info.ch; + da_struct = obj.da_list(ch_info.index); + % Í£Ö¹Êä³ö + da_struct.da.StartStop(2^(ch-1)*16); + % дÈëÐòÁÐ + seq = obj.GenerateContinuousSeq(length(voltage)); + da_struct.da.WriteSeq(ch,0,seq); + % дÈ벨ÐÎ + da_struct.da.WriteWave(ch,0,voltage); + % ¸üÐÂ״̬ + if(mod(floor(da_struct.mask_min/(2^(ch-1))),2) == 0) + obj.da_list(ch_info.index).mask_min = da_struct.mask_min + 2^(ch-1); + end + da_struct.da.StartStop(obj.da_list(ch_info.index).mask_min); + end + + function StopContinuousWave(obj,channel) + ch_info = obj.da_channel_list(channel); + ch = ch_info.ch; + da_struct = obj.da_list(ch_info.index); + if(mod(floor(da_struct.mask_min/(2^(ch-1))),2) ~= 0) + obj.da_list(ch_info.index).mask_min = da_struct.mask_min - 2^(ch-1); + da_struct.da.StartStop(2^(ch-1)*16); + end + end + + function ret = GetDAChannel(obj,ch) + if(isempty(find(obj.da_taken == ch,1))) + obj.da_taken = [obj.da_taken,ch]; + ret = 0; + else + ret = -1; + end + end + + function ret = ReleaseDAChannel(obj,ch) + if(isempty(find(obj.da_taken == ch,1))) + ret = -1; + else + obj.da_taken(obj.da_taken == ch) = []; + ret = 0; + end + end + + function da_name = GetDANameFromChannel(obj,channel) + ch_info = obj.da_channel_list(channel); + da_name = obj.da_list(ch_info.index).da.get('name'); + end + + function SetDATrigDelay(obj,da_name,count) + for k = 1:obj.da_count + name = obj.da_list(k).da.get('name'); + if(strcmpi(name,da_name)) + obj.da_list(k).da.SetTrigDelay(count); + end + end + end + end +end \ No newline at end of file diff --git a/USTCDAC.m b/USTCDAC.m index b0df6aa..cb54fa4 100644 --- a/USTCDAC.m +++ b/USTCDAC.m @@ -2,325 +2,602 @@ % Author:GuoCheng % E-mail:fortune@mail.ustc.edu.cn % All right reserved @ GuoCheng. -% Modified: 2017.7.1 +% Modified: 2017.4.8 % Description:The class of DAC classdef USTCDAC < handle properties (SetAccess = private) - id = 0; % device id - ip = ''; % device ip - port = 80; % port number - status = 'close'; % open state - isopen = 0; % open flag + id = []; %É豸±êʶ + ip = ''; %É豸ip + port = 80; %¶Ë¿ÚºÅ + status = 'close'; %´ò¿ª×´Ì¬ + isopen = 0; %´ò¿ª×´Ì¬ + isblock = 0; %ÊÇ·ñÒÔ×èÈûģʽÔËÐÐ end - properties - isblock = 0; % is run in block mode - name = 'Unnamed'; % DAC's name - channel_amount = 4; % DAC maximum channel number - sample_rate = 2e9; % DAC sample rate - sync_delay = 0; % DAC sync delay - trig_delay = 0; % DAC trig sync delay - da_range = 0.8; % maximum voltage£¬unused - gain = zeros(1,4); % DAC channel gain - offset = zeros(1,4); % DAC channel offset, unused - offsetCorr = zeros(1,4);% DAC offset voltage code. - trig_sel = 0; % trigger source select - trig_interval = 200e-6; % trigger interval - ismaster = 0; % master flag - daTrigDelayOffset = 0; % fix offset between trig and dac output. + properties (SetAccess = private) + name = ''; %DACÃû×Ö + channel_amount = 4; %DACͨµÀÊýÄ¿ + sample_rate = 2e9; %²ÉÑùÂÊ + sync_delay = 0; %DAC°å×ÓµÄͬ²½ÑÓʱ + trig_delay = 0; %DAC´¥·¢Êä³öÑÓʱ + da_range = 0.8; %×î´óµçѹ£¬Î´Ê¹Óà + gain = zeros(1,4); %ͨµÀÔöÒæ + offset = zeros(1,4); %ͨµÀÆ«Öà + default_volt = ones(1,4)*33270; % ¹Ø±ÕDACµçѹ + + trig_sel = 0; %´¥·¢Ô´Ñ¡Ôñ + trig_interval = 200e-6; %Ö÷°åÁ¬Ðø´¥·¢Êä³öʱ¼ä¼ä¸ô + ismaster = 0; %Ö÷°å±êʶ + daTrigDelayOffset = 0; %δʹÓà end properties (GetAccess = private,Constant = true) - driver = 'USTCDACDriver'; % dll module name - driverh = 'USTCDACDriver.h'; % dll header file name - driverdll = 'USTCDACDriver.dll' % dll binary file name + driver = 'USTCDACDriver'; %Çý¶¯Ãû + driverh = 'USTCDACDriver.h'; %Í·ÎļþÃû end - methods (Static = true), - function LoadLibrary() - if(~libisloaded(USTCDAC.driver)) - loadlibrary(USTCDAC.driverdll,USTCDAC.driverh); - end - end + methods (Static = true) + function info = GetDriverInformation() - USTCDAC.LoadLibrary(); - str = libpointer('cstring',blanks(1024)); - [ErrorCode,info] = calllib(USTCDAC.driver,'GetSoftInformation',str); - USTCDAC.DispError('USTCDAC:GetDriverInformation:',ErrorCode); - end - function data = FormatData(datain) - len = length(datain); - data = datain; - if(mod(len,32) ~= 0) % ²¹Æë512bit - len = (floor(len/32)+1)*32; - data = zeros(1,len); - data(1:length(datain)) = datain; + if(~libisloaded(USTCDAC.driver)) + driverfilename = [USTCDAC.driver,'.dll']; + loadlibrary(driverfilename,USTCDAC.driverh); end - for k = 1:length(data)/2 % µßµ¹Ç°ºóÊý¾Ý£¬ÕâÊÇÓÉÓÚFPGA½ÓÊÕ×Ö½ÚÐòÎÊÌâ - temp = data(2*k); - data(2*k) = data(2*k-1); - data(2*k-1) = temp; + str = libpointer('cstring',blanks(50)); + [ret,version] = calllib(USTCDAC.driver,'GetSoftInformation',str); + if(ret == 0) + info = version; + else + error('USTCDAC: Get information failed!'); end end - function DispError(MsgID,errorcode) - if(errorcode ~= 0) - str = libpointer('cstring',blanks(1024)); - [~,info] = calllib(USTCDAC.driver,'GetErrorMsg',int32(errorcode),str); - msg = ['Error code:',num2str(errorcode),' --> ',info]; - WriteErrorLog([MsgID,' ',msg]); - error(MsgID,[MsgID,' ',msg]); + + function device_array = ScanDevice() + if(~libisloaded(USTCDAC.driver)) + driverfilename = [USTCDAC.driver,'.dll']; + loadlibrary(driverfilename,USTCDAC.driverh); + end + [ret,data] = calllib(USTCDAC.driver,'ScanDevice',''); + if(ret == 0) + device_array = data; + else + error('USTCDAC: Scan device failed!'); end end + end methods - function obj = USTCDAC(ip,port) % Construct function - obj.ip = ip; obj.port = port; - end - function Open(obj) % Connect to DAC board. - obj.LoadLibrary(); - if ~obj.isopen - [ErrorCode,obj.id,~] = calllib(obj.driver,'Open',0,obj.ip,obj.port); - obj.DispError(['USTCDAC:Open:',obj.name],ErrorCode); - obj.isopen = 1; obj.status = 'open'; + function obj = USTCDAC(ip,port) %construct function. + obj.ip = ip; + obj.port = port; + driverfilename = [obj.driver,'.dll']; + if(~libisloaded(obj.driver)) + loadlibrary(driverfilename,obj.driverh); end end - function Close(obj) % Disconnect to DAC board. - if obj.isopen - ErrorCode = calllib(obj.driver,'Close',uint32(obj.id)); - obj.DispError(['USTCDAC:Close:',obj.name],ErrorCode); - obj.id = [];obj.status = 'closed';obj.isopen = false; + + function Open(obj) %open the device + if ~obj.isopen + [ret,obj.id,~] = calllib(obj.driver,'Open',0,obj.ip,obj.port); + if(ret == 0) + obj.status = 'open'; + obj.isopen = true; + else + error('USTCDA:OpenError','Open DAC failed!'); + end + obj.Init(); end end - function Init(obj) % Init DAC after first time connect DAC - isDACReady = 0; try_count = 10; + + function Init(obj) + obj.SetTimeOut(10); + obj.SetIsMaster(obj.ismaster); + obj.SetTrigSel(obj.trig_sel); + obj.SetTrigInterval(obj.trig_interval); + obj.SetTotalCount(obj.trig_interval/4e-9 - 5000); + obj.SetDACStart(obj.sync_delay/4e-9 + 1); + obj.SetDACStop(obj.sync_delay/4e-9 + 10); + obj.SetTrigStart(obj.trig_delay/4e-9 + 1); + obj.SetTrigStop(obj.trig_delay/4e-9 + 10); + obj.SetLoop(1,1,1,1); + + try_count = 10; + isDACReady = 0; + while(try_count > 0 && ~isDACReady) - lane = zeros(1,8);idx = 1; + obj.isblock = 1; + arr = zeros(1,8); + idx = 1; for addr = 1136:1139 - lane(idx) = obj.ReadAD9136(1,addr); - lane(idx+1) = obj.ReadAD9136(2,addr); + arr(idx) = obj.ReadAD9136_1(addr); + arr(idx+1) = obj.ReadAD9136_2(addr); idx = idx + 2; end - light = obj.ReadReg(5,8); - lane = mod(lane,256); - if(sum(lane == 255) == length(lane) && mod(floor(light/(2^20)),4) == 3) + ret = obj.ReadReg(5,8); + obj.isblock = 0; + + arr = mod(arr,256); + if(sum(arr == 255) == length(arr) && mod(floor(ret/(2^20)),4) == 3) isDACReady= 1; else obj.InitBoard(); - pause(1); try_count = try_count - 1; + try_count = try_count - 1; + pause(1); end + end if(isDACReady == 0) - error('USTCDAC:Init',['Init DAC ',obj.name,' failed']); + error('USTCDAC:InitError','Config DAC failed!'); end - obj.SetTimeOut(0,10); obj.SetTimeOut(1,10); - obj.SetIsMaster(obj.ismaster); - obj.SetTrigSel(obj.trig_sel); - obj.SetTrigInterval(obj.trig_interval); - obj.SetTotalCount(obj.trig_interval/4e-9 - 5000); - obj.SetLoop(1,1,1,1); - obj.SetDACStart(obj.sync_delay/4e-9 + 1); - obj.SetDACStop(obj.sync_delay/4e-9 + 10); - obj.SetTrigDelay(0); + for k = 1:obj.channel_amount +% obj.SetOffset(k,obj.offset(k)); obj.SetGain(k,obj.gain(k)); - obj.SetDefaultVolt(k,32768); + obj.SetDefaultVolt(k,obj.default_volt(k)); end + obj.PowerOnDAC(1,0); + obj.PowerOnDAC(2,0); end - function WriteReg(obj,bank,addr,data) - cmd = bank*256 + 2; %1±íʾReadReg£¬Ö¸ÁîºÍbank´æ´¢ÔÚÒ»¸öDWORDÊý¾ÝÖÐ - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,cmd,addr,data); - obj.DispError(['USTCDAC:WriteReg:',obj.name],ErrorCode); - obj.Block(); - end - function reg = ReadReg(obj,bank,addr) - cmd = bank*256 + 1; %1±íʾReadReg£¬Ö¸ÁîºÍbank´æ´¢ÔÚÒ»¸öDWORDÊý¾ÝÖÐ - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,cmd,addr,0); - obj.DispError(['USTCDAC:ReadReg:',obj.name],ErrorCode); - value = obj.GetReturn(1); - reg = value.ResponseData; - end - function WriteWave(obj,ch,offset,wave) - if(ch < 1 || ch > obj.channel_amount) % ´Ó0ͨµÀ¿ªÊ¼±àºÅ - error('Wrong channel!'); - end - data = obj.FormatData(wave); % µ÷×Ö½ÚÐòÒÔ¼°²¹¹»512bitµÄλ¿í - data = data + obj.offsetCorr(ch); - data(data > 65535) = 65535; % ·¶Î§ÏÞÖÆ - data(data < 0) = 0; - data = 65535 - data; % ÓÉÓÚ¸ºÍ¨µÀ½Óʾ²¨Æ÷£¬Êý¾Ý·´Ïà·½±ã¹Û²ì - startaddr = (ch-1)*2*2^18+2*offset; - len = length(data)*2; - pval = libpointer('uint16Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'WriteMemory',obj.id,hex2dec('000000004'),startaddr,len,pval); - obj.DispError(['USTCDAC:WriteWave:',obj.name],ErrorCode); - obj.Block(); + + function Close(obj) + if obj.isopen + ret = calllib(obj.driver,'Close',uint32(obj.id)); + if(ret ~= 0) + error('USTCDA:CloseError','Close DA failed.'); + end + obj.id = []; + obj.status = 'closed'; + obj.isopen = false; + end end - function WriteSeq(obj,ch,offset,seq) - data = obj.FormatData(seq); - if(ch < 1 || ch > obj.channel_amount) - error('Wrong channel!'); % ¼ì²éͨµÀ±àºÅ + + function AutoOpen(obj) + if(~libisloaded(obj.driver)) + driverfilename = [obj.driver,'.dll']; + loadlibrary(driverfilename,obj.driverh); end - startaddr = (ch*2-1)*2^18+offset*8; %ÐòÁеÄÄÚ´æÆðʼµØÖ·£¬µ¥Î»ÊÇ×Ö½Ú¡£ - len = length(data)*2; %×Ö½Ú¸öÊý¡£ - pval = libpointer('uint16Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'WriteMemory',obj.id,hex2dec('00000004'),startaddr,len,pval); - obj.DispError(['USTCDAC:WriteSeq:',obj.name],ErrorCode); - obj.Block(); - end - function functype = GetFuncType(obj,offset) - [ErrorCode,functiontype,instruction,para1,para2] = calllib(obj.driver,'GetFunctionType',obj.id,offset,0,0,0,0); - obj.DispError(['USTCDAC:GetFuncType:',obj.name],ErrorCode); - template = {{'Write instruction type'},{'Write memory type.'},{'Read memory type.'}}; - functype = struct('functiontype',functiontype,'instruction',instruction,'para1',para1,'para2',para2,'description',template{functiontype}); - end - function SetTimeOut(obj,isRecv,time) - if(isRecv) - ErrorCode = calllib(obj.driver,'SetTimeOut',obj.id,0,time); - else - ErrorCode = calllib(obj.driver,'SetTimeOut',obj.id,1,time); + if(~obj.isopen) + obj.Open(); end - obj.DispError(['USTCDAC:SetTimeOut:',obj.name],ErrorCode); - end - function SetTrigDelay(obj,point) - obj.SetTrigStart((obj.daTrigDelayOffset + point)/8+1); - obj.SetTrigStop((obj.daTrigDelayOffset + point)/8+10); end - function Block(obj) - if(obj.isblock) - obj.GetReturn(1); + + function StartStop(obj,index) + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction', obj.id,uint32(hex2dec('00000405')),uint32(index),0); + if(ret ~= 0) + error('USTCDAC:StartStopError','Start/Stop failed.'); end end - function data = ReadAD9136(obj,chip,addr) - if(chip == 1) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001c05'),addr,0); - else - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001d05'),addr,0); + % ¸Ãº¯ÊýδʹÓà + function FlipRAM(obj,index) + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction', obj.id,uint32(hex2dec('00000305')),uint32(index),0); + if(ret ~= 0) + error('USTCDAC:FlipRAMError','FlipRAM failed.'); end - obj.DispError(['USTCDAC:ReadAD9136:',obj.name],ErrorCode); - value = obj.GetReturn(1); - data = value.ResponseData; - end - function value = GetReturn(obj,offset) - functype = obj.GetFuncType(1); - pData = libpointer('uint16Ptr',zeros(1,functype.para2/2)); - [ErrorCode,ResStat,ResData,data] = calllib(obj.driver,'GetReturn',obj.id,offset,0,0,pData); - obj.DispError(['USTCDAC:GetReturn:',obj.name],ErrorCode); - obj.DispError(['USTCDAC:GetReturn:',obj.name],int32(ResStat)); - value = struct('ResponseState',ResStat,'ResponseData',ResData,'data',data); - end - function state = CheckStatus(obj) - [ErrorCode,isSuccessed,pos] = calllib(obj.driver,'CheckSuccessed',obj.id,0,0); - state = struct('isSuccessed',isSuccessed,'position',pos); - obj.DispError(['USTCDAC:CheckStatus:',obj.name],ErrorCode); - end - end - - methods - function InitBoard(obj) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001A05'),11,2^16); - obj.DispError(['USTCDAC:InitBoard:',obj.name],ErrorCode); - obj.Block(); - end - function PowerOnDAC(obj,chip,onoff) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001E05'),chip,onoff); - obj.DispError(['USTCDAC:PowerOnDAC:',obj.name],ErrorCode); - obj.Block(); - end - function StartStop(obj,index) - ErrorCode = calllib(obj.driver,'WriteInstruction', obj.id,hex2dec('00000405'),index,0); - obj.DispError(['USTCDAC:StartStop:',obj.name],ErrorCode); - obj.Block(); end + function SetLoop(obj,arg1,arg2,arg3,arg4) - para1 = arg1*2^16 + arg2; para2 = arg3*2^16 + arg4; - ErrorCode = calllib(obj.driver,'WriteInstruction', obj.id,hex2dec('00000905'),para1,para2); - obj.DispError(['USTCDAC:SetLoop:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + para1 = arg1*2^16 + arg2; + para2 = arg3*2^16 + arg4; + ret = calllib(obj.driver,'WriteInstruction', obj.id,uint32(hex2dec('00000905')),uint32(para1),uint32(para2)); + if(ret ~= 0) + error('USTCDAC:SetLoopError','SetLoop failed.'); + end end + function SetTotalCount(obj,count) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001805'),1,count*2^16); - obj.DispError(['USTCDAC:SetTotalCount:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),1,uint32(count*2^16)); + if(ret ~= 0) + error('USTCDAC:SetTotalCount','Set SetTotalCount failed.'); + end end + function SetDACStart(obj,count) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001805'),2,count*2^16); - obj.DispError(['USTCDAC:SetDACStart:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),2,uint32(count*2^16)); + if(ret ~= 0) + error('USTCDAC:SetDACStart','Set SetDACStart failed.'); + end end + function SetDACStop(obj,count) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001805'),3,count*2^16); - obj.DispError(['USTCDAC:SetDACStop:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),3,uint32(count*2^16)); + if(ret ~= 0) + error('USTCDAC:SetDACStop','Set SetDACStop failed.'); + end end + function SetTrigStart(obj,count) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001805'),4,count*2^16); - obj.DispError(['USTCDAC:SetTrigStart:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),4,uint32(count*2^16)); + if(ret ~= 0) + error('USTCDAC:SetTrigStart','Set SetTrigStart failed.'); + end end + function SetTrigStop(obj,count) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001805'),5,count*2^16); - obj.DispError(['USTCDAC:SetTrigStop:',obj.name],ErrorCode); - obj.Block(); - end + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),5,uint32(count*2^16)); + if(ret ~= 0) + error('USTCDAC:SetTrigStop','Set SetTrigStop failed.'); + end + end + function SetIsMaster(obj,ismaster) - ErrorCode= calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001805'),6,ismaster*2^16); - obj.DispError(['USTCDAC:SetIsMaster:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + ret= calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),6,uint32(ismaster*2^16)); + if(ret ~= 0) + error('USTCDAC:SetIsMaster','Set SetIsMaster failed.'); + end end + function SetTrigSel(obj,sel) - ErrorCode= calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001805'),7,sel*2^16); - obj.DispError(['USTCDAC:SetTrigSel:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + ret= calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),7,uint32(sel*2^16)); + if(ret ~= 0) + error('USTCDAC:SetTrigSel','Set SetTrigSel failed.'); + end end + function SendIntTrig(obj) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001805'),8,2^16); - obj.DispError(['USTCDAC:SendIntTrig:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction',uint32(obj.id),uint32(hex2dec('00001805')),8,uint32(2^16)); + if(ret ~= 0) + error('USTCDAC:SendIntTrig','Set SendIntTrig failed.'); + end end + function SetTrigInterval(obj,T) - ErrorCode= calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001805'),9,floor(T/4e-9)*2^12); - obj.DispError(['USTCDAC:SetTrigInterval:',obj.name],ErrorCode); - obj.Block(); + % T unit: seconds, Step 4ns. + obj.AutoOpen(); + count = T/4e-9; + ret= calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001805')),9,uint32(count*2^12)); + if(ret ~= 0) + error('USTCDAC:SelectTrigIntervalError','Set trigger interval failed.'); + end end + function SetTrigCount(obj,count) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001805'),10,count*2^12); - obj.DispError(['USTCDAC:SetTrigCount:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + ret= calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001805')),10,uint32(count*2^12)); + if(ret ~= 0) + error('USTCDAC:SetTrigCountError','Set trigger Count failed.'); + end end + function ClearTrigCount(obj) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001F05'),0,0); - obj.DispError(['USTCDAC:ClearTrigCount:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + ret= calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001F05')),0,0); + if(ret ~= 0) + error('USTCDAC:ClearTrigCount','Clear triger count failed.'); + end end + function SetGain(obj,channel,data) - map = [2,3,0,1];channel = map(channel); - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00000702'),uint32(channel),data); - obj.DispError(['USTCDAC:SetGain:',obj.name],ErrorCode); - obj.Block(); - end + obj.AutoOpen(); + map = [2,3,0,1]; %ÓÐbug£¬ÐèÒª×öÒ»´ÎÓ³Éä + channel = map(channel); + ret = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00000702')),uint32(channel),uint32(data)); + if(ret ~= 0) + error('USTCDAC:WriteGain','WriteGain failed.'); + end + end + function SetOffset(obj,channel,data) - map = [6,7,4,5]; channel = map(channel); - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00000702'),channel,data); - obj.DispError(['USTCDAC:SetOffset:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + map = [6,7,4,5]; %ÓÐbug£¬ÐèÒª×öÒ»´ÎÓ³Éä + channel = map(channel); + ret = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00000702')),uint32(channel),uint32(data)); + if(ret ~= 0) + error('USTCDAC:WriteOffset','WriteOffset failed.'); + end end + function SetDefaultVolt(obj,channel,volt) - volt = volt + obj.offsetCorr(channel); - volt(volt > 65535) = 65535; % ·¶Î§ÏÞÖÆ - volt(volt < 0) = 0; - volt = 65535 - volt; % ÓÉÓÚ¸ºÍ¨µÀ½Óʾ²¨Æ÷£¬Êý¾Ý·´Ïà·½±ã¹Û²ì - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001B05'),channel-1,volt); - obj.DispError(['USTCDAC:SetDefaultVolt:',obj.name],ErrorCode); - obj.Block(); + obj.AutoOpen(); + channel = channel - 1; +% volt = mod(volt,256)*256 + floor(volt/256); %¸ßµÍλÇл» + ret = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001B05')),uint32(channel),uint32(volt)); + if(ret ~= 0) + error('USTCDAC:WriteOffset','WriteOffset failed.'); + end + end + + function WriteReg(obj,bank,addr,data) + obj.AutoOpen(); + cmd = bank*256 + 2; %1±íʾReadReg£¬Ö¸ÁîºÍbank´æ´¢ÔÚÒ»¸öDWORDÊý¾ÝÖÐ + ret = calllib(obj.driver,'WriteInstruction',obj.id,uint32(cmd),uint32(addr),uint32(data)); + if(ret ~= 0) + error('USTCDAC:WriteRegError','WriteReg failed.'); + end + end + + function WriteWave(obj,ch,offset,wave) + obj.AutoOpen(); + % ·¶Î§ÏÞÖÆ + wave(wave > 65535) = 65535; + wave(wave < 0) = 0; + % ²¹¹»512bitµÄλ¿íÕûÊý±¶ + data = wave; + len = length(wave); + if(mod(len,32) ~= 0) + len = (floor(len/32)+1)*32; + data = zeros(1,len); + data(1:length(wave)) = wave; + end + % µßµ¹Ç°ºóÊý¾Ý£¬ÕâÊÇÓÉÓÚFPGA½ÓÊÕ×Ö½ÚÐòÎÊÌâ + for k = 1:length(data)/2 + temp = data(2*k); + data(2*k) = data(2*k-1); + data(2*k-1) = temp; + end + % Êý¾Ý·´Ï࣬ÁÙʱÐèÒª + data = 65535 - data; + % ´Ó0ͨµÀ¿ªÊ¼±àºÅ + ch = ch - 1; + ch(ch < 0) = 0; + startaddr = ch*2*2^18+2*offset; + len = length(data)*2; + pval = libpointer('uint16Ptr', data); + [ret,~] = calllib(obj.driver,'WriteMemory',obj.id,uint32(hex2dec('000000004')),uint32(startaddr),uint32(len),pval); + if(ret ~= 0) + error('USTCDAC:WriteWaveError','WriteWave failed.'); + end + end + + function WriteSeq(obj,ch,offset,seq) + obj.AutoOpen(); + % ²¹¹»512bitλ¿í + len = length(seq); + data = seq; + if(mod(len,32) ~= 0) + len = (floor(len/32)+1)*32; + data = zeros(1,len); + data(1:length(seq)) = seq; + end + % ´Ó0ͨµÀ¿ªÊ¼±àºÅ + ch = ch - 1; + ch(ch < 0) = 0; + startaddr = (ch*2+1)*2^18+offset*8; %ÐòÁеÄÄÚ´æÆðʼµØÖ·£¬µ¥Î»ÊÇ×Ö½Ú¡£ + len = length(data)*2; %×Ö½Ú¸öÊý¡£ + pval = libpointer('uint16Ptr', data); + [ret,~] = calllib(obj.driver,'WriteMemory',obj.id,uint32(hex2dec('00000004')),uint32(startaddr),uint32(len),pval); + if(ret ~= 0) + error('USTCDAC:WriteSeqError','WriteSeq failed.'); + end + end + % ¸Ãº¯ÊýδʹÓà + function wave = ReadWave(obj,ch,offset,len) + obj.AutoOpen(); + wave = []; + startaddr = (ch*2)*2^18 + 2*offset; + ret = calllib(obj.driver,'ReadMemory',obj.id,uint32(hex2dec('00000003')),uint32(startaddr),uint32(len*2)); + if(ret == 0) + if(obj.isblock == true) + wave = obj.GetReturn(1); + end + else + error('USTCDAC:ReadWaveError','ReadWave failed.'); + end + end + % ¸Ãº¯ÊýδʹÓà + function seq = ReadSeq(obj,ch,offset,len) + obj.AutoOpen(); + startaddr = (ch*2+1)*2^18 + offset*8; + ret = calllib(obj.driver,'ReadMemory',obj.id,uint32(hex2dec('00000003')),uint32(startaddr),uint32(len*8)); + if(ret == 0) + if(obj.isblock == true) + seq = obj.GetReturn(1); + end + else + error('USTCDAC:ReadSeqError','ReadSeq failed.'); + end + end + + function reg = ReadReg(obj,bank,addr) + obj.AutoOpen(); + cmd = bank*256 + 1; %1±íʾReadReg£¬Ö¸ÁîºÍbank´æ´¢ÔÚÒ»¸öDWORDÊý¾ÝÖÐ + reg = 0; + ret = calllib(obj.driver,'ReadInstruction',obj.id,uint32(cmd),uint32(addr)); + if(ret == 0) + if(obj.isblock == true) + ret = obj.GetReturn(1); + reg = double(ret(2))*65536 + double(ret(1)); + end + else + error('USTCDAC:ReadWaveError','ReadWave failed.'); + end + end + + function data = ReadAD9136_1(obj,addr) + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001c05')),uint32(addr),uint32(0)); + if(ret ~= 0) + error('USTCDAC:ReadAD9136','ReadAD9136 failed.'); + end + ret = obj.GetReturn(1); + data = double(ret(2))*65536 + double(ret(1)); + end + + function data = ReadAD9136_2(obj,addr) + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001d05')),uint32(addr),uint32(0)); + if(ret ~= 0) + error('USTCDAC:ReadAD9136','ReadAD9136 failed.'); + end + ret = obj.GetReturn(1); + data = double(ret(2))*65536 + double(ret(1)); + end + + function temp = GetDA1_temp(obj) + tt1 = obj.ReadAD9136_1(hex2dec('132')); + tt2 = obj.ReadAD9136_1(hex2dec('133')); + tt1 = mod(tt1,256); + tt2 = mod(tt2,256); + temp = 30+7.3*(tt2*256+tt1-39200)/1000.0; + end + + function temp = GetDA2_temp(obj) + tt1 = obj.ReadAD9136_2(hex2dec('132')); + tt2 = obj.ReadAD9136_2(hex2dec('133')); + tt1 = mod(tt1,256); + tt2 = mod(tt2,256); + temp = 30+7.3*(tt2*256+tt1-39200)/1000.0; + end + + function [functiontype,instruction,para1,para2] = GetFuncType(obj,offset) + obj.AutoOpen() + [ret,functiontype,instruction,para1,para2] = calllib(obj.driver,'GetFunctionType',uint32(obj.id),uint32(offset),0,0,0,0); + if(ret ~= 0) + error('USTCDAC:GetFuncType','GetFuncType failed'); + end + end + + function data = GetReturn(obj,offset) + obj.AutoOpen(); + [func_type,~,~,para2] = obj.GetFuncType(1); + if(func_type == 1 || func_type == 2) + length = 4; + else + length = para2; + end + pData = libpointer('uint16Ptr',zeros(1,length/2)); + [ret,data] = calllib(obj.driver,'GetReturn',uint32(obj.id),uint32(offset),pData); + if(ret ~= 0) + error('USTCDAC:GetReturn','Get return failed!'); + end + end + + function isSuccessed = CheckStatus(obj) + obj.AutoOpen() + [ret,isSuccessed] = calllib(obj.driver,'CheckSuccessed',uint32(obj.id),0); + if(ret ~= 0) + error('USTCDAC:CheckStatus','Exist some task failed!'); + end + end + + function InitBoard(obj) + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001A05')),11,uint32(2^16)); + if(ret ~= 0) + error('USTCDAC:WriteRegError','WriteReg failed.'); + end + end + + function PowerOnDAC(obj,chip,onoff) + obj.AutoOpen(); + ret = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001E05')),uint32(chip),uint32(onoff)); + if(ret ~= 0) + error('USTCDAC:PowerOnDAC','PowerOnDAC failed.'); + end + end + + function SetTimeOut(obj,time) + obj.AutoOpen(); + ret1 = calllib(obj.driver,'SetTimeOut',obj.id,1,time); + ret2 = calllib(obj.driver,'SetTimeOut',obj.id,0,time); + if(ret1 ~= 0||ret2 ~= 0) + error('USTCDAC:SetTimeOut',['error code1',num2str(ret1),'error code2',num2str(ret2)]); + end end + + function SetGainPara(obj,channel,gain) + if(channel <= obj.channel_amount) + obj.gain(channel) = gain; + end + end + + function gain = GetGainPara(obj,channel) + if(channel <= obj.channel_amount) + gain = obj.gain(channel); + end + end + + function SetOffsetPara(obj,channel,offset) + if(channel <= obj.channel_amount) + obj.offset(channel) = offset; + end + end + + function offset = GetOffsetPara(obj,channel) + if(channel <= obj.channel_amount) + offset = obj.offset(channel); + end + end + + function SetTrigDelay(obj,num) + obj.SetTrigStart(floor((obj.trig_delay+ num)/8)+1); + obj.SetTrigStop(floor((obj.trig_delay+ num)/8)+ 10); + end + function SetBoardcast(obj,isBoardcast,period) + obj.AutoOpen(); period = floor(period*5); period(period > 255) = 255; - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,hex2dec('00001305'),isBoardcast,period); - obj.DispError(['USTCDAC:SetBoardcast:',obj.name],ErrorCode); - obj.Block(); + ret = calllib(obj.driver,'WriteInstruction', obj.id,uint32(hex2dec('00001305')),uint32(isBoardcast),uint32(period)); + if(ret ~= 0) + error('USTCDAC:SetLoopError','SetLoop failed.'); + end + end + + function temp = GetDA1_temp(obj) + tt1 = obj.ReadAD9136_1(hex2dec('132')); + tt2 = obj.ReadAD9136_1(hex2dec('133')); + tt1 = mod(tt1,256); + tt2 = mod(tt2,256); + temp = 30+7.3*(tt2*256+tt1-39200)/1000.0; + end + + function temp = GetDA2_temp(obj) + tt1 = obj.ReadAD9136_2(hex2dec('132')); + tt2 = obj.ReadAD9136_2(hex2dec('133')); + tt1 = mod(tt1,256); + tt2 = mod(tt2,256); + temp = 30+7.3*(tt2*256+tt1-39200)/1000.0; + end + + function value = get(obj,properties) + switch lower(properties) + case 'isblock';value = obj.isblock ; + case 'channel_amount';value = obj.channel_amount; + case 'gain';value = obj.gain; + case 'offset';value = obj.offset; + case 'name';value = obj.name; + case 'ismaster';value = obj.ismaster; + case 'trig_sel';value = obj.trig_sel; + case 'trig_interval';value = obj.trig_interval; + case 'sync_delay';value = obj.sync_delay; + case 'trig_delay';value = obj.trig_delay; + case 'sample_rate';value = obj.sample_rate; + otherwise; error('USTCDAC:get','do not exsis the properties') + end + end + + function set(obj,properties,value) + switch lower(properties) + case 'isblock';obj.isblock = value; + case 'channel_amount'; + obj.channel_amount = value; + obj.offset = zeros(1,obj.channel_amount); + obj.gain = zeros(1,obj.channel_amount); + case 'gain';obj.gain = value; + case 'offset';obj.offset = value; + case 'name';obj.name = value; + case 'ismaster';obj.ismaster = value; + case 'trig_sel';obj.trig_sel = value; + case 'trig_interval';obj.trig_interval = value; + case 'sync_delay';obj.sync_delay = value; + case 'trig_delay';obj.trig_delay = value; + case 'sample_rate';obj.sample_rate = value; + case 'datrigdelayoffset'; obj.daTrigDelayOffset = value; + otherwise; error('USTCDAC:get','do not exsis the properties') + end end end end \ No newline at end of file diff --git a/USTCDACDriver.dll b/USTCDACDriver.dll index c0890f5..f2b0095 100644 Binary files a/USTCDACDriver.dll and b/USTCDACDriver.dll differ diff --git a/USTCDACDriver.h b/USTCDACDriver.h index f6ae981..5b02559 100644 --- a/USTCDACDriver.h +++ b/USTCDACDriver.h @@ -3,7 +3,7 @@ Author:GuoCheng E-mail:fortune@mail.ustc.edu.cn All right reserved @ GuoCheng. - Modified: 2017.6.30 + Modified: 2017.2.24 Description: Export function. */ @@ -30,6 +30,9 @@ #define NULL 0 #endif +/* Define three return state. */ +#define RES_OK (0) +#define RES_ERR (-1) /* Open a device and add it to device list. */ DLLAPI int Open(UINT */*pID*/,char*/*ip*/,WORD/*port*/); @@ -37,6 +40,8 @@ DLLAPI int Open(UINT */*pID*/,char*/*ip*/,WORD/*port*/); DLLAPI int Close(UINT/*id*/); /* Write a command to FPGA */ DLLAPI int WriteInstruction(UINT/*id*/,UINT/*instructino*/,UINT/*para1*/,UINT/*para2*/); +/* Read a register from FPGA. */ +DLLAPI int ReadInstruction(UINT/*id*/,UINT/*instruction*/,UINT/*addr*/); /* Write data to DDR4 */ DLLAPI int WriteMemory(UINT/*id*/,UINT/*instruction*/,UINT/*start*/,UINT/*length*/,WORD*/*pData*/); /* Read data from DDR4 */ @@ -46,16 +51,14 @@ DLLAPI int SetTimeOut(UINT/*id*/,UINT /*direction*/,float/*time*/); /* Get funtion type and parameter */ DLLAPI int GetFunctionType(UINT/*id*/,UINT/*offset*/,UINT*/*pFunctype*/,UINT */*pInstruction*/,UINT */*pPara1*/,UINT */*pPara2*/); /* If run as PARALLEL mode, the result will be store in stack, The stack is first in last out.*/ -DLLAPI int GetReturn(UINT/*id*/,UINT /*offset*/,int*/*pRespStat*/,int*/*pRespData*/,WORD*/*pData*/); +DLLAPI int GetReturn(UINT/*id*/,UINT /*offset*/,WORD*/*pData*/); /* Check whether the task execute finished. */ DLLAPI int CheckFinished(UINT/*id*/,UINT* /*isFinished*/); /* Wait task finished */ -DLLAPI int WaitUntilFinished(UINT /*id*/,UINT /*time*/); +DLLAPI int WaitUntilFinished(UINT /*id*/); /* Get software Information*/ DLLAPI int GetSoftInformation(char */*description*/); /* Scan the local network */ DLLAPI int ScanDevice(char *); /* Check if all task successed. */ -DLLAPI int CheckSuccessed(UINT/*id*/,UINT */*pIsSuccessed*/,UINT*/*pPosition*/); -/* Get lastest error message */ -DLLAPI int GetErrorMsg(int/* errorcode */,char */* strMsg */); \ No newline at end of file +DLLAPI int CheckSuccessed(UINT/*id*/,UINT */*pIsSuccessed*/); \ No newline at end of file diff --git a/USTCDAC_backup.m b/USTCDAC_backup.m deleted file mode 100644 index f366a78..0000000 --- a/USTCDAC_backup.m +++ /dev/null @@ -1,264 +0,0 @@ -% FileName:USTCDAC.m -% Author:GuoCheng -% E-mail:fortune@mail.ustc.edu.cn -% All right reserved @ GuoCheng. -% Modified: 2017.7.1 -% Description:The class of DAC - -classdef USTCDAC < handle - properties (SetAccess = private) - id = 0; % device id - ip = ''; % device ip - port = 80; % port number - status = 'close'; % open state - isopen = 0; % open flag - end - - properties - isblock = 0; % is run in block mode - name = 'Unnamed'; % DAC's name - channel_amount = 4; % DAC maximum channel number - sample_rate = 2e9; % DAC sample rate - sync_delay = 0; % DAC sync delay - trig_delay = 0; % DAC trig sync delay - da_range = 0.8; % maximum voltage£¬unused - gain = zeros(1,4); % DAC channel gain - offset = zeros(1,4); % DAC channel offset, unused - offsetCorr = zeros(1,4);% DAC offset voltage code. - - trig_sel = 0; % trigger source select - trig_interval = 200e-6; % trigger interval - ismaster = 0; % master flag - daTrigDelayOffset = 0; % fix offset between trig and dac output. - end - - properties (GetAccess = private,Constant = true) - driver = 'USTCDACDriver'; % dll module name - driverh = 'USTCDACDriver.h'; % dll header file name - driverdll = 'USTCDACDriver.dll' % dll binary file name - end - - properties(GetAccess = private,Constant = true) - func = {... - struct('name','SetLoop','instruction',uint32(hex2dec('00000905')),'para1',@(para)(para{1}*65536+para{2}),'para2',@(para)(para{3}*65536+para{4})),... - struct('name','StartStop','instruction',uint32(hex2dec('00000405')),'para1',@(para)uint32(para{1}),'para2',@(para)(0)),... - struct('name','SetTotalCount','instruction',uint32(hex2dec('00001805')),'para1',@(para)(1),'para2',@(para)(uint32(para{1}*2^16))),... - struct('name','SetDACStart','instruction',uint32(hex2dec('00001805')),'para1',@(para)(2),'para2',@(para)(uint32(para{1}*2^16))),... - struct('name','SetDACStop','instruction',uint32(hex2dec('00001805')),'para1',@(para)(3),'para2',@(para)(uint32(para{1}*2^16))),... - struct('name','SetTrigStart','instruction',uint32(hex2dec('00001805')),'para1',@(para)(4),'para2',@(para)(uint32(para{1}*2^16))),... - struct('name','SetTrigStop','instruction',uint32(hex2dec('00001805')),'para1',@(para)(5),'para2',@(para)(uint32(para{1}*2^16))),... - struct('name','SetIsMaster','instruction',uint32(hex2dec('00001805')),'para1',@(para)(6),'para2',@(para)(uint32(para{1}*2^16))),... - struct('name','SetTrigSel','instruction',uint32(hex2dec('00001805')),'para1',@(para)(7),'para2',@(para)(uint32(para{1}*2^16))),... - struct('name','SendIntTrig','instruction',uint32(hex2dec('00001805')),'para1',@(para)(8),'para2',@(para)(uint32(2^16))),... - struct('name','SetTrigInterval','instruction',uint32(hex2dec('00001805')),'para1',@(para)(9),'para2',@(para)(uint32(para{1}/(4e-9)*2^12))),... - struct('name','SetTrigCount','instruction',uint32(hex2dec('00001805')),'para1',@(para)uint32(10),'para2',@(para)(uint32(para{1}*2^12))),... - struct('name','ClearTrigCount','instruction',uint32(hex2dec('00001F05')),'para1',@(para)(0),'para2',@(para)(0)),... - struct('name','SetGain','instruction',uint32(hex2dec('00000702')),'para1',@(para)(mod(para{1}+1,4)),'para2',@(para)(para{2})),... - struct('name','SetOffset','instruction',uint32(hex2dec('00000702')),'para1',@(para)(mod(para{1}+1,4)+4),'para2',@(para)(para{2})),... - struct('name','SetDefaultVolt','instruction',uint32(hex2dec('00001B05')),'para1',@(para)(para{1}-1),'para2',@(para)(para{2})),... - struct('name','InitBoard','instruction',uint32(hex2dec('00001A05')),'para1',@(para)(11),'para2',@(para)(2^16)),... - struct('name','PowerOnDAC','instruction',uint32(hex2dec('00001E05')),'para1',@(para)(para{1}),'para2',@(para)(para{2})),... - struct('name','SetBoardcast','instruction',uint32(hex2dec('00001305')),'para1',@(para)(para{1}),'para2',@(para)(floor(para{2})*5)),... - } - end - - methods (Static = true), - function LoadLibrary() - if(~libisloaded(USTCDAC.driver)) - loadlibrary(USTCDAC.driverdll,USTCDAC.driverh); - end - end - function info = GetDriverInformation() - USTCDAC.LoadLibrary(); - str = libpointer('cstring',blanks(1024)); - [ErrorCode,info] = calllib(USTCDAC.driver,'GetSoftInformation',str); - USTCDAC.DispError('USTCDAC:GetDriverInformation:',ErrorCode); - end - function data = FormatData(datain) - len = length(datain); - data = datain; - if(mod(len,32) ~= 0) % ²¹Æë512bit - len = (floor(len/32)+1)*32; - data = zeros(1,len); - data(1:length(datain)) = datain; - end - for k = 1:length(data)/2 % µßµ¹Ç°ºóÊý¾Ý£¬ÕâÊÇÓÉÓÚFPGA½ÓÊÕ×Ö½ÚÐòÎÊÌâ - temp = data(2*k); - data(2*k) = data(2*k-1); - data(2*k-1) = temp; - end - end - function DispError(MsgID,errorcode) - if(errorcode ~= 0) - str = libpointer('cstring',blanks(1024)); - [~,info] = calllib(USTCDAC.driver,'GetErrorMsg',int32(errorcode),str); - msg = ['Error code:',num2str(errorcode),' --> ',info]; - error(MsgID,[MsgID,' ',msg]); - end - end - end - - methods - function obj = USTCDAC(ip,port) % Construct function - obj.ip = ip;obj.port = port; - end - function Open(obj) % Connect to DAC board. - obj.LoadLibrary(); - if ~obj.isopen - [ErrorCode,obj.id,~] = calllib(obj.driver,'Open',0,obj.ip,obj.port); - obj.DispError(['USTCDAC:Open:',obj.name],ErrorCode); - obj.isopen = 1; obj.status = 'open'; - end - end - function Close(obj) % Disconnect to DAC board. - if obj.isopen - ErrorCode = calllib(obj.driver,'Close',uint32(obj.id)); - obj.DispError(['USTCDAC:Close:',obj.name],ErrorCode); - obj.id = [];obj.status = 'closed';obj.isopen = false; - end - end - function Init(obj) % Init DAC after first time connect DAC - isDACReady = 0; try_count = 10; - while(try_count > 0 && ~isDACReady) - lane = zeros(1,8);idx = 1; - for addr = 1136:1139 - lane(idx) = obj.ReadAD9136(1,addr); - lane(idx+1) = obj.ReadAD9136(2,addr); - idx = idx + 2; - end - light = obj.ReadReg(5,8); - lane = mod(lane,256); - if(sum(lane == 255) == length(lane) && mod(floor(light/(2^20)),4) == 3) - isDACReady= 1; - else - subsref(obj,[struct('type','.','subs','InitBoard'),struct('type','()','subs',{})]); - pause(1); try_count = try_count - 1; - end - end - if(isDACReady == 0) - error('USTCDAC:Init',['Init DAC ',obj.name,' failed']); - end - obj.SetTimeOut(0,10); obj.SetTimeOut(1,10); - subsref(obj,[struct('type','.','subs','SetIsMaster'),struct('type','()','subs',{{obj.ismaster}})]); - subsref(obj,[struct('type','.','subs','SetTrigSel'),struct('type','()','subs',{{obj.trig_sel}})]); - subsref(obj,[struct('type','.','subs','SetTrigInterval'),struct('type','()','subs',{{obj.trig_interval}})]); - subsref(obj,[struct('type','.','subs','SetTotalCount'),struct('type','()','subs',{{obj.trig_interval/4e-9 - 5000}})]); - subsref(obj,[struct('type','.','subs','SetLoop'),struct('type','()','subs',{[{1},{1},{1},{1}]})]); - subsref(obj,[struct('type','.','subs','SetDACStart'),struct('type','()','subs',{{obj.sync_delay/4e-9 + 1}})]); - subsref(obj,[struct('type','.','subs','SetDACStop'),struct('type','()','subs',{{obj.sync_delay/4e-9 + 10}})]); - subsref(obj,[struct('type','.','subs','SetTrigStart'),struct('type','()','subs',{{obj.trig_delay/4e-9 + 1}})]); - subsref(obj,[struct('type','.','subs','SetTrigStop'),struct('type','()','subs',{{obj.trig_delay/4e-9 + 10}})]); - for k = 1:obj.channel_amount - subsref(obj,[struct('type','.','subs','SetGain'),struct('type','()','subs',{[{k},{obj.gain(k)}]})]); - subsref(obj,[struct('type','.','subs','SetDefaultVolt'),struct('type','()','subs',{[{k},{obj.offsetCorr(k)+32768}]})]); - end - end - function WriteReg(obj,bank,addr,data) - cmd = bank*256 + 2; %1±íʾReadReg£¬Ö¸ÁîºÍbank´æ´¢ÔÚÒ»¸öDWORDÊý¾ÝÖÐ - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,uint32(cmd),uint32(addr),uint32(data)); - obj.DispError(['USTCDAC:WriteReg:',obj.name],ErrorCode); - obj.Block(); - end - function reg = ReadReg(obj,bank,addr) - cmd = bank*256 + 1; %1±íʾReadReg£¬Ö¸ÁîºÍbank´æ´¢ÔÚÒ»¸öDWORDÊý¾ÝÖÐ - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,uint32(cmd),uint32(addr),0); - obj.DispError(['USTCDAC:ReadReg:',obj.name],ErrorCode); - value = obj.GetReturn(1); - reg = value.ResponseData; - end - function WriteWave(obj,ch,offset,wave) - wave(wave > 65535) = 65535; % ·¶Î§ÏÞÖÆ - wave(wave < 0) = 0; - data = obj.FormatData(wave); % µ÷×Ö½ÚÐòÒÔ¼°²¹¹»512bitµÄλ¿í - data = 65535 - data; % Êý¾Ý·´Ï࣬ÁÙʱÐèÒª - if(ch < 1 || ch > obj.channel_amount) % ´Ó0ͨµÀ¿ªÊ¼±àºÅ - error('Wrong channel!'); - end - startaddr = (ch-1)*2*2^18+2*offset; - len = length(data)*2; - pval = libpointer('uint16Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'WriteMemory',obj.id,uint32(hex2dec('000000004')),uint32(startaddr),uint32(len),pval); - obj.DispError(['USTCDAC:WriteWave:',obj.name],ErrorCode); - obj.Block(); - end - function WriteSeq(obj,ch,offset,seq) - data = obj.FormatData(seq); - if(ch < 1 || ch > obj.channel_amount) - error('Wrong channel!'); % ¼ì²éͨµÀ±àºÅ - end - startaddr = (ch*2-1)*2^18+offset*8; %ÐòÁеÄÄÚ´æÆðʼµØÖ·£¬µ¥Î»ÊÇ×Ö½Ú¡£ - len = length(data)*2; %×Ö½Ú¸öÊý¡£ - pval = libpointer('uint16Ptr', data); - [ErrorCode,~] = calllib(obj.driver,'WriteMemory',obj.id,uint32(hex2dec('00000004')),uint32(startaddr),uint32(len),pval); - obj.DispError(['USTCDAC:WriteSeq:',obj.name],ErrorCode); - obj.Block(); - end - function functype = GetFuncType(obj,offset) - [ErrorCode,functiontype,instruction,para1,para2] = calllib(obj.driver,'GetFunctionType',uint32(obj.id),uint32(offset),0,0,0,0); - obj.DispError(['USTCDAC:GetFuncType:',obj.name],ErrorCode); - template = {{'Write instruction type'},{'Write memory type.'},{'Read memory type.'}}; - functype = struct('functiontype',functiontype,'instruction',instruction,'para1',para1,'para2',para2,'description',template{functiontype}); - end - function SetTimeOut(obj,isRecv,time) - if(isRecv) - ErrorCode = calllib(obj.driver,'SetTimeOut',obj.id,0,time); - else - ErrorCode = calllib(obj.driver,'SetTimeOut',obj.id,1,time); - end - obj.DispError(['USTCDAC:SetTimeOut:',obj.name],ErrorCode); - end - function Block(obj) - if(obj.isblock) - obj.GetReturn(1); - end - end - function data = ReadAD9136(obj,chip,addr) - if(chip == 1) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001c05')),uint32(addr),uint32(0)); - else - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,uint32(hex2dec('00001d05')),uint32(addr),uint32(0)); - end - obj.DispError(['USTCDAC:ReadAD9136:',obj.name],ErrorCode); - value = obj.GetReturn(1); - data = value.ResponseData; - end - function SetTrigDelay(obj,point) - subsref(obj,[struct('type','.','subs','SetTrigStart'),struct('type','()','subs',{{(obj.daTrigDelayOffset + point)/8+1}})]); - subsref(obj,[struct('type','.','subs','SetTrigStop'),struct('type','()','subs',{{(obj.daTrigDelayOffset + point)/8+10}})]); - end - function value = GetReturn(obj,offset) - functype = obj.GetFuncType(1); - pData = libpointer('uint16Ptr',zeros(1,functype.para2/2)); - [ErrorCode,ResStat,ResData,data] = calllib(obj.driver,'GetReturn',uint32(obj.id),uint32(offset),0,0,pData); - obj.DispError(['USTCDAC:GetReturn:',obj.name],ErrorCode); - obj.DispError(['USTCDAC:GetReturn:',obj.name],int32(ResStat)); - value = struct('ResponseState',ResStat,'ResponseData',ResData,'data',data); - end - function state = CheckStatus(obj) - [ErrorCode,isSuccessed,pos] = calllib(obj.driver,'CheckSuccessed',uint32(obj.id),0,0); - state = struct('isSuccessed',isSuccessed,'position',pos); - obj.DispError(['USTCDAC:CheckStatus:',obj.name],ErrorCode); - end - function sref = subsref(obj,s) - isInstruction = 0;sref = []; - if(s(1).type == '.') - for k = 1:length(obj.func) - if(strcmp(s(1).subs,obj.func{k}.name)) - isInstruction = 1; break; - end - end - end - if(isInstruction) - ErrorCode = calllib(obj.driver,'WriteInstruction',obj.id,obj.func{k}.instruction,obj.func{k}.para1(s(2).subs),obj.func{k}.para2(s(2).subs)); - obj.Block(); - obj.DispError(['USTCDAC:',obj.func{k}.name,':',obj.name],ErrorCode); - else - try - sref = builtin('subsref',obj,s); - catch - builtin('subsref',obj,s); - end - end - end - end -end \ No newline at end of file diff --git a/WriteErrorLog.m b/WriteErrorLog.m deleted file mode 100644 index 63de3a6..0000000 --- a/WriteErrorLog.m +++ /dev/null @@ -1,7 +0,0 @@ -function WriteErrorLog(msg) - fid = fopen('ErrorLog.txt','a+'); - str = [datestr(now),' ',msg]; - fseek(fid,0,'eof'); - fprintf(fid,'%s',str); - fclose(fid); -end \ No newline at end of file diff --git a/WriteLog.m b/WriteLog.m new file mode 100644 index 0000000..412b546 --- /dev/null +++ b/WriteLog.m @@ -0,0 +1,8 @@ +function WriteLog(ip,data) + fid = fopen('log.txt','a+'); + str = [datestr(now),' ','ip:',ip,' ','data:',num2str(data)]; + fseek(fid,0,'eof'); + fprintf(fid,'%s\n',str); + fclose(fid); +end + diff --git a/anasys.m b/anasys.m new file mode 100644 index 0000000..f1e2bf4 --- /dev/null +++ b/anasys.m @@ -0,0 +1,10 @@ +%% ·ÖÎö +clc +code = []; +index = 1; +for k = 1:len_row + if(chip(1,k)~=chip(2,k)) + code(index) = k; + index = index+1; + end +end diff --git a/load_settings_demo.m b/load_settings_demo.m new file mode 100644 index 0000000..7ab9dbe --- /dev/null +++ b/load_settings_demo.m @@ -0,0 +1,4 @@ +s = qes.util.loadSettings('F:\ѸÀ×ÏÂÔØ\load_settings\qes_settings',{'hardware','hwsettings1','ustcadda'}) +s = qes.util.loadSettings('F:\program\qes_settings',{'hardware','hwsettings1','ustcadda','trigger_source'}) +s = qes.util.loadSettings('F:\program\qes_settings',{'hardware','hwsettings1','ustcadda','da_boards'}) + diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/_readme.txt b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/_readme.txt new file mode 100644 index 0000000..6f24a2b --- /dev/null +++ b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/_readme.txt @@ -0,0 +1,28 @@ +[AlazarTech ATS9360-FIFO 12-bit, 1.8 GS/s, 2-channel digitizer] + +smplrate % Hz, sampling rate when clocksource = 1(internal), value cast to one of the available options: + % [1e3, 2e3, 5e3,... + 10e3, 20e3, 50e3,... + 100e3, 200e3 500e3,... + 1e6, 2e6, 5e6,... + 10e6, 20e6, 25e6, 50e6,... + 100e6, 125e6, 160e6, 180e6, 200e6, 250e6, 400e6, 500e6, 800e6,... + 1e9, 1.2e9, 1.5e9, 1.6e9, 1.8e9]; + % +workmode % 1/2, triggered(default)/continues +timeout % seconds, default 30 seconds. +chnl1enabled % logical, channel 1 enabled or not +chnl2enabled % logical, channel 2 enabled or not +chnl1range % Channel 1 Vpp +chnl2range % Channel 2 Vpp, Channel Vpp value will be cast to one of the availbale options: + % [20e-3, 40e-3, 50e-3, 80e-3,... + 100e-3, 125e-3, 200e-3, 250e-3, 400e-3, 500e-3, 800e-3... + 1, 1.25, 2, 2.5, 4, 5, 8,... + 10, 16, 20, 40]; + % +num_records % number of records to aquire +record_ln % record length in samples + +clocksource % 1/2, internal/external, internal clock source is recommended incase of external is used, + % smplrate is not used, the sample rate is the frequency of the external clock plugged in. + diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/board_id=1.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/board_id=1.key new file mode 100644 index 0000000..197df56 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/board_id=1.key @@ -0,0 +1,5 @@ +{ + "class": "visa", + "vendor": "agilent", + "rscname": "TCPIP0::1.0.0.3::inst0::INSTR" +} diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/chnl1_enabled=true.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/chnl1_enabled=true.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/chnl1_range=0.4.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/chnl1_range=0.4.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/chnl2_enabled=true.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/chnl2_enabled=true.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/chnl2_range=0.4.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/chnl2_range=0.4.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/class@alazarATS.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/class@alazarATS.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/clock_source=2.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/clock_source=2.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/name@ad_ats_9360_1.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/name@ad_ats_9360_1.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/num_records=500.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/num_records=500.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/record_length=1024.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/record_length=1024.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/timeout=30.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/timeout=30.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ad_ast_9360_1/work_mode=1.key b/qes_settings/hardware/hwsettings1/ad_ast_9360_1/work_mode=1.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/class@sync.mwSource.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/class@sync.mwSource.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/freq_limits=2e9,2e10.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/freq_limits=2e9,2e10.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/interface.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/interface.key new file mode 100644 index 0000000..903f112 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/interface.key @@ -0,0 +1,8 @@ +{ + "interface": + { + "class": "visa", + "vendor": "agilent", + "rscname": "TCPIP0::10.0.0.3::inst0::INSTR" + } +} diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/name@mw_anritsu_01.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/name@mw_anritsu_01.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/power_limits=-130,20.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_1/power_limits=-130,20.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/class@sync.mwSource.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/class@sync.mwSource.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/freq_limits=2e9,2e10.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/freq_limits=2e9,2e10.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/interface.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/interface.key new file mode 100644 index 0000000..3bbd582 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/interface.key @@ -0,0 +1,8 @@ +{ + "interface": + { + "class": "visa", + "vendor": "agilent", + "rscname": "TCPIP0::10.0.0.4::inst0::INSTR" + } +} diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/name@mw_anritsu_02.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/name@mw_anritsu_02.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/power_limits=-130,20.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_2/power_limits=-130,20.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/class@sync.mwSource.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/class@sync.mwSource.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/freq_limits=2e9,2e10.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/freq_limits=2e9,2e10.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/interface.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/interface.key new file mode 100644 index 0000000..19b6329 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/interface.key @@ -0,0 +1,8 @@ +{ + "interface": + { + "class": "visa", + "vendor": "agilent", + "rscname": "TCPIP0::10.0.0.5::inst0::INSTR" + } +} diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/name@mw_anritsu_03.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/name@mw_anritsu_03.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/power_limits=-130,20.key b/qes_settings/hardware/hwsettings1/mwsrc_anritsu_3/power_limits=-130,20.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/selected.key b/qes_settings/hardware/hwsettings1/selected.key new file mode 100644 index 0000000..bb7dcd5 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/selected.key @@ -0,0 +1,9 @@ +{ + "selected": + [ + {"val": "ustcadda"}, // ustc ad/da + {"val": "mwsrc_anritsu_1"}, // + {"val": "mwsrc_anritsu_2"}, // + {"val": "mwsrc_anritsu_3"} // + ] +} diff --git a/qes_settings/hardware/hwsettings1/ustcadda/ad_boards.key b/qes_settings/hardware/hwsettings1/ustcadda/ad_boards.key new file mode 100644 index 0000000..a0352b6 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/ustcadda/ad_boards.key @@ -0,0 +1,26 @@ +// DA settings +{ + "ad_boards": + [ + { + "name": "ADC_1", + "netcard": 1, //net card number + "mac": "68-05-CA-47-45-9A" //mac address + "numchnl": 2, //number of channels + "start_delay": 0, + "smplrate": 1e9, + "start_delay": 0, + "records": + [ + { + "delay": 20, + "length": 980, + "demod_freq": + [ + {"val": 100e6} + ] + } + ] + } // add more fields as neccessay + ] +} \ No newline at end of file diff --git a/qes_settings/hardware/hwsettings1/ustcadda/ad_chnl_map.key b/qes_settings/hardware/hwsettings1/ustcadda/ad_chnl_map.key new file mode 100644 index 0000000..014ae55 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/ustcadda/ad_chnl_map.key @@ -0,0 +1,8 @@ +// maps channels on adc boards to logical channels, channels not included are not used. +{ + "ad_chnl_map": + [ + {"ch1": "ADC_1 ch1"}, + {"ch2": "ADC_1 ch2"} + ] +} \ No newline at end of file diff --git a/qes_settings/hardware/hwsettings1/ustcadda/da_boards.key b/qes_settings/hardware/hwsettings1/ustcadda/da_boards.key new file mode 100644 index 0000000..4e6a969 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/ustcadda/da_boards.key @@ -0,0 +1,22 @@ +// DAC boards +{ + "da_boards": + [ + { "name": "DAC_1", // each daboard has unique name label on the hardware front panel + "ip": "10.0.1.5", + "port": 80, + "numchnl": 4, // number of channels + "smplrate": 2e9, // sampling rate + "syncdelay": 0, // an output delay after receiving a trigger event to syncronize output between boards + "trigdelay": 248e-9 // output trig delay, use as adc delay. + }, // add more fields as neccessay + { "name": "DAC_2", + "ip": "10.0.1.219", + "port": 80, + "numchnl": 4, + "smplrate": 2e9, + "syncdelay": 0, + "trigdelay": 248e-9 // output trig delay, use as adc delay. + } + ] +} \ No newline at end of file diff --git a/qes_settings/hardware/hwsettings1/ustcadda/da_chnl_map.key b/qes_settings/hardware/hwsettings1/ustcadda/da_chnl_map.key new file mode 100644 index 0000000..d548da1 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/ustcadda/da_chnl_map.key @@ -0,0 +1,14 @@ +// maps channels on dac boards to logical channels, channels not included are not used. +{ + "da_chnl_map": + [ + {"ch1": "DAC_1 ch1"}, + {"ch2": "DAC_1 ch2"}, + {"ch3": "DAC_1 ch3"}, + {"ch4": "DAC_1 ch4"}, + {"ch5": "DAC_2 ch1"}, + {"ch6": "DAC_2 ch2"}, + {"ch7": "DAC_2 ch3"}, + {"ch8": "DAC_2 ch4"} + ] +} \ No newline at end of file diff --git a/qes_settings/hardware/hwsettings1/ustcadda/da_master@DAC_2.key b/qes_settings/hardware/hwsettings1/ustcadda/da_master@DAC_2.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ustcadda/multi_level_test/_readme.txt b/qes_settings/hardware/hwsettings1/ustcadda/multi_level_test/_readme.txt new file mode 100644 index 0000000..62e4638 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/ustcadda/multi_level_test/_readme.txt @@ -0,0 +1 @@ +multi_level_test is just to test qes.util.loadSettings can load multi-level setttings, it is not used in experiments \ No newline at end of file diff --git a/qes_settings/hardware/hwsettings1/ustcadda/multi_level_test/multi_level_test/ad_boards.key b/qes_settings/hardware/hwsettings1/ustcadda/multi_level_test/multi_level_test/ad_boards.key new file mode 100644 index 0000000..ecd0f3d --- /dev/null +++ b/qes_settings/hardware/hwsettings1/ustcadda/multi_level_test/multi_level_test/ad_boards.key @@ -0,0 +1,42 @@ +// DA settings +{ + "ad_boards": + [ + { + "name": "ADC_1", + "numchnl": 4, // number of channels + "start_delay": 0, + "smplrate": 1e9, + "start_delay": 0, + "records": + [ + { + "delay": 20, + "length": 980, + "demod_freq": + [ + {"val": 100e6} + ] + } + ] + }, // add more fields as neccessay + { + "name": "ADC_2", + "numchnl": 4, // number of channels + "start_delay": 0, + "smplrate": 1e9, + "start_delay": 0, + "records": + [ + { + "delay": 20, + "length": 980, + "demod_freq": + [ + {"val": 100e6} + ] + } + ] + } // add more fields as neccessay + ] +} \ No newline at end of file diff --git a/qes_settings/hardware/hwsettings1/ustcadda/sample_depth=1000.key b/qes_settings/hardware/hwsettings1/ustcadda/sample_depth=1000.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ustcadda/trigger_count=100.key b/qes_settings/hardware/hwsettings1/ustcadda/trigger_count=100.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/hardware/hwsettings1/ustcadda/trigger_interval=200e-6.key b/qes_settings/hardware/hwsettings1/ustcadda/trigger_interval=200e-6.key new file mode 100644 index 0000000..b801b4f --- /dev/null +++ b/qes_settings/hardware/hwsettings1/ustcadda/trigger_interval=200e-6.key @@ -0,0 +1 @@ +// time interval between each waveform, seconds, in case of trigger_interval= 0, continues output \ No newline at end of file diff --git a/qes_settings/hardware/hwsettings1/ustcadda/trigger_source=0.key b/qes_settings/hardware/hwsettings1/ustcadda/trigger_source=0.key new file mode 100644 index 0000000..0e146b2 --- /dev/null +++ b/qes_settings/hardware/hwsettings1/ustcadda/trigger_source=0.key @@ -0,0 +1 @@ +// 0/1, internal/external, work mode is always triggered mode, to output continues wave, use trigger_interval= 0 \ No newline at end of file diff --git a/qes_settings/hardware/selected@hwsettings1.key b/qes_settings/hardware/selected@hwsettings1.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/selected@session1.key b/qes_settings/yulin/selected@session1.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/q_f01=5.902e9.key b/qes_settings/yulin/session1/q1/q_f01=5.902e9.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/q_f02=5.7532e9.key b/qes_settings/yulin/session1/q1/q_f02=5.7532e9.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/q_type@Xmon.key b/qes_settings/yulin/session1/q1/q_type@Xmon.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/qr_x_fc=5.55e9.key b/qes_settings/yulin/session1/q1/qr_x_fc=5.55e9.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/qr_x_halfPiAmp=0.3261.key b/qes_settings/yulin/session1/q1/qr_x_halfPiAmp=0.3261.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/qr_x_piAmp=0.65337.key b/qes_settings/yulin/session1/q1/qr_x_piAmp=0.65337.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/qr_x_piLn=16.key b/qes_settings/yulin/session1/q1/qr_x_piLn=16.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/qr_z_piAmp=1.2307.key b/qes_settings/yulin/session1/q1/qr_z_piAmp=1.2307.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/qr_z_piLn=22.key b/qes_settings/yulin/session1/q1/qr_z_piLn=22.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/r_amp=0.75.key b/qes_settings/yulin/session1/q1/r_amp=0.75.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/r_delay=10.key b/qes_settings/yulin/session1/q1/r_delay=10.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/r_fc=6.7e9.key b/qes_settings/yulin/session1/q1/r_fc=6.7e9.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/r_freq=6.8732e9.key b/qes_settings/yulin/session1/q1/r_freq=6.8732e9.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/r_ln=1e3.key b/qes_settings/yulin/session1/q1/r_ln=1e3.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/r_ringAmp=1.5.key b/qes_settings/yulin/session1/q1/r_ringAmp=1.5.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/q1/r_ringLn=30.key b/qes_settings/yulin/session1/q1/r_ringLn=30.key new file mode 100644 index 0000000..e69de29 diff --git a/qes_settings/yulin/session1/selected@q1,q2.key b/qes_settings/yulin/session1/selected@q1,q2.key new file mode 100644 index 0000000..e69de29 diff --git a/temp.m b/temp.m new file mode 100644 index 0000000..bdec9d9 --- /dev/null +++ b/temp.m @@ -0,0 +1,30 @@ +%% temp1 +data1 = (1+sin((1:32)/32*2*pi))*32767; +data2 =zeros(1,32); +data2(17:32) = 65535; + +da = USTCDAC('10.0.1.219',80); +da.Open(); +seq = USTCADDA.GenerateContinusSeq(32); +da.WriteSeq(1,0,seq); +da.StartStop(1); +for k = 1:1 + da.WriteWave(0,0,data1); + pause(1); + da.WriteWave(0,0,data2); + pause(1); +end + +%% temp2 +data2 =zeros(1,32); +data2(17:32) = 65535; + +da = USTCDAC('10.0.1.219',80); +da.Open(); +da.SetIsMaster(1); +seq = USTCADDA.GenerateTrigSeq(32,0); +da.WriteSeq(1,0,seq); +da.WriteWave(1,0,data2); +da.SetLoop(1,1,1,1); +da.StartStop(1); +da.SendIntTrig(); diff --git a/waveform.m b/waveform.m deleted file mode 100644 index 96e81b3..0000000 --- a/waveform.m +++ /dev/null @@ -1,122 +0,0 @@ -% author:guocheng -% data:2017/3/21 -% version:1.1 -% file:waveform.m -% describe:generate some simple waveform - -classdef waveform - properties - amplitude; - offset; - frequency; - end - properties(Constant = true) - sample_rate = 2e9; - end - methods(Static = true) - function seq = generate_seq(count) - seq = zeros(1,16384); - if(mod(count,8) ~= 0) - count = floor(count/8)+1; - else - count = count/8; - end - for k = 1:4096 - seq(4*k-3) = 0; - seq(4*k-2) = 0; - seq(4*k-1) = 0; - seq(4*k) = count; - end - end - - function seq = generate_trig_seq(count,delay) - % ¶àÊä³ö8~15¸ö±£³ÖÂë - if(mod(count,8) ~= 0) - count = (floor(count/8)+1); - else - count = count/8; - end - % ¹²2¸öÐòÁÐÊý¾Ý,µ«ÊDZØÐë×é³É512bitλ¿íµÄÊý¾Ý - seq = zeros(1,16384); - %first sequence,»á²úÉú16nsÑÓʱ£¬ÓÃÓÚ´¥·¢Æô¶¯Êä³ö¡£ - function_ctrl = 64; %53-63λ - trigger_ctrl = 0; %48-55λ - counter_ctrl = 0; %32-47룬¼ÆÊ±¼ÆÊýÆ÷ - length_wave = 2; %16-31λ,Êä³ö²¨Ðγ¤¶È - address_wave = 0; %0-15²¨ÐÎÆðʼµØÖ· - for k = 1:2:4096 - seq(4*k-3) = function_ctrl*256 + trigger_ctrl; - seq(4*k-2) = counter_ctrl; - seq(4*k-1) = length_wave; - seq(4*k) = address_wave; - end - if(delay ~= 0) - function_ctrl = 32; %53-63룬¼ÆÊ±Êä³ö¼ÓÍ£Ö¹±êʶ - counter_ctrl = delay-1;%32-47룬¼ÆÊ±¼ÆÊýÆ÷ - else - function_ctrl = 0; %±£³ÖÊä³ö - counter_ctrl = 0; - end - trigger_ctrl = 0; %48-55λ - length_wave = count; %16-31λ,Êä³ö²¨Ðγ¤¶È - address_wave = count; %0-15²¨ÐÎÆðʼµØÖ·£¬¼Ó1ÊÇΪÁËÌø¹ý¶àÓàµÄ±£³ÖÂë - for k = 2:2:4096 - seq(4*k-3) = function_ctrl*256 + trigger_ctrl; - seq(4*k-2) = counter_ctrl; - seq(4*k-1) = length_wave; - seq(4*k) = address_wave; - end - end - - function total_point = best_fit_count(fre) - %SETDACFREQUENCY ÔÚ2G²ÉÑùÂʺÍ×î´ó²¨ÐÎÉî¶ÈΪ32768Ìõ¼þÏÂÉú³É¸ø¶¨ÆµÂʲ¨ÐÎ - % Ôڹ̶¨²ÉÑùÂʺÍÓÐÏÞ³¤²¨ÐÎÌõ¼þÏÂÉú³ÉÒ»¸öƵÂÊÎó²î×îСµÄ²¨ÐÎ - sample_rate = 2e9; - period_point = 1/fre*sample_rate; - err = ones(1,floor(32768/period_point)); - for k = 1:floor(32768/period_point) - total_point = floor((floor(k * period_point)/8))*8; - err(k) = abs(k*period_point - total_point); - end - index = find(err == min(err)); - total_point = floor(index(1) * period_point); - end - - end - - methods - function obj = waveform() - obj.amplitude = 65535; - obj.offset = 32767.5; - obj.frequency = 10e6; - end - function wave = generate_squr(obj) - period = obj.sample_rate/obj.frequency; %ÀíÏëperiodÊÇÒ»¸öÕûÊý - total_count = obj.best_fit_count(obj.frequency); - wave = zeros(1,total_count); - x = 0:(total_count-1); - wave(mod(x,period) < period/2) = obj.offset - obj.amplitude/2; - wave(mod(x,period) >= period/2) = obj.offset + obj.amplitude/2; - end - - function wave = generate_sine(obj) - period = obj.sample_rate/obj.frequency; %ÀíÏëperiodÊÇÒ»¸öÕûÊý - total_count = obj.best_fit_count(obj.frequency); - x = 0:(total_count - 1); - wave = 0.5*obj.amplitude*sin(2*pi*x./period); - wave = wave + obj.offset; - end - - function wave = generate_raw(obj) - period = obj.sample_rate/obj.frequency; %ÀíÏëperiodÊÇÒ»¸öÕûÊý - total_count = obj.best_fit_count(obj.frequency); - x = 0:(total_count - 1); - wave = mod(x,period)*obj.amplitude/period - obj.amplitude/2 + obj.offset; - end - - function wave = generate_dc(obj) - wave = ones(1,8)*obj.offset; - end - - end -end \ No newline at end of file