Using the instrument control toolbox to command a SRS DS345 function generator

2 次查看(过去 30 天)
I have this function to command a Function generator (Stanford Research Systems, Synthesized Function Generator, model DS345) to change it's amplitude, frequency, and offset. However, when I uncomment the:
fprintf(obj1, Offs_str)
line (which sends the offset value to the function generator), the instrument outputs a 'syntax error'. This is the syntax specified in the manual. Also, if I change the amplitude command to anything other than 0.0 (i.e. change the command to fprintf(obj1, 'AMPL1.1VP')), the same syntax error is produced.
It's a long shot, but does anyone have experience using instrument control with a DS345 function generator?
function [] = FG_on(Offs)
%Convert Offset input to string
Offs_str = strcat('OFFS',num2str(Offs),'VP');
%create GPIB handle
obj1 = instrfind('Type', 'gpib', 'BoardIndex', 1, 'PrimaryAddress',...
19, 'Tag', '');
%Open connection
fopen(obj1);
%Sampling Frequency
fprintf(obj1, 'FSMP1000');
%Amplitude
fprintf(obj1, 'AMPL0.0VP');
%Offset
%fprintf(obj1, Offs_str);
%Modulation Type
fprintf(obj1, 'MTYP5');
%Function Type
fprintf(obj1, 'FUNC5');
end

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by