Effacer les filtres
Effacer les filtres

controlling EGS3000B signal generator with VISA

1 vue (au cours des 30 derniers jours)
fima v
fima v le 16 Nov 2017
Commenté : Scott le 8 Juin 2022
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 commentaire
Scott
Scott le 8 Juin 2022
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);

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Instrument Control Toolbox dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by