필터 지우기
필터 지우기

controlling EGS3000B signal generator with VISA

조회 수: 1 (최근 30일)
fima v
fima v 2017년 11월 16일
댓글: Scott 2022년 6월 8일
Hello i am trying to control my ESG signal generator with gpib VISA code a simple code to change the frequency was made, but it fives me an "fopen" error,what went wrong?
Thanks
freq_cmd = strcat(':FREQ',{' '},'10');
freq_str = freq_cmd{1};
vg = visa('ni','GPIB0::7::INSTR');
if strcmp(get(vg,'status'),'closed')
fopen(vg);
end
fprintf(vg,'10');
fprintf(vg,power_str);
  댓글 수: 1
Scott
Scott 2022년 6월 8일
I realize this question is almost 5 years old, however, I don't think it would hurt to answer.
I think the problem that you were having has to do with the way you are addressing the device. I would check to make sure you have the National Instruments drivers installed (you state 'ni' on the visa object open). If you have some other VISA drivers installed, you may need to call those instead. You can directly try another driver:
vg = visa('rs', 'GPIB0::7::INSTR'); % if using rhode specific driver
vg = visa('keysight', 'GPIB0::7::INSTR'); % if using keysight driver
My guess is that is your primary issue.
From the frequency command standpoint; if we assume the command you are trying to send is ':freq 10', this needs to be done a the same time (in a single command). You're using overly complicated processes for building your command. I'd suggest something like
cmd = [ ':freq ' str2double(some_freq) ];
fprintf(vg, cmd);
Also, you may want to confirm from the programming manual that you do not need to specify Hz/MHz/etc. If you do, you can do something like
cmd = [ ':freq ' str2double(some_freq) ' MHz' ];
fprintf(vg, cmd);

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Instrument Control Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by