Monday, June 25, 2012

Agilent's New 1000B Series of Economy Oscilloscopes

Recently Agilent released a new family of economy or low cost oscilloscopes called the 1000B series of portable oscilloscopes. The new 1000B series has a lot of features that you typically do not see in scopes at this price range including mask testing and sequenced acquisition capability. The below video (silent)  provides an overview of the 1000 series.


Here is a list of some features and specs for the 1000 series:
  • Bandwidths up to 200 MHz
  • Sampling rates up to 2 GS/s
  • 23 automatic measurements 
  • waveform math capabilities including FFT
  • Simultaneous viewing of main and zoomed waveforms



Monday, June 18, 2012

Sending Binary-Block Waveform Data to an AWG using MATLAB

In this post we will look at how to send waveform points as a binary-block to an arbitrary waveform generator (AWG) using MATLAB. The reason for sending a waveform as binary data versus ASCII data is simple, the binary data is much smaller compared to the equivalent ASCII data. This cuts down on remote IO latency between the computer and AWG for faster performance. Also there is typically a limit on the size of a waveform that can be sent to an AWG remotely in ASCII so for large waveforms you may have to use binary data. Before continuing there are two previous GPETE blog posts that I would recommend to you related to this topic. The first is a post that covers how to connect to an instrument remotely using MATLAB, to go to this post click here. The second is a post that explains how you can get waveform data from a PC or a scope to a modern AWG without using a remote connection, to go to this post click here.

The MATLAB function that makes the binary transfer of waveform data points easy to do is the binblockwrite(). This function writes binary-block (binblock) data to an instrument. To learn more about the binblockwrite() function check out the MATLAB help page on the method by clicking here or type “help binblockwrite” into the MATLAB command line. Note that the binblockwrite function only be used if you have the Instrument Control Toolbox for MATLAB, which is needed anyway to control instruments remotely with MATLAB. For the binblockwrite function to work properly you need to know the endian format of your computer and the AWG. The term endian or endianness refers to the ordering of individually addressable sub-components within the representation of a larger data item (for more info click here). If the endian format of your computer does not match that of the AWG you will need to swap the endian format on the instrument using the proper command before you call binblockwrite.

Let’s lot at an example using MATLAB to send waveform points to Agilent’s 33522A function / arbitrary waveform generator using SCPI. In the below MATLAB example waveform data was converted to a binary-block and sent to the 33522A using a remote USB connection. The SCPI language used in the MATLAB code was for Agilent’s 33521A / 33522A function / arbitrary waveform generators. If you are using a different AWG chances are the command language will be different. The comments in green are describing what is happening in the code.

%opens and creates a visa session for communication with function generator
fgen = visa('AGILENT','USB0::0x0957::0x2C07::MY50000780::0::INSTR');
set (fgen,'OutputBufferSize',2000000);
fopen(fgen);

%Query Idendity string and report
fprintf (fgen, '*IDN?');
idn = fscanf (fgen);
fprintf (idn)
fprintf ('\n\n')

%Clear and reset instrument
fprintf (fgen, '*RST');
fprintf (fgen, '*CLS');

%Clear volatile memory
fprintf(fgen,'SOURce1:DATA:VOLatile:CLEar');

%create waveform
i = 1:1:100000;        % Set rise time (100000 points) */
z = (i-1)/100000;
   
fprintf(fgen, 'FORM:BORD SWAP'); %swap the endian forma
binblockwrite(fgen, z, 'float32', 'SOURce1:DATA:ARBitrary testarb, '); %send the data using binary to the instrument

fprintf(fgen, '*WAI'); %wait for operation to finish
fprintf('Download Complete\n\n')

%Set desired configuration of 33522A
fprintf(fgen,'SOURce1:FUNCtion:ARBitrary testarb'); % set current arb waveform to defined arb pulse
fprintf(fgen,'SOURce1:FUNCtion ARB'); % turn on arb function
fprintf(fgen,'SOURCE1:VOLT 2'); % set max waveform amplitude to 2 Vpp
fprintf(fgen,'SOURCE1:VOLT:OFFSET 0'); % set offset to 0 V
fprintf(fgen,'OUTPUT1:LOAD 50'); % set output load to 50 ohms
fprintf(fgen,'SOURCE1:FUNCtion:ARB:SRATe 100e6'); % set sample rate
 
