Programming Interface Examples (Esg/Psg Only); Before Using The Examples; Interface Check Using Hp Basic - Keysight E4428C ESG RF Programming Manual

Signal generators
Table of Contents

Advertisement

fopen(t);
%for writing to a file instead to see what is being output
%t=fopen('test', 'w');
% send command with filename
fprintf(t, '%s', horzcat(':MEM:DATA:FIR "', instrumentFilename, '",'));
% send type
if (isreal(timeDomainFilter))
fprintf(t, '%s', 'REAL,');
else % convert complex to a real array
fprintf(t, '%s', 'COMP,');
temp=zeros(1,length(timeDomainFilter)*2);
temp(1:2:end)=real(timeDomainFilter);
temp(2:2:end)=imag(timeDomainFilter);
timeDomainFilter=temp;
end
% output osr
fprintf(t, '%d', osr);
% send coefficients
fprintf(t, ',%g', timeDomainFilter);
% send terminator
fprintf(t, '\n');
fclose(t);
end
RS-232 Programming Interface Examples (ESG/PSG Only)
• "Interface Check Using HP BASIC" on page 153
• "Interface Check Using VISA and C" on page 154
• "Queries Using HP Basic and RS-232" on page 156
• "Queries for RS-232 Using VISA and C" on page 158

Before Using the Examples

Before using the examples: On the signal generator select the following settings:
• Baud Rate - 9600 must match computer's baud rate
• RS- 232 Echo - Off
Use an RS- 232 cable, that is compatible with Table 2-2 on page 64.

Interface Check Using HP BASIC

This example program causes the signal generator to perform an instrument reset. The SCPI
command *RST will place the signal generator into a pre- defined state.
The serial interface address for the signal generator in this example is 9. The serial port used is
COM1 (Serial A on some computers). Refer to "Using RS–232 (ESG and PSG Only)" on page 61 for more
information.
Keysight Signal Generators Programming Guide
RS-232 Programming Interface Examples (ESG/PSG Only)
Programming Examples
153

Advertisement

Table of Contents
loading

Table of Contents