image thumbnail

XY Text Writer

by

 

Uses the 33522A waveform generator to write text on scope screen. Turns scope into message board.

XY_Text_Writer.m
%This script inputs a string up to 26 characters and creates two arbs that
%if used on scope in XY mode it will display string on scope

%prompt user for string that is 26 chars or less
disp('Input a string that is 26 characters or less. Spaces count as a character');
string_in = input('Enter string: ','s');

%Get string length and set initial x and y plot placement
str_len = length(string_in);
str_len = int32(str_len);
x_place = .5;
y_place = 8.5;

%Check if string is 26 chars or less
if str_len <= 26
    %character placement in xy graph
    [y x] = Build_XY_Arbs(string_in,str_len,x_place,y_place);
    %sample in Matlab scatter plot
    scatter(x,y);
    
    %normalize for fg/awg xmax=18.3 ymax=11.1, this was optimized for
    %Agilent 7000 series scope
    x = x/21.96;
    y = y/12.444;
 
    %create both the x and y arb strings and send name of arbs
    y_arb = vec2arbstring(x,'xaxis',1);
    x_arb = vec2arbstring(y,'yaxis',2);

    %send the arbs to 33522A
    arbs_2_33522A(y_arb,x_arb);

else
    disp('The string you entered is too long. It must be 26 characters or less.');
end

%sign off
fprintf('Done and outta here....\n');

Contact us