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 Center および File ExchangeInstrument Control Toolbox Supported Hardware についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by