%Enable Output
fprintf(fgen,'OUTPUT1 ON'); % turn on channel 1 output

% Read Error
fprintf(fgen, 'SYST:ERR?');
errorstr = fscanf (fgen);

% error checking
if strncmp (errorstr, '+0,"No error"',13)
   errorcheck = 'Arbitrary waveform generated without any error\n';
   fprintf (errorcheck)
else
   errorcheck = ['Error reported: ', errorstr];
   fprintf (errorcheck)
end

%Save Arb to USB stick, titled test arb
 %fprintf(fgen, 'MMEM:STOR:DATA "USB:\TEST ARB"');

%closes the visa session with the function generator
fclose(fgen);

The majority of the above code is setting up the connection, configuring the 33522A settings, and error checking (to download the 33522A’s programming guide that specifies its commands click here). The main two lines we are interested in for handling binary data are highlighted. The first highlighted line sends a command to the 33522A to swap its endian format to match the format of the incoming data. The second highlighted line is the binblockwrite function, which will convert and send the waveform as a binary-block to the 33522A. The four arguments used in the binblockwrite function are as follows:
  1. “fgen” is the object that refers to the 33522A.
  2. “z” is the array holding the waveform data.
  3. “float32” states the precision. This allows the function to set the number of bits written for each value and the interpretation of the bits. Besides floating-point values, character and integer formats can be used.
  4. “SOURce1:DATA:ARBitrary testarb, “ is the header that will be prefixed to the binary data. In this example it is the beginning of the command to send a binary waveform to the 33522A.
Note that the binary data is in the binary-block format defined by IEEE and the binblockwrite function automatically configures and prefixes the IEEE header to the binary data (the header states the length of the binary data).

The above example MATLAB code creates a simple ramp waveform named "testarb" with a amplitude of 2 Vpp and a frequency of 1 KHz (100 MS/s / 100 KS = 1 KHz). The example MATLAB file was run and the resulting waveform can be seen in the below scope screen shot.


In this post we looked at how to send waveform points to an AWG as a binary-block of data using MATLAB. MATLAB has a function called "binblockwrite" that makes sending binary data to an instrument easy. Before sending the binary data, you want to ensure the endian format of the data matches the AWG's endian read format. Feel free to copy the MATLAB code example used in the post or send me an email and I can send you the .m file. If you have any questions feel free to email me and if you have any personal incites to add use the "Comments" section below.

For more information on the 33522A function / arbitrary waveform generator click here

Monday, June 11, 2012

Configuring a Split Rail Power Supply

In this post we will look at creating a split rail power supply that provides both a positive and negative voltage output. This is a trivial task if you have a multiple output power supply that has a negative output lead. This task becomes more challenging when all you have at your bench is single quadrant power supplies that can only output positive voltage and positive current.

This challenge of creating a split rail supply can be overcome by combining two single quadrant supplies in series. If we call the supply that creates the negative supply voltage V1 and the supply that creates the positive voltage V2, the high lead of V1 will be connected to the low lead of V2. This forms the common or "rail" node of the supplies, which can be tied to ground or to the common of the DUT. The simple split rail power supply setup can be seen in the figure below.

Note that the high lead of V2 is then connected to the positive supply input of the DUT and the low lead of V1 is connected to the negative supply input of the DUT. Lets look at an example where we want to create a split rail supply with a 15 V output and a -15 V output. both outputs were connected to a DMM and the resulting measurements can be seen in the figure below.


Note that the common or low leads on both DMMs are at the same potential. When implementing this setup be sure that the low lead of the negative voltage supply (V1 in the first figure) is not tied to ground. Additional supply outputs, either positive or negative, can be easily added. This is done by either tying the additional power supply low lead, in the case of a positive output, or high lead, in the case of a negative output to the rail node.

In this post we looked at how to configure two single quadrant power supplies to power a DUT that requires a split rail power supply. If you have questions please shot me an email and if you have any personal insights to add to this post please use the comments section below.

Monday, June 4, 2012

Measuring the Triple Point of Water

In this post we take a look at a colleague of mine cover what the triple point of water is, how to measure it, and how to compensate for the error in a Standard Platinum Resistance Thermometer (SPRT). The video is long but interesting especially if you are into Metrology.





To learn more about the 34420A Micro-OHM Meter click here