June 15, 2014

TDS210 Oscilloscope on LabVIEW over GPIB (IEEE-488)

During my studies, I've done a lot of interesting works, like the calculations for electromagnetic fields on my last post for example, and this is another one. For my Industrial Instrumentation class, I came across this work that had to be done using LabVIEW. The goal was to build a virtual interface for a real instrument that would communicate over GPIB interface (IEEE-488) and that could be used to control and read values remotely.


The work was to be done in groups of 2 and we had the opportunity to choose what instrument we would use. The choice was basically between a TDS210 Oscilloscope and a random multimeter which I don't remember the brand and model anymore.

The choice was a little unfair, since the oscilloscope had much more functionalities than the multimeter, but since I love challenges, me and my colleague Fábio Guerreiro, opted for the oscilloscope. Our teacher told us that we didn't need to capture the graph, to be more fair, but he also said that no one of his students ever made the virtual oscilloscope with the graph before. Me and my colleague looked at each other and thought "Challenge Accepted!". We knew from that moment that we wanted to do this work properly.

This was the oscilloscope we were "virtualizing", the Tektronix TDS210:


I'm not going into details about the programming because it's quite complex and extensive but I'll present the results. Here is the main looks of our application:


Since we didn't have much time, we decided to keep it simple and functional, so we separated the different oscilloscope menus with the following tabs: Main, Trigger, Measure, Cursor and Display. Additionally there were 2 buttons on the top right corner: About and Stop.

The Stop button stops the application, while the About button shows a small window with informations about this work:


To test it, we used the oscilloscope's calibration terminal, which is a 1 kHz square wave signal, and we also used a function generator producing a 1 kHz triangular wave. Each of these signals was connected to a different channel:


On the Main tab of the virtual instrument, we put all the general commands like the vertical and horizontal position and scale, as well as the channel options like coupling, probe gain, signal inversion, among others, there was also available the "math" option for the channels. The GPIB address is also configured here, in this case is the address 12:


All tabs have the communication button on the bottom, sometimes called "send" other times "receive" (in Portuguese). The Main tab however, has also a second communication button for the "Autoset" function. The graph is updated when the communication button or the autoset button are pressed.

The Trigger tab has all the trigger functions, like the slope, the source, the mode and the coupling:


When the communication button (Enviar) is pressed, the commands on the current tab are all sent to the scope, which then changes its configuration. This is valid for all tabs.

The Measure tab allows us to get the different values of each channel, like frequency, period, mean value, RMS value and peak to peak voltage:


In this case the communication button is called "Receber" (receive) since it's not changing any configuration on the scope, instead is just asking for information.

The next tab is the Cursor. Here you can determine values for specific intervals. To help understand the location of the cursors, we added this functionality on the graph, that allows you to drag a line to the desired location. The current position will be noted on those text box beneath the graph. For example, in the next image, if you look closely, the line was dragged to the base of the channel 1 wave, its position value is indicated on the box beneath the graph with the name "Tensão" (Voltage) with the values 0 and 2 for X and Y, respectively. What we want is the Y value, since we're calculating voltage, so we can copy the value 2 to the text box on the cursor tab on the right, either for cursor 1 or 2 as desired:


The same can be done for the time axis.

The final tab is the Display tab. Here we can change basic settings of the oscilloscope, like the data format and contrast for example:



In the image above, you can also notice that when the application is communicating with the oscilloscope, the "Busy" LED comes on.

Now let's take a look at the block diagram. We organized it like this to be easier to understand, to export and print. Each one of the white blocks on the right, is a separate function that we created, to simplify the design:

The purple text boxes on the right, indicate what are the different areas calculating. From the top to the bottom, the first 2 are our names, then it follows this order:
  • Main programming;
  • Trigger programming;
  • Display programming;
  • Cursor programming;
  • Measure programming;
  • Graph programming;
The separate functions are also called VI's or virtual instruments, and each one can be opened into another block diagram.

This work was done using LabVIEW 7, and of course the fundamental tool: the oscilloscope communication manual.

The application was developed in Windows 7 and tested on a Windows XP computer with a GPIB card. It must be noted that, the computer Language/keyboard configuration should be set as English, or similar, because of the punctuation system, otherwise there might be a confusion between points and commas, and the requests won't affect the oscilloscope properly.

6 comments:

  1. Hi, João
    now, i trying to communicate tds210 on labview
    but i'm a freshman on labiew's applications
    there are many useful information on this sharing
    i got lots of trouble on labview
    may i send you e-mail and discuss about how do i communicate with tds210 on labview!?
    here is my e-mail adress: m10204307@mail.ntust.edu.tw
    and..sorry about i'm not good at English
    Sincerely, CHI-CHIN LIN

    ReplyDelete
    Replies
    1. Hello, thanks for your comment.
      Be sure to read the Oscilloscope manual, there's plenty of information about the communication commands, you'll find all you need in there, that's how I did it. But if you still have questions, don't forget to check the Labview files on my Github repository.

      Delete
  2. Hi friend, Now that is a good projecto you did there. I have just one question, where did you download the drivers for the oscilloscope so it can communicate with labview??

    ReplyDelete
    Replies
    1. Thanks! It was a special GPIB adapter for PC.

      Delete
    2. I mean did you have to download something before using the oscilloscope with labview?

      Delete