1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我无法使用附件中显示的说明获取结果。
我收到以下错误:??? 在56处使用==> icgroup.invoke时出错此设备组对象不支持函数SetData。 请让我知道如何使它工作。 谢谢我的代码如下:清除所有; 全部关闭; clc time = 0:0.001:1; %定义时间向量包含波形的整数%循环数Amp1 = 0.2; 波形Amp2 = 0.8的每个分量的幅度%; Amp3 = 0.6; frequency1 = 10; 波形频率2 = 14的每个分量的频率; frequency3 = 18; wave1 = Amp1 * sin(2 * pi * frequency1 * time); %波形分量1 wave2 = Amp2 * sin(2 * pi * frequency2 *时间); %波形分量2 wave3 = Amp3 * sin(2 * pi * frequency3 *时间); %波形分量3 wave = wave1 + wave2 + wave3; %个别波形的某些组合波=波+ 0.3 *兰特(1,大小(波,2)); %现在将随机噪声添加到信号波=(wave./max(wave))'; %Normalize,因此值在-1到+ 1%之间可视化信号图(时间,wave1,'m',时间,wave2,'k',时间,wave3,'r'); 等一下; hw = plot(time,wave,'b'); set(hw,'Linewidth',2.5)xlabel('Time(s)'); ylabel('电压(V)'); 轴紧; 图例('组件1','组件2','组件3',......'组件组合换行与随机噪音')v = gpib('agilent',0,10); device = icdevice('agilent_33220a.mdd',v); * invoke(device.Arbitrarywaveform,'SetData',wave); * invoke(device.Arbitrarywaveform,'CopyData','matlabWFM1'); 集(device.Arbitrarywaveform, '用户', 'MATLABWFM1'); set(device.Output,'Function','Agilent33220OutputFunctionUser'); set(device.Output,'Frequency',1); set(device.OutputVoltage,'Amplitude',10); set(device.Output,'State','on')编辑:bmelab于2012年3月24日下午5:44 以上来自于谷歌翻译 以下为原文 I am having trouble getting results using instructions as shown in the attachment. I get the following error: ??? Error using ==> icgroup.invoke at 56 The function SetData is not supported by this device group object. Please let me know how I can make it work. Thanks My code is as follows: clear all; close all;clc time = 0:0.001:1; % Defi ne time vector to contain whole %number of cycles of waveform Amp1 = 0.2; % Amplitude for each component of waveform Amp2 = 0.8; Amp3 = 0.6; frequency1 = 10; % Frequency for each component of waveform frequency2 = 14; frequency3 = 18; wave1 = Amp1*sin(2*pi*frequency1*time); % Waveform component 1 wave2 = Amp2*sin(2*pi*frequency2*time); % Waveform component 2 wave3 = Amp3*sin(2*pi*frequency3*time); % Waveform component 3 wave = wave1 + wave2 + wave3; % Some combination of individual waveforms wave = wave + 0.3*rand(1,size(wave,2)); % Now add random noise into the signal wave = (wave./max(wave))'; % Normalize so values are between -1 to + 1 % Visualize the signals plot(time,wave1,'m',time,wave2,'k',time,wave3,'r'); hold on; hw = plot(time,wave,'b'); set(hw,'Linewidth',2.5) xlabel('Time (s)'); ylabel('Voltage (V)'); axis tight; legend('Component 1','Component 2','Component 3', ... 'Combination of components newline with random noise') v = gpib('agilent',0,10); device = icdevice('agilent_33220a.mdd',v); *invoke(device.Arbitrarywaveform,'SetData',wave);* invoke(device.Arbitrarywaveform,'CopyData','MATLABWFM1'); set(device.Arbitrarywaveform,'User','MATLABWFM1'); set(device.Output, 'Function','Agilent33220OutputFunctionUser'); set(device.Output, 'Frequency', 1); set(device.OutputVoltage, 'Amplitude', 10); set(device.Output,'State','on') Edited by: bmelab on Mar 24, 2012 5:44 PM 附件
|
|
相关推荐
1个回答
|
|
你好,所以我猜你的问题是你运行64位操作系统?
如果是,我们还没有支持33220A的64位应用程序的IVI驱动程序。 幸运的是,你实际上并不需要使用IVI驱动程序,你可以只发送SCPI(64位工作),根据我的经验,无论如何在Matlab中更直接,这是一个关于如何在Matlab中发送arbs的33220A示例 使用SCPI:%{AsciiArb是一个示例程序,演示如何将任意波形下载到仪器易失性存储器中并使用以下配置进行回放:此arb生成8192点脉冲波形,其中前400个点定义为正 脉冲从0伏到最大定义电压幅度。 波形:Arb幅度:2伏峰峰值偏移:0伏输出阻抗:50欧姆输出:启用此示例适用于Agilent 33210A,33220A和33250A%}%清除所有变量,关闭所有打开的文件全部清除; 关闭所有; CLC; %打开并创建签证会话,以便与函数生成器fgen = visa('AGILENT','TCPIP0 :: 156.140.92.62 :: inst0 :: INSTR')进行通信; set(fgen,'OutputBufferSize',100000); 的fopen(FGEN); %Query Idendity字符串和报告fprintf(fgen,'* IDN?'); idn = fscanf(fgen); fprintf(idn)fprintf(' n n')%清除并重置仪器fprintf(fgen,'* RST'); fprintf(fgen,'* CLS'); %使用8192点0-1数据创建arb波形fprintf('生成波形... n n')rise = []; 对于i = 1:1:10%设定上升时间(10分)* / z =(i-1)/ 10; y = num2str(z); s1 = sprintf(',%s',y); 上升= [上升s1]; 结束宽度= []; for i = 11:1:411%设定脉冲宽度(400点)* / y = num2str(1); s2 = sprintf(',%s',y); width = [width s2]; end fall = []; 对于i = 412:1:422%设定下降时间(10分)* / z =(422-i)/ 10; y = num2str(z); s3 = sprintf(',%s',y); 跌倒= [跌倒s3]; 结束低= []; for i = 423:1:8192%将剩余点设置为零* / y = num2str(0); s4 = sprintf(',%s',y); 低= [低s4]; end%组合所有字符串s = [上升宽度下降低]; %将数据串与scpi命令组合使用arbstring = sprintf('DATA VOLATILE%s',s); %Send命令设置所需的配置fprintf('下载波形... n n')fprintf(fgen,arbstring); %make instrument等待数据下载,然后转到下一个%命令set fprintf(fgen,'* WAI'); fprintf('下载完成 n n')%设置所需的配置。 fprintf(fgen,'VOLT 2'); %将最大波形幅度设置为2 Vpp fprintf(fgen,'VOLT:OFFSET 0'); %将偏移设置为0 V fprintf(fgen,'OUTPUT:LOAD 50'); %将输出负载设置为50欧姆fprintf(fgen,'FREQ 1000'); %设定频率为1KHz fprintf(fgen,'FUNC:USER VOLATILE'); fprintf(fgen,'FUNC:SHAP USER'); %启用输出fprintf(fgen,'OUTPUT ON'); %打开通道1输出%读取错误fprintf(fgen,'SYST:ERR?'); errorstr = fscanf(fgen); %错误检查strncmp(errorstr,'+ 0,“无错误”',13)errorcheck ='生成的任意波形没有任何错误 n'; fprintf(错误检查)else errorcheck = ['错误报告:',errorstr]; fprintf(错误检查)end%用函数发生器fclose(fgen)关闭签证会话; 以上来自于谷歌翻译 以下为原文 Hello, So I'm guessing the issue is that your running a 64 bit OS? If yes we don't have an IVI driver that supports 64 bit applications for the 33220A yet. Luckily, you don't actually need to use the IVI driver, you can just send SCPI instead (works on 64 bit), which in my experience is more straighforward in Matlab anyway, Here is a 33220A sample on how to send arbs in Matlab using SCPI: %{ AsciiArb is a sample program that demonstrates how to download an arbitrary waveform into instrument volatile memory and play back the same with the configuration below: This arb generates a 8192 point pulse waveform, of which the first 400 points define a positive pulse from 0 volts to the maximum defined voltage amplitude. Wave Shape: Arb Amplitude: 2 Volt Peak to Peak Offset: 0 Volt Output Impedance: 50 Ohm Output: Enabled This example will work with the Agilent 33210A, 33220A, and 33250A %} % clears all variables, closes all open files clear all; close all; clc; %opens and creates a visa session for communication with function generator fgen = visa('AGILENT','TCPIP0::156.140.92.62::inst0::INSTR'); set (fgen,'OutputBufferSize',100000); fopen(fgen); %Query Idendity string and report fprintf (fgen, '*IDN?'); idn = fscanf (fgen); fprintf (idn) fprintf ('nn') %Clear and reset instrument fprintf (fgen, '*RST'); fprintf (fgen, '*CLS'); % Create arb waveform with 8192 points of 0-1 data fprintf('Generating Waveform...nn') rise=[]; for i = 1:1:10 % Set rise time (10 points) */ z = (i-1)/10; y = num2str(z); s1 = sprintf(', %s', y); rise = [rise s1]; end width=[]; for i= 11:1:411 % Set pulse width (400 points) */ y = num2str(1); s2 = sprintf(', %s', y); width = [width s2]; end fall=[]; for i = 412:1:422 % Set fall time (10 points) */ z= (422 - i)/10; y = num2str(z); s3 = sprintf(', %s', y); fall = [fall s3]; end low=[]; for i = 423:1:8192 % Set remaining points to zero */ y = num2str(0); s4 = sprintf(', %s', y); low = [low s4]; end %combine all of the strings s = [rise width fall low]; % combine string of data with scpi command arbstring =sprintf('DATA VOLATILE %s', s); %Send Command to set the desired configuration fprintf('Downloading Waveform...nn') fprintf(fgen, arbstring); %make instrument wait for data to download before moving on to next %command set fprintf(fgen, '*WAI'); fprintf('Download Completenn') %Set desired configuration. fprintf(fgen,'VOLT 2'); % set max waveform amplitude to 2 Vpp fprintf(fgen,'VOLT:OFFSET 0'); % set offset to 0 V fprintf(fgen,'OUTPUT:LOAD 50'); % set output load to 50 ohms fprintf(fgen,'FREQ 1000'); %set frequency to 1KHz fprintf(fgen,'FUNC:USER VOLATILE'); fprintf(fgen,'FUNC:SHAP USER'); %Enable Output fprintf(fgen,'OUTPUT ON'); % turn on channel 1 output % Read Error fprintf(fgen, 'SYST:ERR?'); errorstr = fscanf (fgen); % error checking if strncmp (errorstr, '+0,"No error"',13) errorcheck = 'Arbitrary waveform generated without any error n'; fprintf (errorcheck) else errorcheck = ['Error reported: ', errorstr]; fprintf (errorcheck) end %closes the visa session with the function generator fclose(fgen); |
|
|
|
只有小组成员才能发言,加入小组>>
1285 浏览 0 评论
2373 浏览 1 评论
2192 浏览 1 评论
2064 浏览 5 评论
2948 浏览 3 评论
1111浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
753浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
926浏览 0评论
1287浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 21:20 , Processed in 1.415667 second(s), Total 77, Slave 61 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号