Commit eb3f1987 authored by Maciej Sumiński's avatar Maciej Sumiński Committed by Projects

doc/gw-test-procedure: pulsegen description

parent ca007ca1
......@@ -7,3 +7,8 @@
title = {{Conv TTL Blocking Repository on OHWR}},
howpublished = {\url{}}
title = {{Agilent 33250A User's Guide}},
howpublished = {\url{}}
......@@ -751,16 +751,155 @@ Instructions for filling in the table:
Instructions for filling in the table:
\item Make sure the glitch filter is \textbf{ON}
\item Make sure the glitch filter switch is set to \textbf{GF EN}
\item Following the test procedure in Section~\ref{sec:proc-ttlbar-blo} (under step~\ref{item:ttlbar-proc}),
tick each box if the output is as expected
\item Start with inputting a signal from the pulse generator on the front panel,
then after validation, change the input to the rear panel
\item Tick the \textbf{TTL} boxes if the TTL-BAR output on the front panel is as specified
in step \ref{item:ttlbar-meas-ttl-out}
in step~\ref{item:ttlbar-meas-ttl-out}
\item Tick the \textbf{Blo} boxes if the blocking output on the rear panel
is as specified in step \ref{item:ttlbar-meas-blo-out}
is as specified in step~\ref{item:ttlbar-meas-blo-out}
\section{Pulsegen script}
Some of the tests require a generator capable of outputting a burst of more
than one million pulses. It is not a common feature for a signal generator,
especially given such high number of pulses.
Agilent 33250A was the only signal generator in the lab, capable of generating
pulse bursts, but the pulse count is limited to one million. To overcome this
restriction, one can create an arbitrary waveform containing multiple pulses and
repeat the signal as many times as required.
Creating an arbitrary waveform using the signal generator interface is a
tedious task. To automate the process, a Python script called
\textit{pulsegen} has been developed.
\subsection{Principle of operation}
\textit{Pulsegen} connects to Agilent 33250A signal generator via its serial
port and uses SCPI commands~\cite[ch.4]{33250a-ug} for configuration.
The script allows to select the number of pulses, pulse duration, and repetition
rate. When the number of requested pulses is less or equal to one million, the
output signal type is set to pulse. For other cases arbitrary waveform is selected.
In the latter case, the script generates appropriate waveform by concatenating
multiple pulses of requested width.
\textbf{IMPORTANT:} If the number of requested pulses is high enough to use the arbitrary
waveform, it may happen that the actual number of pulses will be rounded to the
number of pulses in the arbitrary waveform. It is caused by the way the signal
is generated (a number of pulses in arbitrary waveform repeated multiple times).
Once the generator is configured, the script checks if any errors occurred. It
may take a several second to configure the generator, if the arbitrary waveform
it to be used. It is normal to hear relays clicking, but a beep sound usually
indicates an error.
If there were not any problems, the output is enabled and the signal is
triggered. Scripts works in blocking mode, meaning it finishes its operation
only after the signal generation is completed.
Connect Agilent 33250A to a Linux PC via a null-modem
cable~\cite[p.221]{33250a-ug} to the PC serial port or a USB-to-serial
converter. If you use the converter, be sure it can be set to use \textbf{RTS/CTS}
Configure the generator RS-232 interface using the front panel interface. Press
\textit{Utility} button, then choose \textit{I/O} menu~\cite[p.45]{33250a-ug}.
Be sure that:
\item \textit{I/O port} tab has \texttt{RS-232} option highlighted
\item \textit{Baud Rate} is set to \texttt{115200}
\item \textit{Parity/\# Bits} is set to \texttt{None/8 bits}
\item \textit{Handshake} is set to \texttt{RTS}
Run the script specifying the requested signal parameters. You may also
override the default settings for the serial port interface (device
/dev/ttyUSB0, 115200 baud).
List of possible arguments:
serial port baud rate (default: 115200)
serial port device path (default: /dev/ttyUSB0)
number of requested pulses (default: 2000000)
frequency of the pulses [Hz] (default: 2000000)
pulse duration [s] (default: 250e-9 s)
shows this information
An example (2000 pulses at 1 MHz):
./ -c 2000 -f 1e6
\item{No module named 'serial'}
If you receive an error, similar to the one below:
Traceback (most recent call last):
File "./", line 45, in <module>
import serial
ModuleNotFoundError: No module named 'serial'
Indicates that you are missing the pyserial package. Please install it using:
sudo pip install pyserial
\item{Cannot access a serial port device}
If you get an error:
could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
Then it means that your permissions are not sufficient to use the serial port
converter. You can either run scripts as root, or (recommended) add udev rules which
will grant you the required permissions.
To add a udev rule, create a file named /etc/udev/rules.d/99-serial.rules and put
the following contents (requires root privilege):
KERNEL=="ttyUSB*", MODE="0666"
KERNEL=="ttyACM*", MODE="0666"
Once saved, you need to reload the udev rules by executing the following command:
sudo udevadm control --reload
The last step is to reconnect the serial port converter.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment