Dan*_*hoa 8 matlab oscilloscope
我正在构建一个MATLAB GUI来从Tektronix DPO4104示波器(这里是 MATLAB驱动程序)进行数据采集.
我正在tmtool使用我的GUI代码并且发现驱动程序只能收集10,000个数据点,无论示波器是否设置为显示超过10k点.我在CCSM中发现了这篇文章,但它并没有非常有用.(如果您愿意阅读它,我就是那里的最后一篇文章.)我正在使用DPO4104驱动程序,而我相信这篇文章讨论了DPO4100驱动程序的使用.
据我所知,步骤是:
readwaveform功能以考虑当前recordLength- 在我的情况下,100,000点,比方说.MaxNumberPoint10,000到100,000.(在我的情况下,默认数字是0 ..我将其更改为100,000).EndingPoint.我也将它设置为100,000.set(interfaceObj, 'InputBufferLength', 2.5*recordLength),即确保输入缓冲区可以容纳超过100,000个点.建议至少使用预期缓冲区的两倍.我用2.5只是因为.connect(),以及readwaveform.利润.tmtool通过我的GUI ,我仍然无法收集超过10,000点积分.任何帮助,将不胜感激.
我想到了!我认为。花几周时间退后一步、恢复精神确实有帮助。这就是我所做的:
1) 编辑驱动程序的init函数以配置更大的缓冲区大小。完整init代码:
function init(obj)
% This method is called after the object is created.
% OBJ is the device object.
% End of function definition - DO NOT EDIT
% Extract the interface object.
interface = get(obj, 'Interface');
fclose(interface);
% Configure the buffer size to allow for waveform transfer.
set(interface, 'InputBufferSize', 12e6);
set(interface, 'OutputBufferSize', 12e6); % Originally is set to 50,000
Run Code Online (Sandbox Code Playgroud)
我最初尝试将缓冲区大小设置为 22e6(我想获得 1000 万个点),但出现内存不足错误。据说缓冲区应该是您期望得到的两倍多一点,加上标题空间。我可能不需要价值200万点的“标题”,但是呃。
2) 编辑驱动程序readwaveform(),首先查询用户可设置的要收集的点数应该是多少。然后,将 SCPI 命令写入示波器,以确保要传输的数据点数等于用户所需的点数。下面的代码片段可以解决这个问题readwaveform:
try
% Specify source
fprintf(interface,['DATA:SOURCE ' trueSource]);
%----------BEGIN CODE TO HANDLE MORE THAN 10k POINTS----------
recordLength = query(interface, 'HORizontal:RECordlength?');
fprintf(interface, 'DATA:START 1');
fprintf(interface, 'DATA:STOP %d', str2num(recordLength));
%----------END CODE TO HANDLE MORE THAN 10k POINTS----------
% Issue the curve transfer command.
fprintf(interface, 'CURVE?');
raw = binblockread(interface, 'int16');
% Tektronix scopes send and extra terminator after the binblock.
fread(interface, 1);
Run Code Online (Sandbox Code Playgroud)
3)在用户代码中,设置一个SCPI命令来更改底层接口对象的记录大小:
% interfaceObj is a VISA object.
fprintf(interfaceObj, 'HORizontal:RECordlength 5000000');
Run Code Online (Sandbox Code Playgroud)
你有它。希望这可以帮助任何其他试图解决这个问题的人。
| 归档时间: |
|
| 查看次数: |
4014 次 |
| 最近记录: |